LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/binomial.c
// Function: binomial_start
void
binomial_start(void)
/*
 * Precomputes all numbers (n over k) with k<=NCARDSPERHAND and
 * n<=NCARDSPERDECK.
 * Numbers are stored in pascal_triangle[][] with L bytes precision (96 bits)
 *
 * Calculation method is the addition from the top of the triangle
 * with the equation:
 * 	n_over_k(n,k) = n_over_k(n-1, k-1) + n_over_k(n-1, k)
 * except for some boundary condition situations
 */
{
	int i,j,min;

	for (i=0; i<=NCARDSPERDECK; i++) {
		if (i<NCARDSPERHAND)
			min = i;
		else
			min = NCARDSPERHAND;
		for (j=0; j<=min; j++) {
			if (i==j || j==0)
				mp96_one(pascal_triangle[i][j]);
			else
				mp96_add(pascal_triangle[i][j],
					   pascal_triangle[i-1][j],
					   pascal_triangle[i-1][j-1]);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x5fc4(%rip), %rbx      # 0x98e0
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0xd, %r15
movl $0xd, %eax
cmovbq %r15, %rax
leaq (%rax,%rax,2), %rax
leaq 0xc(,%rax,4), %r12
xorl %r13d, %r13d
cmpq %r13, %r14
setne %al
testq %r13, %r13
setne %cl
leaq (%rbx,%r13), %rdi
testb %cl, %al
jne 0x3959
callq 0x379f
jmp 0x3974
leaq (%rbx,%r13), %rsi
addq $-0xa8, %rsi
leaq (%rbx,%r13), %rdx
addq $-0xb4, %rdx
callq 0x37bf
addq $0xc, %r13
cmpq %r13, %r12
jne 0x393e
incq %r15
addq $0xc, %r14
addq $0xa8, %rbx
cmpq $0x35, %r15
jne 0x3922
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/main.c
// Function: readline
static int
readline(FILE *ifile, char *buf, int len)
/*
 * Read line into buf
 * Check for length, discard trailing \n
 */
{
	char *eol;

	if(fgets(buf, len, ifile) == NULL)
		return 0;
	eol = strchr(buf, '\n');
	if (eol)
		*eol = 0;
	return 1;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rax
movq %rsi, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x2140
testq %rax, %rax
je 0x3e0a
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20b0
movq %rax, %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x3e0c
movb $0x0, (%rcx)
jmp 0x3e0c
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/main.c
// Function: read_init_file
void
read_init_file(char *ifname, int write_when_absent)
/*
 * Read init file
 */
{
	FILE *ifile;
	char buf[MESSLEN+LONGESTKEYWORD];
	char *eqptr;
	struct ifrecord *ifrp;

	ifile = fopen(ifname, "r");
	if (ifile == NULL) {
		if (write_when_absent)
			write_init_file(ifname);
		return;
	}
	while (readline(ifile, buf, MESSLEN+LONGESTKEYWORD)) {
		if (buf[0] == 0)
			continue;		/* empty line */
		if (strcmp(buf, init_header)==0)
			continue;		/* header for Windows routines */
		if (buf[0] == '[')
			break;			/* end of our stuff */
		eqptr = strchr(buf, '=');
		if (eqptr == 0) {
			fprintf(stderr, "Line '%s' does not contain =\n", buf);
			fprintf(stderr, "Suggest rerun program with -R flag\n");
			continue;
		}
		*eqptr++ = 0;
		for (ifrp=init_file; ifrp->if_keyword; ifrp++) {
			if (strcmp(ifrp->if_keyword, buf)==0) {
				strcpy(ifrp->if_value, eqptr);
				break;
			}
		}
		if (!ifrp->if_keyword) {
			fprintf(stderr, "Keyword %s in init_file unknown\n", buf);
			fprintf(stderr, "Suggest rerun program with -R flag\n");
		}
	}
	fclose(ifile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebp
movq %rdi, %r14
leaq 0x27b2(%rip), %rsi      # 0x65da
callq 0x21a0
testq %rax, %rax
je 0x3f2c
movq %rax, %rbx
movq %rsp, %rsi
movq %rax, %rdi
movl $0x78, %edx
callq 0x3dd2
testl %eax, %eax
je 0x3f15
movq %rsp, %r14
leaq 0x5445(%rip), %r15      # 0x92a0
leaq 0x53fe(%rip), %r13      # 0x9260
movb (%rsp), %bpl
testb %bpl, %bpl
je 0x3ef1
movq %r14, %rdi
movq %r15, %rsi
callq 0x2150
testl %eax, %eax
je 0x3ef1
cmpb $0x5b, %bpl
je 0x3f15
movq %r14, %rdi
movl $0x3d, %esi
callq 0x20b0
leaq 0x2236(%rip), %rdi      # 0x60d2
testq %rax, %rax
je 0x3f0b
movq %rax, %r12
movb $0x0, (%rax)
movq 0x53b2(%rip), %rdi      # 0x9260
movq %r13, %rbp
testq %rdi, %rdi
je 0x3ee3
incq %r12
movq %r13, %rbp
movq %r14, %rsi
callq 0x2150
testl %eax, %eax
je 0x3ed7
movq 0x10(%rbp), %rdi
addq $0x10, %rbp
testq %rdi, %rdi
jne 0x3ebc
jmp 0x3ee3
movq 0x8(%rbp), %rdi
movq %r12, %rsi
callq 0x2050
cmpq $0x0, (%rbp)
leaq 0x2225(%rip), %rdi      # 0x6114
je 0x3f0b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x78, %edx
callq 0x3dd2
testl %eax, %eax
jne 0x3e62
jmp 0x3f15
movq %r14, %rsi
callq 0x2210
jmp 0x3ef1
movq %rbx, %rdi
callq 0x2080
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
je 0x3f1d
movq %r14, %rdi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3bf4
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/main.c
// Function: setboards
void
setboards(char *a) {
	char *chptr;

	chptr =strchr(a,'-');
	if (chptr) {
		*chptr++ = 0;
		parameters.pp_lowboard = atoi(a);
		parameters.pp_highboard = atoi(chptr);
	} else {
		parameters.pp_lowboard = 1;
		parameters.pp_highboard = atoi(a);
	}
	parameters.pp_nboards =
	    parameters.pp_highboard - parameters.pp_lowboard + 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2d, %esi
callq 0x20b0
testq %rax, %rax
je 0x3f78
movq %rax, %r14
incq %r14
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0x21c0
movl %eax, 0x7c3d(%rip)      # 0xbbb0
movq %r14, %rdi
jmp 0x3f85
movl $0x1, 0x7c2e(%rip)      # 0xbbb0
movq %rbx, %rdi
callq 0x21c0
movl %eax, 0x7c24(%rip)      # 0xbbb4
subl 0x7c1a(%rip), %eax      # 0xbbb0
incl %eax
movl %eax, 0x7c1a(%rip)      # 0xbbb8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/main.c
// Function: RMDhash
static byte *
RMDhash(byte *value, int length)
/*
 * Hashes value of length bytes using RIPEMD160
 *
 * Returns pointer to 20 bytes hashcode
 */
{
	dword         MDbuf[RMDdwords];		/* contains (A, B, C, D(, E)) */
	dword	      X[16];			/* current 16 word chunk      */
	static byte   hashcode[RMDbytes];	/* for final hash-value       */
	unsigned int  i;			/* counter                    */
	int	      nbytes;			/* bytes not yet processed    */

	/* initialize */
	MDinit(MDbuf);

	/* Process value in 16-word chunks */
	for (nbytes=length; nbytes>=64; nbytes-=64) {
		for (i=0; i<16; i++) {
			X[i] = BYTES_TO_DWORD(value);
			value += 4;
		}
		compress(MDbuf, X);
	}
		
	/* finish: */
	MDfinish(MDbuf, value, length, 0);

	for (i=0; i<RMDbytes; i+=4) {
		hashcode[i]   =  MDbuf[i>>2];        /* implicit cast to byte */
		hashcode[i+1] = (MDbuf[i>>2] >>  8); /*  extracts the 8 least */
		hashcode[i+2] = (MDbuf[i>>2] >> 16); /*  significant bits.    */
		hashcode[i+3] = (MDbuf[i>>2] >> 24);
	}

	return (byte *)hashcode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
movq %rdi, %r12
leaq 0x10(%rsp), %rdi
callq 0x23cc
cmpl $0x40, %ebx
jl 0x448e
leaq 0x10(%rsp), %r14
leaq 0x30(%rsp), %r15
movl %ebx, 0xc(%rsp)
movl %ebx, %ebp
movq %r12, %r13
xorl %ebx, %ebx
movl (%r13,%rbx), %eax
movl %eax, 0x30(%rsp,%rbx)
addq $0x4, %rbx
cmpq $0x40, %rbx
jne 0x4458
movq %r14, %rdi
movq %r15, %rsi
callq 0x23de
leal -0x40(%rbp), %eax
leaq (%rbx,%r13), %r12
cmpl $0x7f, %ebp
movl %eax, %ebp
jg 0x4453
addq %rbx, %r13
movq %r13, %r12
movl 0xc(%rsp), %ebx
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x36cf
movq $-0x4, %rax
leaq 0x7753(%rip), %rcx      # 0xbc00
movl 0x14(%rsp,%rax), %edx
movl %edx, 0x4(%rax,%rcx)
addq $0x4, %rax
cmpq $0x10, %rax
jb 0x44ad
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/collect.c
// Function: collect_more
void
collect_more(byte *bp, int nbytes, int entropybits)
/*
 * Throw a bunch of information into the machine.
 * The user supplies a hopefully pessimistic estimate of the entropy
 */
{

	nrandombits += entropybits;
#ifdef BIGDEALX
	if (flog) {
		int i;

		fprintf(flog, "collect_more(");
		for (i=0; i < nbytes; i++)
			fprintf(flog, "%02x", bp[i]);
		fprintf(flog, ", %d, %d) -> %d\n", nbytes, entropybits, nrandombits);
	}
#endif
	while(nbytes > 0) {
		collect_byte(*bp);
		nbytes--;
		bp++;
	}
}

// Assembly:
addl %edx, 0x7743(%rip)      # 0xbc3c
testl %esi, %esi
jle 0x458b
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x7725(%rip), %r13      # 0xbc40
leaq 0x76fe(%rip), %r15      # 0xbc20
movq %rsp, %r12
movb (%rbx), %al
incl 0x770b(%rip)            # 0xbc38
movslq 0x7700(%rip), %rcx      # 0xbc34
leal 0x1(%rcx), %edx
movl %edx, 0x76f7(%rip)      # 0xbc34
movb %al, (%rcx,%r13)
cmpl $0x40, %edx
jne 0x456e
xorl %eax, %eax
movl (%r13,%rax,4), %ecx
movl %ecx, (%rsp,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x4548
movq %r15, %rdi
movq %r12, %rsi
callq 0x23de
movl $0x0, 0x76c6(%rip)      # 0xbc34
leal -0x1(%r14), %eax
incq %rbx
cmpl $0x1, %r14d
movl %eax, %r14d
jg 0x4525
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/collect.c
// Function: collect_finish
void
collect_finish(byte *hash)
/*
 * Halt the hashing engine
 * Extract the result into hash[]
 */
{
	int i;

	MDfinish(MDbuf, variousbytes, nhashbytes, 0);
#ifdef BIGDEALX
	if (flog)
		fprintf(flog, "collected %d random bits, from %d bytes of data\n",
			nrandombits, nhashbytes);

#endif
	for (i=0; i<RMDbytes; i+=4) {
		hash[i]   =  MDbuf[i>>2];         /* implicit cast to byte  */
		hash[i+1] = (MDbuf[i>>2] >>  8);  /*  extracts the 8 least  */
		hash[i+2] = (MDbuf[i>>2] >> 16);  /*  significant bits.     */
		hash[i+3] = (MDbuf[i>>2] >> 24);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x769e(%rip), %edx      # 0xbc38
leaq 0x767f(%rip), %r14      # 0xbc20
leaq 0x7698(%rip), %rsi      # 0xbc40
xorl %r15d, %r15d
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x36cf
movb (%r15,%r14), %al
movb %al, (%rbx,%r15)
movb 0x1(%r15,%r14), %al
movb %al, 0x1(%rbx,%r15)
movb 0x2(%r15,%r14), %al
movb %al, 0x2(%rbx,%r15)
movb 0x3(%r15,%r14), %al
movb %al, 0x3(%rbx,%r15)
leaq 0x4(%r15), %rax
cmpq $0x10, %r15
movq %rax, %r15
jb 0x45b5
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: init_kops
void
init_kops(FILE *out) {
    int nb = prparp->pp_nboards;

    putc(nb&0xff, out);
    putc((nb>>8)&0xff, out);
    out_fill(out, ' ', 11);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x7682(%rip), %rax      # 0xbc80
movl 0x8(%rax), %ebp
movl $0xff, %r14d
movl %ebp, %edi
andl %r14d, %edi
movq %rbx, %rsi
callq 0x2160
shrl $0x8, %ebp
andl %r14d, %ebp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2160
movl $0xb, %ebp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2160
decl %ebp
jne 0x4629
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: output_help
void
output_help(void) {
	of_p ofp;

	printf("%-8s%8s    Explanation\n\n", "Name", "Suffix");
	/* For all formats: */
	for (ofp=output_formats; ofp->of_name; ofp++) {
		printf("%-8s%8s    %s\n",
			ofp->of_name,
			ofp->of_suffix? ofp->of_suffix : "",
			ofp->of_help);
	}
	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x1e15(%rip), %rdi      # 0x6460
leaq 0x1e27(%rip), %rsi      # 0x6479
leaq 0x1e25(%rip), %rdx      # 0x647e
xorl %eax, %eax
callq 0x20c0
movq 0x4c49(%rip), %rsi      # 0x92b0
testq %rsi, %rsi
je 0x46a6
leaq 0x4c85(%rip), %r14      # 0x92f8
leaq 0x1d63(%rip), %r15      # 0x63dd
leaq 0x1e04(%rip), %rbx      # 0x6485
movq -0x30(%r14), %rdx
movq -0x20(%r14), %rcx
testq %rdx, %rdx
cmoveq %r15, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20c0
movq (%r14), %rsi
addq $0x48, %r14
testq %rsi, %rsi
jne 0x4681
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: output_createfiles
void
output_createfiles(char *fileprefix, progparams_p ppp)
/*
 * Create a file for every wanted output format
 * Set the formatset variable
 */
{
	char filename[100];
	of_p ofp;
	FILE *f;

	prparp = ppp;
	/* For all formats: */
	for (ofp=output_formats; ofp->of_name; ofp++) {
		/* If not in use forget it */
		if (!(ofp->of_flags&OFF_USEIT))
			continue;

		if (ofp->of_high_board &&
		    ppp->pp_highboard > ofp->of_high_board) {
			fprintf(stderr, "Format %s supports %d as high board, skipping\n", ofp->of_name, ofp->of_high_board);
			continue;
		}
		/* Make note of internal formats we have to make */
		formatset |= formatclosure[ofp->of_baseform];

		/* If no suffix use Standard Output */
		if (ofp->of_suffix) {
			if (strlen(fileprefix)+strlen(ofp->of_suffix)+1 >
					sizeof(filename)) {
				fprintf(stderr, "File name %s%s too long(cannot happen)\n", fileprefix, ofp->of_suffix);
				exit(-1);
			}
			strcpy(filename, fileprefix);
			strcat(filename, ofp->of_suffix);
			f = fopen(filename, ofp->of_flags&OFF_BINARY ? "wb" : "w");
			if (f == NULL) {
				fprintf(stderr, "Cannot create %s\n", filename);
				exit(-1);
			}
			ofp->of_file = f;
		} else {
			ofp->of_file = stdout;
		}
		/*
		 * If there is an init routine call it now
		 */
		if (ofp->of_init)
			(*ofp->of_init)(ofp->of_file);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, 0x8(%rsp)
movq %rsi, 0x73bb(%rip)      # 0xbc80
movq 0x49e4(%rip), %rdx      # 0x92b0
testq %rdx, %rdx
je 0x49d5
movq %rdi, %rbx
leaq 0x49d9(%rip), %r12      # 0x92b8
leaq 0x10(%rsp), %r15
movl (%r12), %r14d
testb $0x1, %r14b
je 0x49a7
movl 0x1c(%r12), %ecx
testl %ecx, %ecx
je 0x4909
movq 0x8(%rsp), %rax
cmpl %ecx, 0x4(%rax)
jg 0x49bb
movslq 0x18(%r12), %rax
leaq 0x1fab(%rip), %rcx      # 0x68c0
movl (%rcx,%rax,4), %eax
orl %eax, 0x736a(%rip)      # 0xbc88
movq 0x10(%r12), %r13
testq %r13, %r13
je 0x4987
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbp
movq %r13, %rdi
callq 0x2090
addq %rbp, %rax
addq $-0x64, %rax
cmpq $-0x66, %rax
jbe 0x49ee
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2050
movq %r15, %rdi
movq %r13, %rsi
callq 0x21d0
testb $0x2, %r14b
leaq 0x1b91(%rip), %rsi      # 0x64fe
leaq 0x1d24(%rip), %rax      # 0x6698
cmoveq %rax, %rsi
movq %r15, %rdi
callq 0x21a0
testq %rax, %rax
jne 0x4991
jmp 0x49e4
movq 0x4632(%rip), %rax      # 0x8fc0
movq (%rax), %rax
movq %rax, 0x8(%r12)
movq 0x28(%r12), %rax
testq %rax, %rax
je 0x49a7
movq 0x8(%r12), %rdi
callq *%rax
movq 0x40(%r12), %rdx
addq $0x48, %r12
testq %rdx, %rdx
jne 0x48e4
jmp 0x49d5
movq 0x462e(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x1adb(%rip), %rsi      # 0x64a7
xorl %eax, %eax
callq 0x2180
jmp 0x49a7
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
callq 0x228b
movq %rbx, %rdi
movq %r13, %rsi
callq 0x22af
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_dlm
static void
print_dlm(FILE *out, int boardno, hr_p hrp)
/*
 * Writes out one DLM record, including "checksum"
 * Record is mainly one lower case character per two cards
 */
{
	dl_byc *dbcp = hrp->hr_value.hv_dbcp;
	int i;
	int c;
	int checksum;

	if (boardno>99)	/* Format cannot do more than 99 */
		return;
	fprintf(out, "Duplicates %02d=0\n", boardno);
	fprintf(out, "Board %02d=", boardno);
	checksum = boardno;
	for(i=0; i<NCARDSPERDECK/2; i++) {
		c = 'a';
		c += dbcp->dc_card[2*i+0]<<2;
		c += dbcp->dc_card[2*i+1]<<0;
		putc(c, out);
		checksum ^= c;
	}
	fprintf(out, "%03d\n", checksum);
}

// Assembly:
cmpl $0x63, %esi
jle 0x4c01
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdx), %r15
leaq 0x1af6(%rip), %rsi      # 0x670f
xorl %r12d, %r12d
movl %ebx, %edx
xorl %eax, %eax
callq 0x2180
leaq 0x1b21(%rip), %rsi      # 0x674d
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2180
movzbl (%r15,%r12,2), %eax
movzbl 0x1(%r15,%r12,2), %ecx
leal (%rcx,%rax,4), %ebp
addl $0x61, %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x2160
xorl %ebp, %ebx
incq %r12
cmpq $0x1a, %r12
jne 0x4c38
leaq 0x1ae2(%rip), %rsi      # 0x6747
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2180
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_bri
static void
print_bri(FILE *out, int boardno, hr_p hrp)
/*
 * Writes out "bri" format, including filler
 *
 * It is unknown whether the strange half space, half zero fill
 * is actually necessary. This is just the way I saw my first BRI file
 */
{
	dl_byh *dbhp = hrp->hr_value.hv_dbhp;

	out_bri(out, dbhp);
	out_fill(out, ' ', 32);
	out_fill(out, 0, 18);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdx), %r15
leaq 0x198e(%rip), %r14      # 0x663b
xorl %r12d, %r12d
xorl %r13d, %r13d
movzbl (%r15,%r13), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2180
incq %r13
cmpq $0xd, %r13
jne 0x4cb3
incq %r12
addq $0xd, %r15
cmpq $0x3, %r12
jne 0x4cb0
movl $0x20, %ebp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2160
decl %ebp
jne 0x4ce0
movl $0x12, %ebp
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2160
decl %ebp
jne 0x4cf6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_lin
static void
print_lin(FILE *out, int boardno, hr_p hrp)
/*
 * Write out the "pbn" record, with furnishings
 */
{
	dl_byh *dbhp = hrp->hr_value.hv_dbhp;

	fprintf(out, "qx|o%d|md|%d", boardno, (boardno+1)%4+1);
	out_handrep(out, dbhp, lin_suitstr, cardrep_int, COMPASS_SOUTH);
	putc(',', out);
	out_handrep(out, dbhp, lin_suitstr, cardrep_int, COMPASS_WEST);
	putc(',', out);
	out_handrep(out, dbhp, lin_suitstr, cardrep_int, COMPASS_NORTH);
	fprintf(out, "|rh||ah|Board %d|sv|%s|pg||\n", boardno, lin_vulnrep[vuln_index[boardno%16]]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leal 0x1(%rbx), %eax
leal 0x4(%rbx), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
movq 0x8(%rdx), %r15
andl $-0x4, %ecx
negl %ecx
addl %ebx, %ecx
addl $0x2, %ecx
leaq 0x1846(%rip), %rsi      # 0x6826
movl %ebx, %edx
xorl %eax, %eax
callq 0x2180
leaq 0x47d0(%rip), %r12      # 0x97c0
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x2, %ecx
callq 0x539d
movl $0x2c, %edi
movq %r14, %rsi
callq 0x2160
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x3, %ecx
callq 0x539d
movl $0x2c, %edi
movq %r14, %rsi
callq 0x2160
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x539d
leal 0xf(%rbx), %eax
testl %ebx, %ebx
cmovnsl %ebx, %eax
andl $-0x10, %eax
movl %ebx, %ecx
subl %eax, %ecx
movslq %ecx, %rax
leaq 0x13a7(%rip), %rcx      # 0x6400
movslq (%rcx,%rax,4), %rax
leaq 0x13dc(%rip), %rdx      # 0x6440
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
leaq 0x17c1(%rip), %rsi      # 0x6833
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2180
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_csv
static void
print_csv(FILE *out, int boardno, hr_p hrp)
/*
 * Write out a CSV record
 */
{
	dl_byh *dbhp = hrp->hr_value.hv_dbhp;

	out_cardrep(out, dbhp, csv_suitstr, cardrep_int);
	fprintf(out, "\",\"%d\",\"%s/%s\"\n",
		boardno,
		dealerstr[boardno%4],
		csv_vulnrep[vuln_index[boardno%16]]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdx), %r15
xorl %ebp, %ebp
leaq 0x479d(%rip), %r12      # 0x9840
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x539d
incl %ebp
cmpl $0x4, %ebp
jne 0x50a3
leal 0x3(%rbx), %eax
leal 0xf(%rbx), %edx
testl %ebx, %ebx
cmovnsl %ebx, %eax
cmovnsl %ebx, %edx
andl $-0x4, %eax
movl %ebx, %ecx
subl %eax, %ecx
movslq %ecx, %rax
leaq 0x3cd7(%rip), %rcx      # 0x8db0
movq (%rcx,%rax,8), %rcx
andl $-0x10, %edx
movl %ebx, %eax
subl %edx, %eax
cltq
leaq 0x1313(%rip), %rdx      # 0x6400
movslq (%rdx,%rax,4), %rax
leaq 0x1358(%rip), %rdx      # 0x6450
movslq (%rdx,%rax,4), %r8
addq %rdx, %r8
leaq 0x1752(%rip), %rsi      # 0x6858
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2180
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_borel
static void
print_borel(FILE *out, int boardno, hr_p hrp)
/*
 * Write out a "bhg" record
 */
{
	dl_byh *dbhp = hrp->hr_value.hv_dbhp;
	int i, j, compass, card;

	for (i=0; i<NCOMPASS; i++) {
		/*
		 * Start at dealer of this hand
		 */
		compass = (boardno - 1 + i) % NCOMPASS;
		for (j=0; j<NCARDSPERHAND; j++) {
			card = dbhp->dh_hand[compass][j];
			putc(card <= 2*NCARDSPERHAND ?
				'A'+card-1 : 'a'+card-2*NCARDSPERHAND-1,
				out);
		}
	}
	fprintf(out, "\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq 0x8(%rdx), %r15
decl %r14d
xorl %r12d, %r12d
movl %r14d, %eax
addl %r12d, %eax
leal 0x3(%r14,%r12), %ecx
cmovnsl %eax, %ecx
andl $-0x4, %ecx
subl %ecx, %eax
cltq
leaq (%rax,%rax,2), %rcx
leaq (%rax,%rcx,4), %r13
addq %r15, %r13
movq $-0xd, %rbp
movzbl 0xd(%r13,%rbp), %eax
movl %eax, %ecx
orl $0x40, %ecx
leal 0x46(%rax), %edi
cmpl $0x1b, %eax
cmovbl %ecx, %edi
movq %rbx, %rsi
callq 0x2160
incq %rbp
jne 0x5197
incl %r12d
cmpl $0x4, %r12d
jne 0x5170
movl $0xa, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_dup_common
static void
print_dup_common(FILE *out, int boardno, dl_byh *dbhp, int not_on_screen)
/*
 * Write out a "dup" record
 * This is actually a BRI, followed by a DGE, and some padding
 */
{

	/*
	 * Horribly convoluted hack upon hack format
	 *
	 * Duplimate, generation X
	 */
	out_bri(out, dbhp);
	if (boardno == 1 && not_on_screen) {
		out_fill(out, ' ', 68);
	} else {
		out_dge(out, dbhp);
	}
	putc('Y', out);		/* Y to Random Hands */
	putc('N', out);		/* N to reverse order */
	putc('1', out);		/* Start at board 1 */
	putc(' ', out);
	putc(' ', out);
	putc('0', out);		/* No copies immediate */
	putc(' ', out);
	putc('0' + (prparp->pp_nboards/10)%10, out);/* tens of number */
	putc('0' + prparp->pp_nboards%10, out);	/* units of number */
	putc(' ', out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movq %rdx, %r14
movl %esi, (%rsp)
movq %rdi, %rbx
leaq 0x1409(%rip), %r12      # 0x663b
movq %rdx, %r13
xorl %ebp, %ebp
xorl %r15d, %r15d
movzbl (%r13,%r15), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2180
incq %r15
cmpq $0xd, %r15
jne 0x523a
incq %rbp
addq $0xd, %r13
cmpq $0x3, %rbp
jne 0x5237
cmpl $0x1, (%rsp)
sete %al
cmpl $0x0, 0x4(%rsp)
setne %cl
testb %cl, %al
je 0x528e
movl $0x44, %ebp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2160
decl %ebp
jne 0x527b
jmp 0x52ae
xorl %ebp, %ebp
leaq 0x4409(%rip), %r15      # 0x96a0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x539d
incl %ebp
cmpl $0x4, %ebp
jne 0x5297
movl $0x59, %edi
movq %rbx, %rsi
callq 0x2160
movl $0x4e, %edi
movq %rbx, %rsi
callq 0x2160
movl $0x31, %edi
movq %rbx, %rsi
callq 0x2160
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2160
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2160
movl $0x30, %edi
movq %rbx, %rsi
callq 0x2160
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2160
movq 0x6970(%rip), %rax      # 0xbc80
movslq 0x8(%rax), %rax
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
movslq %eax, %rdi
imulq $0x66666667, %rdi, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
addl %eax, %eax
leal (%rax,%rax,4), %eax
subl %eax, %edi
addl $0x30, %edi
movq %rbx, %rsi
callq 0x2160
movq 0x6928(%rip), %rax      # 0xbc80
movslq 0x8(%rax), %rdi
imulq $0x66666667, %rdi, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
addl %eax, %eax
leal (%rax,%rax,4), %eax
subl %eax, %edi
addl $0x30, %edi
movq %rbx, %rsi
callq 0x2160
movl $0x20, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2160
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: out_handrep
static void
out_handrep(FILE *out, dl_byh *dbhp, char *suitstr[NCOMPASS][NSUIT], char *cardrep, int compass)
/*
 * Write out a "dge", "lin" or "pbn" single hand
 */
{
	int suit;
	int i;
	int card, card_in_suit;

	for (suit=SUIT_SPADES; suit<=SUIT_CLUBS; suit++) {
		fputs(suitstr[compass][suit], out);
		for (i=0; i<NCARDSPERHAND; i++) {
			/*
			 * Get card in this position for player
			 * If it is part of the suit we are working on
			 * (1..13 for spades, upto 40..52 for clubs)
			 * print it.
			 */
			card = dbhp->dh_hand[compass][i];
			card_in_suit = card - 13*suit;
			if (card_in_suit > 0 && card_in_suit <= 13)
				putc(cardrep[card_in_suit-1], out);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rax
leaq (%rcx,%rax,4), %r15
addq %rsi, %r15
xorl %r12d, %r12d
shlq $0x5, %rcx
addq %rdx, %rcx
movq %rcx, (%rsp)
leaq 0x1272(%rip), %r13      # 0x6640
movq (%rsp), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
callq 0x20e0
imull $-0xd, %r12d, %ebp
movq $-0xd, %r14
movzbl 0xd(%r15,%r14), %eax
leal (%rax,%rbp), %ecx
decl %ecx
cmpl $0xc, %ecx
ja 0x540b
addl %ebp, %eax
movl %eax, %eax
movsbl -0x1(%rax,%r13), %edi
movq %rbx, %rsi
callq 0x2160
incq %r14
jne 0x53e9
incq %r12
cmpq $0x4, %r12
jne 0x53ce
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: init_dlmcommon
static void
init_dlmcommon(FILE *out, int dups, int show)
{
	int checksum;

	/*
	 * Very badly documented, sorry(not my fault)
	 */
	fprintf(out, "[Document]\n");
	fprintf(out, "Headline=Generated by Big Deal version %d.%d%s\n",
		VERSION_MAJOR, VERSION_MINOR, VERSION_PAREN);
	fprintf(out, "Status=%s\n", show ? "Show" : "Sealed");
	fprintf(out, "Duplicates=%d\n", dups);
	fprintf(out, "From board=%d\n",
		prparp->pp_lowboard<=99 ? prparp->pp_lowboard : 99);
	fprintf(out, "To board=%d\n",
		prparp->pp_highboard<=99 ? prparp->pp_highboard : 99);
	fprintf(out, "Next board to duplimate=0\n");
	fprintf(out, "PrintOuts=0\n");
	fprintf(out, "Crypto key=0\n");
	checksum = dups ^ prparp->pp_lowboard ^ prparp->pp_highboard;
	if (show)
		checksum ^= 1;	/* XOR with 1 if show */
	fprintf(out, "Checksum=%d\n", checksum);
	fill_dlm(out, 0, prparp->pp_lowboard);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x1215(%rip), %rdi      # 0x664e
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21f0
leaq 0x1208(%rip), %rsi      # 0x665a
leaq 0xf84(%rip), %r8        # 0x63dd
movq %rbx, %rdi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2180
xorl %ebp, %ebp
testl %r14d, %r14d
setne %bpl
leaq 0x121b(%rip), %rax      # 0x6695
leaq 0x1219(%rip), %rdx      # 0x669a
cmovneq %rax, %rdx
leaq 0x11fe(%rip), %rsi      # 0x668a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2180
leaq 0x1204(%rip), %rsi      # 0x66a1
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2180
movq 0x67d0(%rip), %rax      # 0xbc80
movl (%rax), %edx
movl $0x63, %r14d
cmpl %r14d, %edx
cmovgel %r14d, %edx
leaq 0x11ea(%rip), %rsi      # 0x66b0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2180
movq 0x67a9(%rip), %rax      # 0xbc80
movl 0x4(%rax), %eax
cmpl $0x63, %eax
cmovll %eax, %r14d
leaq 0x11d7(%rip), %rsi      # 0x66bf
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2180
leaq 0x11d0(%rip), %rdi      # 0x66cc
movl $0x1a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21f0
leaq 0x11d2(%rip), %rdi      # 0x66e7
movl $0xc, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21f0
leaq 0x11c6(%rip), %rdi      # 0x66f4
movl $0xd, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21f0
movq 0x6739(%rip), %rax      # 0xbc80
xorl (%rax), %ebp
xorl 0x4(%rax), %ebp
leaq 0x11af(%rip), %rsi      # 0x6702
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2180
movq 0x671a(%rip), %rax      # 0xbc80
movl (%rax), %edx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5573
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: fill_dlm
static void
fill_dlm(FILE *out, int lowbrd, int highbrd)
{
	int i;
	int checksum;

	for (i=lowbrd+1; i<highbrd; i++) {
		checksum = i^14;	/* KGB calculated */
		fprintf(out, "Duplicates %02d=0\n", i);
		fprintf(out, "Board %02d=aaaaaabffffffkkkkkklpppppp%03d\n",
			i, checksum);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
incl %ebp
cmpl %edx, %ebp
jge 0x55c7
movl %edx, %ebx
movq %rdi, %r14
leaq 0x117d(%rip), %r15      # 0x670f
leaq 0x1189(%rip), %r12      # 0x6722
movl %ebp, %r13d
xorl $0xe, %r13d
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2180
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2180
incl %ebp
cmpl %ebp, %ebx
jne 0x5599
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_kops_cds
static void
print_kops_cds(FILE *out, dl_byc *dbcp, int rotoffset) {
    int card, byte, suit, cardno, cardpos;

    for (card=0; card<NCARDSPERHAND; card++) {
	byte = 0;
	for (suit=0; suit<NSUIT; suit++) {
	    cardno = NCARDSPERHAND*suit+card;
	    cardpos = dbcp->dc_card[cardno];
	    cardpos = (cardpos+rotoffset)%NSUIT;
	    byte |= cardpos << 2*(NSUIT-1-suit);
	}
	putc(byte, out);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movl $0x6, %ecx
movq $-0x34, %rax
xorl %edi, %edi
movzbl 0x34(%r14,%rax), %edx
addl %ebx, %edx
andl $0x3, %edx
shll %cl, %edx
orl %edx, %edi
addl $-0x2, %ecx
addq $0xd, %rax
jne 0x55f7
movq %r15, %rsi
callq 0x2160
incq %r12
incq %r14
cmpq $0xd, %r12
jne 0x55e9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/unix.c
// Function: gettod
void
gettod(struct timeval *tp)
/*
 * Fill in *tp with gettimeofday values
 * Side effect: calculate approx precision
 */
{
	int b;

	gettimeofday(tp, (struct timezone *) 0);
	/* Find how many bits are set in usec field */
	for(b = 0; b < 20; b++) {
		if (tp->tv_usec&(1<<b))
			break;
	}
	if (20-b > subsecbits) {
		subsecbits = 20-b;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x20d0
movq 0x8(%rbx), %rax
btq %r14, %rax
jb 0x565a
incl %r14d
cmpl $0x14, %r14d
jne 0x5645
movl $0x14, %r14d
movl $0x14, %eax
subl %r14d, %eax
cmpl 0x4260(%rip), %eax      # 0x98c8
jle 0x5670
movl %eax, 0x4258(%rip)      # 0x98c8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/unix.c
// Function: getchtm
int
getchtm(int *nbits)
/*
 * Read one character from standard input
 * Time the wait, and use bits for random
 * MUST be in cbreak mode for this to work
 */
{
	struct timeval t1, t2;
	long sdiff, mdiff;
	int c;
	long shift;
	int b;

	gettod(&t1);
	c = getchar();
	gettod(&t2);
	mdiff = t2.tv_usec - t1.tv_usec;
	sdiff = t2.tv_sec - t1.tv_sec;
	if (sdiff > 1000)
		sdiff = 1000;
	mdiff += sdiff * 1000000;
	/*
	 * Everything slower than 1/8 second can be faked
	 * Trust at most half of the rest
	 */
	for (shift = mdiff, b= 0; shift>3 ; shift >>= 2, b++)
		;
	if (b <= MAX_INTERVAL_ENTROPY)
		*nbits = b;
	else
		*nbits = MAX_INTERVAL_ENTROPY;
	collect_more((byte *) &t1, sizeof(t1), 0);
	collect_more((byte *) &t2, sizeof(t2), 0);
	if (flog)
		fprintf(flog, "Collected character %d, timediff %ld, timebits %d\n",
			c, mdiff, *nbits);
	return c;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x5630
callq 0x2170
movl %eax, %ebx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x5630
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq 0x8(%r15), %rcx
subq (%r15), %rax
movl $0x3e8, %edx            # imm = 0x3E8
cmpq %rdx, %rax
cmovgeq %rdx, %rax
imulq $0xf4240, %rax, %r15    # imm = 0xF4240
addq %rcx, %r15
xorl %eax, %eax
cmpq $0x4, %r15
jl 0x56ec
xorl %eax, %eax
movq %r15, %rdx
movq %r15, %rcx
shrq $0x2, %rcx
incl %eax
cmpq $0xf, %rdx
movq %rcx, %rdx
ja 0x56dd
cmpl $0x6, %eax
movl $0x6, %ecx
cmovbl %eax, %ecx
movl %ecx, (%r14)
leaq 0x18(%rsp), %rdi
movl $0x10, %esi
xorl %edx, %edx
callq 0x44f3
leaq 0x8(%rsp), %rdi
movl $0x10, %esi
xorl %edx, %edx
callq 0x44f3
leaq 0x64d5(%rip), %rax      # 0xbbf8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x5741
movl (%r14), %r8d
leaq 0x119b(%rip), %rsi      # 0x68d0
movl %ebx, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2180
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/unix.c
// Function: os_collect
void
os_collect(void) {
	int pid;
	struct timeval t;

	if (os_dev_random()) {
		return;
	}
	pid = getpid();
	/* Trust about 8 bits of randomness in pid */
	collect_more((byte *) &pid, sizeof(pid), 8);
	gettod(&t);
	/* Trust 6 bits of seconds, and half the subsecond bits */
	collect_more((byte *) &t, sizeof(t), 6+subsecbits/2);
	if (flog)
		fprintf(flog, "First TOD=(%ld, %ld), subsecbits = %d\n",
			t.tv_sec, t.tv_usec, subsecbits);
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
leaq 0x11da(%rip), %rdi      # 0x6935
xorl %esi, %esi
xorl %eax, %eax
callq 0x2190
testl %eax, %eax
js 0x579d
movl %eax, %ebx
leaq 0x10(%rsp), %rsi
movl $0x28, %edx
movl %eax, %edi
callq 0x2130
cmpl $0x28, %eax
jne 0x579d
movl %ebx, %edi
callq 0x2110
leaq 0x10(%rsp), %rdi
movl $0x28, %esi
movl $0x140, %edx            # imm = 0x140
callq 0x44f3
jmp 0x580b
callq 0x2070
leaq 0xc(%rsp), %rdi
movl %eax, (%rdi)
movl $0x4, %esi
movl $0x8, %edx
callq 0x44f3
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x5630
movl 0x40fd(%rip), %edx      # 0x98c8
shrl %edx
addl $0x6, %edx
movq %rbx, %rdi
movl $0x10, %esi
callq 0x44f3
leaq 0x6414(%rip), %rax      # 0xbbf8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x580b
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl 0x40cb(%rip), %r8d      # 0x98c8
leaq 0x10ff(%rip), %rsi      # 0x6903
xorl %eax, %eax
callq 0x2180
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/unix.c
// Function: cbreak
void
cbreak(void)
/*
 * Set terminal to state where characters can be read one at a time
 * Also disable echo
 */
{
	struct termios newtios;

	newtios = tios;

	/* fiddle newtios */
	newtios.c_lflag &= ~(ICANON|ECHO);
	newtios.c_cc[VMIN] = 1;
	newtios.c_cc[VTIME] = 0;
	ioctl(0, STTY, &newtios);
}

// Assembly:
subq $0x48, %rsp
movups 0x64cc(%rip), %xmm0     # 0xbce8
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movups 0x64cf(%rip), %xmm0     # 0xbcf8
movaps %xmm0, 0x10(%rdx)
movups 0x64e0(%rip), %xmm0     # 0xbd14
movups %xmm0, 0x2c(%rdx)
movups 0x64c9(%rip), %xmm0     # 0xbd08
movaps %xmm0, 0x20(%rdx)
andb $-0xb, 0xc(%rdx)
movw $0x100, 0x16(%rdx)      # imm = 0x100
movl $0x5404, %esi           # imm = 0x5404
xorl %edi, %edi
xorl %eax, %eax
callq 0x2100
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/unix.c
// Function: legal_filename_prefix
int
legal_filename_prefix(char *s)
/*
 * Legal prefix to make legal name when three letter suffix added
 */
{

	if (*s == 0)	/* Too short */
		return 0;
	if (strlen(s) > 100)	/* Worst case would be System V with 10, but should be dead by now */
		return 0;
	while (*s) {
		if (*s == '/' || *s == ' ')	/* disallow space */
			return 0;
		s++;
	}
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpb $0x0, (%rdi)
je 0x58d4
movq %rdi, %r14
callq 0x2090
cmpq $0x64, %rax
ja 0x58d4
movzbl (%r14), %eax
testl %eax, %eax
je 0x58cf
cmpl $0x20, %eax
je 0x58d4
cmpl $0x2f, %eax
je 0x58d4
incq %r14
jmp 0x58b8
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aes128n8t8clocv2/ref/cloc.c
// Function: ae_init
int ae_init(ae_cxt* cxt, const byte* userkey, int keylen)
{
	if(keylen != STATE_LEN){
		return KEY_ERROR;
	}
	cxt->userkey = (byte*)userkey;
	cxt->pt_ekey = &(cxt->ekey);
	AES_set_encrypt_key(userkey, keylen*8, cxt->pt_ekey); /* set the encryption key */
	cxt->klen = keylen;
    
	return SUCCESS;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x10, %edx
jne 0x30a2
pushq %rbx
movq %rdi, %rbx
movq %rsi, 0x120(%rdi)
leaq 0x20(%rdi), %rdx
movq %rdx, 0x118(%rdi)
movq %rsi, %rdi
movl $0x80, %esi
callq 0x10a0
movl $0x10, 0x128(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aes128n8t8clocv2/ref/encrypt.c
// Function: crypto_aead_encrypt
int crypto_aead_encrypt(
		unsigned char *c, unsigned long long *clen,
		const unsigned char *m, unsigned long long mlen,
		const unsigned char *ad, unsigned long long adlen,
		const unsigned char *nsec,                          //not relavent to CLOC
		const unsigned char *npub,
		const unsigned char *k
		)
{
    /* set ciphertext length */
    *clen = mlen + CRYPTO_ABYTES;
    
    unsigned char tag[CRYPTO_ABYTES];
    ae_cxt cxt;
    
    /* set key and compute round keys */
    if(ae_init(&cxt, k, CRYPTO_KEYBYTES))
        return RETURN_KEYSIZE_ERR;
    
    /* process the associated data */
    process_ad(&cxt, ad, adlen, npub, CRYPTO_NPUBBYTES);
    
    /* encrypt message */
    ae_encrypt(&cxt, (unsigned char*)m, mlen, c, tag, CRYPTO_ABYTES, ENC);
    
    /* copy the tag to the end of ciphertext */
    memcpy(c+mlen, tag, CRYPTO_ABYTES);
	return RETURN_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %r9, %r12
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
movq 0x1e0(%rsp), %rax
addq $0x8, %rcx
movq %rcx, (%rsi)
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
movl $0x10, %edx
callq 0x1090
movl %eax, %ecx
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
testl %ecx, %ecx
jne 0x363d
movq 0x1d8(%rsp), %rcx
leaq 0x18(%rsp), %rbp
movl $0x8, %r8d
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1050
movl $0x1, (%rsp)
leaq 0x10(%rsp), %r12
movl $0x8, %r9d
movq %rbp, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %r12, %r8
callq 0x10b0
movq (%r12), %rax
movq %rax, (%r14,%rbx)
xorl %eax, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aes128n8t8clocv2/ref/encrypt.c
// Function: crypto_aead_decrypt
int crypto_aead_decrypt(
		unsigned char *m,unsigned long long *mlen,
		unsigned char *nsec,                                //not relavent to CLOC
		const unsigned char *c,unsigned long long clen,
		const unsigned char *ad,unsigned long long adlen,
		const unsigned char *npub,
		const unsigned char *k
		)
{
    /* set plaintext length */
    *mlen = clen - CRYPTO_ABYTES;
    
    unsigned char tag[CRYPTO_ABYTES];
    ae_cxt cxt;
    
    /* set key and compute round keys */
    if(ae_init(&cxt, k, CRYPTO_KEYBYTES))
        return RETURN_KEYSIZE_ERR;
    
    /* process the associated data */
    process_ad(&cxt, ad, adlen, npub, CRYPTO_NPUBBYTES);
    
    /* decrypt ciphertext */
    ae_encrypt(&cxt, m, *mlen, (unsigned char*)c, tag, CRYPTO_ABYTES, DEC);
    
    /* compare the tag */
    int i;
    for(i = 0; i < CRYPTO_ABYTES; i++)
        if(tag[i] != c[(*mlen) + i]){
            return RETURN_TAG_NO_MATCH;
        }
    
	return RETURN_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %r9, %r12
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x1d0(%rsp), %rsi
addq $-0x8, %r8
movq %r8, (%r14)
leaq 0x10(%rsp), %rdi
movl $0x10, %edx
callq 0x1090
movl %eax, %ecx
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
testl %ecx, %ecx
jne 0x36fd
movq 0x1c8(%rsp), %rcx
movq 0x1c0(%rsp), %rdx
leaq 0x10(%rsp), %r13
movl $0x8, %r8d
movq %r13, %rdi
movq %r12, %rsi
callq 0x1050
movq (%r14), %rdx
movl $0x2, (%rsp)
leaq 0x8(%rsp), %r8
movl $0x8, %r9d
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x10b0
addq (%r14), %rbx
xorl %eax, %eax
movb 0x8(%rsp,%rax), %cl
cmpb (%rbx,%rax), %cl
jne 0x36f8
incq %rax
cmpq $0x8, %rax
jne 0x36e2
xorl %eax, %eax
jmp 0x36fd
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aes128n8t8clocv2/ref/utils.c
// Function: print_cxt
void print_cxt(const ae_cxt* cxt)
{
	printf("user key of %d bytes:\n", cxt->klen);
	pstate(cxt->userkey, cxt->klen);
	printf("associated data of %llu bytes:\n", cxt->adlen);
	pstate(cxt->ad, cxt->adlen);
	printf("nonce of %llu bytes:\n", cxt->nlen);
	pstate(cxt->nonce, cxt->nlen);
	printf("plaintext of %llu bytes:\n", cxt->ptlen);
	pstate(cxt->pt, cxt->ptlen);
	printf("ciphertext of %llu bytes:\n", cxt->ctlen);
	pstate(cxt->ct, cxt->ctlen);
	printf("MAC of %d bytes:\n", cxt->tlen);
	pstate(cxt->tag, cxt->tlen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x128(%rdi), %esi
leaq 0x30ec(%rip), %rdi      # 0x6850
xorl %eax, %eax
callq 0x1030
movq 0x138(%rbx), %rsi
leaq 0x30ee(%rip), %rdi      # 0x6867
xorl %eax, %eax
callq 0x1030
movq 0x148(%rbx), %rsi
leaq 0x30f9(%rip), %rdi      # 0x6887
xorl %eax, %eax
callq 0x1030
movq 0x158(%rbx), %rsi
leaq 0x30fa(%rip), %rdi      # 0x689d
xorl %eax, %eax
callq 0x1030
movq 0x168(%rbx), %rsi
leaq 0x30ff(%rip), %rdi      # 0x68b7
xorl %eax, %eax
callq 0x1030
movl 0x178(%rbx), %esi
leaq 0x3106(%rip), %rdi      # 0x68d2
xorl %eax, %eax
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]libcperciva/tests/crypto_aesctr/main.c
// Function: perftest
static int
perftest(void)
{
	struct crypto_aesctr * aesctr;
	struct crypto_aes_key * key_exp;
	uint8_t key_unexpanded[32];
	size_t i;

	/* Inform user about the hardware optimization status. */
	print_hardware("Performance test of AES-CTR");
	fflush(stdout);

	/* Prepare the key.  We're only performance-testing 256-bit keys. */
	for (i = 0; i < 32; i++)
		key_unexpanded[i] = (uint8_t)i;
	if ((key_exp = crypto_aes_key_expand(key_unexpanded, 32)) == NULL)
		goto err0;

	/* Prepare the aesctr object. */
	if ((aesctr = crypto_aesctr_alloc()) == NULL)
		goto err1;
	crypto_aesctr_init2(aesctr, key_exp, 0);

	/* Time the function. */
	if (perftest_buffers(nbytes_perftest, perfsizes, num_perf,
	    nbytes_warmup, 1, perftest_init, perftest_func, NULL, aesctr)) {
		warn0("perftest_buffers");
		goto err2;
	}

	/* Clean up. */
	crypto_aesctr_free(aesctr);
	crypto_aes_key_free(key_exp);

	/* Success! */
	return (0);

err2:
	crypto_aesctr_free(aesctr);
err1:
	crypto_aes_key_free(key_exp);
err0:
	/* Failure! */
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x36eb(%rip), %rdi      # 0x600a
callq 0x2b41
movq 0x76cd(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
callq 0x2250
xorl %eax, %eax
movb %al, (%rsp,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x2935
movq %rsp, %rdi
movl $0x20, %esi
callq 0x342f
testq %rax, %rax
je 0x29e4
movq %rax, %rbx
callq 0x3be4
testq %rax, %rax
je 0x29ec
movq %rax, %r14
xorl %r15d, %r15d
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3bee
subq $0x8, %rsp
leaq 0x239(%rip), %rax       # 0x2bbf
leaq 0x3d13(%rip), %rsi      # 0x66a0
leaq 0x20d(%rip), %r9        # 0x2ba1
movl $0x2000000, %edi        # imm = 0x2000000
movl $0xb, %edx
movl $0x9c4000, %ecx         # imm = 0x9C4000
movl $0x1, %r8d
pushq %r14
pushq $0x0
pushq %rax
callq 0x48a8
addq $0x20, %rsp
testl %eax, %eax
je 0x29da
leaq 0x3664(%rip), %rdi      # 0x6026
xorl %eax, %eax
callq 0x4e37
callq 0x21c0
movl $0x0, (%rax)
movl $0x1, %r15d
movq %r14, %rdi
callq 0x3f3a
jmp 0x29f2
movl $0x1, %r15d
jmp 0x29fa
movl $0x1, %r15d
movq %rbx, %rdi
callq 0x34cf
movl %r15d, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]libcperciva/tests/crypto_aesctr/main.c
// Function: selftest
static int
selftest(void)
{
	uint64_t nonce;
	size_t num_tests;
	int failures = 0;

	/* Test with nonce = 0. */
	num_tests = sizeof(tests_128) / sizeof(tests_128[0]);
	if (selftest_cases(tests_128, num_tests, 0))
		failures++;
	num_tests = sizeof(tests_256) / sizeof(tests_256[0]);
	if (selftest_cases(tests_256, num_tests, 0))
		failures++;

	/* Test with nonce = 0xfedcba9876543210. */
	nonce = 0xfedcba9876543210;
	num_tests = sizeof(tests_128_nonce) / sizeof(tests_128_nonce[0]);
	if (selftest_cases(tests_128_nonce, num_tests, nonce))
		failures++;
	num_tests = sizeof(tests_256_nonce) / sizeof(tests_256_nonce[0]);
	if (selftest_cases(tests_256_nonce, num_tests, nonce))
		failures++;

	/* Test with nonce = 0, re-using the same object. */
	num_tests = sizeof(tests_128) / sizeof(tests_128[0]);
	if (selftest_cases_singleobj(tests_128, num_tests, 0))
		failures++;
	num_tests = sizeof(tests_256) / sizeof(tests_256[0]);
	if (selftest_cases_singleobj(tests_256, num_tests, 0))
		failures++;

	/* Test with nonce = 0xfedcba9876543210. */
	nonce = 0xfedcba9876543210;
	num_tests = sizeof(tests_128_nonce) / sizeof(tests_128_nonce[0]);
	if (selftest_cases_singleobj(tests_128_nonce, num_tests, nonce))
		failures++;
	num_tests = sizeof(tests_256_nonce) / sizeof(tests_256_nonce[0]);
	if (selftest_cases_singleobj(tests_256_nonce, num_tests, nonce))
		failures++;

	/* Test unaligned access. */
	if (selftest_unaligned_access(16))
		failures++;
	if (selftest_unaligned_access(32))
		failures++;

	/* Report overall success to exit code. */
	if (failures)
		return (1);
	else
		return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7047(%rip), %r14      # 0x9a60
movq %r14, %rdi
xorl %esi, %esi
callq 0x2bfc
xorl %ebx, %ebx
testq %rax, %rax
setne %bl
leaq 0x710e(%rip), %r15      # 0x9b40
movq %r15, %rdi
xorl %esi, %esi
callq 0x2bfc
leal 0x1(%rbx), %ebp
testq %rax, %rax
cmovel %ebx, %ebp
leaq 0x71d4(%rip), %r12      # 0x9c20
movabsq $-0x123456789abcdf0, %rbx # imm = 0xFEDCBA9876543210
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2bfc
cmpq $0x1, %rax
sbbl $-0x1, %ebp
leaq 0x7291(%rip), %r13      # 0x9d00
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2bfc
cmpq $0x1, %rax
sbbl $-0x1, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x2d6e
cmpq $0x1, %rax
sbbl $-0x1, %ebp
movq %r15, %rdi
xorl %esi, %esi
callq 0x2d6e
cmpq $0x1, %rax
sbbl $-0x1, %ebp
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2d6e
cmpq $0x1, %rax
sbbl $-0x1, %ebp
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2d6e
cmpq $0x1, %rax
sbbl $-0x1, %ebp
movl $0x10, %edi
callq 0x2fb0
movq %rax, %rbx
movl $0x20, %edi
callq 0x2fb0
testq %rax, %rax
setne %al
orl %ebp, %ebx
setne %cl
orb %al, %cl
movzbl %cl, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq