LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/theandrew168[P]squeaky/src/vm.c
// Function: vm_make_eof
struct value*
vm_make_eof(struct vm* vm)
{
    assert(vm != NULL);

    struct value* value = next_available_value(vm);
    value->type = VALUE_EOF;
    return value;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x7423
callq 0x7076
movl $0xe, (%rax)
popq %rcx
retq
leaq 0x1a92(%rip), %rdi      # 0x8ebc
leaq 0x1a96(%rip), %rsi      # 0x8ec7
leaq 0x1e2e(%rip), %rcx      # 0x9266
movl $0x136, %edx            # imm = 0x136
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/zpole[P]IICV/src/test_threads.c
// Function: testThread
void *
testThread(void * args)
{
  int j ;
  int id = *(int*)args ;
  vl_tic() ;
  for (j = 0 ; j < 10 ; ++j) {
    printf("Thread %5d: %d\n",
      id, vl_rand_int31(vl_get_rand())) ;
    fflush(stdout) ;
  }
  printf("Thread %5d: elapsed time: %.2f s\n", id, vl_toc()) ;
  return NULL ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %ebx
callq 0x1030
movl $0xa, %ebp
leaq 0xe1e(%rip), %r14       # 0x2004
movq 0x2df3(%rip), %r15      # 0x3fe0
callq 0x10b0
movq %rax, %rdi
callq 0x1060
shrl %eax
movq %r14, %rdi
movl %ebx, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x1070
movq (%r15), %rdi
callq 0x1090
decl %ebp
jne 0x11ed
callq 0x1050
leaq 0xdf2(%rip), %rdi       # 0x2014
movl %ebx, %esi
movb $0x1, %al
callq 0x1070
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zpole[P]IICV/src/test_threads.c
// Function: main
int
main(int argc VL_UNUSED, char** argv VL_UNUSED)
{
#ifndef VL_DISABLE_THREADS
#if defined(VL_THREADS_POSIX)
  vl_uindex i ;
  pthread_t threads [5] ;
  int threadIds [5] ;
  for (i = 0 ; i < sizeof(threads) / sizeof(threads[0]) ; ++i) {
    threadIds [i] = i ;
    pthread_create (threads + i, NULL, testThread, threadIds + i) ;
  }
  for (i = 0 ; i < sizeof(threads) / sizeof(threads[0]) ; ++i) {
    pthread_join (threads[i], NULL) ;
  }
#elif defined(VL_THREADS_WIN)
  int i ;
  DWORD threadIds [5] ;
  HANDLE threadHandles [5] ;
  for (i = 0 ; i < sizeof(threadHandles) / sizeof(threadHandles[0]) ; ++i) {
    threadHandles [i] = CreateThread (
      NULL, 0,
      testThread, threadIds + i,
      0, threadIds + i) ;
  }
  for (i = 0 ; i < sizeof(threadHandles) / sizeof(threadHandles[0]) ; ++i) {
    WaitForSingleObject (threadHandles[i], INFINITE);
  }
#endif
/* VL_DISABLE_THREADS */
#else
  printf("VLFeat was compiled without threading support\n") ;
#endif
  {
    char * string = vl_configuration_to_string_copy() ;
    printf("%s", string) ;
    vl_free(string) ;
  }
  return 0 ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsp, %rbx
leaq 0x20(%rsp), %r14
xorl %r12d, %r12d
leaq -0x89(%rip), %r15       # 0x11cc
movl %r12d, (%rbx)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x10a0
incq %r12
addq $0x4, %rbx
addq $0x8, %r14
cmpq $0x5, %r12
jne 0x1255
xorl %ebx, %ebx
movq 0x20(%rsp,%rbx,8), %rdi
xorl %esi, %esi
callq 0x10c0
incq %rbx
cmpq $0x5, %rbx
jne 0x127b
callq 0x1040
movq %rax, %rbx
leaq 0xd97(%rip), %rdi       # 0x2036
movq %rax, %rsi
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x1080
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Keith-S-Thompson[P]kst-time-utils/jd.c
// Function: main
int main(int argc, char **argv) {
    int modified = 0; /* use Modified Julian Date */
    for (int i = 1; i < argc; i ++) {
        if (strcmp(argv[i], "-m") == 0) {
            modified = 1;
        }
        else {
            usage_error(argv[0]);
        }
    }
    struct timeval tp;
    if (gettimeofday(&tp, NULL) != 0) {
        perror("gettimeofday");
        exit(EXIT_FAILURE);
    }
    const long double unix_time = tp.tv_sec + tp.tv_usec/1000000.0;
    const long double jd = unix_time / 86400.0 + (modified ? 40587.0 : 2440587.5);
    printf("%.9Lf\n", jd);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
flds 0xe47(%rip)             # 0x2004
fstpt 0x14(%rsp)
cmpl $0x2, %edi
jl 0x11fb
movq %rsi, %rbx
movl %edi, %r15d
movl $0x1, %r12d
leaq 0xe3f(%rip), %r14       # 0x2018
flds 0xe29(%rip)             # 0x2008
fstpt 0x14(%rsp)
movq (%rbx,%r12,8), %rdi
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
jne 0x125e
incq %r12
cmpq %r12, %r15
jne 0x11e3
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x1050
testl %eax, %eax
jne 0x129d
cvtsi2sdq 0x28(%rsp), %xmm0
cvtsi2sdq 0x30(%rsp), %xmm1
divsd 0xdeb(%rip), %xmm1      # 0x2010
addsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
fldl 0x20(%rsp)
fdivs 0xdd3(%rip)             # 0x200c
fldt 0x14(%rsp)
faddp %st, %st(1)
fstpt (%rsp)
leaq 0xddf(%rip), %rdi       # 0x2028
xorl %eax, %eax
callq 0x1040
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq (%rbx), %rsi
leaq 0xdc7(%rip), %rdi       # 0x202f
xorl %eax, %eax
callq 0x1040
leaq 0xdc9(%rip), %rdi       # 0x203f
callq 0x1030
leaq 0xde0(%rip), %rdi       # 0x2062
callq 0x1030
leaq 0xdfa(%rip), %rdi       # 0x2088
callq 0x1030
movl $0x1, %edi
callq 0x1080
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/openshmem-org[P]openshmem-examples/c/collect64.c
// Function: main
int
main(void)
{
    int i;

    shmem_init();
    npes = shmem_n_pes();
    me = shmem_my_pe();

    for (i = 0; i < DST_SIZE; i++) {
        dst[i] = -1;
    }

    for (i = 0; i < SHMEM_COLLECT_SYNC_SIZE; i += 1) {
        pSync[i] = SHMEM_SYNC_VALUE;
    }

    shmem_barrier_all();

    shmem_collect64(dst, src, me + 1, 0, 0, npes, pSync);

    shmem_barrier_all();

    show_dst("AFTER");

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
callq 0x10b0
callq 0x1060
movl %eax, 0x2ecb(%rip)      # 0x40a0
callq 0x1090
movl %eax, 0x2ec4(%rip)      # 0x40a4
leaq 0x2ec9(%rip), %rbx      # 0x40b0
movl $0xa0, %edx
movq %rbx, %rdi
movl $0xff, %esi
callq 0x1040
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, 0x2f4b(%rip)     # 0x4150
movq $-0x1, 0x2f50(%rip) # 0x4160
leaq 0x2f39(%rip), %r14      # 0x4150
callq 0x10a0
movslq 0x2e81(%rip), %rdx      # 0x40a4
incq %rdx
movl 0x2e73(%rip), %r9d      # 0x40a0
movq %r14, (%rsp)
leaq 0x2e38(%rip), %rsi      # 0x4070
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1070
callq 0x10a0
movl 0x2e54(%rip), %edx      # 0x40a4
movl 0x2e4a(%rip), %ecx      # 0x40a0
leaq 0xdad(%rip), %rdi       # 0x200a
leaq 0xda0(%rip), %rsi       # 0x2004
xorl %eax, %eax
callq 0x1030
leaq 0xdaa(%rip), %r14       # 0x201c
xorl %r15d, %r15d
movq (%r15,%rbx), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1030
addq $0x8, %r15
cmpq $0xa0, %r15
jne 0x1275
movl $0xa, %edi
callq 0x1050
callq 0x1080
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmakebas/zmakebas.c
// Function: getopt
int getopt(int argc,char *argv[],char *optstring)
{
char *ptr;

/* check for end of arg list */
if(optind==argc || *(argv[optind])!='-' || strlen(argv[optind])<=1)
  return(-1);

if((ptr=strchr(optstring,argv[optind][optpos]))==NULL)
  return('?');		/* error: unknown option */
else
  {
  optopt=*ptr;
  if(ptr[1]==':')
    {
    if(optind==argc-1) return(':');	/* error: missing option */
    optarg=argv[optind+1];
    optpos=1;
    optind+=2;
    return(optopt);	/* return early, avoiding the normal increment */
    }
  }

/* now increment position ready for next time.
 * no checking is done for the end of args yet - this is done on
 * the next call.
 */
optpos++;
if(optpos>=strlen(argv[optind]))
  {
  optpos=1;
  optind++;
  }

return(optopt);		/* return the found option */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x528a(%rip), %r13      # 0x86f8
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl %edi, %r13d
je 0x352a
movq %rsi, %rbx
movq (%rsi,%r13,8), %r14
cmpb $0x2d, (%r14)
jne 0x352a
movq %rdx, %r12
movl %edi, %ebp
movq %r14, %rdi
callq 0x3080
cmpq $0x2, %rax
jb 0x352a
movslq 0x5250(%rip), %r15      # 0x86fc
movsbl (%r14,%r15), %esi
movq %r12, %rdi
callq 0x3070
testq %rax, %rax
je 0x34ef
movsbl (%rax), %r12d
movl %r12d, 0x524f(%rip)     # 0x8718
cmpb $0x3a, 0x1(%rax)
jne 0x34f7
decl %ebp
movl $0x3a, %r15d
cmpl %ebp, %r13d
je 0x352a
movq 0x8(%rbx,%r13,8), %rax
movq %rax, 0x5238(%rip)      # 0x8720
movl $0x2, %ecx
jmp 0x3513
movl $0x3f, %r15d
jmp 0x352a
incq %r15
movl %r15d, 0x51fb(%rip)     # 0x86fc
movq %r14, %rdi
callq 0x3080
movl $0x1, %ecx
cmpq %r15, %rax
ja 0x3527
movl $0x1, 0x51df(%rip)      # 0x86fc
addl %ecx, %r13d
movl %r13d, 0x51d1(%rip)     # 0x86f8
movl %r12d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmakebas/zmakebas.c
// Function: grok_hex
unsigned long grok_hex(unsigned char **ptrp,int textlinenum)
{
static char *hexits="0123456789abcdefABCDEF",*lookup;
unsigned char *ptr=*ptrp;
unsigned long v=0,n;

/* we know the number starts with "0x" and we're pointing to it */

ptr+=2;
if(strchr(hexits,*ptr)==NULL)
  {
  fprintf(stderr,"line %d: bad BIN 0x... number\n",textlinenum);
  exit(1);
  }

while(*ptr && (lookup=strchr(hexits,*ptr))!=NULL)
  {
  n=lookup-hexits;
  if(n>15) n-=6;
  v=v*16+n;
  ptr++;
  }

*ptrp=ptr;
return(v);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %r12
movzbl 0x2(%r12), %esi
leaq 0x1c0d(%rip), %r15      # 0x528e
movl $0x17, %edx
movq %r15, %rdi
callq 0x3130
testq %rax, %rax
je 0x36f2
addq $0x2, %r12
movb (%r12), %cl
xorl %r14d, %r14d
testb %cl, %cl
je 0x36e3
movzbl %cl, %esi
movl $0x17, %edx
movq %r15, %rdi
callq 0x3130
testq %rax, %rax
je 0x36dc
movq %rax, %rcx
subq %r15, %rcx
leaq -0x6(%rcx), %rdx
cmpq $0x10, %rcx
cmovbq %rcx, %rdx
shlq $0x4, %r14
addq %rdx, %r14
movb 0x1(%r12), %cl
incq %r12
testb %cl, %cl
jne 0x36a2
movq %rax, 0x5045(%rip)      # 0x8728
movq %r12, (%rbx)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x3200
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmakebas/zmakebas.c
// Function: grok_binary
unsigned long grok_binary(unsigned char **ptrp,int textlinenum)
{
unsigned long v=0;
unsigned char *ptr=*ptrp;

while(isspace(*ptr)) ptr++;

if(*ptr!='0' && *ptr!='1')
  {
  fprintf(stderr,"line %d: bad BIN number\n",textlinenum);
  exit(1);
  }

if(ptr[1]=='x' || ptr[1]=='X')
  {
  *ptrp=ptr;
  return(grok_hex(ptrp,textlinenum));
  }

while(*ptr=='0' || *ptr=='1')
  {
  v*=2;
  v+=*ptr-'0';
  ptr++;
  }

*ptrp=ptr;
return(v);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %r14
callq 0x3110
movq (%rax), %rax
decq %r14
movzbl 0x1(%r14), %ecx
incq %r14
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x3710
andb $-0x2, %cl
cmpb $0x30, %cl
jne 0x377a
movzbl 0x1(%r14), %eax
orl $0x20, %eax
cmpl $0x78, %eax
jne 0x3745
movq %r14, (%rbx)
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3664
movb (%r14), %cl
movl %ecx, %eax
andb $-0x2, %al
cmpb $0x30, %al
jne 0x3770
xorl %eax, %eax
movzbl %cl, %ecx
leaq (%rcx,%rax,2), %rax
addq $-0x30, %rax
movb 0x1(%r14), %cl
incq %r14
movl %ecx, %edx
andb $-0x2, %dl
cmpb $0x30, %dl
je 0x3752
jmp 0x3772
xorl %eax, %eax
movq %r14, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movl %ebp, %edi
callq 0x3223
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmakebas/zmakebas.c
// Function: usage_help
void usage_help()
{
printf("zmakebas - public domain by Russell Marks.\n\n");

printf("usage: zmakebas [-hlr] [-a line] [-i incr] [-n speccy_filename]\n");
printf("                [-o output_file] [-s line] [input_file]\n\n");

printf("        -a      set auto-start line of basic file (default none).\n");
printf("        -h      give this usage help.\n");
printf("        -i      in labels mode, set line number incr. (default 2).\n");
printf("        -l      use labels rather than line numbers.\n");
printf("        -n      set Spectrum filename (to be given in tape header).");
printf("\n        -o      specify output file (default `%s').\n",
						DEFAULT_OUTPUT);
printf("        -r      output raw headerless file (default is .tap file).\n");
printf("        -s      in labels mode, set starting line number ");
printf("(default 10).\n");
}

// Assembly:
pushq %rax
leaq 0x2113(%rip), %rdi      # 0x589c
callq 0x31a0
leaq 0x2133(%rip), %rdi      # 0x58c8
callq 0x31a0
leaq 0x2167(%rip), %rdi      # 0x5908
callq 0x31a0
leaq 0x2194(%rip), %rdi      # 0x5941
callq 0x31a0
leaq 0x21ca(%rip), %rdi      # 0x5983
callq 0x31a0
leaq 0x21e4(%rip), %rdi      # 0x59a9
callq 0x31a0
leaq 0x221b(%rip), %rdi      # 0x59ec
callq 0x31a0
leaq 0x1b00(%rip), %rdi      # 0x52dd
xorl %eax, %eax
callq 0x3030
leaq 0x1b36(%rip), %rdi      # 0x5321
leaq 0x1b65(%rip), %rsi      # 0x5357
xorl %eax, %eax
callq 0x3030
leaq 0x2221(%rip), %rdi      # 0x5a21
callq 0x31a0
leaq 0x1b53(%rip), %rdi      # 0x535f
xorl %eax, %eax
callq 0x3030
leaq 0x224a(%rip), %rdi      # 0x5a64
popq %rax
jmp 0x31a0
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmakebas/zmakebas.c
// Function: grok_block
int grok_block(unsigned char *ptr,int textlinenum)
{
static char *lookup[]=
  {
  "  ", " '", "' ", "''", " .", " :", "'.", "':",
  ". ", ".'", ": ", ":'", "..", ".:", ":.", "::",
  NULL
  };
char **lptr;
int f=128,v=-1;
            
for(lptr=lookup;*lptr!=NULL;lptr++,f++)
  {
  if(strncmp(ptr+1,*lptr,2)==0)
    {
    v=f;
    break;
    }
  }

if(v==-1)
  {
  fprintf(stderr,"line %d: invalid block graphics escape\n",textlinenum);
  exit(1);
  }

return(v);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r15
incq %r15
leaq 0x1af5(%rip), %rsi      # 0x5543
xorl %r14d, %r14d
leaq 0x42c8(%rip), %r12      # 0x7d20
movl $0x2, %edx
movq %r15, %rdi
callq 0x3090
testl %eax, %eax
je 0x3a7f
movq 0x8(%r12,%r14,8), %rsi
incq %r14
cmpl $0x10, %r14d
jne 0x3a58
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x3a83
subl $-0x80, %r14d
cmpl $-0x1, %r14d
je 0x3a98
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %ebx, %edi
callq 0x3343
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/batman.c
// Function: get_gw_speeds
void get_gw_speeds(unsigned char gw_class, int *down, int *up)
{
	char sbit = (gw_class & 0x80) >> 7;
	char dpart = (gw_class & 0x78) >> 3;
	char upart = (gw_class & 0x07);

	*down = 32 * (sbit + 2) * (1 << dpart);
	*up = ((upart + 1) * (*down)) / 8;
}

// Assembly:
movl %edi, %ecx
shrb $0x3, %cl
andb $0xf, %cl
movl %edi, %eax
shrb $0x2, %dil
andb $0x20, %dil
orb $0x40, %dil
movzbl %dil, %edi
shll %cl, %edi
andb $0x7, %al
movl %edi, (%rsi)
incb %al
movzbl %al, %eax
imull %edi, %eax
shrl $0x3, %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/batman.c
// Function: get_gw_class
unsigned char get_gw_class(int down, int up)
{
	int mdown = 0, tdown, tup, difference = 0x0FFFFFFF;
	unsigned char gw_class = 0, sbit, part;


	/* test all downspeeds */
	for (sbit = 0; sbit < 2; sbit++) {

		for (part = 0; part < 16; part++) {

			tdown = 32 * (sbit + 2) * (1 << part);

			if ( abs(tdown - down) < difference) {

				gw_class = (sbit << 7) + (part << 3);
				difference = abs(tdown - down);
				mdown = tdown;

			}

		}

	}

	/* test all upspeeds */
	difference = 0x0FFFFFFF;

	for (part = 0; part < 8; part++) {

		tup = ((part + 1) * (mdown)) / 8;

		if (abs(tup - up) < difference) {

			gw_class = (gw_class & 0xF8) | part;
			difference = abs(tup - up);

		}

	}

	return gw_class;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl $0xfffffff, %r9d        # imm = 0xFFFFFFF
xorl %r8d, %r8d
xorl %r10d, %r10d
xorl %eax, %eax
xorl %edx, %edx
movl %r10d, %r11d
shll $0x5, %r11d
addl $0x40, %r11d
movl %r8d, %ebx
xorl %ecx, %ecx
movl %r11d, %ebp
shll %cl, %ebp
movl %r9d, %r14d
movl %ebp, %r15d
subl %edi, %r15d
movl %r15d, %r9d
negl %r9d
cmovsl %r15d, %r9d
cmpl %r14d, %r9d
cmovll %ebp, %edx
cmovgel %r14d, %r9d
movzbl %bl, %ebx
movzbl %al, %eax
cmovll %ebx, %eax
incl %ecx
addb $0x8, %bl
cmpl $0x10, %ecx
jne 0x3437
leal 0x1(%r10), %ecx
addb $-0x80, %r8b
testl %r10d, %r10d
movl %ecx, %r10d
je 0x3427
movl $0xfffffff, %ecx        # imm = 0xFFFFFFF
xorl %r8d, %r8d
movl %edx, %edi
leal 0x7(%rdi), %r9d
testl %edi, %edi
cmovnsl %edi, %r9d
sarl $0x3, %r9d
subl %esi, %r9d
movl %r9d, %r10d
negl %r10d
cmovsl %r9d, %r10d
movzbl %al, %r9d
movl %r9d, %eax
andl $0xf8, %eax
addl %r8d, %eax
cmpl %ecx, %r10d
cmovll %r10d, %ecx
cmovgel %r9d, %eax
leal 0x1(%r8), %r9d
addl %edx, %edi
movl %r9d, %r8d
cmpl $0x8, %r9d
jne 0x3486
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/batman.c
// Function: count_real_packets
static uint8_t count_real_packets(struct bat_packet *in, uint32_t neigh, struct batman_if *if_incoming)
{
	struct list_head *list_pos;
	struct orig_node *orig_node;
	struct neigh_node *tmp_neigh_node;
	uint8_t is_duplicate = 0;


	orig_node = get_orig_node( in->orig );

	/*char orig_str[ADDR_STR_LEN], neigh_str[ADDR_STR_LEN];

	addr_to_string( in->orig, orig_str, ADDR_STR_LEN );
	addr_to_string( neigh, neigh_str, ADDR_STR_LEN );

	debug_output( 3, "count_real_packets: orig = %s, neigh = %s, seq = %i, last seq = %i\n", orig_str, neigh_str, in->seqno, orig_node->last_real_seqno );*/

	list_for_each( list_pos, &orig_node->neigh_list ) {

		tmp_neigh_node = list_entry( list_pos, struct neigh_node, list );

		if ( !is_duplicate )
			is_duplicate = get_bit_status( tmp_neigh_node->real_bits, orig_node->last_real_seqno, in->seqno );

		if ( ( tmp_neigh_node->addr == neigh ) && ( tmp_neigh_node->if_incoming == if_incoming ) ) {

			bit_get_packet( tmp_neigh_node->real_bits, in->seqno - orig_node->last_real_seqno, 1 );
			/*debug_output( 3, "count_real_packets (yes): neigh = %s, is_new = %s, seq = %i, last seq = %i\n", neigh_str, ( is_new_seqno ? "YES" : "NO" ), in->seqno, orig_node->last_real_seqno );*/

		} else {

			bit_get_packet( tmp_neigh_node->real_bits, in->seqno - orig_node->last_real_seqno, 0 );
			/*debug_output( 3, "count_real_packets (no): neigh = %s, is_new = %s, seq = %i, last seq = %i\n", neigh_str, ( is_new_seqno ? "YES" : "NO" ), in->seqno, orig_node->last_real_seqno );*/

		}

		tmp_neigh_node->real_packet_count = bit_packet_count( tmp_neigh_node->real_bits );

	}

	if ( !is_duplicate ) {

		debug_output( 4, "updating last_seqno: old %d, new %d \n", orig_node->last_real_seqno, in->seqno );
		orig_node->last_real_seqno = in->seqno;

	}

	return is_duplicate;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movl %esi, %r12d
movq %rdi, %rbx
movl 0x8(%rdi), %edi
callq 0x43bb
movq %rax, %r14
movq 0x48(%rax), %r13
movq %rax, %r15
addq $0x48, %r15
xorl %ebp, %ebp
cmpq %r15, %r13
je 0x4270
testb %bpl, %bpl
jne 0x422f
movq 0x20(%r13), %rdi
movzwl 0x42(%r14), %esi
movzwl 0x4(%rbx), %edx
callq 0x6112
movl %eax, %ebp
cmpl %r12d, 0x8(%r13)
jne 0x423f
movq (%rsp), %rax
cmpq %rax, 0x30(%r13)
je 0x426c
xorl %eax, %eax
movq 0x20(%r13), %rdi
movzwl 0x4(%rbx), %ecx
subw 0x42(%r14), %cx
movswl %cx, %esi
movzbl %al, %edx
callq 0x6205
movq 0x20(%r13), %rdi
callq 0x6309
movb %al, 0xc(%r13)
movq (%r13), %r13
jmp 0x4211
movb $0x1, %al
jmp 0x4241
testb %bpl, %bpl
jne 0x429a
movzwl 0x42(%r14), %edx
movzwl 0x4(%rbx), %ecx
leaq 0xbcb2(%rip), %rsi      # 0xff37
movl $0x4, %edi
xorl %eax, %eax
callq 0xd5b0
movzwl 0x4(%rbx), %eax
movw %ax, 0x42(%r14)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/originator.c
// Function: create_neighbor
struct neigh_node * create_neighbor(struct orig_node *orig_node, struct orig_node *orig_neigh_node, uint32_t neigh, struct batman_if *if_incoming) {

	struct neigh_node *neigh_node;

	debug_output( 4, "Creating new last-hop neighbour of originator\n" );

	neigh_node = debugMalloc( sizeof(struct neigh_node), 403 );
	memset( neigh_node, 0, sizeof(struct neigh_node) );
	INIT_LIST_HEAD(&neigh_node->list);

	neigh_node->addr = neigh;
	neigh_node->orig_node = orig_neigh_node;
	neigh_node->if_incoming = if_incoming;

	neigh_node->tq_recv = debugMalloc(sizeof(uint16_t) * global_win_size, 406);
	memset(neigh_node->tq_recv, 0, sizeof(uint16_t) * global_win_size);

	neigh_node->real_bits = debugMalloc(sizeof(TYPE_OF_WORD) * num_words, 407);
	memset(neigh_node->real_bits, 0, sizeof(TYPE_OF_WORD) * num_words);

	list_add_tail(&neigh_node->list, &orig_node->neigh_list);

	return neigh_node;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
leaq 0xbd33(%rip), %rsi      # 0xfff9
movl $0x4, %edi
xorl %eax, %eax
callq 0xd5b0
movl $0x38, %edi
movl $0x193, %esi            # imm = 0x193
callq 0x5d3e
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movq %rax, (%rax)
movl %ebp, 0x8(%rax)
movq %r12, 0x28(%rax)
movq %r15, 0x30(%rax)
leaq 0x12f8f(%rip), %r15     # 0x17296
movzbl (%r15), %edi
addl %edi, %edi
movl $0x196, %esi            # imm = 0x196
callq 0x5d3e
movq %rax, 0x10(%r14)
movzbl (%r15), %edx
addl %edx, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x21c0
leaq 0x12f66(%rip), %r15     # 0x17298
movzbl (%r15), %edi
shll $0x3, %edi
movl $0x197, %esi            # imm = 0x197
callq 0x5d3e
movq %rax, 0x20(%r14)
movzbl (%r15), %edx
shll $0x3, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x21c0
addq $0x48, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bb9
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/originator.c
// Function: choose_orig
int choose_orig( void *data, int32_t size ) {

	unsigned char *key= data;
	uint32_t hash = 0;
	size_t i;

	for (i = 0; i < 4; i++) {
		hash += key[i];
		hash += (hash << 10);
		hash ^= (hash >> 6);
	}

	hash += (hash << 3);
	hash ^= (hash >> 11);
	hash += (hash << 15);

	return (hash%size);

}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rdi,%rax), %edx
addl %ecx, %edx
movl %edx, %r8d
shll $0xa, %r8d
addl %edx, %r8d
movl %r8d, %ecx
shrl $0x6, %ecx
xorl %r8d, %ecx
incq %rax
cmpq $0x4, %rax
jne 0x4381
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0xf, %eax
addl %ecx, %eax
xorl %edx, %edx
divl %esi
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/allocate.c
// Function: checkIntegrity
void checkIntegrity(void)
{
	struct chunkHeader *walker;
	struct chunkTrailer *chunkTrailer;
	unsigned char *memory;


#if defined MEMORY_USAGE

	struct memoryUsage *memoryWalker;

	debug_output( 5, " \nMemory usage information:\n" );

	pthread_mutex_lock(&memory_mutex);
	for ( memoryWalker = memoryList; memoryWalker != NULL; memoryWalker = memoryWalker->next ) {

		if ( memoryWalker->counter != 0 )
			debug_output( 5, "   tag: %4i, num malloc: %4i, bytes per malloc: %4i, total: %6i\n", memoryWalker->tag, memoryWalker->counter, memoryWalker->length, memoryWalker->counter * memoryWalker->length );

	}
	pthread_mutex_unlock(&memory_mutex);

#endif

	pthread_mutex_lock(&chunk_mutex);

	for (walker = chunkList; walker != NULL; walker = walker->next)
	{
		if (walker->magicNumber != MAGIC_NUMBER)
		{
			debug_output( 0, "checkIntegrity - invalid magic number in header: %08x, malloc tag = %d\n", walker->magicNumber, walker->tag );
			pthread_mutex_unlock(&chunk_mutex);
			restore_and_exit(0);
		}

		memory = (unsigned char *)walker;

		chunkTrailer = (struct chunkTrailer *)(memory + sizeof(struct chunkHeader) + getHeaderPad() + walker->length + getTrailerPad(walker->length));

		if (chunkTrailer->magicNumber != MAGIC_NUMBER)
		{
			debug_output( 0, "checkIntegrity - invalid magic number in trailer: %08x, malloc tag = %d\n", chunkTrailer->magicNumber, walker->tag );
			pthread_mutex_unlock(&chunk_mutex);
			restore_and_exit(0);
		}
	}

	pthread_mutex_unlock(&chunk_mutex);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xaa68(%rip), %rsi      # 0x10663
movl $0x5, %edi
xorl %eax, %eax
callq 0xd5b0
leaq 0x1189a(%rip), %rdi     # 0x174a8
callq 0x24c0
movq 0x11886(%rip), %r14     # 0x174a0
testq %r14, %r14
je 0x5c54
leaq 0xaa5a(%rip), %rbx      # 0x10680
movl 0xc(%r14), %ecx
testl %ecx, %ecx
je 0x5c4c
movl 0x8(%r14), %r8d
movl 0x10(%r14), %edx
movl %r8d, %r9d
imull %ecx, %r9d
movl $0x5, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xd5b0
movq (%r14), %r14
testq %r14, %r14
jne 0x5c26
leaq 0x1184d(%rip), %rdi     # 0x174a8
callq 0x22d0
leaq 0x11869(%rip), %rdi     # 0x174d0
callq 0x24c0
leaq 0x11825(%rip), %rax     # 0x17498
movq (%rax), %rax
testq %rax, %rax
je 0x5cb7
movl 0x10(%rax), %edx
cmpl $0x12345678, %edx       # imm = 0x12345678
jne 0x5cca
movl 0x8(%rax), %ecx
leaq (%rax,%rcx), %rdx
andl $0x7, %ecx
movl $0x8, %esi
subq %rcx, %rsi
testq %rcx, %rcx
cmoveq %rcx, %rsi
movl 0x18(%rsi,%rdx), %edx
cmpl $0x12345678, %edx       # imm = 0x12345678
je 0x5c73
movl 0xc(%rax), %ecx
leaq 0xaa54(%rip), %rsi      # 0x10709
jmp 0x5cd4
leaq 0x11812(%rip), %rdi     # 0x174d0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22d0
movl 0xc(%rax), %ecx
leaq 0xa9ed(%rip), %rsi      # 0x106c1
xorl %edi, %edi
xorl %eax, %eax
callq 0xd5b0
leaq 0x117ec(%rip), %rdi     # 0x174d0
callq 0x22d0
xorl %edi, %edi
callq 0xbd8c
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/allocate.c
// Function: checkLeak
void checkLeak(void)
{
	struct chunkHeader *walker;

	pthread_mutex_lock(&chunk_mutex);
	for (walker = chunkList; walker != NULL; walker = walker->next)
		debug_output( 0, "Memory leak detected, malloc tag = %d\n", walker->tag );

	pthread_mutex_unlock(&chunk_mutex);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x117d5(%rip), %rdi     # 0x174d0
callq 0x24c0
movq 0x11791(%rip), %r14     # 0x17498
testq %r14, %r14
je 0x5d2b
leaq 0xaa3f(%rip), %rbx      # 0x10752
movl 0xc(%r14), %edx
xorl %edi, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xd5b0
movq (%r14), %r14
testq %r14, %r14
jne 0x5d13
leaq 0x1179e(%rip), %rdi     # 0x174d0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22d0
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/allocate.c
// Function: debugMalloc
void *debugMalloc(uint32_t length, int32_t tag)
{
	unsigned char *memory;
	struct chunkHeader *chunkHeader;
	struct chunkTrailer *chunkTrailer;
	unsigned char *chunk;

/* 	printf("sizeof(struct chunkHeader) = %u, sizeof (struct chunkTrailer) = %u\n", sizeof (struct chunkHeader), sizeof (struct chunkTrailer)); */

	memory = malloc(length + sizeof(struct chunkHeader) + sizeof(struct chunkTrailer) + getHeaderPad() + getTrailerPad(length));

	if (memory == NULL)
	{
		debug_output( 0, "Cannot allocate %u bytes, malloc tag = %d\n", (unsigned int)(length + sizeof(struct chunkHeader) + sizeof(struct chunkTrailer)), tag );
		restore_and_exit(0);
	}

	chunkHeader = (struct chunkHeader *)memory;
	chunk = memory + sizeof(struct chunkHeader) + getHeaderPad();
	chunkTrailer = (struct chunkTrailer *)(memory + sizeof(struct chunkHeader) + length + getHeaderPad() + getTrailerPad(length));

	fillPadding((unsigned char*)chunkHeader + sizeof(struct chunkHeader), getHeaderPad());
	fillPadding(chunk + length, getTrailerPad(length));

	chunkHeader->length = length;
	chunkHeader->tag = tag;
	chunkHeader->magicNumber = MAGIC_NUMBER;

	chunkTrailer->magicNumber = MAGIC_NUMBER;

	pthread_mutex_lock(&chunk_mutex);
	chunkHeader->next = chunkList;
	chunkList = chunkHeader;
	pthread_mutex_unlock(&chunk_mutex);

#if defined MEMORY_USAGE

	addMemory( length, tag );

#endif

	return chunk;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl %edi, %r14d
movl %r14d, %r13d
andl $0x7, %r13d
movl $0x8, %r12d
subq %r13, %r12
testq %r13, %r13
cmoveq %r13, %r12
leaq (%r12,%r14), %rdi
addq $0x1c, %rdi
callq 0x22e0
testq %rax, %rax
je 0x5e4d
movq %rax, %r15
addq %r14, %rax
addq $0x18, %rax
testq %r13, %r13
je 0x5d9e
movb $-0x59, %cl
xorl %edx, %edx
movb %cl, (%rax,%rdx)
incq %rdx
addb $-0x59, %cl
cmpq %rdx, %r12
jne 0x5d90
movq %r15, %r14
addq $0x18, %r14
movl %ebp, 0x8(%r15)
movl %ebx, 0xc(%r15)
movl $0x12345678, %ecx       # imm = 0x12345678
movl %ecx, 0x10(%r15)
movl %ecx, (%rax,%r12)
leaq 0x1170f(%rip), %r12     # 0x174d0
movq %r12, %rdi
callq 0x24c0
movq 0x116c8(%rip), %rax     # 0x17498
movq %rax, (%r15)
movq %r15, 0x116be(%rip)     # 0x17498
movq %r12, %rdi
callq 0x22d0
leaq 0x116bf(%rip), %rdi     # 0x174a8
callq 0x24c0
leaq 0x116ab(%rip), %rax     # 0x174a0
movq (%rax), %rax
testq %rax, %rax
je 0x5e07
cmpl %ebx, 0x10(%rax)
jne 0x5df5
incl 0xc(%rax)
jmp 0x5e2f
movl $0x18, %edi
callq 0x22e0
movl %ebp, 0x8(%rax)
movl %ebx, 0x10(%rax)
movl $0x1, 0xc(%rax)
movq 0x1167b(%rip), %rcx     # 0x174a0
movq %rcx, (%rax)
movq %rax, 0x11671(%rip)     # 0x174a0
leaq 0x11672(%rip), %rdi     # 0x174a8
callq 0x22d0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x1c, %r14
leaq 0xa921(%rip), %rsi      # 0x10779
xorl %edi, %edi
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0xd5b0
xorl %edi, %edi
callq 0xbd8c
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/allocate.c
// Function: debugRealloc
void *debugRealloc(void *memoryParameter, uint32_t length, int32_t tag)
{
	unsigned char *memory;
	struct chunkHeader *chunkHeader=NULL;
	struct chunkTrailer *chunkTrailer;
	unsigned char *result;
	uint32_t copyLength;

	if (memoryParameter) { /* if memoryParameter==NULL, realloc() should work like malloc() !! */
		memory = memoryParameter;
		chunkHeader = (struct chunkHeader *)(memory - sizeof(struct chunkHeader) - getHeaderPad());

		if (chunkHeader->magicNumber != MAGIC_NUMBER)
		{
			debug_output( 0, "debugRealloc - invalid magic number in header: %08x, malloc tag = %d\n", chunkHeader->magicNumber, chunkHeader->tag );
			restore_and_exit(0);
		}

		if (checkPadding(memory - getHeaderPad(), getHeaderPad()) == 0) {
			debug_output( 0, "debugRealloc - invalid magic padding in header, malloc tag = %d\n", chunkHeader->tag );
			restore_and_exit(0);
		}

		chunkTrailer = (struct chunkTrailer *)(memory + chunkHeader->length + getTrailerPad(chunkHeader->length));

		if (chunkTrailer->magicNumber != MAGIC_NUMBER)
		{
			debug_output( 0, "debugRealloc - invalid magic number in trailer: %08x, malloc tag = %d\n", chunkTrailer->magicNumber, chunkHeader->tag );
			restore_and_exit(0);
		}

		if (checkPadding(memory + chunkHeader->length, getTrailerPad(chunkHeader->length)) == 0) {
			debug_output( 0, "debugRealloc - invalid magic padding in trailer, malloc tag = %d\n", chunkHeader->tag );
			restore_and_exit(0);
		}
	}


	result = debugMalloc(length, tag);
	if (memoryParameter) {
		copyLength = length;

		if (copyLength > chunkHeader->length)
			copyLength = chunkHeader->length;

		memcpy(result, memoryParameter, copyLength);
		debugFree(memoryParameter, 9999);
	}

	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5ed3
movl -0x8(%rbx), %eax
cmpl $0x12345678, %eax       # imm = 0x12345678
jne 0x5f38
movl -0x10(%rbx), %edi
leaq (%rbx,%rdi), %rcx
andl $0x7, %edi
movl $0x8, %esi
subq %rdi, %rsi
testq %rdi, %rdi
cmoveq %rdi, %rsi
movl (%rsi,%rcx), %eax
cmpl $0x12345678, %eax       # imm = 0x12345678
jne 0x5f44
leaq -0x18(%rbx), %r12
testq %rdi, %rdi
je 0x5ed6
xorl %eax, %eax
xorl %edi, %edi
addb $-0x59, %al
cmpb (%rcx,%rdi), %al
jne 0x5f1e
incq %rdi
cmpq %rdi, %rsi
jne 0x5ec2
jmp 0x5ed6
xorl %r12d, %r12d
movl %r14d, %edi
movl %edx, %esi
callq 0x5d3e
movq %rax, %r15
testq %rbx, %rbx
je 0x5f0f
movl 0x8(%r12), %eax
cmpl %r14d, %eax
cmovbl %eax, %r14d
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2290
movq %rbx, %rdi
movl $0x270f, %esi           # imm = 0x270F
callq 0x5f5b
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl -0xc(%rbx), %edx
leaq 0xa909(%rip), %rsi      # 0x10831
xorl %edi, %edi
xorl %eax, %eax
callq 0xd5b0
xorl %edi, %edi
callq 0xbd8c
movl -0xc(%rbx), %ecx
leaq 0xa862(%rip), %rsi      # 0x107a4
jmp 0x5f4e
movl -0xc(%rbx), %ecx
leaq 0xa89c(%rip), %rsi      # 0x107ea
xorl %edi, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0xd5b0
jmp 0x5f31
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/bitarray.c
// Function: bit_shift
void bit_shift( TYPE_OF_WORD *seq_bits, int32_t n ) {
	int32_t word_offset, word_num;
	int32_t i;

/*	bit_print( seq_bits );*/
	if( n<=0 ) return;

	word_offset= n%WORD_BIT_SIZE;	/* shift how much inside each word */
	word_num   = n/WORD_BIT_SIZE;	/* shift over how much (full) words */

	for ( i=num_words-1; i>word_num; i-- ) {
		/* going from old to new, so we can't overwrite the data we copy from. *
 		 * left is high, right is low: FEDC BA98 7654 3210
		 *	                                  ^^ ^^
		 *                             vvvv
		 * ^^^^ = from, vvvvv =to, we'd have word_num==1 and
		 * word_offset==WORD_BIT_SIZE/2 ????? in this example. (=24 bits)
		 *
		 * our desired output would be: 9876 5432 1000 0000
		 * */

		seq_bits[i]=
			(seq_bits[i - word_num] << word_offset) +
					/* take the lower port from the left half, shift it left to its final position */
			(seq_bits[i - word_num - 1] >>	(WORD_BIT_SIZE-word_offset));
					/* and the upper part of the right half and shift it left to it's position */
		/* for our example that would be: word[0] = 9800 + 0076 = 9876 */
	}
	/* now for our last word, i==word_num, we only have the it's "left" half. that's the 1000 word in
	 * our example.*/

	seq_bits[i]= (seq_bits[i - word_num] << word_offset);

	/* pad the rest with 0, if there is anything */
	i--;

	for (; i>=0; i--) {
		seq_bits[i]= 0;
	}
/*	bit_print( seq_bits ); */
}

// Assembly:
testl %esi, %esi
jle 0x6204
movl %esi, %eax
andl $0x3f, %eax
shrl $0x6, %esi
leaq 0x1111d(%rip), %rcx     # 0x17298
movzbl (%rcx), %edx
leal -0x1(%rdx), %ecx
cmpl %esi, %ecx
jle 0x61dd
pushq %r14
pushq %rbx
movl %eax, %r8d
movl $0x40, %r9d
subl %eax, %r9d
movl %edx, %edx
movl %esi, %r10d
leal (,%rsi,8), %ecx
movq %rdi, %r11
subq %rcx, %r11
addq $-0x8, %r11
movq %rdx, %rbx
movq -0x8(%r11,%rdx,8), %rdx
movq (%r11,%rbx,8), %r14
movl %r8d, %ecx
shlq %cl, %r14
movl %r9d, %ecx
shrq %cl, %rdx
addq %r14, %rdx
movq %rdx, -0x8(%rdi,%rbx,8)
leaq -0x1(%rbx), %rdx
addq $-0x2, %rbx
cmpq %r10, %rbx
jg 0x61aa
leal -0x1(%rdx), %ecx
popq %rbx
popq %r14
movslq %ecx, %r8
subl %esi, %ecx
movslq %ecx, %rcx
movq (%rdi,%rcx,8), %rsi
movl %eax, %ecx
shlq %cl, %rsi
movq %rsi, (%rdi,%r8,8)
cmpl $0x2, %edx
jl 0x6204
decl %edx
shlq $0x3, %rdx
xorl %esi, %esi
jmp 0x21c0
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/bitarray.c
// Function: bit_get_packet
char bit_get_packet( TYPE_OF_WORD *seq_bits, int16_t seq_num_diff, int8_t set_mark ) {

	int i;

	/* we already got a sequence number higher than this one, so we just mark it. this should wrap around the integer just fine */
	if ((seq_num_diff < 0) && (seq_num_diff >= -local_win_size)) {

		if ( set_mark )
			bit_mark( seq_bits, -seq_num_diff );

		return 0;

	}

	if ((seq_num_diff > local_win_size) || (seq_num_diff < -local_win_size)) {        /* it seems we missed a lot of packets or the other host restarted */

		if (seq_num_diff > local_win_size)
			debug_output(4, "It seems we missed a lot of packets (%i) !\n",  seq_num_diff-1);

		if (-seq_num_diff > local_win_size)
			debug_output(4, "Other host probably restarted !\n");

		for (i=0; i<num_words; i++)
			seq_bits[i]= 0;

		if ( set_mark )
			seq_bits[0] = 1;  /* we only have the latest packet */

	} else {

		bit_shift(seq_bits, seq_num_diff);

		if ( set_mark )
			bit_mark(seq_bits, 0);

	}

	return 1;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
testw %r14w, %r14w
jns 0x6231
leaq 0x11076(%rip), %rax     # 0x17297
movzbl (%rax), %eax
movl %eax, %ecx
negl %ecx
cmpl %ecx, %r14d
jge 0x62dc
leaq 0x1105f(%rip), %r15     # 0x17297
movzbl (%r15), %eax
cmpl %eax, %r14d
setg %cl
movl %eax, %edx
negl %edx
cmpl %edx, %r14d
setl %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x62bf
cmpl %eax, %r14d
jle 0x626f
leal -0x1(%r14), %edx
leaq 0xa7bb(%rip), %rsi      # 0x10a1e
movl $0x4, %edi
xorl %eax, %eax
callq 0xd5b0
negl %r14d
movzbl (%r15), %eax
cmpl %eax, %r14d
jle 0x628e
leaq 0xa7c8(%rip), %rsi      # 0x10a4a
movl $0x4, %edi
xorl %eax, %eax
callq 0xd5b0
leaq 0x11003(%rip), %rax     # 0x17298
cmpb $0x0, (%rax)
je 0x62af
xorl %ecx, %ecx
movq $0x0, (%rbx,%rcx,8)
incq %rcx
movzbl (%rax), %edx
cmpq %rdx, %rcx
jb 0x629c
movb $0x1, %al
testb %bpl, %bpl
je 0x62fe
movq $0x1, (%rbx)
jmp 0x62fe
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6164
movb $0x1, %al
testb %bpl, %bpl
je 0x62fe
cmpb $0x0, (%r15)
je 0x62fe
orb $0x1, (%rbx)
jmp 0x62fe
testb %bpl, %bpl
je 0x62fc
negl %r14d
cmpl %r14d, %eax
jle 0x62fc
movl $0x1, %eax
movl %r14d, %ecx
shlq %cl, %rax
shrl $0x6, %r14d
orq %rax, (%rbx,%r14,8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_init
void hash_init(struct hashtable_t *hash)
{
	int i;

	hash->elements = 0;

	for (i = 0; i < hash->size; i++)
		hash->table[i] = NULL;
}

// Assembly:
movl $0x0, 0x8(%rdi)
movslq 0xc(%rdi), %rax
testq %rax, %rax
jle 0x6375
xorl %ecx, %ecx
movq (%rdi), %rdx
movq $0x0, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x6362
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_delete
void hash_delete(struct hashtable_t *hash, hashdata_free_cb free_cb)
{
	struct element_t *bucket, *last_bucket;
	int i;

	for (i = 0; i < hash->size; i++) {

		bucket = hash->table[i];
		while (bucket != NULL) {

			if (free_cb != NULL)
				free_cb(bucket->data);

			last_bucket = bucket;
			bucket = bucket->next;
			debugFree(last_bucket, 1301);

		}

	}

	hash_destroy(hash);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
jle 0x63ca
movq %rsi, %r14
xorl %r12d, %r12d
movq (%rbx), %rax
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x63be
testq %r14, %r14
je 0x63a5
movq (%r15), %rdi
callq *%r14
movq 0x8(%r15), %r13
movq %r15, %rdi
movl $0x515, %esi            # imm = 0x515
callq 0x5f5b
movq %r13, %r15
testq %r13, %r13
jne 0x639a
incq %r12
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jl 0x638e
movq (%rbx), %rdi
movl $0x516, %esi            # imm = 0x516
callq 0x5f5b
movq %rbx, %rdi
movl $0x517, %esi            # imm = 0x517
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5f5b
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_new
struct hashtable_t *hash_new(int size, hashdata_compare_cb compare,
			     hashdata_choose_cb choose)
{
	struct hashtable_t *hash;

	hash = debugMalloc(sizeof(struct hashtable_t), 302);
	if (!hash)
		return NULL;

	hash->size = size;
	hash->table = debugMalloc(sizeof(struct element_t *)*size, 303);

	if (!hash->table) {
		debugFree(hash, 1305);
		return NULL;
	}

	hash_init(hash);
	hash->compare = compare;
	hash->choose = choose;
	return hash;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movl $0x20, %edi
movl $0x12e, %esi            # imm = 0x12E
callq 0x5d3e
testq %rax, %rax
je 0x6594
movq %rax, %rbx
movl %ebp, 0xc(%rax)
shll $0x3, %ebp
movl %ebp, %edi
movl $0x12f, %esi            # imm = 0x12F
callq 0x5d3e
movq %rax, (%rbx)
testq %rax, %rax
je 0x6587
movl $0x0, 0x8(%rbx)
movslq 0xc(%rbx), %rax
testq %rax, %rax
jle 0x657d
xorl %ecx, %ecx
movq (%rbx), %rdx
movq $0x0, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x656a
movq %r15, 0x10(%rbx)
movq %r14, 0x18(%rbx)
jmp 0x6596
movq %rbx, %rdi
movl $0x519, %esi            # imm = 0x519
callq 0x5f5b
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_add
int hash_add(struct hashtable_t *hash, void *data)
{
	int ret;
	struct element_t *bucket;

	/* found the tail of the list, add new element */
	bucket = debugMalloc(sizeof(struct element_t), 304);

	if (!bucket)
		return -1;

	ret = hash_add_bucket(hash, data, bucket, 1);
	if (ret < 0)
		debugFree(bucket, 1307);

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl $0x10, %edi
movl $0x130, %esi            # imm = 0x130
callq 0x5d3e
testq %rax, %rax
je 0x65ee
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movl $0x1, %ecx
callq 0x65fb
movl %eax, %ebx
testl %eax, %eax
jns 0x65f3
movq %r14, %rdi
movl $0x51b, %esi            # imm = 0x51B
callq 0x5f5b
jmp 0x65f3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_add_bucket
static int hash_add_bucket(struct hashtable_t *hash, void *data,
			   struct element_t *bucket, int check_duplicate)
{
	int index;
	struct element_t *bucket_it, *prev_bucket = NULL;

	index = hash->choose(data, hash->size);
	bucket_it = hash->table[index];

	while (bucket_it != NULL) {
		if (check_duplicate &&
		    hash->compare(bucket_it->data, data))
			return -1;

		prev_bucket = bucket_it;
		bucket_it = bucket_it->next;
	}

	/* init the new bucket */
	bucket->data = data;
	bucket->next = NULL;

	/* and link it */
	if (prev_bucket == NULL)
		hash->table[index] = bucket;
	else
		prev_bucket->next = bucket;

	hash->elements++;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0xc(%rdi), %esi
movq %r15, %rdi
callq *0x18(%r14)
movq (%r14), %rcx
movslq %eax, %r12
movq (%rcx,%r12,8), %rax
testq %rax, %rax
je 0x664b
movq %rax, %r13
testl %ebp, %ebp
je 0x6640
movq (%r13), %rdi
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
jne 0x667a
movq 0x8(%r13), %rax
testq %rax, %rax
jne 0x662a
jmp 0x664e
xorl %r13d, %r13d
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
testq %r13, %r13
je 0x6667
addq $0x8, %r13
movq %r13, %r12
jmp 0x666e
shlq $0x3, %r12
addq (%r14), %r12
movq %rbx, (%r12)
incl 0x8(%r14)
xorl %eax, %eax
jmp 0x667f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_find
void *hash_find(struct hashtable_t *hash, void *keydata)
{
	int index;
	struct element_t *bucket;

	index = hash->choose(keydata , hash->size);
	bucket = hash->table[index];

	while (bucket != NULL) {
		if (hash->compare(bucket->data, keydata))
			return bucket->data;

		bucket = bucket->next;
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %esi
movq %rbx, %rdi
callq *0x18(%r14)
movq (%r14), %rcx
cltq
movq (%rcx,%rax,8), %r12
xorl %r15d, %r15d
testq %r12, %r12
je 0x66d1
movq (%r12), %rdi
movq %rbx, %rsi
callq *0x10(%r14)
testl %eax, %eax
jne 0x66cd
movq 0x8(%r12), %r12
jmp 0x66b2
movq (%r12), %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_remove_bucket
void *hash_remove_bucket(struct hashtable_t *hash, struct hash_it_t *hash_it_t)
{
	void *data_save;

	/* save the pointer to the data */
	data_save = hash_it_t->bucket->data;

	if (hash_it_t->prev_bucket != NULL)
		hash_it_t->prev_bucket->next = hash_it_t->bucket->next;
	else if (hash_it_t->first_bucket != NULL)
		(*hash_it_t->first_bucket) = hash_it_t->bucket->next;

	debugFree(hash_it_t->bucket, 1306);

	hash->elements--;
	return data_save;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rcx
movq (%rax), %r14
testq %rcx, %rcx
je 0x6701
movq 0x8(%rax), %rax
movq %rax, 0x8(%rcx)
jmp 0x6711
movq 0x18(%rsi), %rcx
testq %rcx, %rcx
je 0x6711
movq 0x8(%rax), %rax
movq %rax, (%rcx)
movq 0x8(%rsi), %rdi
movl $0x51a, %esi            # imm = 0x51A
callq 0x5f5b
decl 0x8(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_remove
void *hash_remove(struct hashtable_t *hash, void *data)
{
	struct hash_it_t hash_it_t;

	hash_it_t.index = hash->choose(data, hash->size);
	hash_it_t.bucket = hash->table[hash_it_t.index];
	hash_it_t.prev_bucket = NULL;

	while (hash_it_t.bucket != NULL) {
		if (hash->compare(hash_it_t.bucket->data, data)) {
			int bucket_same;
			bucket_same = (hash_it_t.bucket ==
				       hash->table[hash_it_t.index]);
			hash_it_t.first_bucket = (bucket_same ?
						  &hash->table[hash_it_t.index] :
						  NULL);
			return hash_remove_bucket(hash, &hash_it_t);
		}

		hash_it_t.prev_bucket = hash_it_t.bucket;
		hash_it_t.bucket = hash_it_t.bucket->next;
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rdi), %esi
movq %r14, %rdi
callq *0x18(%rbx)
movl %eax, (%rsp)
movq (%rbx), %rcx
movslq %eax, %r12
movq (%rcx,%r12,8), %r15
movq %r15, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
testq %r15, %r15
je 0x677a
movq (%r15), %rdi
movq %r14, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x678b
xorl %ecx, %ecx
jmp 0x67aa
xorl %r13d, %r13d
movq %r15, 0x8(%rsp)
movq %r13, 0x10(%rsp)
xorl %eax, %eax
jmp 0x67d1
movq %r15, %r13
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x677d
movq (%r15), %rdi
movq %r14, %rsi
callq *0x10(%rbx)
movq %r13, %rcx
movq %r15, %r13
testl %eax, %eax
je 0x678e
movq %rsp, %rsi
movq %r15, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movq (%rbx), %rax
leaq (%rax,%r12,8), %rax
xorl %ecx, %ecx
cmpq (%rax), %r15
cmoveq %rax, %rcx
movq %rcx, 0x18(%rsi)
movq %rbx, %rdi
callq 0x66e0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hash.c
// Function: hash_resize
struct hashtable_t *hash_resize(struct hashtable_t *hash, int size)
{
	struct hashtable_t *new_hash;
	struct element_t *bucket;
	int i;

	/* initialize a new hash with the new size */
	new_hash = hash_new(size, hash->compare, hash->choose);
	if (!new_hash)
		return NULL;

	/* copy the elements */
	for (i = 0; i < hash->size; i++) {
		while (hash->table[i]) {
			bucket = hash->table[i];
			hash->table[i] = bucket->next;
			hash_add_bucket(new_hash, bucket->data, bucket, 0);
		}
	}
	/* remove hash and eventual overflow buckets but not the
	 * content itself. */
	hash_delete(hash, NULL);
	return new_hash;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %eax
movq %rdi, %r14
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rdx
movl %eax, %edi
callq 0x6518
testq %rax, %rax
je 0x6855
movq %rax, %rbx
cmpl $0x0, 0xc(%r14)
jle 0x6849
xorl %r15d, %r15d
movq (%r14), %rax
movq (%rax,%r15,8), %rdx
testq %rdx, %rdx
je 0x683d
leaq (%rax,%r15,8), %rax
movq 0x8(%rdx), %rcx
movq %rcx, (%rax)
movq (%rdx), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x65fb
movq (%r14), %rax
leaq (%rax,%r15,8), %rax
movq (%rax), %rdx
testq %rdx, %rdx
jne 0x681a
incq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jl 0x680a
movq %r14, %rdi
xorl %esi, %esi
callq 0x6376
jmp 0x6857
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq