LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: ListSymbols
void ListSymbols(FILE *lf, int n, int lb, int ub)
{
   int i,j,l;
   char A;

   if (!ListOn) return;
   for (i=0 ; i < n && i < Labels; ++i)
   if (lab[i].Address >= lb && lab[i].Address <= ub)
   {
      fprintf(lf,"%-30.30s $%4.4x",lab[i].Name,lab[i].Address);
      if (lab[i].Locked) fprintf(lf," L");
      else               fprintf(lf,"  ");
      for (j=0 ; j <= lab[i].NumRef ; ++j)
      {
         if (j > 0 && (j % 5) == 0)
         fprintf(lf,"\n                                    ");
         fprintf(lf,"%6d",lab[i].Ref[j]);
         l = lab[i].Att[j];
         if (l == LDEF || l == LBSS || l == LPOS) A = 'D';
         else  A = ' ';
         if ((A != ' ' || (j % 5) != 4) && j != lab[i].NumRef)
            fprintf(lf,"%c",A);
      }
      fprintf(lf,"\n");
   }
}

// Assembly:
cmpl $0x0, 0x80b8(%rip)      # 0x111b8
je 0x9287
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r8d
movq %rdi, %r14
movslq %esi, %r9
movl 0x1b911(%rip), %eax     # 0x24a34
leaq 0x1b916(%rip), %r10     # 0x24a40
leaq 0x3517(%rip), %rbx      # 0xc648
pushq $0x44
popq %r13
xorl %r11d, %r11d
movl %ecx, 0x4(%rsp)
movl %edx, (%rsp)
movq %r9, 0x8(%rsp)
cmpq %r9, %r11
jge 0x9279
movslq %eax, %rcx
cmpq %rcx, %r11
jge 0x9279
imulq $0x30, %r11, %r15
movl 0xc(%r15,%r10), %ecx
cmpl %edx, %ecx
setl %dil
cmpl %r8d, %ecx
setg %sil
orb %dil, %sil
jne 0x9271
movq %r11, 0x10(%rsp)
addq %r10, %r15
movq (%r15), %rdx
movq %r14, %rdi
leaq 0x3482(%rip), %rsi      # 0xc60f
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0x14(%r15)
leaq 0x347f(%rip), %rdi      # 0xc61f
leaq 0x349e(%rip), %rax      # 0xc645
cmoveq %rax, %rdi
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2300
xorl %ebp, %ebp
movl %ebp, %eax
xorl %edx, %edx
pushq $0x5
popq %rcx
divl %ecx
movslq 0x18(%r15), %rcx
cmpq %rcx, %rbp
jg 0x9247
imull $-0x5, %eax, %r12d
testq %rbp, %rbp
je 0x91f3
leaq (%r12,%rbp), %rax
testl %eax, %eax
jne 0x91f3
leaq 0x343d(%rip), %rdi      # 0xc622
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x2300
addq %rbp, %r12
addq $-0x4, %r12
movq 0x20(%r15), %rax
movl (%rax,%rbp,4), %edx
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2210
movq 0x28(%r15), %rax
movl (%rax,%rbp,4), %eax
addl $-0x4, %eax
cmpl $-0x3, %eax
movl %r13d, %edi
pushq $0x20
popq %rcx
cmovbl %ecx, %edi
testl %r12d, %r12d
jne 0x922e
cmpl $-0x3, %eax
jb 0x923f
movl 0x18(%r15), %eax
cmpq %rax, %rbp
je 0x923f
movq %r14, %rsi
callq 0x21a0
incq %rbp
jmp 0x91bb
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x21a0
movl 0x1b7dc(%rip), %eax     # 0x24a34
movl 0x4(%rsp), %r8d
movl (%rsp), %edx
movq 0x8(%rsp), %r9
leaq 0x1b7d4(%rip), %r10     # 0x24a40
movq 0x10(%rsp), %r11
incq %r11
jmp 0x9144
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: PrintSymbols
void PrintSymbols(void)
{
   int i;

   fprintf(yf,"%5d\n",Labels);
   for (i=0 ; i < Labels; ++i)
   {
      if (lab[i].Type == 0) lab[i].Type = ' ';
      fprintf(yf,"%c %4.4x %s\n",lab[i].Type,lab[i].Address,lab[i].Name);
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x7ddbc(%rip), %rdi     # 0x87050
movl 0x1b79a(%rip), %edx     # 0x24a34
leaq 0x2e2e(%rip), %rsi      # 0xc0cf
xorl %eax, %eax
callq 0x2210
leaq 0x1b79d(%rip), %r14     # 0x24a4c
leaq 0x3396(%rip), %rbx      # 0xc64c
xorl %r15d, %r15d
movslq 0x1b774(%rip), %rax     # 0x24a34
cmpq %rax, %r15
jge 0x92f8
movb -0x4(%r14), %al
testb %al, %al
jne 0x92d4
movb $0x20, -0x4(%r14)
movb $0x20, %al
movq 0x7dd75(%rip), %rdi     # 0x87050
movsbl %al, %edx
movl (%r14), %ecx
movq -0xc(%r14), %r8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2210
incq %r15
addq $0x30, %r14
jmp 0x92b9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: ListUndefinedSymbols
void ListUndefinedSymbols(void)
{
   int i;

   for (i=0 ; i < Labels ; ++i)
   {
      if (lab[i].Address == UNDEF)
      {
         printf("* Undefined   : %-25.25s *\n",lab[i].Name);
         ++ErrNum;
      }
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x1b736(%rip), %r14     # 0x24a40
movl 0x1b724(%rip), %eax     # 0x24a34
leaq 0x3342(%rip), %rbx      # 0xc659
xorl %r15d, %r15d
movslq %eax, %rcx
cmpq %rcx, %r15
jge 0x934e
cmpl $0xff0000, 0xc(%r14)    # imm = 0xFF0000
jne 0x9345
movq (%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2130
incl 0x1b6ed(%rip)           # 0x24a2c
movl 0x1b6ef(%rip), %eax     # 0x24a34
incq %r15
addq $0x30, %r14
jmp 0x931a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: CmpRefs
int CmpRefs( const void *arg1, const void *arg2 )
{
   struct LabelStruct *Label1;
   struct LabelStruct *Label2;

   Label1 = (struct LabelStruct *) arg1;
   Label2 = (struct LabelStruct *) arg2;

   if (Label1->NumRef == Label2->NumRef)
   {
      if (Label1->Address < Label2->Address) return  1;
      if (Label1->Address > Label2->Address) return -1;
      return 0;
   }
   if (Label1->NumRef  < Label2->NumRef) return 1;
   return -1;
}

// Assembly:
movl 0x18(%rsi), %eax
cmpl %eax, 0x18(%rdi)
jne 0x937d
movl 0xc(%rsi), %eax
cmpl %eax, 0xc(%rdi)
jge 0x938b
pushq $0x1
popq %rax
retq
setl %al
movzbl %al, %eax
leal -0x1(,%rax,2), %eax
retq
setg %al
movzbl %al, %eax
negl %eax
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: WriteBinaryFormat
void WriteBinaryFormat(int i)
{
    unsigned char lo,hi;
    FILE *bf;
    const char *msg = "Write binary";

    if (df) fprintf(df,"Storing $%4.4x - $%4.4x <%s>\n",
                    SFA[i],SFA[i]+SFL[i],SFF[i]);
    bf = AssertFileOp(fopen(SFF[i],"wb"), msg);
    if (SFE[i] > -1)
    {
       lo = SFA[i] & 0xff;
       hi = SFA[i]  >>  8;
       if (fwrite(&hi,1,1,bf) < 1) AssertFileOp(NULL, msg);
       if (fwrite(&lo,1,1,bf) < 1) AssertFileOp(NULL, msg);
    }
    if (fwrite(ROM+SFA[i],1,SFL[i],bf) < (size_t)SFL[i]) AssertFileOp(NULL, msg);
    if (fclose(bf)) AssertFileOp(NULL, msg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %eax
movq 0x1b66a(%rip), %rdi     # 0x24a10
movslq %eax, %r14
testq %rdi, %rdi
je 0x93df
leaq 0x7aecb(%rip), %rax     # 0x84280
movl (%rax,%r14,4), %edx
leaq 0x7af10(%rip), %rax     # 0x842d0
movl (%rax,%r14,4), %ecx
addl %edx, %ecx
leaq 0x7afa3(%rip), %rax     # 0x84370
movq (%rax,%r14,8), %r8
leaq 0x32aa(%rip), %rsi      # 0xc682
xorl %eax, %eax
callq 0x2210
leaq 0x7af8a(%rip), %rax     # 0x84370
movq (%rax,%r14,8), %rdi
leaq 0x32af(%rip), %rsi      # 0xc6a0
callq 0x22b0
movq %rax, %rbx
leaq 0x3275(%rip), %rsi      # 0xc675
movq %rax, %rdi
callq 0x2575
leaq 0x7af11(%rip), %rax     # 0x84320
cmpl $0x0, (%rax,%r14,4)
js 0x9475
leaq 0x7ae63(%rip), %rax     # 0x84280
movl (%rax,%r14,4), %eax
movb %al, 0xf(%rsp)
movb %ah, 0xe(%rsp)
leaq 0xe(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rdx, %rsi
movq %rbx, %rcx
callq 0x2300
testq %rax, %rax
jne 0x944f
leaq 0x322d(%rip), %rsi      # 0xc675
xorl %edi, %edi
callq 0x2575
leaq 0xf(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rdx, %rsi
movq %rbx, %rcx
callq 0x2300
testq %rax, %rax
jne 0x9475
leaq 0x3207(%rip), %rsi      # 0xc675
xorl %edi, %edi
callq 0x2575
leaq 0x7ae04(%rip), %rax     # 0x84280
movslq (%rax,%r14,4), %rax
leaq 0xa7c9(%rip), %rdi      # 0x13c50
addq %rax, %rdi
leaq 0x7ae3f(%rip), %r15     # 0x842d0
movslq (%r15,%r14,4), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x2300
movslq (%r15,%r14,4), %rcx
cmpq %rcx, %rax
jae 0x94b7
leaq 0x31c5(%rip), %rsi      # 0xc675
xorl %edi, %edi
callq 0x2575
movq %rbx, %rdi
callq 0x2100
testl %eax, %eax
je 0x94da
leaq 0x31ab(%rip), %rsi      # 0xc675
xorl %edi, %edi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2575
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: Checksum
int Checksum(int start, int n)
{
   int sum = 0;
   int i;
   for (i=start ; i < start+n-1 ; i+=2)
      sum += (ROM[i] << 8) | ROM[i+1];
   return sum & 0xffff;
}

// Assembly:
leal (%rdi,%rsi), %eax
decl %eax
movslq %edi, %rcx
movslq %eax, %rdx
xorl %eax, %eax
leaq 0xa758(%rip), %rsi      # 0x13c50
cmpq %rdx, %rcx
jge 0x9510
movzwl (%rcx,%rsi), %edi
rolw $0x8, %di
movzwl %di, %edi
addl %edi, %eax
addq $0x2, %rcx
jmp 0x94f8
movzwl %ax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: WriteSparrowFormat
void WriteSparrowFormat(int i)
{
    int Start,Length,Check;
    unsigned char Head[8];
    FILE *bf;
    const char *msg = "Write Sparrow binary";

    Start  = SFA[i];
    Length = SFL[i];
    Check  = Checksum(Start,Length);

    if (df) fprintf(df,"Storing $%4.4x - $%4.4x <%s>\n",
                    Start,Start+Length-1,SFF[i]);
    Head[0] = 'S';
    Head[1] =  Start  >> 16;
    Head[2] = (Start  >>  8) & 0xff;
    Head[3] = (Start       ) & 0xff;
    Head[4] = Length  >>  8;
    Head[5] = Length  & 0xff;
    Head[6] = Check   >>  8;
    Head[7] = Check   & 0xff;

    bf = AssertFileOp(fopen(SFF[i],"wb"), msg);
    if (fwrite(Head,1,8,bf) < 8) AssertFileOp(NULL, msg);
    if (fwrite(ROM+Start,1,Length,bf) < (size_t)Length) AssertFileOp(NULL, msg);
    if (fclose(bf)) AssertFileOp(NULL, msg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %edi, %r15
leaq 0x7ad57(%rip), %rax     # 0x84280
movl (%rax,%r15,4), %ebx
movslq %ebx, %r14
leaq 0x7ad99(%rip), %rax     # 0x842d0
movl (%rax,%r15,4), %r12d
movslq %r12d, %rsi
movl %r14d, %edi
movq %rsi, %r13
callq 0x94e4
movq 0x1b4c0(%rip), %rdi     # 0x24a10
testq %rdi, %rdi
je 0x957a
movl %eax, %ebp
leal (%rbx,%r12), %ecx
decl %ecx
leaq 0x7ae0c(%rip), %rax     # 0x84370
movq (%rax,%r15,8), %r8
leaq 0x3113(%rip), %rsi      # 0xc682
movl %ebx, %edx
xorl %eax, %eax
callq 0x2210
movl %ebp, %eax
movq %rsp, %r12
movb $0x53, (%r12)
movl %ebx, %ecx
shrl $0x10, %ecx
movb %cl, 0x1(%r12)
movb %bh, 0x2(%rsp)
movb %r14b, 0x3(%r12)
movq %r13, %rbx
movb %bh, 0x4(%rsp)
movb %bl, 0x5(%r12)
movb %ah, 0x6(%rsp)
movb %al, 0x7(%r12)
leaq 0x7adbf(%rip), %rax     # 0x84370
movq (%rax,%r15,8), %rdi
leaq 0x30e4(%rip), %rsi      # 0xc6a0
callq 0x22b0
movq %rax, %r15
leaq 0x30d8(%rip), %rsi      # 0xc6a3
movq %rax, %rdi
callq 0x2575
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
movq %r12, %rdi
movq %r15, %rcx
callq 0x2300
cmpq $0x7, %rax
ja 0x95f8
leaq 0x30b2(%rip), %rsi      # 0xc6a3
xorl %edi, %edi
callq 0x2575
leaq 0xa651(%rip), %rdi      # 0x13c50
addq %r14, %rdi
pushq $0x1
popq %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x2300
cmpq %rbx, %rax
jae 0x9623
leaq 0x3087(%rip), %rsi      # 0xc6a3
xorl %edi, %edi
callq 0x2575
movq %r15, %rdi
callq 0x2100
testl %eax, %eax
je 0x964b
leaq 0x306d(%rip), %rsi      # 0xc6a3
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2575
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: WriteS19Line
void WriteS19Line(FILE *bf, const char *RecordType, int PayloadSize, int Address, unsigned char *Data)
{
   int i,Checksum;
   const char *msg = "Write S19 record";

   fprintf(bf, "%s", RecordType);
   // 3 extra bytes for address and checksum
   Checksum = PayloadSize + 3 + (Address & 0xff) + (Address >> 8);
   fprintf(bf, "%02X%04X", PayloadSize + 3, Address);
   if (ferror(bf)) AssertFileOp(NULL, msg);
   for (i=0; i < PayloadSize; ++i)
   {
      fprintf(bf, "%02X", Data[i]);
      if (ferror(bf)) AssertFileOp(NULL, msg);
      Checksum += Data[i];
   }
   // Force CR LF line endings for ancient EPROM programmers
   fprintf(bf, "%02X\r\n", ~Checksum & 0xff);
   if (ferror(bf)) AssertFileOp(NULL, msg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movl %ecx, %r12d
movl %edx, %r15d
movq %rdi, %rbx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x2170
leal 0x3(%r15), %edx
leal (%r15,%r12), %ebp
addl $0x3, %ebp
movl %r12d, %r13d
sarl $0x8, %r13d
leaq 0x3034(%rip), %rsi      # 0xc6c9
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2210
movq %rbx, %rdi
callq 0x20b0
testl %eax, %eax
je 0x96bc
leaq 0x3003(%rip), %rsi      # 0xc6b8
xorl %edi, %edi
callq 0x2575
addl %r13d, %ebp
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
leaq 0x3000(%rip), %r12      # 0xc6d2
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x9712
movzbl (%r14,%r13), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2210
movq %rbx, %rdi
callq 0x20b0
testl %eax, %eax
je 0x9706
xorl %edi, %edi
leaq 0x2fb7(%rip), %rsi      # 0xc6b8
callq 0x2575
movzbl (%r14,%r13), %eax
addl %eax, %ebp
incq %r13
jmp 0x96d5
notl %ebp
movzbl %bpl, %edx
leaq 0x2fb8(%rip), %rsi      # 0xc6d7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2210
movq %rbx, %rdi
callq 0x20b0
testl %eax, %eax
je 0x9751
leaq 0x2f7c(%rip), %rsi      # 0xc6b8
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2575
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: WriteBinaries
void WriteBinaries(void)
{
   int i;

   for (i=0 ; i < StoreCount ; ++i)
   {
           if (SFT[i] == SRECORD) WriteS19Format(i);
      else if (SFT[i] == SPARROW) WriteSparrowFormat(i);
      else                        WriteBinaryFormat(i);
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7aaa3(%rip), %r14     # 0x84410
xorl %ebx, %ebx
movslq 0x1a3fa(%rip), %rax     # 0x23d70
cmpq %rax, %rbx
jge 0x99a6
movl (%r14), %eax
movl %ebx, %edi
cmpl $0x2, %eax
je 0x9991
cmpl $0x1, %eax
jne 0x9998
callq 0x9760
jmp 0x999d
callq 0x9514
jmp 0x999d
callq 0x9394
incq %rbx
addq $0x4, %r14
jmp 0x996f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Edilbert[P]BS9/bs9.c
// Function: usage
void usage(void)
{
   printf("Usage: bs9 [options] <source>\n");
   printf("Options:\n");
   printf("   -d print details in file <Debug.lst>\n");
   printf("   -D Define symbols\n");
   printf("   -i ignore case in symbols\n");
   printf("   -I include path\n");
   printf("   -h display this usage\n");
   printf("   -l preset value for memory\n");
   printf("   -m Motorola codestyle: blank = field separator\n");
   printf("   -n include line numbers in listing\n");
   printf("   -o optimize long branches and jumps\n");
   printf("   -p print preprocessed source\n");
   printf("   -q quiet mode\n");
   printf("   -x assemble listing file - skip hex in front\n");
   exit(1);
}

// Assembly:
pushq %rax
leaq 0x3064(%rip), %rdi      # 0xca32
callq 0x20a0
leaq 0x3076(%rip), %rdi      # 0xca50
callq 0x20a0
leaq 0x3073(%rip), %rdi      # 0xca59
callq 0x20a0
leaq 0x308f(%rip), %rdi      # 0xca81
callq 0x20a0
leaq 0x3098(%rip), %rdi      # 0xca96
callq 0x20a0
leaq 0x30a9(%rip), %rdi      # 0xcab3
callq 0x20a0
leaq 0x30b0(%rip), %rdi      # 0xcac6
callq 0x20a0
leaq 0x30bd(%rip), %rdi      # 0xcadf
callq 0x20a0
leaq 0x30cf(%rip), %rdi      # 0xcafd
callq 0x20a0
leaq 0x30f5(%rip), %rdi      # 0xcb2f
callq 0x20a0
leaq 0x310f(%rip), %rdi      # 0xcb55
callq 0x20a0
leaq 0x312a(%rip), %rdi      # 0xcb7c
callq 0x20a0
leaq 0x313e(%rip), %rdi      # 0xcb9c
callq 0x20a0
leaq 0x3143(%rip), %rdi      # 0xcbad
callq 0x20a0
pushq $0x1
popq %rdi
callq 0x22f0
// File: /workspace/github_c_makefile_star2_O2/mulle-nat[P]long-long-double-trouble/long-long.c
// Function: main
int   main( int argc, char *argv[])
{
   double  value;

   fprintf( stderr, "long-long (%d bytes): %lld - %lld\n", (int) sizeof( long long), LLONG_MIN, LLONG_MAX);
   fprintf( stderr, "double (%d bytes): %g - %g\n", (int) sizeof( double), DBL_MIN, DBL_MAX);

   assert( (double) LLONG_MAX <= DBL_MAX);

   // keep my code optimiza
   if( argc == 1)
      value = (double) LLONG_MAX;
   else
      value = (double) (LLONG_MAX - atoi( argv[ 1]));

   if( fits_llong( value))
      printf( "FITS\n");
   else
      printf( "NOPE\n");
   return( 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movabsq $0x7fffffffffffffff, %rbx # imm = 0x7FFFFFFFFFFFFFFF
movq 0x2e32(%rip), %r12      # 0x3ff8
movq (%r12), %rdi
leaq 0x1(%rbx), %rcx
leaq 0xe7a(%rip), %rsi       # 0x204f
pushq $0x8
popq %r15
movl %r15d, %edx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1040
movq (%r12), %rdi
leaq 0xe81(%rip), %rsi       # 0x2072
movsd 0xe2f(%rip), %xmm0      # 0x2028
movsd 0xe2f(%rip), %xmm1      # 0x2030
movl %r15d, %edx
movb $0x2, %al
callq 0x1040
cmpl $0x1, %ebp
jne 0x121a
movsd 0xe08(%rip), %xmm0      # 0x2020
jmp 0x122d
movq 0x8(%r14), %rdi
callq 0x1050
cltq
subq %rax, %rbx
cvtsi2sd %rbx, %xmm0
callq 0x115c
testl %eax, %eax
leaq 0xe53(%rip), %rax       # 0x208e
leaq 0xe51(%rip), %rdi       # 0x2093
cmoveq %rax, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/arena.c
// Function: mem
char	*mem(char *ptr, int idx, t_arena *arena, t_process *process)
{
	int	temp;

	temp = ptr - process->pc;
	temp %= MEM_SIZE;
	if (idx)
		temp %= IDX_MOD;
	if (process->pc + temp < arena->memory)
		return (process->pc + temp + MEM_SIZE);
	if (process->pc + temp >= arena->memory + MEM_SIZE)
		return (process->pc + temp - MEM_SIZE);
	return (process->pc + temp);
}

// Assembly:
movq %rdx, %r8
movq %rdi, %rax
movq 0x48(%rcx), %rdi
subl %edi, %eax
movl $0x1000, %ecx           # imm = 0x1000
cltd
idivl %ecx
movl %edx, %ecx
movw $0x200, %r9w            # imm = 0x200
movl %ecx, %eax
cwtd
idivw %r9w
testl %esi, %esi
movswl %dx, %eax
cmovel %ecx, %eax
movslq %eax, %rcx
addq %rdi, %rcx
movq (%r8), %rdx
movl $0x1000, %esi           # imm = 0x1000
leaq (%rdx,%rsi), %rdi
xorl %eax, %eax
cmpq %rdi, %rcx
setb %al
shll $0xc, %eax
addq $-0x1000, %rax          # imm = 0xF000
cmpq %rdx, %rcx
cmovbq %rsi, %rax
addq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/arena.c
// Function: create_arena
t_arena	*create_arena(void)
{
	char	*memory;
	t_arena	*new;

	new = (t_arena *)ft_memalloc(sizeof(t_arena));
	memory = (char *)ft_memalloc(MEM_SIZE);
	new->memory = memory;
	new->players = NULL;
	new->cycle = 1;
	new->cycle_to_die = CYCLE_TO_DIE;
	new->last_check_cycle = 0;
	new->print_lives = 0;
	new->checks_without_decrement = 0;
	new->processes = NULL;
	new->dump_cycle = -1;
	new->display = NULL;
	return (new);
}

// Assembly:
pushq %rbx
pushq $0x38
popq %rdi
callq 0x51a0
movq %rax, %rbx
movl $0x1000, %edi           # imm = 0x1000
callq 0x51a0
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movsd 0x4c85(%rip), %xmm0     # 0x7010
movups %xmm0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/arena.c
// Function: display_champions
void	display_champions(t_arena *arena)
{
	t_player	*i;

	ft_putendl("Introducing contestants...");
	i = arena->players;
	while (i != NULL)
	{
		ft_printf("* Player %d, weighing %d bytes, \"%s\" (\"%s\") !\n",
				i->id, i->champ_size, i->name, i->comment);
		i = i->next;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4c6e(%rip), %rdi      # 0x7020
callq 0x51ec
addq $0x8, %rbx
leaq 0x4c79(%rip), %r14      # 0x703b
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x23e7
movl (%rbx), %esi
movl 0x20(%rbx), %edx
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r8
movq %r14, %rdi
xorl %eax, %eax
callq 0x527c
addq $0x38, %rbx
jmp 0x23c2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/arena.c
// Function: dump_memory
void	dump_memory(t_arena *arena)
{
	int			i;
	t_process	*p;

	p = arena->processes;
	ft_printf("\nDumping memory at cycle %d (%d processus):",
			arena->cycle, arena->processes->number);
	i = 0;
	while (i < MEM_SIZE)
	{
		p = arena->processes;
		if (i % 32 == 0 && i != MEM_SIZE - 1)
			ft_printf("\n%0#6x : ", i);
		ft_printf("%02x ", (unsigned char)arena->memory[i]);
		i++;
	}
	ft_putchar('\n');
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %esi
movq 0x28(%rdi), %rax
movl 0x5c(%rax), %edx
leaq 0x4c5f(%rip), %rdi      # 0x706a
xorl %eax, %eax
callq 0x527c
leaq 0x4c7d(%rip), %r14      # 0x7096
leaq 0x4c80(%rip), %r15      # 0x70a0
xorl %r12d, %r12d
cmpq $0x1000, %r12           # imm = 0x1000
je 0x2456
testb $0x1f, %r12b
jne 0x243f
movq %r14, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x527c
movq (%rbx), %rax
movzbl (%rax,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x527c
incq %r12
jmp 0x2423
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51d4
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/arena.c
// Function: destroy_arena
void	destroy_arena(t_arena *arena)
{
	if (arena->display != NULL)
		destroy_display(arena);
	while (arena->processes != NULL)
		kill_process(arena->processes);
	free_players(arena);
	free(arena->memory);
	free(arena);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x30(%rdi)
je 0x2483
movq %rbx, %rdi
callq 0x47c3
jmp 0x2483
callq 0x280b
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
jne 0x247e
movq %rbx, %rdi
callq 0x26b3
movq (%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/player.c
// Function: save_players
void			save_players(int ac, char **av, t_arena *arena)
{
	int			player_id;
	int			attempt;

	while (ac-- > 0)
	{
		player_id = 1;
		if (ft_strcmp("-n", av[0]) == 0)
		{
			check_player(av[1]);
			attempt = ft_atoi(av[1]);
			av += 2;
			ac -= 2;
			if (is_free_player_id(attempt, arena->players, ac, av))
				player_id = attempt;
		}
		else
			while (!is_free_player_id(player_id, arena->players, ac, av))
				player_id++;
		create_player(player_id, arena, av[0]);
		av++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
pushq $0x40
popq %r12
testl %ebp, %ebp
jle 0x2589
movq (%r14), %rsi
leaq 0x4bd5(%rip), %rdi      # 0x70a6
callq 0x5100
testl %eax, %eax
je 0x24f9
decl %ebp
xorl %r13d, %r13d
incl %r13d
movq 0x8(%rbx), %rsi
movl %r13d, %edi
movl %ebp, %edx
movq %r14, %rcx
callq 0x2598
testl %eax, %eax
je 0x24df
jmp 0x252e
movq 0x8(%r14), %rdi
callq 0x45ac
movq 0x8(%r14), %rdi
callq 0x511c
movl %eax, %r13d
addq $0x10, %r14
addl $-0x3, %ebp
movq 0x8(%rbx), %rsi
movl %eax, %edi
movl %ebp, %edx
movq %r14, %rcx
callq 0x2598
testl %eax, %eax
pushq $0x1
popq %rax
cmovel %eax, %r13d
movq (%r14), %r15
movq %r12, %rdi
callq 0x51a0
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0x256c
cmpl %r13d, (%rcx)
jle 0x2551
movq %rcx, 0x38(%rax)
movq %rax, 0x8(%rbx)
jmp 0x2575
movq %rcx, %rdx
movq 0x38(%rcx), %rcx
testq %rcx, %rcx
je 0x2562
cmpl %r13d, (%rcx)
jl 0x2551
movq %rcx, 0x38(%rax)
movq %rax, 0x38(%rdx)
jmp 0x2575
movq %rax, 0x8(%rbx)
andq $0x0, 0x38(%rax)
movl %r13d, (%rax)
andl $0x0, 0x30(%rax)
movq %r15, 0x18(%rax)
addq $0x8, %r14
jmp 0x24bf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/player.c
// Function: is_free_player_id
static int		is_free_player_id(int id, t_player *p, int ac, char **av)
{
	if (id < 1)
		return (0);
	ac--;
	av++;
	while (p != NULL)
	{
		if (p->id == id)
			return (0);
		p = p->next;
	}
	while (ac-- > 0)
	{
		if (ft_strcmp("-n", av[0]) == 0)
		{
			if (ft_atoi(av[1]) == id)
				return (0);
			av += 2;
			ac -= 2;
		}
		av++;
	}
	return (1);
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
jle 0x2622
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movl %edx, %r15d
movl %edi, %ebp
decl %r15d
testq %rsi, %rsi
je 0x25c7
cmpl %ebp, (%rsi)
je 0x2614
movq 0x38(%rsi), %rsi
jmp 0x25b8
leaq 0x4ad8(%rip), %r12      # 0x70a6
testl %r15d, %r15d
jle 0x260d
movq %r13, %r14
movl %r15d, %ebx
addq $0x8, %r13
leal -0x1(%rbx), %r15d
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x5100
testl %eax, %eax
jne 0x25ce
movq 0x10(%r14), %rdi
callq 0x511c
cmpl %ebp, %eax
je 0x2612
addq $0x18, %r14
addl $-0x3, %ebx
movl %ebx, %r15d
movq %r14, %r13
jmp 0x25ce
pushq $0x1
popq %rax
jmp 0x2614
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/player.c
// Function: load_players
void			load_players(t_arena *arena)
{
	t_player	*i;
	int			n;
	int			total;

	total = 0;
	i = arena->players;
	while (i != NULL)
	{
		total++;
		i = i->next;
	}
	if (total < 1 || total > MAX_PLAYERS)
	{
		ft_putendl("Error : too many players");
		exit(1);
	}
	i = arena->players;
	n = 0;
	while (i != NULL)
	{
		i->begin = (arena->memory + n++ * MEM_SIZE / total);
		get_player_code(i);
		create_process(i->id, i->begin, arena, NULL);
		i = i->next;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
xorl %r12d, %r12d
movq %r14, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x2649
incl %r12d
addq $0x38, %rax
jmp 0x2638
leal -0x5(%r12), %eax
cmpl $-0x4, %eax
jb 0x269f
xorl %r15d, %r15d
movq (%r14), %r14
testq %r14, %r14
je 0x2693
movl %r15d, %eax
xorl %edx, %edx
divl %r12d
addq (%rbx), %rax
movq %rax, 0x28(%r14)
movq %r14, %rdi
callq 0x2a5c
movl (%r14), %edi
movq 0x28(%r14), %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x276b
addq $0x38, %r14
addl $0x1000, %r15d          # imm = 0x1000
jmp 0x2656
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4a03(%rip), %rdi      # 0x70a9
callq 0x51ec
pushq $0x1
popq %rdi
callq 0x21d0
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/player.c
// Function: free_players
void			free_players(t_arena *arena)
{
	t_player	*next;
	t_player	*current;

	current = arena->players;
	while (current != NULL)
	{
		next = current->next;
		free(current->name);
		free(current->comment);
		free(current);
		current = next;
	}
	arena->players = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x26e7
movq 0x8(%r14), %rdi
movq 0x38(%r14), %r15
callq 0x2040
movq 0x10(%r14), %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2040
movq %r15, %r14
jmp 0x26bf
andq $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/process.c
// Function: create_copy_registers
void	create_copy_registers(t_process *p, t_process *parent, int player)
{
	int		i;

	i = -1;
	while (++i < REG_NUMBER)
	{
		if (parent == NULL)
		{
			if (i == 0)
				ft_write_big_endian(player, p->registers[0], REG_SIZE);
			else
				ft_bzero(p->registers[i], REG_SIZE);
		}
		else
			ft_memcpy(p->registers[i], parent->registers[i], REG_SIZE);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x4, %r14
leaq 0x4(%rsi), %r13
movslq %edx, %r15
xorl %ebp, %ebp
pushq $0x4
popq %r12
cmpq $0x40, %rbp
je 0x275c
testq %rbx, %rbx
je 0x2735
leaq (%r14,%rbp), %rdi
movq %r13, %rsi
addq %rbp, %rsi
movq %r12, %rdx
callq 0x50d4
jmp 0x2756
testq %rbp, %rbp
je 0x2748
leaq (%r14,%rbp), %rdi
movq %r12, %rsi
callq 0x50bc
jmp 0x2756
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x5210
addq $0x4, %rbp
jmp 0x2716
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/process.c
// Function: create_process
void	create_process(int player, char *pc, t_arena *arena, t_process *parent)
{
	t_process	*new;
	static int	i = 0;

	i++;
	new = (t_process*)malloc(sizeof(t_process));
	if (new == NULL)
		return ;
	new->player = player;
	new->pc = pc;
	new->carry = (parent == NULL) ? 0 : parent->carry;
	new->lives = (parent == NULL) ? 0 : parent->lives;
	new->count_lives = 0;
	new->cycles_to_wait = -1;
	new->op_code = 0;
	new->arena = arena;
	new->next = arena->processes;
	new->number = i;
	create_copy_registers(new, parent, player);
	arena->processes = new;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movl %edi, %ebp
movl 0x8c44(%rip), %r13d     # 0xb3cc
incl %r13d
movl %r13d, 0x8c3a(%rip)     # 0xb3cc
pushq $0x78
popq %rdi
callq 0x2170
testq %rax, %rax
je 0x27ee
movq %rax, %r15
movl %ebp, (%rax)
movq %r12, 0x48(%rax)
testq %r14, %r14
je 0x27b7
movb 0x50(%r14), %al
movl 0x58(%r14), %ecx
jmp 0x27bb
xorl %eax, %eax
xorl %ecx, %ecx
movb %al, 0x50(%r15)
movl %ecx, 0x58(%r15)
andq $0x0, 0x60(%r15)
orl $-0x1, 0x54(%r15)
movq %rbx, 0x68(%r15)
movq 0x28(%rbx), %rax
movq %rax, 0x70(%r15)
movl %r13d, 0x5c(%r15)
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x26f4
movq %r15, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/process.c
// Function: kill_process
void	kill_process(t_process *process)
{
	t_process	*i;

	if (process->arena->processes == process)
		process->arena->processes = process->next;
	else
	{
		i = process->arena->processes;
		while (i->next != process)
			i = i->next;
		i->next = process->next;
	}
	free(process);
}

// Assembly:
movq 0x68(%rdi), %rax
movq 0x28(%rax), %rcx
cmpq %rdi, %rcx
je 0x282a
movq %rcx, %rax
movq 0x70(%rcx), %rcx
cmpq %rdi, %rcx
jne 0x2818
addq $0x70, %rax
jmp 0x282e
addq $0x28, %rax
movq 0x70(%rdi), %rcx
movq %rcx, (%rax)
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/get_input.c
// Function: get_input
void				get_input(int fd, t_player *player, unsigned int *prog_size)
{
	int				ret;
	char			buf[BUFF_SIZE];
	int				i;

	i = 0;
	ret = 0;
	check_magic(fd, buf, ret, player);
	player->name = get_name(fd, buf, ret, i);
	*prog_size = get_prog_size(fd, buf, ret, i);
	if (*prog_size > CHAMP_MAX_SIZE)
	{
		ft_printf_fd(2,
				"Error: file %s has too large code(%d bytes > %d bytes)\n",
				player->file_name, *prog_size, CHAMP_MAX_SIZE);
		exit(1);
	}
	player->comment = get_comment(fd, buf, ret, i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, 0x8(%rsp)
movl %edi, %ebp
xorl %r14d, %r14d
leaq 0x7(%rsp), %r15
pushq $0x1
popq %r12
cmpq $0x4, %r14
je 0x28a2
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2110
cmpl $-0x1, %eax
je 0x29ea
movb 0x7(%rsp), %al
movb %al, 0x10(%rsp,%r14)
incq %r14
jmp 0x2878
cmpl $0xf383ea00, 0x10(%rsp) # imm = 0xF383EA00
jne 0x2a19
movl $0x81, %edi
callq 0x51a0
movq %rax, %r15
movb $0x0, 0x80(%rax)
xorl %r14d, %r14d
leaq 0x7(%rsp), %r12
pushq $0x1
popq %r13
cmpq $0x80, %r14
je 0x28fc
movl %ebp, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2110
cmpl $-0x1, %eax
je 0x29ea
movb 0x7(%rsp), %al
movb %al, (%r15,%r14)
incq %r14
jmp 0x28d0
pushq $0x5
popq %r14
leaq 0x7(%rsp), %r12
pushq $0x1
popq %r13
decl %r14d
je 0x2925
movl %ebp, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2110
cmpl $-0x1, %eax
jne 0x2909
jmp 0x29ea
movq 0x8(%rsp), %rax
movq %r15, 0x8(%rax)
xorl %r14d, %r14d
leaq 0x7(%rsp), %r15
pushq $0x1
popq %r12
cmpq $0x4, %r14
je 0x2964
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2110
cmpl $-0x1, %eax
je 0x29ea
movb 0x7(%rsp), %al
movb %al, 0x14(%rsp,%r14)
incq %r14
jmp 0x293a
leaq 0x14(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x5232
movl %eax, (%rbx)
cmpl $0x2ab, %eax            # imm = 0x2AB
jae 0x2a35
movl $0x801, %edi            # imm = 0x801
callq 0x51a0
movq %rax, %r14
movb $0x0, 0x800(%rax)
xorl %r13d, %r13d
leaq 0x7(%rsp), %r15
pushq $0x1
popq %r12
cmpq $0x800, %r13            # imm = 0x800
je 0x29c6
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2110
cmpl $-0x1, %eax
je 0x29ea
movb 0x7(%rsp), %al
movb %al, (%r14,%r13)
incq %r13
jmp 0x299e
pushq $0x5
popq %r13
leaq 0x7(%rsp), %r15
pushq $0x1
popq %r12
decl %r13d
je 0x2a01
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2110
cmpl $-0x1, %eax
jne 0x29d3
leaq 0x4709(%rip), %rdi      # 0x70fa
pushq $0x2
popq %rsi
callq 0x51fc
pushq $0x1
popq %rdi
callq 0x21d0
movq 0x8(%rsp), %rax
movq %r14, 0x10(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x46f1(%rip), %rsi      # 0x711a
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x53f0
jmp 0x29f9
movq 0x8(%rsp), %rcx
movq 0x18(%rcx), %rdx
leaq 0x467d(%rip), %rsi      # 0x70c2
pushq $0x2
popq %rdi
movl %eax, %ecx
movl $0x2aa, %r8d            # imm = 0x2AA
xorl %eax, %eax
callq 0x53f0
jmp 0x29f9
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/get_player_code.c
// Function: get_player_code
void		get_player_code(t_player *player)
{
	int				fd;
	unsigned int	prog_size;

	player->champ_size = 0;
	if ((fd = open(player->file_name, O_RDONLY)) < 0)
	{
		ft_printf_fd(2, "Error: Open file %s failed.\n", player->file_name);
		exit(1);
	}
	get_input(fd, player, &prog_size);
	player->begin = read_prog(fd, player->begin, &player->champ_size);
	if (prog_size != player->champ_size)
	{
		ft_printf_fd(2, "Error: File %s has a code size that differs \
from what its header says.\n", player->file_name);
		exit(1);
	}
	if ((close(fd)) == -1)
	{
		ft_printf_fd(2, "Error: Close file %s failed.\n", player->file_name);
		exit(1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
andl $0x0, 0x20(%rdi)
movq 0x18(%rdi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x21a0
testl %eax, %eax
js 0x2aea
movl %eax, %ebp
leaq 0x4(%rsp), %rdx
movl %eax, %edi
movq %rbx, %rsi
callq 0x2854
movq 0x28(%rbx), %r12
leaq 0x3(%rsp), %r14
pushq $0x1
popq %r15
movq %r12, %r13
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2110
testq %rax, %rax
je 0x2ac2
movb 0x3(%rsp), %al
movb %al, (%r13)
incl 0x20(%rbx)
incq %r13
jmp 0x2aa0
movq %r12, 0x28(%rbx)
movl 0x4(%rsp), %eax
cmpl 0x20(%rbx), %eax
jne 0x2af7
movl %ebp, %edi
callq 0x20f0
cmpl $-0x1, %eax
je 0x2b04
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rdx
leaq 0x464c(%rip), %rsi      # 0x7141
jmp 0x2b0f
movq 0x18(%rbx), %rdx
leaq 0x465c(%rip), %rsi      # 0x715e
jmp 0x2b0f
movq 0x18(%rbx), %rdx
leaq 0x4697(%rip), %rsi      # 0x71a6
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x53f0
pushq $0x1
popq %rdi
callq 0x21d0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/main.c
// Function: main
int				main(int argc, char **argv)
{
	t_arena	*arena;

	arena = create_arena();
	check_param(&argc, &argv, arena);
	save_players(argc, argv, arena);
	load_players(arena);
	if (arena->display != NULL)
		init_display(arena);
	else
		display_champions(arena);
	start_fight(arena);
	if (arena->cycle != arena->dump_cycle)
	{
		if (arena->display != NULL && !arena->display->quitting)
			print_winner_display(arena);
		else
			print_winner(arena);
	}
	destroy_arena(arena);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
callq 0x2365
cmpl $0x1, %ebp
je 0x2c94
movq %rax, %rbx
leaq 0x8(%r14), %r15
movq 0x8(%r14), %rsi
leaq 0x49ae(%rip), %rdi      # 0x74fe
callq 0x5100
testl %eax, %eax
je 0x2b8d
movq (%r15), %rsi
leaq 0x4748(%rip), %rdi      # 0x72ab
callq 0x5100
testl %eax, %eax
je 0x2ba1
movq (%r15), %rsi
leaq 0x473b(%rip), %rdi      # 0x72b1
callq 0x5100
testl %eax, %eax
jne 0x2be8
movl $0x1, 0x24(%rbx)
pushq $-0x1
popq %rax
pushq $0x8
jmp 0x2be2
movq %r14, %rdi
callq 0x45da
movq $0x1, 0x30(%rbx)
decl %ebp
jmp 0x2beb
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x2bbe
movq %rdi, %rax
movb (%rax), %cl
testb %cl, %cl
je 0x2bd5
addb $-0x30, %cl
incq %rax
cmpb $0xa, %cl
jb 0x2bad
leaq 0x46ef(%rip), %rdi      # 0x72b4
pushq $0x2
popq %rsi
callq 0x51fc
pushq $0x1
popq %rdi
callq 0x21d0
callq 0x511c
movl %eax, 0x20(%rbx)
pushq $-0x2
popq %rax
pushq $0x10
popq %rcx
addq %rcx, %r14
addl %eax, %ebp
movq %r14, %r15
addq $0x8, %r15
decl %ebp
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x24a8
movq %rbx, %rdi
callq 0x2623
cmpq $0x0, 0x30(%rbx)
je 0x2c19
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4624
jmp 0x2c21
movq %rbx, %rdi
callq 0x23a4
movq %rbx, %rdi
callq 0x4321
movl 0x10(%rbx), %eax
cmpl 0x20(%rbx), %eax
je 0x2c7f
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x2c40
cmpl $0x0, 0x10(%rax)
je 0x2c77
movq 0x8(%rbx), %rcx
movq %rcx, %rax
testq %rcx, %rcx
je 0x2c5c
movl 0x30(%rcx), %edx
cmpl 0x30(%rax), %edx
cmovgeq %rcx, %rax
movq 0x38(%rcx), %rcx
jmp 0x2c47
movl 0x30(%rax), %esi
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rcx
leaq 0x4673(%rip), %rdi      # 0x72e1
xorl %eax, %eax
callq 0x527c
jmp 0x2c7f
movq %rbx, %rdi
callq 0x4b30
movq %rbx, %rdi
callq 0x2469
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4529(%rip), %rdi      # 0x71c4
pushq $0x2
popq %rbx
movl %ebx, %esi
callq 0x51fc
leaq 0x4540(%rip), %rdi      # 0x71ec
movl %ebx, %esi
callq 0x51fc
leaq 0x4561(%rip), %rdi      # 0x721b
movl %ebx, %esi
callq 0x51fc
leaq 0x4584(%rip), %rdi      # 0x724c
movl %ebx, %esi
callq 0x51fc
leaq 0x45a9(%rip), %rdi      # 0x727f
movl %ebx, %esi
callq 0x51fc
leaq 0x45b6(%rip), %rdi      # 0x729a
movl %ebx, %esi
jmp 0x2bc8
nop
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/instruction_param.c
// Function: decode_ocp
void		decode_ocp(t_process *process, t_parameters *param, int i)
{
	int		select;
	int		decal;
	int		temp;
	int		j;

	select = 0xC0;
	j = 0;
	decal = 6;
	while (j < g_op_tab[i].param_nbr && j < 4)
	{
		temp = mem(PC + 1, 1, PA, process)[0] & select;
		param->type[j] = temp >> decal;
		select = select >> 2;
		decal -= 2;
		j++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq %edx, %rax
imulq $0x28, %rax, %rax
leaq 0x8415(%rip), %rcx      # 0xb120
leaq (%rcx,%rax), %r12
addq $0x8, %r12
movl $0xc0, %r13d
pushq $0x6
popq %rbp
xorl %r15d, %r15d
cmpq $0x3, %r15
ja 0x2d5e
movslq (%r12), %rax
cmpq %rax, %r15
jge 0x2d5e
movq 0x48(%r14), %rdi
movq 0x68(%r14), %rdx
incq %rdi
pushq $0x1
popq %rsi
movq %r14, %rcx
callq 0x230c
movzbl (%rax), %eax
andl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
movb %al, (%rbx,%r15)
shrl $0x2, %r13d
addl $-0x2, %ebp
incq %r15
jmp 0x2d1f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/instruction_param.c
// Function: params_value
void		params_value(t_process *process, t_parameters *param, int j)
{
	int	i;

	i = 0;
	while (i < g_op_tab[j].param_nbr && i < 4)
	{
		if (param->type[i] == REG_CODE)
		{
			param->value[i] = rm(mem(PC + param->jump, 1, PA, process), 1, PP);
			param->jump += 1;
		}
		else if (param->type[i] == DIR_CODE && param->o != 11 && param->o != 10
				&& param->o != 14)
		{
			param->value[i] = rm(mem(PC + PJ, 1, PA, process), DIR_SIZE, PP);
			param->jump += DIR_SIZE;
		}
		else if (param->type[i] == 0)
			;
		else
		{
			param->value[i] = rm(mem(PC + PJ, 1, PA, process), IND_SIZE, PP);
			param->jump += IND_SIZE;
		}
		i++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq %edx, %rax
imulq $0x28, %rax, %rax
leaq 0x8394(%rip), %rcx      # 0xb120
leaq (%rcx,%rax), %r12
addq $0x8, %r12
xorl %r13d, %r13d
cmpq $0x3, %r13
ja 0x2e35
movslq (%r12), %rax
cmpq %rax, %r13
jge 0x2e35
movzbl (%rbx,%r13), %r15d
testl %r15d, %r15d
je 0x2e2d
cmpl $0x1, %r15d
je 0x2df1
cmpl $0x2, %r15d
jne 0x2df6
movb 0x2c(%rbx), %al
addb $-0xa, %al
pushq $0x4
popq %rbp
pushq $0x4
popq %rcx
movl %ecx, %r15d
cmpb $0x5, %al
jae 0x2dff
movzbl %al, %eax
leaq 0x4668(%rip), %rcx      # 0x7448
movq (%rcx,%rax,8), %rbp
leaq 0x4685(%rip), %rcx      # 0x7470
movl (%rcx,%rax,4), %r15d
jmp 0x2dff
movq %r15, %rbp
jmp 0x2dff
pushq $0x2
popq %rbp
pushq $0x2
popq %rax
movl %eax, %r15d
movslq 0x28(%rbx), %rdi
addq 0x48(%r14), %rdi
movq 0x68(%r14), %rdx
pushq $0x1
popq %rsi
movq %r14, %rcx
callq 0x230c
movq %rax, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x450f
movq %rax, 0x8(%rbx,%r13,8)
addl %r15d, 0x28(%rbx)
incq %r13
jmp 0x2d97
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/instruction_param.c
// Function: check_registers
int			check_registers(t_parameters *param, t_process *process, int j)
{
	int	i;

	i = 0;
	while (i < g_op_tab[j].param_nbr && i < 4)
	{
		if (param->type[i] == REG_CODE)
		{
			if (PR[param->value[i] - 1] == NULL || param->value[i] > REG_NUMBER
					|| param->value[i] < 1)
				return (1);
		}
		i++;
	}
	return (0);
}

// Assembly:
movslq %edx, %rax
imulq $0x28, %rax, %rax
leaq 0x82ce(%rip), %rcx      # 0xb120
movslq 0x8(%rcx,%rax), %rcx
xorl %eax, %eax
pushq $0x1
popq %rdx
xorl %esi, %esi
cmpq $0x3, %rsi
ja 0x2e85
cmpq %rcx, %rsi
jge 0x2e85
cmpb $0x1, (%rdi,%rsi)
jne 0x2e7e
movq 0x8(%rdi,%rsi,8), %r8
addq $-0x11, %r8
cmpq $-0x10, %r8
jb 0x2e83
incq %rsi
jmp 0x2e5e
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/instruction_param.c
// Function: execute_instruction
int			execute_instruction(t_process *process)
{
	static int		(*instruction[16])(t_process *process, int i) =
	{alive, load, store, addition, soustraction, ft_and, ft_or, ft_xor, zjump,
		load_index, store_index, ft_fork, long_load, long_load_index, long_fork,
		aff};
	int				i;

	i = 0;
	while (g_op_tab[i].op_code != process->op_code && g_op_tab[i].name != NULL)
		i++;
	if (g_op_tab[i].name == NULL)
		return (1);
	return ((*instruction[i])(process, i));
}

// Assembly:
leaq 0x8293(%rip), %rcx      # 0xb120
addq $0x10, %rcx
movl 0x64(%rdi), %edx
xorl %esi, %esi
leaq 0x7eb3(%rip), %rax      # 0xad50
movsbl (%rcx), %r9d
movq -0x10(%rcx), %r8
cmpl %r9d, %edx
je 0x2ebb
testq %r8, %r8
je 0x2ec2
incl %esi
addq $0x8, %rax
addq $0x28, %rcx
jmp 0x2e9d
testq %r8, %r8
je 0x2ec2
jmpq *(%rax)
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/instruction_param.c
// Function: check_param_error
int			check_param_error(t_parameters param, int i)
{
	int	j;

	j = 0;
	while (j < g_op_tab[i].param_nbr && param.type[j])
	{
		if (param.type[j] == REG_CODE)
			param.type[j++] = T_REG;
		else if (param.type[j] == DIR_CODE)
			param.type[j++] = T_DIR;
		else if (param.type[j] == IND_CODE)
			param.type[j++] = T_IND;
		else
			param.type[j++] = 0;
	}
	j = -1;
	while (++j < g_op_tab[i].param_nbr && j < 4)
	{
		if ((g_op_tab[i].param_type[j] & param.type[j]) == 0)
			return (1);
	}
	return (0);
}

// Assembly:
leaq 0x8(%rsp), %rcx
movslq %edi, %rax
imulq $0x28, %rax, %rax
leaq 0x8247(%rip), %rsi      # 0xb120
leaq (%rsi,%rax), %rdx
movslq 0x8(%rsi,%rax), %rsi
xorl %eax, %eax
testl %esi, %esi
movl $0x0, %edi
cmovgl %esi, %edi
cmpq %rax, %rdi
je 0x2f21
movb (%rcx,%rax), %r8b
movzbl %r8b, %r9d
leal -0x1(%r9), %r10d
cmpl $0x2, %r10d
jb 0x2f18
cmpl $0x3, %r9d
je 0x2f15
testl %r9d, %r9d
je 0x2f21
xorl %r8d, %r8d
jmp 0x2f18
movb $0x4, %r8b
movb %r8b, (%rcx,%rax)
incq %rax
jmp 0x2eee
xorl %eax, %eax
pushq $0x1
popq %rdi
xorl %r8d, %r8d
leaq -0x1(%r8), %r9
cmpq $0x2, %r9
jg 0x2f4c
cmpq %rsi, %r8
jge 0x2f4c
movb (%rcx,%r8), %r9b
leaq 0x1(%r8), %r10
testb %r9b, 0xc(%rdx,%r8)
movq %r10, %r8
jne 0x2f29
movl %edi, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/instructions_p1.c
// Function: alive
int		alive(t_process *process, int i)
{
	t_parameters	param;
	t_player		*temp;

	i += 1;
	param.type[0] = DIR_CODE;
	param.value[0] = rm(mem(process->pc + 1, 1, PA, process), DIR_SIZE, PP);
	process->lives = 1;
	process->count_lives += 1;
	temp = process->arena->players;
	while (temp != NULL && temp->id != param.value[0])
		temp = temp->next;
	if (temp != NULL)
	{
		temp->last_live = process->arena->cycle;
		if (process->arena->print_lives == 1)
			ft_printf("Un processus dit que le joueur %s est en vie.\n",
				temp->name);
	}
	return (1 + DIR_SIZE);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
movq 0x68(%rbx), %rdx
incq %rdi
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x230c
pushq $0x4
popq %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x450f
movl $0x1, 0x58(%rbx)
incl 0x60(%rbx)
movq 0x68(%rbx), %rdx
leaq 0x8(%rdx), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x2fbe
movslq (%rcx), %rsi
cmpq %rsi, %rax
je 0x2fa0
addq $0x38, %rcx
jmp 0x2f8a
movl 0x10(%rdx), %eax
movl %eax, 0x30(%rcx)
cmpl $0x1, 0x24(%rdx)
jne 0x2fbe
movq 0x8(%rcx), %rsi
leaq 0x44cd(%rip), %rdi      # 0x7484
xorl %eax, %eax
callq 0x527c
pushq $0x5
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/instructions_p1.c
// Function: load
int		load(t_process *process, int i)
{
	t_parameters	param;

	param.o = 2;
	decode_ocp(process, &param, i);
	param.jump = 1 + g_op_tab[i].has_ocp;
	if (g_op_tab[i].has_ocp == 0)
		return (1);
	params_value(process, &param, i);
	if (check_registers(&param, process, i) == 1 || param.type[1] != REG_CODE
	|| check_param_error(param, i) == 1 || g_op_tab[i].param_nbr < 2
	|| g_op_tab[i].param_nbr > 4)
		return (param.jump);
	if (param.type[0] == REG_CODE)
		param.value[0] = RBE(PR[param.value[0] - 1], REG_SIZE);
	else if (param.type[0] == IND_CODE)
		PV[0] = rm(mem(process->pc + PV[0], 1, PA, process), REG_SIZE, PP);
	WBE(param.value[0], PR[param.value[1] - 1], REG_SIZE);
	change_carry(process, PV[0]);
	return (param.jump);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movb $0x2, 0x2c(%r14)
movq %r14, %rsi
movl %ebp, %edx
callq 0x2cec
movslq %ebp, %rax
imulq $0x28, %rax, %r12
leaq 0x812a(%rip), %r15      # 0xb120
movl 0x20(%r15,%r12), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x28(%r14)
testl %eax, %eax
je 0x30b0
leaq 0x30(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2d6d
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x2e44
cmpl $0x1, %eax
je 0x30f2
cmpb $0x1, 0x31(%rsp)
jne 0x30f2
movups 0x30(%rsp), %xmm0
movups 0x40(%rsp), %xmm1
movups 0x50(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %ebp, %edi
callq 0x2ec6
cmpl $0x1, %eax
je 0x30f2
addq %r12, %r15
movl 0x8(%r15), %eax
addl $-0x5, %eax
cmpl $-0x4, %eax
jbe 0x30f2
movzbl 0x30(%rsp), %eax
cmpl $0x1, %eax
je 0x30b5
cmpl $0x3, %eax
jne 0x30d0
movq 0x48(%rbx), %rdi
movq 0x68(%rbx), %rdx
addq 0x38(%rsp), %rdi
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x230c
pushq $0x4
popq %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x450f
jmp 0x30c6
pushq $0x1
popq %rax
jmp 0x30f6
movq 0x38(%rsp), %rax
leaq (%rbx,%rax,4), %rdi
pushq $0x4
popq %rsi
callq 0x5232
movq %rax, %rdi
movq %rax, 0x38(%rsp)
jmp 0x30d5
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rax
leaq (%rbx,%rax,4), %rsi
pushq $0x4
popq %rdx
callq 0x5210
movl 0x38(%rsp), %esi
movq %rbx, %rdi
callq 0x42e5
movl 0x58(%rsp), %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq