LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_pack.c
// Function: gen_output
ULONG gen_output(void)
{
	ULONG pos;

	struct lzinfo lz;




	if( !emit_init() )
	{
		printf("gen_output(): emit_init() failed!\n");
		return 0;
	}


	pos=1; // first byte copied to output 'as-is', without LZ coding

	while( pos<inlen )
	{
		// write best code to the output stream
		if( !make_lz_info(indata[pos],&pdata[pos].best,&lz) )
		{
				printf("gen_output(): make_lz_info() failed!\n");
				return 0;
		}

		if( !emit_code(&lz) )
		{
			printf("gen_output(): emit_code() failed!\n");
			return 0;
		}
		pos+=lz.length; // step to the next unpacked byte
	}

	// sanity check
	if( pos>inlen )
	{
		printf("gen_output(): last position is out of input file!\n");
		return 0;
	}





	// just finish all deals
	if( !emit_finish() )
	{
		printf("gen_output(): emit_finish() failed!\n");
		return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
callq 0x1aec
testl %eax, %eax
je 0x246b
pushq $0x1
popq %rbp
leaq 0x2cb0(%rip), %r14      # 0x50d8
leaq 0x2cb1(%rip), %r15      # 0x50e0
leaq 0xc(%rsp), %rbx
cmpl (%r14), %ebp
jae 0x2474
movq (%r15), %rax
movl %ebp, %esi
movzbl (%rax,%rsi), %edi
shlq $0x3, %rsi
addq 0x51e3(%rip), %rsi      # 0x7630
movq %rbx, %rdx
callq 0x1d44
testl %eax, %eax
je 0x247f
movq %rbx, %rdi
callq 0x1b1d
testl %eax, %eax
je 0x2488
addl 0xc(%rsp), %ebp
jmp 0x2434
leaq 0x1032(%rip), %rdi      # 0x34a4
jmp 0x248f
jbe 0x24a1
leaq 0x106d(%rip), %rdi      # 0x34ea
jmp 0x248f
leaq 0x1096(%rip), %rdi      # 0x351c
jmp 0x248f
leaq 0x10b2(%rip), %rdi      # 0x3541
callq 0x1110
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x1c1d
testl %eax, %eax
je 0x24af
pushq $0x1
popq %rax
jmp 0x2496
leaq 0x1010(%rip), %rdi      # 0x34c6
jmp 0x248f
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_twobyters.c
// Function: add_twobyter
ULONG add_twobyter(UBYTE last,UBYTE curr,ULONG curpos)
{ // adds new twobyter to the array of chains

	struct tb_chain * newtb;
	ULONG index;


	index=(((ULONG)last)<<8)+((ULONG)curr);

	newtb=get_free_twobyter();
	if( !newtb )
	{ // no free elements

		// first try to flush current chain
		cutoff_twobyte_chain(index,curpos);

		newtb=get_free_twobyter();
		if( !newtb )
		{ // nothing free - allocate new bunch
			if( !add_bunch_of_twobyters() )
			{
				return 0;
			}

			newtb=get_free_twobyter();
		}
	}



	newtb->next=tb_entry[index];
	tb_entry[index]=newtb;

	newtb->pos=curpos-1; // points to the first byte of given two bytes

	return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %edi, %ebp
shll $0x8, %ebp
orl %esi, %ebp
movq 0x5110(%rip), %rax      # 0x7640
testq %rax, %rax
jne 0x255a
movl %ebp, %edi
movl %ebx, %esi
callq 0x25a2
movq 0x50fb(%rip), %rax      # 0x7640
testq %rax, %rax
jne 0x255a
callq 0x2612
testl %eax, %eax
je 0x2587
movq 0x50e6(%rip), %rax      # 0x7640
movq (%rax), %rcx
movq %rcx, 0x50dc(%rip)      # 0x7640
movl %ebp, %ecx
leaq 0x50e3(%rip), %rdx      # 0x7650
movq (%rdx,%rcx,8), %rsi
movq %rsi, (%rax)
movq %rax, (%rdx,%rcx,8)
decl %ebx
movl %ebx, 0x8(%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
jmp 0x2580
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_twobyters.c
// Function: add_bunch_of_twobyters
ULONG add_bunch_of_twobyters(void)
{ // adds a bunch of twobyters to the free list

	ULONG i;
	struct tb_bunch * newbunch;

	// alloc new bunch
	newbunch=(struct tb_bunch *)malloc( sizeof(struct tb_bunch) );
	if( newbunch==NULL ) return 0;

	// link every twobyter into one list
	for(i=0;i<(BUNCHSIZE-1);i++)
	{
		newbunch->bunch[i].next=&(newbunch->bunch[i+1]);
	}

	// add this list to the free list
	newbunch->bunch[BUNCHSIZE-1].next=tb_free;
	tb_free=&(newbunch->bunch[0]);

	// add bunch to bunches list
	newbunch->next=tb_bunches;
	tb_bunches=newbunch;

	return 1;
}

// Assembly:
pushq %rax
movl $0x1008, %edi           # imm = 0x1008
callq 0x10e0
testq %rax, %rax
je 0x266d
leaq 0x8(%rax), %rcx
movq %rax, %rdx
addq $0x18, %rdx
movl $0xff, %esi
subq $0x1, %rsi
jb 0x2642
movq %rdx, -0x10(%rdx)
addq $0x10, %rdx
jmp 0x2632
movq 0x4ff7(%rip), %rdx      # 0x7640
movq %rdx, 0xff8(%rax)
movq %rcx, 0x4fe9(%rip)      # 0x7640
movq 0x4fea(%rip), %rcx      # 0x7648
movq %rcx, (%rax)
movq %rax, 0x4fe0(%rip)      # 0x7648
pushq $0x1
popq %rax
jmp 0x266f
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-zoe/tex-to_image.c
// Function: generatePalettePairs
void generatePalettePairs( unsigned int numPaletteEntries, unsigned char* palette, paletteEntry *paired, unsigned int bpp ) {
	int i, e = 0;
	if( bpp == palMode4bpp ) {
		for( i = 0; i < numPaletteEntries; i++ ) {
			paired[i].red = palette[e];
			e++;
			paired[i].green = palette[e];
			e++;
			paired[i].blue = palette[e];
			e++;
			if( palette[e] >= 0x7F ) paired[i].alpha = 0xFF;
			else if ( palette[e] == 0 ) paired[i].alpha = 0; 
			else paired[i].alpha = (palette[e] + 1)*2;
			e++;
		}
	}
	else if( bpp == palMode8bpp ) {
		for( i = 0; i < numPaletteEntries; i++ ) {
			e = 4 * swizzle(i);
			paired[i].red = palette[e];
			e++;
			paired[i].green = palette[e];
			e++;
			paired[i].blue = palette[e];
			e++;
			if( palette[e] >= 0x7F ) paired[i].alpha = 0xFF;
			else if ( palette[e] == 0 ) paired[i].alpha = 0; 
			else paired[i].alpha = (palette[e] + 1)*2;
			e++;
		}
	}
		return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
testl %ecx, %ecx
je 0x9ffc
cmpl $0x1, %ecx
jne 0xa044
movl %edi, %r12d
xorl %r15d, %r15d
cmpq %r15, %r12
je 0xa044
movl %r15d, %edi
callq 0x9f5c
cltq
movb (%r14,%rax,4), %cl
shlq $0x2, %rax
movb %cl, (%rbx,%r15,4)
cltq
movb 0x1(%r14,%rax), %cl
movb %cl, 0x1(%rbx,%r15,4)
movb 0x2(%r14,%rax), %cl
movb %cl, 0x2(%rbx,%r15,4)
movb 0x3(%r14,%rax), %al
movb $-0x1, %cl
cmpb $0x7e, %al
ja 0x9ff2
testb %al, %al
je 0x9ff0
addb %al, %al
addb $0x2, %al
movl %eax, %ecx
jmp 0x9ff2
xorl %ecx, %ecx
movb %cl, 0x3(%rbx,%r15,4)
incq %r15
jmp 0x9fa4
movl %edi, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0xa044
movb (%r14,%rcx,4), %dl
movb %dl, (%rbx,%rcx,4)
movb 0x1(%r14,%rcx,4), %dl
movb %dl, 0x1(%rbx,%rcx,4)
movb 0x2(%r14,%rcx,4), %dl
movb %dl, 0x2(%rbx,%rcx,4)
movb 0x3(%r14,%rcx,4), %dl
movb $-0x1, %sil
cmpb $0x7e, %dl
ja 0xa03a
testb %dl, %dl
je 0xa038
addb %dl, %dl
addb $0x2, %dl
movl %edx, %esi
jmp 0xa03a
xorl %esi, %esi
movb %sil, 0x3(%rbx,%rcx,4)
incq %rcx
jmp 0xa000
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/rsa/keygen.c
// Function: keygen
struct keygen_t keygen(void)
{ 
  srand(time(0));
  unsigned int p,q, prime = (rand()/RAND_LIMITS)%RAND_LIMITS;
  unsigned long phi, e = 2, n;
  double d = 0;
  struct keygen_t key;
  
  /* Getting prime number */
  p = findNxtPrime(prime);
  q = findNxtPrime(p+2);
  n = p*q;
  /* finding e and d value for rsa*/
  phi = (p-1)*(q-1);
  while(gcd(phi,e)!=1) e++;
  d = mod_inverse(e, phi);

  printf("Prime No.    -> p: %u q: %u\n",p, q);
  printf("n, phi Value -> n: %lu phi: %lu\n",n, phi);
  printf("e, d Value   -> e: %lu d: %.2f\n", e, d);
  printf("d<phi-> %d\n", d<phi);
  key.pub.val = e, key.pub.n = n;
  key.pri.val = d, key.pri.n = n;
  return key;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x10a0
movl %eax, %edi
callq 0x1080
callq 0x10b0
movl $0xffff, %ecx           # imm = 0xFFFF
cltd
idivl %ecx
movq %rax, %rdi
callq 0x1410
movq %rax, %r12
leal 0x2(%rax), %edi
callq 0x1410
movq %rax, %rbp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %r12d, %ecx
addl %eax, %ecx
movl %ebp, %r15d
addl %eax, %r15d
imull %ecx, %r15d
pushq $0x1
popq %r14
incq %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x13f7
cmpq $0x1, %rax
jne 0x1213
movl %ebp, %r13d
imull %r12d, %r13d
movq %r14, %rdi
movq %r15, %rsi
callq 0x1431
movsd %xmm0, (%rsp)
leaq 0xdbf(%rip), %rdi       # 0x2004
movl %r12d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1060
leaq 0xdc9(%rip), %rdi       # 0x2021
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1060
leaq 0xdd6(%rip), %rdi       # 0x2042
movq %r14, %rsi
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x1060
cvtsi2sd %r15, %xmm0
xorl %esi, %esi
ucomisd (%rsp), %xmm0
seta %sil
leaq 0xdd0(%rip), %rdi       # 0x2062
xorl %eax, %eax
callq 0x1060
movq %r14, (%rbx)
cvttsd2si (%rsp), %rax
movq %r13, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movq %r13, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/rsa/rsa_crypto.c
// Function: encrypt
int encrypt(long long *en, const char * msg,struct key_t pub, size_t len)
{
  if(NULL == msg){
    printf("Error: empty message pass\n");
    return -1;
  }
  int i;
  for(i=0; i<len; i++){
    en[i] = mod_cal(msg[i], pub.val, pub.n);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x1306
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbp
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x1302
movsbq (%r13,%r12), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x1477
movq %rax, (%rbp,%r12,8)
incq %r12
jmp 0x12e2
xorl %eax, %eax
jmp 0x1315
leaq 0xd61(%rip), %rdi       # 0x206e
callq 0x1040
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/rsa/rsa_crypto.c
// Function: decrypt
int decrypt(char *msg, const long long * cipher,struct key_t pri, size_t len)
{
  if(NULL == cipher){
    printf("Error: empty message pass\n");
    return -1;
  }

  int i;
  for(i=0; i<len; i++){
    msg[i]=0;
    msg[i] = mod_cal(cipher[i], pri.val, pri.n);
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x136f
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbp
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x136b
movb $0x0, (%rbp,%r12)
movq (%r13,%r12,8), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x1477
movb %al, (%rbp,%r12)
incq %r12
jmp 0x1346
xorl %eax, %eax
jmp 0x137e
leaq 0xcf8(%rip), %rdi       # 0x206e
callq 0x1040
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/rsa/math.c
// Function: isPrime
int isPrime(long long n)
{
    if (n <= 1)  return 0;
    if (n <= 3)  return 1;

    if (n%2 == 0 || n%3 == 0) return 0;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return 0;

    return 1;
}

// Assembly:
xorl %ecx, %ecx
cmpq $0x2, %rdi
jl 0x13f4
cmpq $0x4, %rdi
jae 0x13a3
pushq $0x1
popq %rcx
jmp 0x13f4
xorl %ecx, %ecx
pushq $0x3
popq %rsi
movq %rdi, %rax
xorl %edx, %edx
divq %rsi
testb $0x1, %dil
je 0x13f4
testq %rdx, %rdx
je 0x13f4
pushq $0x5
popq %rcx
movq %rcx, %rsi
imulq %rcx, %rsi
cmpq %rdi, %rsi
ja 0x13ec
movq %rdi, %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
je 0x13ec
leaq 0x2(%rcx), %r8
movq %rdi, %rax
xorl %edx, %edx
divq %r8
addq $0x6, %rcx
testq %rdx, %rdx
jne 0x13be
xorl %ecx, %ecx
cmpq %rdi, %rsi
seta %cl
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/rsa/math.c
// Function: mod_util
static long long _mod_util(long long a,unsigned long long *buff, long long x, int n)
{
  /* [(a mod n)*(b mod n)] mod n = (a*b)mod n */
  if(x<0)
    return 1;
  if(x<MAX_SIZE){
    if(buff[x]){
      return buff[x];
    }
    else {
      if(x == 0){
        buff[x] = 1;
        return buff[x];
      }
      if(x == 1){
        buff[x] =  a%n;
        return buff[x];
      }
      buff[x] = ((_mod_util(a, buff, x/2, n)*_mod_util(a, buff, x - x/2,n))%(long long)n);
      return buff[x];
    }
  }
  return ((_mod_util(a, buff, x/2, n)*_mod_util(a, buff, x - x/2,n))%(long long)n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
pushq $0x1
popq %rcx
testq %rdx, %rdx
js 0x1501
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0xf9f, %rdx            # imm = 0xF9F
ja 0x1506
movq (%r14,%rbx,8), %rax
testq %rax, %rax
jne 0x1541
cmpq $0x1, %rbx
je 0x1550
testq %rbx, %rbx
jne 0x1558
movq $0x1, (%r14,%rbx,8)
movq %rcx, %rax
jmp 0x1541
movq %rbx, %r12
shrq %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x14be
movq %rax, %r13
subq %r12, %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x14be
imulq %r13, %rax
movslq %ebp, %rcx
cqto
idivq %rcx
movq %rdx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %ebp, %rcx
movq %r15, %rax
jmp 0x158b
movq %rbx, %r12
shrq %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x14be
movq %rax, %r13
movq %rbx, %rdx
subq %r12, %rdx
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x14be
imulq %r13, %rax
movslq %ebp, %rcx
cqto
idivq %rcx
movq %rdx, %rax
movq %rdx, (%r14,%rbx,8)
jmp 0x1541
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/rsa/main.c
// Function: main
int main(int argc, char *argv[])
{
  long long emsg[MSG_LIMIT]={0};
  unsigned char dmsg[MSG_LIMIT] = {0};
  char msg[MSG_LIMIT]={'\0'};
  int i;
  size_t len;
  if((argc<=1)||(argc>2)){
    printf("rsa help:\n\
        ./rsa <message>\n");
    return 0;
  }
  len = strlen(argv[1]);
  if(len>=MSG_LIMIT){
    printf("Error: enter msg within limits of 1-1022");
    return 0;
  }
  memcpy(msg, argv[1], len);

  printf("Input msg: ");
  for(i=0; i<len;i++)
      printf("%x ",msg[i]);
  printf("\n");

  struct keygen_t key = keygen();
  encrypt(emsg, msg, key.pub ,len);
  printf("Cipher :\n");
  for(i=0; i<len;i++)
      printf("%llx ",emsg[i]);
  printf("\n");

  decrypt(dmsg, emsg, key.pri, len);
  printf("Decipher :\n");
  for(i=0; i<len;i++)
      printf("%x ",dmsg[i]);
  printf("\n");;

  printf("original msg: %s\n", msg);
  printf("decrypt  msg: %s\n", dmsg);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2828, %rsp           # imm = 0x2828
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x820(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x1070
leaq 0x420(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x1070
leaq 0x20(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x1070
cmpl $0x2, %ebp
jne 0x1613
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x1050
cmpq $0x400, %rax            # imm = 0x400
jb 0x1624
leaq 0xa81(%rip), %rdi       # 0x2088
xorl %eax, %eax
callq 0x1060
jmp 0x1758
leaq 0xae5(%rip), %rdi       # 0x20ff
callq 0x1040
jmp 0x1758
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1090
leaq 0xa73(%rip), %rdi       # 0x20b1
xorl %eax, %eax
callq 0x1060
leaq 0xa71(%rip), %r14       # 0x20bd
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x1669
movsbl 0x20(%rsp,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
incq %r15
jmp 0x164f
pushq $0xa
popq %rdi
callq 0x1030
movq %rsp, %r14
movq %r14, %rdi
callq 0x11bc
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x820(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rbx, %r8
callq 0x12c0
leaq 0xa4c(%rip), %rdi       # 0x20eb
callq 0x1040
leaq 0xa16(%rip), %r14       # 0x20c1
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x16ca
movq 0x820(%rsp,%r15,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
incq %r15
jmp 0x16ae
pushq $0xa
popq %rdi
callq 0x1030
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
leaq 0x420(%rsp), %rdi
leaq 0x820(%rsp), %rsi
movq %rbx, %r8
callq 0x1324
leaq 0x9f9(%rip), %rdi       # 0x20f4
callq 0x1040
leaq 0x9b6(%rip), %r14       # 0x20bd
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x1727
movzbl 0x420(%rsp,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
incq %r15
jmp 0x170a
pushq $0xa
popq %rdi
callq 0x1030
leaq 0x991(%rip), %rdi       # 0x20c7
leaq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x1060
leaq 0x990(%rip), %rdi       # 0x20d9
leaq 0x420(%rsp), %rsi
xorl %eax, %eax
callq 0x1060
xorl %eax, %eax
addq $0x2828, %rsp           # imm = 0x2828
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/programs/cat/io_test.c
// Function: test_io_write_vector_to_file
void test_io_write_vector_to_file(void) {
	Vector vec = vector_create(0, NULL);
	vector_insert_last(vec, "foo");
	vector_insert_last(vec, "bar");

	// δημιουργία ενός προσωρινού αρχείου
	TEST_ASSERT(io_write_vector_to_file("io_tests_temp", vec) > 0);

	vector_destroy(vec);
}

// Assembly:
pushq %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x42bc
movq %rax, %rbx
leaq 0x1865(%rip), %rsi      # 0x5318
movq %rax, %rdi
callq 0x4383
leaq 0x185a(%rip), %rsi      # 0x531c
movq %rbx, %rdi
callq 0x4383
leaq 0x184f(%rip), %rdi      # 0x5320
movq %rbx, %rsi
callq 0x427b
xorl %edi, %edi
testl %eax, %eax
setg %dil
leaq 0x1846(%rip), %rsi      # 0x532e
leaq 0x19ca(%rip), %rcx      # 0x54b9
leaq 0x1842(%rip), %r8       # 0x5338
pushq $0x13
popq %rdx
xorl %eax, %eax
callq 0x23cc
testl %eax, %eax
je 0x3b0d
movq %rbx, %rdi
popq %rbx
jmp 0x4492
callq 0x2bf0
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/programs/cat/io_test.c
// Function: test_io_read_file_as_vector
void test_io_read_file_as_vector(void) {
	Vector vec = io_read_file_as_vector("io_tests_temp");
	TEST_ASSERT(vec != NULL);

	TEST_ASSERT(strcmp(vector_get_at(vec, 0), "foo") == 0);
	TEST_ASSERT(strcmp(vector_get_at(vec, 1), "bar") == 0);

	// διαγραφή του προσωρινού αρχείου
	remove("io_tests_temp");

	TEST_ASSERT(io_read_file_as_vector("a_file_that_doesnt_exist") == NULL);

	vector_destroy(vec);
}

// Assembly:
pushq %rbx
leaq 0x1806(%rip), %rdi      # 0x5320
callq 0x41d8
movq %rax, %rbx
xorl %edi, %edi
testq %rax, %rax
setne %dil
leaq 0x17fc(%rip), %rsi      # 0x532e
leaq 0x1980(%rip), %rcx      # 0x54b9
leaq 0x182a(%rip), %r8       # 0x536a
pushq $0x1a
popq %rdx
xorl %eax, %eax
callq 0x23cc
testl %eax, %eax
je 0x3c2c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x42fa
leaq 0x17b5(%rip), %rsi      # 0x5318
movq %rax, %rdi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x17b4(%rip), %rsi      # 0x532e
leaq 0x1938(%rip), %rcx      # 0x54b9
leaq 0x17ee(%rip), %r8       # 0x5376
pushq $0x1c
popq %rdx
xorl %eax, %eax
callq 0x23cc
testl %eax, %eax
je 0x3c2c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x42fa
leaq 0x1770(%rip), %rsi      # 0x531c
movq %rax, %rdi
callq 0x2190
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x176b(%rip), %rsi      # 0x532e
leaq 0x18ef(%rip), %rcx      # 0x54b9
leaq 0x17cf(%rip), %r8       # 0x53a0
pushq $0x1d
popq %rdx
xorl %eax, %eax
callq 0x23cc
testl %eax, %eax
je 0x3c2c
leaq 0x173a(%rip), %rdi      # 0x5320
callq 0x2070
leaq 0x17d8(%rip), %rdi      # 0x53ca
callq 0x41d8
xorl %edi, %edi
testq %rax, %rax
sete %dil
leaq 0x1727(%rip), %rsi      # 0x532e
leaq 0x18ab(%rip), %rcx      # 0x54b9
leaq 0x17ce(%rip), %r8       # 0x53e3
pushq $0x22
popq %rdx
xorl %eax, %eax
callq 0x23cc
testl %eax, %eax
je 0x3c2c
movq %rbx, %rdi
popq %rbx
jmp 0x4492
callq 0x2bf0
// File: /workspace/github_c_makefile_star2_O2/hoomanist[P]carrot/mkdir.c
// Function: main
int main(int argc, char **argv)
{
	if(argc == 1){
		printf("what do you want? \n");
		return 0;
	}
	else if(argc > 2){
		printf("how many arguments :/ \n");
		return 0;
	}
	struct stat st = {0};
	if(stat(argv[1], &st) == -1)
	{
		mkdir(argv[1], 0700);
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
cmpl $0x1, %edi
jne 0x1184
leaq 0xe99(%rip), %rdi       # 0x201b
jmp 0x1190
cmpl $0x3, %edi
jl 0x11a2
leaq 0xe74(%rip), %rdi       # 0x2004
callq 0x1040
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
movq %rsi, %rbx
leaq 0x8(%rsp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1050
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x1060
cmpl $-0x1, %eax
jne 0x1195
movq 0x8(%rbx), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x1030
jmp 0x1195
// File: /workspace/github_c_makefile_star2_O2/tylerneylon[P]APIsWithLua/ch2/eatyguy1.c
// Function: set_color
int set_color(lua_State *L) {
  int color = lua_tonumber(L, 1);
  char cmd[1024];
  snprintf(cmd, 1024, "tput setab %d", color);
  system(cmd);
  return 0;  // 0 is the number of Lua-visible return values.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x4bf3
cvttsd2si %xmm0, %ecx
leaq 0x199f7(%rip), %rdx     # 0x1e004
leaq -0x410(%rbp), %rbx
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4170
movq %rbx, %rdi
callq 0x4140
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tylerneylon[P]APIsWithLua/ch2/eatyguy1.c
// Function: main
int main() {

  // Create a Lua state and load the module.
  lua_State *L = luaL_newstate();
  luaL_openlibs(L);
  luaL_dofile(L, "eatyguy1.lua");
  lua_setglobal(L, "eatyguy");
  lua_settop(L, 0);

  // Make the set_color function visible to Lua.
  lua_pushcfunction(L, set_color);
  lua_setglobal(L, "set_color");

  // Run the init() function.
  lua_getglobal(L, "eatyguy");
  lua_getfield(L, -1, "init");  // -1 means stack top.
  lua_call(L, 0, 0);            // 0, 0 = #args, #retvals

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x12bd2
movq %rax, %rbx
movq %rax, %rdi
callq 0x12df8
leaq 0x199bd(%rip), %rsi     # 0x1e012
movq %rbx, %rdi
xorl %edx, %edx
callq 0x123a3
testl %eax, %eax
jne 0x4678
pushq $-0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x5900
leaq 0x199a0(%rip), %r14     # 0x1e01f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5431
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4819
leaq -0xaf(%rip), %rsi       # 0x45ec
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4ff2
leaq 0x1997b(%rip), %rsi     # 0x1e027
movq %rbx, %rdi
callq 0x5431
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50c0
leaq 0x1996b(%rip), %rdx     # 0x1e031
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x51dc
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5898
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/rakitzis[P]rc/mkstatval.c
// Function: main
int main(void) {
	int cstatus, pstatus;
	pid_t pid;
	
	for (cstatus = 0; cstatus < 2; ++cstatus) {
		switch (pid = fork()) {
		case -1:
			perror("fork");
			return 1;
		case 0:
			_exit(cstatus);
		default:
			if (wait(&pstatus) != pid) {
				perror("wait");
				return 1;
			}
			printf("#define STATUS%d %d\n", cstatus, pstatus);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0xe74(%rip), %r14       # 0x2004
leaq 0x4(%rsp), %r15
leaq 0xe72(%rip), %r12       # 0x200e
xorl %ebp, %ebp
cmpl $0x2, %ebp
je 0x11e7
callq 0x1070
cmpl $-0x1, %eax
je 0x11dc
movl %eax, %r13d
testl %eax, %eax
je 0x11f8
movq %r15, %rdi
callq 0x1060
cmpl %r13d, %eax
jne 0x11d5
movl 0x4(%rsp), %edx
movq %r12, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1040
incl %ebp
jmp 0x119e
leaq 0xe2d(%rip), %r14       # 0x2009
movq %r14, %rdi
callq 0x1050
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x1030
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_03/flockr.c
// Function: main
int main(void)
{
	int fd;
	char buf[32];
	struct flock fl;
	int ret;

	/* Open the file */
	fd = open("file.locked", O_RDONLY);
	if (fd < 0) {
		perror("open");
		return -1;
	}
	printf("file opened\n");

	/* Establish a read lock */
	fl.l_type   = F_RDLCK;
	fl.l_whence = SEEK_SET;
	fl.l_start  = 0;        /* Offset from l_whence */
	fl.l_len    = 0;        /* length, 0 = to EOF   */
	fl.l_pid    = getpid(); /* our PID              */
	ret = fcntl(fd, F_SETLKW, &fl);
	if (ret < 0) {
		perror("fcntl(F_SETLKW)");
		return -1;
	}
	printf("read lock get\n");

	/* Do the read */
	ret = read(fd, buf, 32);
	if (ret < 0) {
		perror("read");
		return -1;
	}
	printf("read done\n");

	printf("sleeping 10s...\n");
	sleep(10);

	/* Unlock the region */
	fl.l_type   = F_UNLCK;
	fl.l_whence = SEEK_SET;
	fl.l_start  = 0;        /* Offset from l_whence */
	fl.l_len    = 0;        /* length, 0 = to EOF   */
	fl.l_pid    = getpid(); /* our PID              */
	ret = fcntl(fd, F_UNLCK, &fl);
	if (ret < 0) {
		perror("fcntl(F_SETLKW)");
		return -1;
	}
	printf("unlock done\n");

	close(fd);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
leaq 0xe49(%rip), %rdi       # 0x2004
xorl %esi, %esi
xorl %eax, %eax
callq 0x1080
testl %eax, %eax
js 0x1298
movl %eax, %ebx
leaq 0xe55(%rip), %rdi       # 0x202a
callq 0x1030
movq %rsp, %r14
andl $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
callq 0x1050
movl %eax, 0x18(%r14)
pushq $0x7
popq %rsi
movl %ebx, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1040
testl %eax, %eax
js 0x128f
leaq 0xe26(%rip), %rdi       # 0x2036
callq 0x1030
leaq 0x20(%rsp), %rsi
pushq $0x20
popq %rdx
movl %ebx, %edi
callq 0x1070
testl %eax, %eax
js 0x12a1
leaq 0x8(%rsp), %r14
leaq 0xe10(%rip), %rdi       # 0x2044
callq 0x1030
leaq 0xe0e(%rip), %rdi       # 0x204e
callq 0x1030
pushq $0xa
popq %rdi
callq 0x10a0
movl $0x2, -0x8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
callq 0x1050
movl %eax, 0x10(%r14)
xorl %ebp, %ebp
pushq $0x2
popq %rsi
movq %rsp, %rdx
movl %ebx, %edi
xorl %eax, %eax
callq 0x1040
testl %eax, %eax
js 0x128f
leaq 0xddd(%rip), %rdi       # 0x205e
callq 0x1030
movl %ebx, %edi
callq 0x1060
jmp 0x12b0
leaq 0xd7f(%rip), %rdi       # 0x2015
jmp 0x12a8
leaq 0xd71(%rip), %rdi       # 0x2010
jmp 0x12a8
leaq 0xd7d(%rip), %rdi       # 0x2025
callq 0x1090
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-mgs/gcx-decompile.c
// Function: gcx_iscommand
int gcx_iscommand(unsigned char *data) {
	unsigned int i;
	uint16_t cmd = bswap_16(*(uint16_t *)data);
	for(i = 0; i < sizeofarr(gcxcommands); i++) {
		if(gcxcommands[i].hash == cmd) return i;
	}
	return -1;
}

// Assembly:
movzwl (%rdi), %ecx
rolw $0x8, %cx
leaq 0x2e86(%rip), %rsi      # 0x40a0
xorl %edx, %edx
pushq $-0x1
popq %rax
cmpq $0xd, %rdx
je 0x1235
cmpw %cx, (%rsi)
je 0x1233
incq %rdx
addq $0x22, %rsi
jmp 0x121f
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-mgs/gcx-decompile.c
// Function: gcx_param
uint16_t gcx_param(unsigned char *data, FILE *out) {
	unsigned int i;
	uint16_t size = 0;
	gcxdef blank;
	blank.name = 0;
	blank.off = 0;
	printf("gcx_param == type %04x == size ????\n", data[0]);
	switch(data[0]) {
		case 0x30: {
			size = data[1];
			fprintf(out, "STACKOP!\n");
			break;
		}
		case 0x40: {
			gcx_proc(blank, data, out);
			break;
		}
		case 0x50: {
			// size of params plus param letter
			size = data[2] + 1;
			switch(data[1]) {
				case 'm': {
					fprintf(out, "-m [%02x]:%04x\n", data[3], bswap_16(*(uint16_t *)(data+4)));
					break;
				}
				case 's': {
					fprintf(out, "-s [%02x]:%02x\n", data[3], data[4]);
					break;
				}
				default: {
					fprintf(out, "-%c ", *(char *)(data+1));
					for(i = 0; i < (size-1); size++) fprintf(out, "%02x", data[3+i]);
					fprintf(out, "\n");
					break;
				}
			}
			break;
		}
		default: {
			printf("unknown param %02x size %04x\n", data[0], size);
			break;
		}
	}
	return size+1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%rdi), %esi
leaq 0xdb6(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1090
movzbl (%r14), %esi
cmpl $0x50, %esi
je 0x129b
cmpl $0x40, %esi
je 0x1287
cmpl $0x30, %esi
jne 0x12ce
movzbl 0x1(%r14), %ebp
leaq 0xdb5(%rip), %rdi       # 0x2029
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1100
jmp 0x1346
xorl %ebp, %ebp
xorl %edi, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1354
jmp 0x1346
movzbl 0x2(%r14), %r12d
leal 0x1(%r12), %ebp
movzbl 0x1(%r14), %eax
cmpl $0x73, %eax
je 0x12e2
cmpl $0x6d, %eax
jne 0x12ff
movzbl 0x3(%r14), %edx
movzwl 0x4(%r14), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
leaq 0xd67(%rip), %rsi       # 0x2033
jmp 0x12f3
leaq 0xd88(%rip), %rdi       # 0x205d
xorl %ebp, %ebp
xorl %edx, %edx
xorl %eax, %eax
callq 0x1090
jmp 0x1346
movzbl 0x3(%r14), %edx
movzbl 0x4(%r14), %ecx
leaq 0xd50(%rip), %rsi       # 0x2043
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
jmp 0x1346
movsbl %al, %edx
leaq 0xd4a(%rip), %rsi       # 0x2053
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0xd3e(%rip), %r15       # 0x2058
testw %r12w, %r12w
je 0x1337
movzbl 0x3(%r14), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10b0
incl %r12d
jmp 0x131a
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x10a0
movw $0x1, %bp
movzwl %bp, %eax
incl %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-mgs/gcx-decompile.c
// Function: gcx_proc
uint16_t gcx_proc(gcxdef def, unsigned char *data, FILE *out) {
	uint16_t size = bswap_16(*(uint16_t *)(data + 1)), cur = 0;
	printf("gcx_proc == type %02x == size %04x\n", data[0], size);
	switch(data[0]) {
		case 0x40: {
			fprintf(out, "proc %04x {\n", def.name);
			cur = 3;
			while(data[cur]) cur += gcx_proc(def, data+cur, out);
			fprintf(out, "}\n");
			break;
		}
		case 0x60: {
			fprintf(out, "begin {\n");
			cur = 3;
			while(gcx_iscommand(data+cur) > -1) cur += gcx_cmd(data+cur, out);
			fprintf(out, "}\n");
			break;
		}
		case 0x70: {
			size >>= 8;
			fprintf(out, "call %04x\n", bswap_16(*(uint16_t *)(data+2)));
			break;
		}
		default: {
			printf("unknown type %02x size %04x\n", data[0], size);
			break;
		}
	}
	return (size+1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movzwl 0x1(%rsi), %ebx
rolw $0x8, %bx
movzbl (%rsi), %esi
movzwl %bx, %r12d
leaq 0xd51(%rip), %rdi       # 0x20ce
movl %r12d, %edx
xorl %eax, %eax
callq 0x1090
movzbl (%r15), %esi
cmpl $0x70, %esi
je 0x142f
cmpl $0x60, %esi
je 0x13d8
cmpl $0x40, %esi
jne 0x1455
movzwl %bp, %edx
leaq 0xd46(%rip), %rsi       # 0x20f2
movq %r14, %rdi
xorl %eax, %eax
callq 0x10b0
movw $0x3, %r12w
movzwl %r12w, %esi
cmpb $0x0, (%r15,%rsi)
je 0x1418
addq %r15, %rsi
movl %ebp, %edi
movq %r14, %rdx
callq 0x1354
addl %eax, %r12d
jmp 0x13bb
leaq 0xd23(%rip), %rdi       # 0x2102
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x1100
pushq $0x3
popq %r13
movzwl %r13w, %r13d
leaq (%r15,%r13), %r12
movq %r12, %rdi
callq 0x120c
testl %eax, %eax
js 0x1418
movq %r12, %rdi
movq %r14, %rsi
callq 0x1479
movzwl %ax, %eax
addl %eax, %r13d
jmp 0x13f1
leaq 0xce0(%rip), %rdi       # 0x20ff
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x1100
jmp 0x1466
shrl $0x8, %r12d
movzwl 0x2(%r15), %eax
rolw $0x8, %ax
movzwl %ax, %edx
leaq 0xcc5(%rip), %rsi       # 0x210b
movq %r14, %rdi
xorl %eax, %eax
callq 0x10b0
movl %r12d, %ebx
jmp 0x1466
leaq 0xcba(%rip), %rdi       # 0x2116
movl %r12d, %edx
xorl %eax, %eax
callq 0x1090
incl %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-mgs/gcx-decompile.c
// Function: gcx_cmd
uint16_t gcx_cmd(unsigned char *data, FILE *out) {
	int cmd = gcx_iscommand(data);
	uint16_t size = bswap_16(*(uint16_t *)(data+2)) >> 8, cur = 0;
	printf("gcx_cmd == cmd %s (%d) == size %04x\n", gcxcommands[cmd].name, cmd, size);
	fprintf(out, "%s(", gcxcommands[cmd].name);
	cur = 3;
	switch(cmd) {
		case 0: // eval
		case 3:
		case 1: { // if
			while(data[cur]) cur += gcx_param(data+cur, out);
			break;
		}
		case 2: { // load
			fprintf(out, "%02x \"%s\"\n", data[cur], (char *)(data+cur+2));
			cur += data[cur];
			while(data[cur]) cur += gcx_param(data+cur, out);
			break;
		}
		default: {
			printf("unknown cmd %02x size %04x\n", cmd, size);
			break;
		}
	}
	fprintf(out, ")\n");
	return size+2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x120c
movl %eax, %r15d
movzbl 0x2(%r14), %ebp
cltq
imulq $0x22, %rax, %rax
leaq 0x2bff(%rip), %rcx      # 0x40a0
leaq (%rax,%rcx), %r12
addq $0x2, %r12
leaq 0xbcb(%rip), %rdi       # 0x207b
movq %r12, %rsi
movl %r15d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1090
leaq 0xbda(%rip), %rsi       # 0x20a0
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10b0
cmpl $0x2, %r15d
jb 0x14e1
je 0x1501
cmpl $0x3, %r15d
jne 0x153f
movw $0x3, %r15w
movzwl %r15w, %edi
cmpb $0x0, (%r14,%rdi)
je 0x1552
addq %r14, %rdi
movq %rbx, %rsi
callq 0x1236
addl %eax, %r15d
jmp 0x14e6
movzbl 0x3(%r14), %edx
leaq 0x5(%r14), %rcx
leaq 0xb93(%rip), %rsi       # 0x20a4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
movzbl 0x3(%r14), %r15d
addl $0x3, %r15d
movzwl %r15w, %edi
cmpb $0x0, (%r14,%rdi)
je 0x1552
addq %r14, %rdi
movq %rbx, %rsi
callq 0x1236
addl %eax, %r15d
jmp 0x1524
leaq 0xb69(%rip), %rdi       # 0x20af
movl %r15d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1090
leaq 0xb72(%rip), %rdi       # 0x20cb
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1100
movzwl %bp, %eax
addl $0x2, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/tests/nc-server/main.c
// Function: callback_snc_response
static int
callback_snc_response(void * cookie, uint8_t * buf, size_t buflen, int sock)
{
	struct nc_cookie * C = cookie;

	/* Write buffer to the previously-opened file. */
	if (fwrite(buf, sizeof(uint8_t), buflen, C->out) != buflen) {
		warnp("fwrite");
		goto err0;
	}

	/* Echo to the client (if applicable). */
	if ((C->bps > 0) && (write_bps(sock, buf, buflen, C->bps)))
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rcx
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x22e0
cmpq %r14, %rax
jne 0x2673
movq 0x8(%r12), %r12
testq %r12, %r12
je 0x2780
leaq 0x10(%rsp), %rdi
callq 0x43ac
testl %eax, %eax
je 0x26a9
leaq 0x4ad9(%rip), %rdi      # 0x713b
xorl %eax, %eax
callq 0x562c
callq 0x2090
andl $0x0, (%rax)
jmp 0x26a1
callq 0x2090
cmpl $0x0, (%rax)
je 0x2693
movq %rax, %rbx
leaq 0x4aad(%rip), %rdi      # 0x7134
xorl %eax, %eax
callq 0x549d
andl $0x0, (%rbx)
jmp 0x26a1
leaq 0x4a9a(%rip), %rdi      # 0x7134
xorl %eax, %eax
callq 0x562c
pushq $-0x1
popq %rax
jmp 0x2782
movq %r12, %xmm0
punpckldq 0x495a(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x4962(%rip), %xmm0     # 0x7020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
xorl %r12d, %r12d
movq %rsp, %r13
andq $0x0, 0x20(%rsp)
movq $0x989680, 0x28(%rsp)   # imm = 0x989680
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x2130
movq %r13, %rdi
callq 0x43ac
testl %eax, %eax
jne 0x265b
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq 0x10(%rsp), %rax
cvtsi2sd %rax, %xmm0
subq 0x18(%rsp), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0x490a(%rip), %xmm1     # 0x7030
addsd %xmm0, %xmm1
mulsd 0x30(%rsp), %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rcx
subsd 0x48f8(%rip), %xmm1     # 0x7038
cvttsd2si %xmm1, %rbp
sarq $0x3f, %rcx
andq %rcx, %rbp
orq %rax, %rbp
subq %r12, %rbp
jbe 0x2777
cmpq %r14, %rbp
cmovaeq %r14, %rbp
movl %ebx, %edi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x2791
subq %rbp, %r14
addq %rbp, %r15
addq %rbp, %r12
testq %r14, %r14
jne 0x26d6
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2090
cmpl $0x0, (%rax)
je 0x27aa
movq %rax, %rbx
leaq 0x4990(%rip), %rdi      # 0x7135
jmp 0x2687
leaq 0x4984(%rip), %rdi      # 0x7135
jmp 0x269a
nop
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/tests/nc-server/simple_server.c
// Function: doaccept
static int
doaccept(struct accept_state * A)
{
	int rc = 0;

	/* If we can, accept a new connection. */
	if ((A->nconn < A->nconn_max) && (A->accept_cookie == NULL) &&
	    !A->shutdown_requested) {
		if ((A->accept_cookie =
		    network_accept(A->s, callback_gotconn, A)) == NULL) {
			warnp("network_accept");
			rc = -1;
		}
	}

	/* Return success/fail status. */
	return (rc);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x20(%rdi), %rax
xorl %ebx, %ebx
cmpq 0x28(%rdi), %rax
jae 0x2aa5
movq %rdi, %r14
cmpq $0x0, 0x30(%rdi)
jne 0x2aa5
cmpl $0x0, 0x8(%r14)
jne 0x2aa5
movl (%r14), %edi
leaq 0x4c(%rip), %rsi        # 0x2aaf
movq %r14, %rdx
callq 0x3f80
movq %rax, 0x30(%r14)
testq %rax, %rax
jne 0x2aa5
callq 0x2090
cmpl $0x0, (%rax)
je 0x2a94
movq %rax, %rbx
leaq 0x4710(%rip), %rdi      # 0x7198
xorl %eax, %eax
callq 0x549d
andl $0x0, (%rbx)
jmp 0x2aa2
leaq 0x46fd(%rip), %rdi      # 0x7198
xorl %eax, %eax
callq 0x562c
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/tests/nc-server/simple_server.c
// Function: callback_gotconn
static int
callback_gotconn(void * cookie, int s)
{
	struct accept_state * A = cookie;
	struct conn_list_node * node_new;

	/* This accept is no longer in progress. */
	A->accept_cookie = NULL;

	/* If we got a -1 descriptor, something went seriously wrong. */
	if (s == -1) {
		warnp("network_accept");
		goto err0;
	}

	/* We have gained a connection. */
	A->nconn += 1;

	/* Create new conn_list_node. */
	if ((node_new = malloc(sizeof(struct conn_list_node))) == NULL) {
		warn0("Out of memory");
		goto err1;
	}
	node_new->A = A;
	node_new->sock_read = s;

	/* Schedule reading from this connection. */
	if ((node_new->network_read_cookie = network_read(node_new->sock_read,
	    node_new->buf, BUFLEN, 1, callback_read, node_new)) == NULL) {
		warnp("network_read");
		goto err2;
	}

	/* Insert node_new to the beginning of the conn_cookies list. */
	LIST_INSERT_HEAD(&A->conn_cookies, node_new, entries);

	/* Accept another connection if we can. */
	if (doaccept(A)) {
		warn0("doaccept");
		goto err0;
	}

	/* Success! */
	return (0);

err2:
	free(node_new);
err1:
	A->nconn -= 1;
	if (close(s))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
andq $0x0, 0x30(%rdi)
cmpl $-0x1, %esi
je 0x2b5a
movl %esi, %ebp
movq %rdi, %rbx
incq 0x20(%rdi)
movl $0x2028, %edi           # imm = 0x2028
callq 0x21f0
testq %rax, %rax
je 0x2b7a
movq %rax, %r14
movq %rbx, 0x10(%rax)
movl %ebp, 0x18(%rax)
movq %rax, %rsi
addq $0x1c, %rsi
leaq 0x136(%rip), %r8        # 0x2c2e
pushq $0x1
popq %rcx
movl $0x2000, %edx           # imm = 0x2000
movl %ebp, %edi
movq %rax, %r9
callq 0x4054
movq %rax, 0x2020(%r14)
testq %rax, %rax
je 0x2b92
leaq 0x38(%rbx), %rax
movq 0x38(%rbx), %rcx
movq %rcx, (%r14)
testq %rcx, %rcx
je 0x2b2a
movq %r14, 0x8(%rcx)
movq %r14, 0x38(%rbx)
movq %rax, 0x8(%r14)
movq %rbx, %rdi
callq 0x2a38
testl %eax, %eax
je 0x2bc6
leaq 0x462d(%rip), %rdi      # 0x7176
xorl %eax, %eax
callq 0x562c
callq 0x2090
andl $0x0, (%rax)
jmp 0x2bc1
callq 0x2090
cmpl $0x0, (%rax)
je 0x2bb3
movq %rax, %rbx
leaq 0x462a(%rip), %rdi      # 0x7198
xorl %eax, %eax
callq 0x549d
andl $0x0, (%rbx)
jmp 0x2bc1
leaq 0x45e7(%rip), %rdi      # 0x7168
xorl %eax, %eax
callq 0x562c
callq 0x2090
andl $0x0, (%rax)
jmp 0x2be0
callq 0x2090
cmpl $0x0, (%rax)
je 0x2bca
movq %rax, %r15
leaq 0x4601(%rip), %rdi      # 0x71a7
xorl %eax, %eax
callq 0x549d
andl $0x0, (%r15)
jmp 0x2bd8
leaq 0x45de(%rip), %rdi      # 0x7198
xorl %eax, %eax
callq 0x562c
pushq $-0x1
popq %rbx
jmp 0x2c21
xorl %ebx, %ebx
jmp 0x2c21
leaq 0x45d6(%rip), %rdi      # 0x71a7
xorl %eax, %eax
callq 0x562c
movq %r14, %rdi
callq 0x2040
decq 0x20(%rbx)
movl %ebp, %edi
callq 0x2180
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0x2c21
callq 0x2090
cmpl $0x0, (%rax)
je 0x2c13
movq %rax, %r14
leaq 0x44a7(%rip), %rdi      # 0x70ad
xorl %eax, %eax
callq 0x549d
andl $0x0, (%r14)
jmp 0x2c21
leaq 0x4493(%rip), %rdi      # 0x70ad
xorl %eax, %eax
callq 0x562c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/tests/nc-server/simple_server.c
// Function: callback_read
static int
callback_read(void * cookie, ssize_t lenread)
{
	struct conn_list_node * R = cookie;
	struct accept_state * A = R->A;
	int sock = R->sock_read;

	/* Cookie is no longer valid. */
	R->network_read_cookie = NULL;

	/* If we have a message. */
	if (lenread > 0) {
		/* Handle it with the parent code. */
		if (A->callback_nc_message(A->caller_cookie, R->buf,
		    (size_t)lenread, sock))
			goto err0;

		/* Try to read some more data. */
		if ((R->network_read_cookie = network_read(R->sock_read,
		    R->buf, BUFLEN, 1, callback_read, R)) == NULL) {
			warnp("network_read");
			goto err0;
		}
	} else if (lenread == 0) {
		if (drop(R)) {
			warn0("drop");
			goto err0;
		}
	} else {
		warn0("Failed to read from network");
		A->conndone = 1;
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rbx
movl 0x18(%rdi), %ecx
andq $0x0, 0x2020(%rdi)
testq %rsi, %rsi
jle 0x2cb1
movq %rsi, %rdx
movq 0x40(%rbx), %rdi
leaq 0x1c(%r14), %r15
movq %r15, %rsi
callq *0x48(%rbx)
pushq $-0x1
popq %rbx
testl %eax, %eax
jne 0x2cfb
movl 0x18(%r14), %edi
leaq -0x43(%rip), %r8        # 0x2c2e
pushq $0x1
popq %rcx
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rsi
movq %r14, %r9
callq 0x4054
movq %rax, 0x2020(%r14)
testq %rax, %rax
jne 0x2cf9
callq 0x2090
cmpl $0x0, (%rax)
je 0x2d03
movq %rax, %r14
leaq 0x4503(%rip), %rdi      # 0x71a7
xorl %eax, %eax
callq 0x549d
andl $0x0, (%r14)
jmp 0x2cfb
je 0x2cd2
leaq 0x44ff(%rip), %rdi      # 0x71b9
xorl %eax, %eax
callq 0x562c
callq 0x2090
andl $0x0, (%rax)
movl $0x1, 0x4(%rbx)
jmp 0x2cf4
movq %r14, %rdi
callq 0x2d13
testl %eax, %eax
je 0x2cf9
leaq 0x44cf(%rip), %rdi      # 0x71b4
xorl %eax, %eax
callq 0x562c
callq 0x2090
andl $0x0, (%rax)
pushq $-0x1
popq %rbx
jmp 0x2cfb
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x449d(%rip), %rdi      # 0x71a7
xorl %eax, %eax
callq 0x562c
jmp 0x2cfb
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/tests/nc-server/simple_server.c
// Function: drop
static int
drop(struct conn_list_node * node_ptr)
{

	/* If we still have an active read cookie, cancel it. */
	if (node_ptr->network_read_cookie != NULL)
		network_read_cancel(node_ptr->network_read_cookie);

	/* Close the incoming connection. */
	if (close(node_ptr->sock_read) == -1) {
		warnp("close");
		goto err0;
	}

	/* Clean up the node. */
	conndied(node_ptr);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2020(%rdi), %rdi
testq %rdi, %rdi
je 0x2d2b
callq 0x4327
movl 0x18(%rbx), %edi
callq 0x2180
cmpl $-0x1, %eax
je 0x2da9
movq 0x10(%rbx), %r14
cmpq $0x0, 0x38(%r14)
je 0x2de2
decq 0x20(%r14)
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x2d6c
movq 0x18(%r14), %rcx
incq %rcx
movq %rcx, 0x18(%r14)
cmpq %rax, %rcx
jb 0x2d6c
movl $0x1, 0x8(%r14)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
testq %rax, %rax
je 0x2d7c
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
movq %rbx, %rdi
callq 0x2040
cmpl $0x0, 0x8(%r14)
je 0x2d9d
cmpq $0x0, 0x20(%r14)
jne 0x2d9d
movl $0x1, 0x4(%r14)
movq %r14, %rdi
callq 0x2a38
xorl %eax, %eax
jmp 0x2dda
callq 0x2090
cmpl $0x0, (%rax)
je 0x2dc9
movq %rax, %rbx
leaq 0x42f0(%rip), %rdi      # 0x70ad
xorl %eax, %eax
callq 0x549d
andl $0x0, (%rbx)
jmp 0x2dd7
leaq 0x42dd(%rip), %rdi      # 0x70ad
xorl %eax, %eax
callq 0x562c
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x43ec(%rip), %rdi      # 0x71d5
leaq 0x4403(%rip), %rsi      # 0x71f3
leaq 0x440c(%rip), %rcx      # 0x7203
pushq $0x4c
popq %rdx
callq 0x2160
nop
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/hfile.c
// Function: fail
void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) HTS_NORETURN
fail(const char *format, ...)
{
    int err = errno;
    va_list args;
    va_start(args, format);
    vfprintf(stderr, format, args);
    va_end(args);
    if (err != 0) fprintf(stderr, ": %s", strerror(err));
    fprintf(stderr, "\n");
    exit(EXIT_FAILURE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %r14
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x5aff
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x4050
movl (%rax), %ebx
movq %rsp, %rdx
movq %r15, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x934b3(%rip), %r15     # 0x98fe0
movq (%r15), %rdi
movq %r14, %rsi
callq 0x4680
testl %ebx, %ebx
je 0x5b5a
movq (%r15), %r14
movl %ebx, %edi
callq 0x4140
leaq 0x70ee0(%rip), %rsi     # 0x76a2d
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x46f0
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x4620
pushq $0x1
popq %rdi
callq 0x45d0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/hfile.c
// Function: check_offset
void check_offset(hFILE *f, off_t off, const char *message)
{
    off_t ret = htell(f);
    if (ret < 0) fail("htell(%s)", message);
    if (ret == off) return;

    fprintf(stderr, "%s offset incorrect: expected %ld but got %ld\n",
            message, (long)off, (long)ret);
    exit(EXIT_FAILURE);
}

// Assembly:
pushq %rax
movq 0x28(%rdi), %r8
addq 0x8(%rdi), %r8
subq (%rdi), %r8
js 0x5b85
movq %rsi, %rcx
cmpq %rsi, %r8
jne 0x5b96
popq %rax
retq
leaq 0x6c478(%rip), %rdi     # 0x72004
movq %rdx, %rsi
xorl %eax, %eax
callq 0x5a9c
movq 0x93443(%rip), %rax     # 0x98fe0
movq (%rax), %rdi
leaq 0x6c467(%rip), %rsi     # 0x7200e
xorl %eax, %eax
callq 0x46f0
pushq $0x1
popq %rdi
callq 0x45d0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/hfile.c
// Function: slurp
char *slurp(const char *filename)
{
    char *text;
    struct stat sbuf;
    size_t filesize;
    FILE *f = fopen(filename, "rb");
    if (f == NULL) fail("fopen(\"%s\", \"rb\")", filename);
    if (fstat(fileno(f), &sbuf) != 0) fail("fstat(\"%s\")", filename);
    filesize = sbuf.st_size;

    text = (char *) malloc(filesize + 1);
    if (text == NULL) fail("malloc(text)");

    if (fread(text, 1, filesize, f) != filesize) fail("fread");
    fclose(f);

    text[filesize] = '\0';
    return text;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %r14
leaq 0x6c471(%rip), %rsi     # 0x7203d
callq 0x45a0
testq %rax, %rax
je 0x5c38
movq %rax, %rbx
movq %rax, %rdi
callq 0x44e0
movq %rsp, %rsi
movl %eax, %edi
callq 0x4870
testl %eax, %eax
jne 0x5c41
movq 0x30(%rsp), %r14
leaq 0x1(%r14), %rdi
callq 0x4670
testq %rax, %rax
je 0x5c52
movq %rax, %r15
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x4780
cmpq %r14, %rax
jne 0x5c5b
movq %rbx, %rdi
callq 0x44a0
movb $0x0, (%r15,%r14)
movq %r15, %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x6c401(%rip), %rdi     # 0x72040
jmp 0x5c48
leaq 0x6c40a(%rip), %rdi     # 0x72052
movq %r14, %rsi
xorl %eax, %eax
callq 0x5a9c
leaq 0x6c405(%rip), %rdi     # 0x7205e
jmp 0x5c62
leaq 0x6c409(%rip), %rdi     # 0x7206b
xorl %eax, %eax
callq 0x5a9c