155553f71Sda#!/usr/bin/env perl
255553f71Sda#
355553f71Sda# ====================================================================
455553f71Sda# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
555553f71Sda# project. Rights for redistribution and usage in source and binary
655553f71Sda# forms are granted according to the OpenSSL license.
755553f71Sda# ====================================================================
855553f71Sda#
955553f71Sda# sha256/512_block procedure for x86_64.
1055553f71Sda#
1155553f71Sda# 40% improvement over compiler-generated code on Opteron. On EM64T
1255553f71Sda# sha256 was observed to run >80% faster and sha512 - >40%. No magical
1355553f71Sda# tricks, just straight implementation... I really wonder why gcc
1455553f71Sda# [being armed with inline assembler] fails to generate as fast code.
1555553f71Sda# The only thing which is cool about this module is that it's very
1655553f71Sda# same instruction sequence used for both SHA-256 and SHA-512. In
1755553f71Sda# former case the instructions operate on 32-bit operands, while in
1855553f71Sda# latter - on 64-bit ones. All I had to do is to get one flavor right,
1955553f71Sda# the other one passed the test right away:-)
2055553f71Sda#
2155553f71Sda# sha256_block runs in ~1005 cycles on Opteron, which gives you
2255553f71Sda# asymptotic performance of 64*1000/1005=63.7MBps times CPU clock
2355553f71Sda# frequency in GHz. sha512_block runs in ~1275 cycles, which results
2455553f71Sda# in 128*1000/1275=100MBps per GHz. Is there room for improvement?
2555553f71Sda# Well, if you compare it to IA-64 implementation, which maintains
2655553f71Sda# X[16] in register bank[!], tends to 4 instructions per CPU clock
2755553f71Sda# cycle and runs in 1003 cycles, 1275 is very good result for 3-way
2855553f71Sda# issue Opteron pipeline and X[16] maintained in memory. So that *if*
2955553f71Sda# there is a way to improve it, *then* the only way would be to try to
3055553f71Sda# offload X[16] updates to SSE unit, but that would require "deeper"
3155553f71Sda# loop unroll, which in turn would naturally cause size blow-up, not
3255553f71Sda# to mention increased complexity! And once again, only *if* it's
3355553f71Sda# actually possible to noticeably improve overall ILP, instruction
3455553f71Sda# level parallelism, on a given CPU implementation in this case.
3555553f71Sda#
3655553f71Sda# Special note on Intel EM64T. While Opteron CPU exhibits perfect
3755553f71Sda# perfromance ratio of 1.5 between 64- and 32-bit flavors [see above],
3855553f71Sda# [currently available] EM64T CPUs apparently are far from it. On the
3955553f71Sda# contrary, 64-bit version, sha512_block, is ~30% *slower* than 32-bit
4055553f71Sda# sha256_block:-( This is presumably because 64-bit shifts/rotates
4155553f71Sda# apparently are not atomic instructions, but implemented in microcode.
4255553f71Sda
4355553f71Sda#
4455553f71Sda# OpenSolaris OS modifications
4555553f71Sda#
4655553f71Sda# Sun elects to use this software under the BSD license.
4755553f71Sda#
4855553f71Sda# This source originates from OpenSSL file sha512-x86_64.pl at
4955553f71Sda# ftp://ftp.openssl.org/snapshot/openssl-0.9.8-stable-SNAP-20080131.tar.gz
5055553f71Sda# (presumably for future OpenSSL release 0.9.8h), with these changes:
5155553f71Sda#
5255553f71Sda# 1. Added perl "use strict" and declared variables.
5355553f71Sda#
5455553f71Sda# 2. Added OpenSolaris ENTRY_NP/SET_SIZE macros from
5555553f71Sda# /usr/include/sys/asm_linkage.h, .ident keywords, and lint(1B) guards.
5655553f71Sda#
5755553f71Sda# 3. Removed x86_64-xlate.pl script (not needed for as(1) or gas(1)
5855553f71Sda# assemblers).  Replaced the .picmeup macro with assembler code.
5955553f71Sda#
6055553f71Sda# 4. Added 8 to $ctx, as OpenSolaris OS has an extra 4-byte field, "algotype",
6155553f71Sda# at the beginning of SHA2_CTX (the next field is 8-byte aligned).
6255553f71Sda#
6355553f71Sda
6455553f71Sdause strict;
6555553f71Sdamy ($code, $func, $TABLE, $SZ, @Sigma0, @Sigma1, @sigma0, @sigma1, $rounds,
6655553f71Sda	@ROT, $A, $B, $C, $D, $E, $F, $G, $H, $T1, $a0, $a1, $a2, $i,
6755553f71Sda	$ctx, $round, $inp, $Tbl, $_ctx, $_inp, $_end, $_rsp, $framesz);
6855553f71Sdamy $output = shift;
6955553f71Sdaopen STDOUT,">$output";
7055553f71Sda
7155553f71Sda#
7255553f71Sda# OpenSSL library:
7355553f71Sda# void sha512_block_data_order(SHA512_CTX *ctx, const void *in, size_t num);
7455553f71Sda# void sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num);
7555553f71Sda#
7655553f71Sda# OpenSolaris OS:
7755553f71Sda# void SHA512TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num);
7855553f71Sda# void SHA256TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num);
7955553f71Sda# Note: the OpenSolaris SHA2 structure has an extra 8 byte field at the
8055553f71Sda# beginning (over OpenSSL's SHA512 or SHA256 structure).
8155553f71Sda#
8255553f71Sda
8355553f71Sdaif ($output =~ /512/) {
8455553f71Sda	$func="SHA512TransformBlocks";
8555553f71Sda	$TABLE="K512";
8655553f71Sda	$SZ=8;
8755553f71Sda	@ROT=($A,$B,$C,$D,$E,$F,$G,$H)=("%rax","%rbx","%rcx","%rdx",
8855553f71Sda					"%r8", "%r9", "%r10","%r11");
8955553f71Sda	($T1,$a0,$a1,$a2)=("%r12","%r13","%r14","%r15");
9055553f71Sda	@Sigma0=(28,34,39);
9155553f71Sda	@Sigma1=(14,18,41);
9255553f71Sda	@sigma0=(1,  8, 7);
9355553f71Sda	@sigma1=(19,61, 6);
9455553f71Sda	$rounds=80;
9555553f71Sda} else {
9655553f71Sda	$func="SHA256TransformBlocks";
9755553f71Sda	$TABLE="K256";
9855553f71Sda	$SZ=4;
9955553f71Sda	@ROT=($A,$B,$C,$D,$E,$F,$G,$H)=("%eax","%ebx","%ecx","%edx",
10055553f71Sda					"%r8d","%r9d","%r10d","%r11d");
10155553f71Sda	($T1,$a0,$a1,$a2)=("%r12d","%r13d","%r14d","%r15d");
10255553f71Sda	@Sigma0=( 2,13,22);
10355553f71Sda	@Sigma1=( 6,11,25);
10455553f71Sda	@sigma0=( 7,18, 3);
10555553f71Sda	@sigma1=(17,19,10);
10655553f71Sda	$rounds=64;
10755553f71Sda}
10855553f71Sda
10955553f71Sda$ctx="%rdi";	# 1st arg
11055553f71Sda$round="%rdi";	# zaps $ctx
11155553f71Sda$inp="%rsi";	# 2nd arg
11255553f71Sda$Tbl="%rbp";
11355553f71Sda
11455553f71Sda$_ctx="16*$SZ+0*8(%rsp)";
11555553f71Sda$_inp="16*$SZ+1*8(%rsp)";
11655553f71Sda$_end="16*$SZ+2*8(%rsp)";
11755553f71Sda$_rsp="16*$SZ+3*8(%rsp)";
11855553f71Sda$framesz="16*$SZ+4*8";
11955553f71Sda
12055553f71Sda
12155553f71Sdasub ROUND_00_15()
12255553f71Sda{ my ($i,$a,$b,$c,$d,$e,$f,$g,$h) = @_;
12355553f71Sda
12455553f71Sda$code.=<<___;
12555553f71Sda	mov	$e,$a0
12655553f71Sda	mov	$e,$a1
12755553f71Sda	mov	$f,$a2
12855553f71Sda
12955553f71Sda	ror	\$$Sigma1[0],$a0
13055553f71Sda	ror	\$$Sigma1[1],$a1
13155553f71Sda	xor	$g,$a2			# f^g
13255553f71Sda
13355553f71Sda	xor	$a1,$a0
13455553f71Sda	ror	\$`$Sigma1[2]-$Sigma1[1]`,$a1
13555553f71Sda	and	$e,$a2			# (f^g)&e
13655553f71Sda	mov	$T1,`$SZ*($i&0xf)`(%rsp)
13755553f71Sda
13855553f71Sda	xor	$a1,$a0			# Sigma1(e)
13955553f71Sda	xor	$g,$a2			# Ch(e,f,g)=((f^g)&e)^g
14055553f71Sda	add	$h,$T1			# T1+=h
14155553f71Sda
14255553f71Sda	mov	$a,$h
14355553f71Sda	add	$a0,$T1			# T1+=Sigma1(e)
14455553f71Sda
14555553f71Sda	add	$a2,$T1			# T1+=Ch(e,f,g)
14655553f71Sda	mov	$a,$a0
14755553f71Sda	mov	$a,$a1
14855553f71Sda
14955553f71Sda	ror	\$$Sigma0[0],$h
15055553f71Sda	ror	\$$Sigma0[1],$a0
15155553f71Sda	mov	$a,$a2
15255553f71Sda	add	($Tbl,$round,$SZ),$T1	# T1+=K[round]
15355553f71Sda
15455553f71Sda	xor	$a0,$h
15555553f71Sda	ror	\$`$Sigma0[2]-$Sigma0[1]`,$a0
15655553f71Sda	or	$c,$a1			# a|c
15755553f71Sda
15855553f71Sda	xor	$a0,$h			# h=Sigma0(a)
15955553f71Sda	and	$c,$a2			# a&c
16055553f71Sda	add	$T1,$d			# d+=T1
16155553f71Sda
16255553f71Sda	and	$b,$a1			# (a|c)&b
16355553f71Sda	add	$T1,$h			# h+=T1
16455553f71Sda
16555553f71Sda	or	$a2,$a1			# Maj(a,b,c)=((a|c)&b)|(a&c)
16655553f71Sda	lea	1($round),$round	# round++
16755553f71Sda
16855553f71Sda	add	$a1,$h			# h+=Maj(a,b,c)
16955553f71Sda___
17055553f71Sda}
17155553f71Sda
17255553f71Sdasub ROUND_16_XX()
17355553f71Sda{ my ($i,$a,$b,$c,$d,$e,$f,$g,$h) = @_;
17455553f71Sda
17555553f71Sda$code.=<<___;
17655553f71Sda	mov	`$SZ*(($i+1)&0xf)`(%rsp),$a0
17755553f71Sda	mov	`$SZ*(($i+14)&0xf)`(%rsp),$T1
17855553f71Sda
17955553f71Sda	mov	$a0,$a2
18055553f71Sda
18155553f71Sda	shr	\$$sigma0[2],$a0
18255553f71Sda	ror	\$$sigma0[0],$a2
18355553f71Sda
18455553f71Sda	xor	$a2,$a0
18555553f71Sda	ror	\$`$sigma0[1]-$sigma0[0]`,$a2
18655553f71Sda
18755553f71Sda	xor	$a2,$a0			# sigma0(X[(i+1)&0xf])
18855553f71Sda	mov	$T1,$a1
18955553f71Sda
19055553f71Sda	shr	\$$sigma1[2],$T1
19155553f71Sda	ror	\$$sigma1[0],$a1
19255553f71Sda
19355553f71Sda	xor	$a1,$T1
19455553f71Sda	ror	\$`$sigma1[1]-$sigma1[0]`,$a1
19555553f71Sda
19655553f71Sda	xor	$a1,$T1			# sigma1(X[(i+14)&0xf])
19755553f71Sda
19855553f71Sda	add	$a0,$T1
19955553f71Sda
20055553f71Sda	add	`$SZ*(($i+9)&0xf)`(%rsp),$T1
20155553f71Sda
20255553f71Sda	add	`$SZ*($i&0xf)`(%rsp),$T1
20355553f71Sda___
20455553f71Sda	&ROUND_00_15(@_);
20555553f71Sda}
20655553f71Sda
20755553f71Sda#
20855553f71Sda# Execution begins here
20955553f71Sda#
21055553f71Sda
21155553f71Sda$code=<<___;
212*8de5c4f4SDan OpenSolaris Anderson#if defined(lint) || defined(__lint)
213*8de5c4f4SDan OpenSolaris Anderson#include <sys/stdint.h>
214*8de5c4f4SDan OpenSolaris Anderson#include <sys/sha2.h>
215*8de5c4f4SDan OpenSolaris Anderson
216*8de5c4f4SDan OpenSolaris Anderson/* ARGSUSED */
217*8de5c4f4SDan OpenSolaris Andersonvoid
218*8de5c4f4SDan OpenSolaris Anderson$func(SHA2_CTX *ctx, const void *in, size_t num)
219*8de5c4f4SDan OpenSolaris Anderson{
220*8de5c4f4SDan OpenSolaris Anderson}
221*8de5c4f4SDan OpenSolaris Anderson
222*8de5c4f4SDan OpenSolaris Anderson
223*8de5c4f4SDan OpenSolaris Anderson#else
22455553f71Sda#include <sys/asm_linkage.h>
22555553f71Sda
22655553f71SdaENTRY_NP($func)
22755553f71Sda	push	%rbx
22855553f71Sda	push	%rbp
22955553f71Sda	push	%r12
23055553f71Sda	push	%r13
23155553f71Sda	push	%r14
23255553f71Sda	push	%r15
23355553f71Sda	mov	%rsp,%rbp		# copy %rsp
23455553f71Sda	shl	\$4,%rdx		# num*16
23555553f71Sda	sub	\$$framesz,%rsp
23655553f71Sda	lea	($inp,%rdx,$SZ),%rdx	# inp+num*16*$SZ
23755553f71Sda	and	\$-64,%rsp		# align stack frame
23855553f71Sda	add	\$8,$ctx		# Skip OpenSolaris field, "algotype"
23955553f71Sda	mov	$ctx,$_ctx		# save ctx, 1st arg
24055553f71Sda	mov	$inp,$_inp		# save inp, 2nd arg
24155553f71Sda	mov	%rdx,$_end		# save end pointer, "3rd" arg
24255553f71Sda	mov	%rbp,$_rsp		# save copy of %rsp
24355553f71Sda
24455553f71Sda	/.picmeup $Tbl
24555553f71Sda	/ The .picmeup pseudo-directive, from perlasm/x86_64_xlate.pl, puts
24655553f71Sda	/ the address of the "next" instruction into the target register
24755553f71Sda	/ ($Tbl).  This generates these 2 instructions:
24855553f71Sda	lea	.Llea(%rip),$Tbl
24955553f71Sda	/nop	/ .picmeup generates a nop for mod 8 alignment--not needed here
25055553f71Sda
25155553f71Sda.Llea:
25255553f71Sda	lea	$TABLE-.($Tbl),$Tbl
25355553f71Sda
25455553f71Sda	mov	$SZ*0($ctx),$A
25555553f71Sda	mov	$SZ*1($ctx),$B
25655553f71Sda	mov	$SZ*2($ctx),$C
25755553f71Sda	mov	$SZ*3($ctx),$D
25855553f71Sda	mov	$SZ*4($ctx),$E
25955553f71Sda	mov	$SZ*5($ctx),$F
26055553f71Sda	mov	$SZ*6($ctx),$G
26155553f71Sda	mov	$SZ*7($ctx),$H
26255553f71Sda	jmp	.Lloop
26355553f71Sda
26455553f71Sda.align	16
26555553f71Sda.Lloop:
26655553f71Sda	xor	$round,$round
26755553f71Sda___
26855553f71Sda	for($i=0;$i<16;$i++) {
26955553f71Sda		$code.="	mov	$SZ*$i($inp),$T1\n";
27055553f71Sda		$code.="	bswap	$T1\n";
27155553f71Sda		&ROUND_00_15($i,@ROT);
27255553f71Sda		unshift(@ROT,pop(@ROT));
27355553f71Sda	}
27455553f71Sda$code.=<<___;
27555553f71Sda	jmp	.Lrounds_16_xx
27655553f71Sda.align	16
27755553f71Sda.Lrounds_16_xx:
27855553f71Sda___
27955553f71Sda	for(;$i<32;$i++) {
28055553f71Sda		&ROUND_16_XX($i,@ROT);
28155553f71Sda		unshift(@ROT,pop(@ROT));
28255553f71Sda	}
28355553f71Sda
28455553f71Sda$code.=<<___;
28555553f71Sda	cmp	\$$rounds,$round
28655553f71Sda	jb	.Lrounds_16_xx
28755553f71Sda
28855553f71Sda	mov	$_ctx,$ctx
28955553f71Sda	lea	16*$SZ($inp),$inp
29055553f71Sda
29155553f71Sda	add	$SZ*0($ctx),$A
29255553f71Sda	add	$SZ*1($ctx),$B
29355553f71Sda	add	$SZ*2($ctx),$C
29455553f71Sda	add	$SZ*3($ctx),$D
29555553f71Sda	add	$SZ*4($ctx),$E
29655553f71Sda	add	$SZ*5($ctx),$F
29755553f71Sda	add	$SZ*6($ctx),$G
29855553f71Sda	add	$SZ*7($ctx),$H
29955553f71Sda
30055553f71Sda	cmp	$_end,$inp
30155553f71Sda
30255553f71Sda	mov	$A,$SZ*0($ctx)
30355553f71Sda	mov	$B,$SZ*1($ctx)
30455553f71Sda	mov	$C,$SZ*2($ctx)
30555553f71Sda	mov	$D,$SZ*3($ctx)
30655553f71Sda	mov	$E,$SZ*4($ctx)
30755553f71Sda	mov	$F,$SZ*5($ctx)
30855553f71Sda	mov	$G,$SZ*6($ctx)
30955553f71Sda	mov	$H,$SZ*7($ctx)
31055553f71Sda	jb	.Lloop
31155553f71Sda
31255553f71Sda	mov	$_rsp,%rsp
31355553f71Sda	pop	%r15
31455553f71Sda	pop	%r14
31555553f71Sda	pop	%r13
31655553f71Sda	pop	%r12
31755553f71Sda	pop	%rbp
31855553f71Sda	pop	%rbx
31955553f71Sda
32055553f71Sda	ret
32155553f71SdaSET_SIZE($func)
32255553f71Sda
32355553f71Sda___
32455553f71Sda
32555553f71Sdaif ($SZ==4) {
32655553f71Sda# SHA256
32755553f71Sda$code.=<<___;
32855553f71Sda.align	64
32955553f71Sda.type	$TABLE,\@object
33055553f71Sda$TABLE:
33155553f71Sda	.long	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
33255553f71Sda	.long	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
33355553f71Sda	.long	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
33455553f71Sda	.long	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
33555553f71Sda	.long	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
33655553f71Sda	.long	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
33755553f71Sda	.long	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
33855553f71Sda	.long	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
33955553f71Sda	.long	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
34055553f71Sda	.long	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
34155553f71Sda	.long	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
34255553f71Sda	.long	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
34355553f71Sda	.long	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
34455553f71Sda	.long	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
34555553f71Sda	.long	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
34655553f71Sda	.long	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
34755553f71Sda___
34855553f71Sda} else {
34955553f71Sda# SHA512
35055553f71Sda$code.=<<___;
35155553f71Sda.align	64
35255553f71Sda.type	$TABLE,\@object
35355553f71Sda$TABLE:
35455553f71Sda	.quad	0x428a2f98d728ae22,0x7137449123ef65cd
35555553f71Sda	.quad	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
35655553f71Sda	.quad	0x3956c25bf348b538,0x59f111f1b605d019
35755553f71Sda	.quad	0x923f82a4af194f9b,0xab1c5ed5da6d8118
35855553f71Sda	.quad	0xd807aa98a3030242,0x12835b0145706fbe
35955553f71Sda	.quad	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
36055553f71Sda	.quad	0x72be5d74f27b896f,0x80deb1fe3b1696b1
36155553f71Sda	.quad	0x9bdc06a725c71235,0xc19bf174cf692694
36255553f71Sda	.quad	0xe49b69c19ef14ad2,0xefbe4786384f25e3
36355553f71Sda	.quad	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
36455553f71Sda	.quad	0x2de92c6f592b0275,0x4a7484aa6ea6e483
36555553f71Sda	.quad	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
36655553f71Sda	.quad	0x983e5152ee66dfab,0xa831c66d2db43210
36755553f71Sda	.quad	0xb00327c898fb213f,0xbf597fc7beef0ee4
36855553f71Sda	.quad	0xc6e00bf33da88fc2,0xd5a79147930aa725
36955553f71Sda	.quad	0x06ca6351e003826f,0x142929670a0e6e70
37055553f71Sda	.quad	0x27b70a8546d22ffc,0x2e1b21385c26c926
37155553f71Sda	.quad	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
37255553f71Sda	.quad	0x650a73548baf63de,0x766a0abb3c77b2a8
37355553f71Sda	.quad	0x81c2c92e47edaee6,0x92722c851482353b
37455553f71Sda	.quad	0xa2bfe8a14cf10364,0xa81a664bbc423001
37555553f71Sda	.quad	0xc24b8b70d0f89791,0xc76c51a30654be30
37655553f71Sda	.quad	0xd192e819d6ef5218,0xd69906245565a910
37755553f71Sda	.quad	0xf40e35855771202a,0x106aa07032bbd1b8
37855553f71Sda	.quad	0x19a4c116b8d2d0c8,0x1e376c085141ab53
37955553f71Sda	.quad	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
38055553f71Sda	.quad	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
38155553f71Sda	.quad	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
38255553f71Sda	.quad	0x748f82ee5defb2fc,0x78a5636f43172f60
38355553f71Sda	.quad	0x84c87814a1f0ab72,0x8cc702081a6439ec
38455553f71Sda	.quad	0x90befffa23631e28,0xa4506cebde82bde9
38555553f71Sda	.quad	0xbef9a3f7b2c67915,0xc67178f2e372532b
38655553f71Sda	.quad	0xca273eceea26619c,0xd186b8c721c0c207
38755553f71Sda	.quad	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
38855553f71Sda	.quad	0x06f067aa72176fba,0x0a637dc5a2c898a6
38955553f71Sda	.quad	0x113f9804bef90dae,0x1b710b35131c471b
39055553f71Sda	.quad	0x28db77f523047d84,0x32caab7b40c72493
39155553f71Sda	.quad	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
39255553f71Sda	.quad	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
39355553f71Sda	.quad	0x5fcb6fab3ad6faec,0x6c44198c4a475817
39455553f71Sda___
39555553f71Sda}
39655553f71Sda$code.=<<___;
39755553f71Sda#endif /* !lint && !__lint */
39855553f71Sda___
39955553f71Sda
40055553f71Sda$code =~ s/\`([^\`]*)\`/eval $1/gem;
40155553f71Sdaprint $code;
40255553f71Sdaclose STDOUT;
403