LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: bilde_f_und_g_sp_rek
BOOL bilde_f_und_g_sp_rek(KNOTENTYP *f, KNOTENTYP *g, KANTE *k1, KANTE *k2) {
  KNOTENTYP u,v;
  k1 = k1->invers->prev;
  k2 = k2->invers->next;   /* k1 und k2 spiegelverkehrt nach rechts und links */
  u = k1->name;            /* von u wird der Funktionswert f[u] berechnet */
  v = k2->name;
  if (!(f[u])) {          /* Funktionswert noch nicht bekannt */
    f[u] = v;
    if (g[v]) {return(0);}    /* Widerspruch gefunden */
    g[v] = u;
    if (!bilde_f_und_g_sp_rek(f,g,k1,k2))  {return(0);}  /* weitere Funktionswerte: Widerspruch? */
  }
  else { 
    if (!(g[v])) {return(0);}     /* Widerspruch gefunden. Diese Abfrage koennte aber auch
                                      entfallen, denn wenn ein Wert von g noch nicht festgelegt
        ist, obwohl der zugehoerige Wert von f bereits feststeht, so wird an anderer Stelle ein
        Wert von g zuviel festgelegt sein, obwohl der zugehoerige Wert von f noch nicht feststeht */
  }
  k1 = k1->prev;           /* k1 und k2 spiegelverkehrt nach links und rechts */
  k2 = k2->next;           /* denn: (k->invers->next)->next = k->invers->prev */
  u = k1->name;
  v = k2->name;
  if (!(f[u])) {
    f[u] = v;
    if (g[v]) {return(0);}
    g[v] = u;
    if (!bilde_f_und_g_sp_rek(f,g,k1,k2))  {return(0);}
  }
  else {
    if (!(g[v])) {return(0);}
  }
  return(1);       /* keinen Widerspruch festgestellt */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdx), %rax
movq 0x18(%rax), %r15
movq 0x28(%rcx), %rax
movq 0x20(%rax), %r12
movzwl 0x2(%r15), %ecx
movzwl 0x2(%r12), %edx
movzwl %dx, %eax
cmpw $0x0, (%rdi,%rcx,2)
je 0x91a8
cmpw $0x0, (%rbx,%rax,2)
je 0x91db
movq 0x18(%r15), %rdx
movq 0x20(%r12), %rcx
movzwl 0x2(%rdx), %esi
movzwl 0x2(%rcx), %edi
movzwl %di, %eax
cmpw $0x0, (%r14,%rsi,2)
je 0x91cf
cmpw $0x0, (%rbx,%rax,2)
je 0x91db
movb $0x1, %al
jmp 0x91dd
movw %dx, (%r14,%rcx,2)
cmpw $0x0, (%rbx,%rax,2)
jne 0x91db
movw %cx, (%rbx,%rax,2)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x9147
testb %al, %al
jne 0x9181
jmp 0x91db
movw %di, (%r14,%rsi,2)
cmpw $0x0, (%rbx,%rax,2)
je 0x91e9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movw %si, (%rbx,%rax,2)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9147
testb %al, %al
jne 0x91a4
jmp 0x91db
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: bilde_f_und_g_sp
BOOL bilde_f_und_g_sp(KNOTENTYP *f, KNOTENTYP *g, KANTE *k1, KANTE *k2, KNOTENTYP anz) {
  KNOTENTYP i;
  for (i=1; i<=anz; i++) {f[i]=0; g[i]=0;}   /* Funktionstabellen loeschen */
  f[k1->ursprung] = k2->ursprung;
  f[k1->name]     = k2->name;           /* f: k1 wird auf k2 abgebildet */  
  g[k2->ursprung] = k1->ursprung;
  g[k2->name]     = k1->name;           /* g: k2 wird auf k1 abgebildet */
  return(bilde_f_und_g_sp_rek(f,g,k1,k2));
}

// Assembly:
testl %r8d, %r8d
je 0x9232
incl %r8d
cmpw $0x3, %r8w
movl $0x2, %eax
cmovael %r8d, %eax
movzwl %ax, %eax
movl $0x1, %r8d
xorl %r9d, %r9d
movw %r9w, (%rdi,%r8,2)
movw %r9w, (%rsi,%r8,2)
incq %r8
cmpq %r8, %rax
jne 0x9220
movzwl (%rcx), %eax
movzwl (%rdx), %r8d
movw %ax, (%rdi,%r8,2)
movzwl 0x2(%rcx), %eax
movzwl 0x2(%rdx), %r8d
movw %ax, (%rdi,%r8,2)
movzwl (%rdx), %eax
movzwl (%rcx), %r8d
movw %ax, (%rsi,%r8,2)
movzwl 0x2(%rdx), %eax
movzwl 0x2(%rcx), %r8d
movw %ax, (%rsi,%r8,2)
jmp 0x9147
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: bilde_f_und_g_rek
BOOL bilde_f_und_g_rek(KNOTENTYP *f, KNOTENTYP *g, KANTE *k1, KANTE *k2) {
  KNOTENTYP u,v;
  k1 = k1->invers->prev;
  k2 = k2->invers->prev;   /* k1 und k2 im Gleichschritt nach rechts und links */
  u = k1->name;            /* von u wird der Funktionswert f[u] berechnet */
  v = k2->name;
  if (!(f[u])) {          /* Funktionswert noch nicht bekannt */
    f[u] = v;
    if (g[v]) {return(0);}    /* Widerspruch gefunden */
    g[v] = u;
    if (!bilde_f_und_g_rek(f,g,k1,k2))  {return(0);}  /* weitere Funktionswerte: Widerspruch? */
  }
  else { 
    if (!(g[v])) {return(0);}     /* Widerspruch gefunden. Diese Abfrage koennte aber auch
                                      entfallen, denn wenn ein Wert von g noch nicht festgelegt
        ist, obwohl der zugehoerige Wert von f bereits feststeht, so wird an anderer Stelle ein
        Wert von g zuviel festgelegt sein, obwohl der zugehoerige Wert von f noch nicht feststeht */
  }
  k1 = k1->prev;           /* k1 und k2 spiegelverkehrt nach links und rechts */
  k2 = k2->prev;           /* denn: (k->invers->prev)->prev = k->invers->next */
  u = k1->name;
  v = k2->name;
  if (!(f[u])) {
    f[u] = v;
    if (g[v]) {return(0);}
    g[v] = u;
    if (!bilde_f_und_g_rek(f,g,k1,k2))  {return(0);}
  }
  else {
    if (!(g[v])) {return(0);}
  }
  return(1);       /* keinen Widerspruch festgestellt */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdx), %rax
movq 0x18(%rax), %r15
movq 0x28(%rcx), %rax
movq 0x18(%rax), %r12
movzwl 0x2(%r15), %ecx
movzwl 0x2(%r12), %edx
movzwl %dx, %eax
cmpw $0x0, (%rdi,%rcx,2)
je 0x92cc
cmpw $0x0, (%rbx,%rax,2)
je 0x92ff
movq 0x18(%r15), %rdx
movq 0x18(%r12), %rcx
movzwl 0x2(%rdx), %esi
movzwl 0x2(%rcx), %edi
movzwl %di, %eax
cmpw $0x0, (%r14,%rsi,2)
je 0x92f3
cmpw $0x0, (%rbx,%rax,2)
je 0x92ff
movb $0x1, %al
jmp 0x9301
movw %dx, (%r14,%rcx,2)
cmpw $0x0, (%rbx,%rax,2)
jne 0x92ff
movw %cx, (%rbx,%rax,2)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x926b
testb %al, %al
jne 0x92a5
jmp 0x92ff
movw %di, (%r14,%rsi,2)
cmpw $0x0, (%rbx,%rax,2)
je 0x930d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movw %si, (%rbx,%rax,2)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x926b
testb %al, %al
jne 0x92c8
jmp 0x92ff
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: bilde_f_und_g
BOOL bilde_f_und_g(KNOTENTYP *f, KNOTENTYP *g, KANTE *k1, KANTE *k2, KNOTENTYP anz) {
  KNOTENTYP i;
  for (i=1; i<=anz; i++) {f[i]=0; g[i]=0;}   /* Funktionstabellen loeschen */
  f[k1->ursprung] = k2->ursprung;
  f[k1->name]     = k2->name;           /* f: k1 wird auf k2 abgebildet */  
  g[k2->ursprung] = k1->ursprung;
  g[k2->name]     = k1->name;           /* g: k2 wird auf k1 abgebildet */
  return(bilde_f_und_g_rek(f,g,k1,k2));
}

// Assembly:
testl %r8d, %r8d
je 0x9356
incl %r8d
cmpw $0x3, %r8w
movl $0x2, %eax
cmovael %r8d, %eax
movzwl %ax, %eax
movl $0x1, %r8d
xorl %r9d, %r9d
movw %r9w, (%rdi,%r8,2)
movw %r9w, (%rsi,%r8,2)
incq %r8
cmpq %r8, %rax
jne 0x9344
movzwl (%rcx), %eax
movzwl (%rdx), %r8d
movw %ax, (%rdi,%r8,2)
movzwl 0x2(%rcx), %eax
movzwl 0x2(%rdx), %r8d
movw %ax, (%rdi,%r8,2)
movzwl (%rdx), %eax
movzwl (%rcx), %r8d
movw %ax, (%rsi,%r8,2)
movzwl 0x2(%rdx), %eax
movzwl 0x2(%rcx), %r8d
movw %ax, (%rsi,%r8,2)
jmp 0x926b
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: checksize_2
int checksize_2( KANTE* edge)
{
KANTE *run; 
int zaehler=1;

for (run=edge->invers->next; run != edge; run=run->invers->next) 
  { if (run->name==aussen) return(6); 
    zaehler++;  }
return(zaehler);
}

// Assembly:
movq 0x28(%rdi), %rax
movq 0x20(%rax), %rcx
movl $0x1, %eax
cmpq %rdi, %rcx
je 0xc40e
cmpw $0x246, 0x2(%rcx)       # imm = 0x246
je 0xc409
incl %eax
movq 0x28(%rcx), %rcx
movq 0x20(%rcx), %rcx
jmp 0xc3f0
movl $0x6, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: vergleiche_symm
BOOL vergleiche_symm(char nr) {
  int i;
  for (i=0; i<symm_len; i++) {
    if (symm[i]==nr) {return(True);}
  }
  return(False);
}

// Assembly:
movslq 0x8e3a(%rip), %rax      # 0x15250
testq %rax, %rax
jle 0xc432
xorl %ecx, %ecx
leaq 0x8e0c(%rip), %rdx      # 0x15230
cmpb %dil, (%rcx,%rdx)
je 0xc435
incq %rcx
cmpq %rcx, %rax
jne 0xc424
xorl %eax, %eax
retq
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: teste_und_schreibe
void teste_und_schreibe(PLANMAP map, KNOTENTYP *code)
{ int erg;

(non_iso_graphenzahl[map[0][0].name])++;
if ((erg=minitest(map,code))) { 
  (graphenzahl[map[0][0].name])++;
  if (symm_len==0 || vergleiche_symm(erg)) codiereplanar(map);
  (symm_anz[erg])++;                  /* fuer die Symmetriestatistik */  
}

}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x2(%rdi), %eax
leaq 0x146e7(%rip), %rcx     # 0x20b30
incq (%rcx,%rax,8)
callq 0x938f
testl %eax, %eax
je 0xc4a3
movl %eax, %ebp
movzwl 0x2(%rbx), %eax
leaq 0x1127d(%rip), %rcx     # 0x1d6e0
incq (%rcx,%rax,8)
movl 0x8de3(%rip), %eax      # 0x15250
testq %rax, %rax
je 0xc48f
testl %eax, %eax
jle 0xc497
xorl %ecx, %ecx
leaq 0x8db1(%rip), %rdx      # 0x15230
cmpb %bpl, (%rcx,%rdx)
je 0xc48f
incq %rcx
cmpq %rcx, %rax
jne 0xc47f
jmp 0xc497
movq %rbx, %rdi
callq 0x3e31
movl %ebp, %eax
leaq 0x8d10(%rip), %rcx      # 0x151b0
incl (%rcx,%rax,4)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: suche_item
ITEMLISTE *suche_item(KNOTENTYP *adresse)
{
int i, laenge;
SEQUENZLISTE *sq;

laenge=8-adresse[0];

sq=mapliste.sechser[adresse[1]];

for (i=2; i<laenge; i++)
  { if (sq->number_next <= adresse[i]) return(nil);
    if (sq->next_level[adresse[i]]==nil) return(nil);
    sq=sq->next_level[adresse[i]]; }
return(sq->items);
}

// Assembly:
movzwl (%rdi), %eax
movzwl 0x2(%rdi), %ecx
leaq 0x13698(%rip), %rdx     # 0x1fb50
movq 0x8(%rdx,%rcx,8), %rcx
cmpw $0x5, %ax
ja 0xc4f3
movl $0x8, %edx
subl %eax, %edx
movzwl %dx, %edx
movl $0x2, %esi
xorl %eax, %eax
movzwl (%rdi,%rsi,2), %r8d
cmpl %r8d, 0x8(%rcx)
jle 0xc4f7
movq (%rcx), %rcx
movq (%rcx,%r8,8), %rcx
testq %rcx, %rcx
je 0xc4f7
incq %rsi
cmpq %rsi, %rdx
jne 0xc4d4
movq 0x10(%rcx), %rax
retq
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: insert_patch
void insert_patch(PLANMAP map, KANTE *anfang, ITEMLISTE *item, int flaechenzahl, int fuenfecke)
{

FLAECHENTYP *code;
KANTE *run;
int zaehler, codestelle;

code=item->code;
    for (codestelle=0, zaehler=1, run=anfang; run != nil; zaehler++ )
      { 
	if ((codestelle<fuenfecke) && (code[codestelle]==zaehler))
          { add_polygon_invers(5, map, run, &run); codestelle++; }
        else add_polygon_invers(6, map, run, &run);
      }
        if (zaehler != flaechenzahl) 
	  { fprintf(stderr,"Insert_patch: Could not insert enough faces: ");
	    fprintf(stderr,"%d instead of %d\n (insert_patch)\n",zaehler,flaechenzahl);
	    exit(92); }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0xc(%rsp)
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
je 0xd5d3
movl %r8d, %r14d
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %r12
movl $0x1, %ebp
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
cmpl %r14d, %ebx
jge 0xd5b5
movslq %ebx, %rax
movzbl 0x8(%r15,%rax), %eax
cmpl %eax, %ebp
jne 0xd5b5
movl $0x5, %edi
movq %r12, %rsi
movq %r13, %rcx
callq 0xc51c
incl %ebx
jmp 0xd5c5
movl $0x6, %edi
movq %r12, %rsi
movq %r13, %rcx
callq 0xc51c
incl %ebp
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
jne 0xd58f
jmp 0xd5d8
movl $0x1, %ebp
movl 0xc(%rsp), %esi
cmpl %esi, %ebp
jne 0xd5ef
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: delete_patch
void delete_patch(PLANMAP map, KANTE *anfang, KNOTENTYP *adresse)
{
int sqlaenge, randlaenge, i, j, knotenverlust;
KANTE *run;

sqlaenge=6-adresse[0];
for (i=2, randlaenge=sqlaenge; i<= 1+sqlaenge; i++) randlaenge+=(2*adresse[i]);

knotenverlust=(3*adresse[0])+randlaenge;
knotenverlust= knotenverlust/2;  /* diese konstruktion nur Sicherheitshalber, damit kein
				    Compiler die Ordnung "erst 3a[0]+r" aufloest */
knotenverlust= knotenverlust+(2*adresse[1])+1-randlaenge;
/*alles nur Euler-Formel*/

map[0][0].name = map[0][0].name - knotenverlust;

for (i=1+sqlaenge; adresse[i]==0; i--);
for ( run=anfang ; i>1 ; i--)
  { if (adresse[i])
      { for (j=0; j < adresse[i]; j++)
	  { 
	    run->name=aussen; run->invers=nil; run = run->next->invers->next->invers->next; }
	run=run->invers->next;
      }
    else { run=run->invers->next; }
  }
}

// Assembly:
movzwl (%rdx), %eax
movl $0x6, %ecx
subl %eax, %ecx
cmpl $0x5, %eax
ja 0xd625
movl $0x8, %r8d
subq %rax, %r8
movl $0x2, %r9d
movzwl (%rdx,%r9,2), %r10d
leal (%rcx,%r10,2), %ecx
incq %r9
cmpq %r9, %r8
jne 0xd614
leal (%rax,%rax,2), %r8d
addl %ecx, %r8d
movl %r8d, %r9d
shrl $0x1f, %r9d
addl %r8d, %r9d
shrl %r9d
movzwl 0x2(%rdx), %r8d
leal (%r9,%r8,2), %r8d
notl %r8d
addl %ecx, %r8d
addw %r8w, 0x2(%rdi)
movl %eax, %ecx
movl $0x8, %eax
subq %rcx, %rax
cmpw $0x0, -0x2(%rdx,%rax,2)
leaq -0x1(%rax), %rax
je 0xd657
cmpq $0x2, %rax
jl 0xd6bb
movl %eax, %eax
cmpw $0x0, (%rdx,%rax,2)
je 0xd6a7
cmpw $0x0, (%rdx,%rax,2)
je 0xd6a7
xorl %ecx, %ecx
movw $0x246, 0x2(%rsi)       # imm = 0x246
movq $0x0, 0x28(%rsi)
movq 0x20(%rsi), %rsi
movq 0x28(%rsi), %rsi
movq 0x20(%rsi), %rsi
movq 0x28(%rsi), %rsi
movq 0x20(%rsi), %rsi
incl %ecx
movzwl (%rdx,%rax,2), %edi
cmpl %edi, %ecx
jb 0xd67b
movq 0x28(%rsi), %rcx
movq 0x20(%rcx), %rsi
leaq -0x1(%rax), %rcx
cmpl $0x2, %eax
movq %rcx, %rax
jg 0xd66b
retq
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/fullgen.c
// Function: berechne_adresse3
void berechne_adresse3(int l1, int l3, KNOTENTYP adresse[]) 
{
int sl1, sl3;

if (l1%2) { sl1=(l1-1)/2; 
	    if (l3%2) { sl3=(l3-1)/2; adresse[0]=4;
			if (sl3>sl1) { adresse[2]=sl3; adresse[3]=sl1; } 
			else { adresse[2]=sl1; adresse[3]=sl3; }
		      } else /* d.h. l3 gerade */
			{ sl3=(l3-2)/2;
			  adresse[0]=3;
			  if (sl3>sl1) { adresse[2]=sl3; adresse[3]=0; adresse[4]=sl1; }
			  else { adresse[2]=sl1;
				 adresse[3]=sl3; adresse[4]=0; }
			}
	  }

else { sl1=(l1-2)/2; 
       if (l3%2) { sl3=(l3-1)/2;
		   adresse[0]=3;
		   if (sl3>sl1) { adresse[2]=sl3; adresse[3]=0; adresse[4]=sl1; } 
		   else { adresse[2]=sl1; adresse[3]=sl3; adresse[4]=0; }
		 } else /*d.h. l3 gerade */ 
		   { sl3=(l3-2)/2;
		     adresse[0]=2; 
		     if (sl3>sl1) { adresse[2]=sl3; adresse[3]=0; adresse[4]=sl1; adresse[5]=0; } 
		     else { adresse[2]=sl1; adresse[3]=0; adresse[4]=sl3; adresse[5]=0; }
		   }
     }
 }

// Assembly:
testb $0x1, %dil
jne 0xdcea
addl $-0x2, %edi
sarl %edi
testb $0x1, %sil
jne 0xdcf9
addl $-0x2, %esi
sarl %esi
movw $0x2, (%rdx)
cmpl %edi, %esi
jle 0xdd3a
movw %si, 0x4(%rdx)
xorl %eax, %eax
movw %ax, 0x6(%rdx)
movw %di, 0x8(%rdx)
jmp 0xdd48
decl %edi
sarl %edi
testb $0x1, %sil
jne 0xdd15
addl $-0x2, %esi
jmp 0xdcfb
decl %esi
sarl %esi
movw $0x3, (%rdx)
cmpl %edi, %esi
jle 0xdd2b
movw %si, 0x4(%rdx)
movw $0x0, 0x6(%rdx)
movw %di, 0x8(%rdx)
retq
decl %esi
sarl %esi
movw $0x4, (%rdx)
cmpl %edi, %esi
jle 0xdd4d
movw %si, 0x4(%rdx)
movw %di, 0x6(%rdx)
retq
movw %di, 0x4(%rdx)
movw %si, 0x6(%rdx)
movw $0x0, 0x8(%rdx)
retq
movw %di, 0x4(%rdx)
xorl %eax, %eax
movw %ax, 0x6(%rdx)
movw %si, 0x8(%rdx)
movw %ax, 0xa(%rdx)
retq
movw %di, 0x4(%rdx)
movw %si, 0x6(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/cath-mawr[P]rscmapgen/mapdump.c
// Function: load_chunk
int
load_chunk(struct chunk *c, unsigned x, unsigned y, unsigned z)
{
	FILE *f;
	char name[128];

	snprintf(name, sizeof(name), "./Map/%u-%u-%u.dat", x, y, z);
	f = fopen(name, "rb");
	if (f == NULL) {
		if (errno == ENOENT) {
			memset(c->overlays[z], 2, sizeof(c->overlays[z]));
			return 0;
		}
		return 1;
	}
	puts(name);
	fread(c->colour[z], 1, CHUNKAREA, f);
	fread(c->elevation[z], 1, CHUNKAREA, f);
	fread(c->h_boundaries[z], 1, CHUNKAREA, f);
	fread(c->v_boundaries[z], 1, CHUNKAREA, f);
	fread(c->d_boundaries[z], 2, CHUNKAREA, f);
	fread(c->roofing[z], 1, CHUNKAREA, f);
	fread(c->overlays[z], 1, CHUNKAREA, f);
	fread(c->rotation[z], 1, CHUNKAREA, f);
	fclose(f);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, %ebp
movl %edx, %r8d
movl %esi, %ecx
movq %rdi, %r14
leaq 0x30e32(%rip), %rdx     # 0x32040
xorl %ebx, %ebx
movq %rsp, %r15
movl $0x80, %esi
movq %r15, %rdi
movl %ebp, %r9d
xorl %eax, %eax
callq 0x1090
leaq 0x30e27(%rip), %rsi     # 0x32053
movq %r15, %rdi
callq 0x10d0
testq %rax, %rax
je 0x1344
movq %rax, %r15
movq %rsp, %rdi
callq 0x1050
movl %ebp, %eax
leaq (%rax,%rax,8), %r13
movq %r13, %r12
shlq $0x8, %r12
leaq (%r14,%r12), %rdi
addq $0x2400, %rdi           # imm = 0x2400
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
leaq (%r14,%r12), %rdi
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
leaq (%r14,%r12), %rdi
addq $0x6c00, %rdi           # imm = 0x6C00
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
leaq (%r14,%r12), %rdi
addq $0x4800, %rdi           # imm = 0x4800
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
shlq $0x9, %r13
leaq (%r14,%r13), %rdi
addq $0x9000, %rdi           # imm = 0x9000
movl $0x2, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
leaq (%r14,%r12), %rdi
addq $0xd800, %rdi           # imm = 0xD800
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
leaq (%r14,%r12), %rdi
addq $0xfc00, %rdi           # imm = 0xFC00
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
leaq (%r14,%r12), %rdi
addq $0x12000, %rdi          # imm = 0x12000
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
movq %r15, %rcx
callq 0x1060
movq %r15, %rdi
callq 0x1070
jmp 0x1379
callq 0x1040
movl $0x1, %ebx
cmpl $0x2, (%rax)
jne 0x1379
movl %ebp, %eax
leaq (%rax,%rax,8), %rax
shlq $0x8, %rax
leaq (%r14,%rax), %rdi
addq $0xfc00, %rdi           # imm = 0xFC00
movl $0x900, %edx            # imm = 0x900
movl $0x2, %esi
callq 0x10a0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/cath-mawr[P]rscmapgen/mapdump.c
// Function: get_tile_colour
uint32_t
get_tile_colour(const struct chunk *c, unsigned x, unsigned y)
{
	const unsigned pos = x + y * CHUNKSIZE;

	switch (c->overlays[0][pos]) {
	case 0: return colour_tab[c->colour[0][pos]];
	case 1: return 0x40403f;
	case 2: return 0x1f3f7d;
	case 3: return 0x603001;
	case 4: return 0x603001;
	case 5: return 0x40403f;
	case 6: return 0x6b030f;
	case 7: return 0x0e2c38;
	case 8: return 0x000000;
	case 9: return 0x606260;
	case 10: return 0x000000;
	case 11: return 0x9f5000;
	case 12: return 0x613000;
	case 13: return 0x1f3f7d;
	case 14: return 0x40403f;
	case 15: return 0x241609;
	case 16: return 0x241609;
	case 17: return 0x797b7a;
	case 23: return 0x483000;
	case 21: return 0x000000;
	case 24: return 0x3f2200;
	default:
		printf("Missing overlay definition: %u\n", c->overlays[0][pos]);
		return 0x0;
	}
}

// Assembly:
pushq %rbx
leal (%rdx,%rdx,2), %eax
shll $0x4, %eax
addl %esi, %eax
movzbl 0xfc00(%rdi,%rax), %esi
cmpq $0x18, %rsi
ja 0x13d4
leaq 0xc65(%rip), %rcx       # 0x2010
movslq (%rcx,%rsi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl $0x40403f, %ebx         # imm = 0x40403F
jmp 0x1430
xorl %ebx, %ebx
jmp 0x1430
movl $0x603001, %ebx         # imm = 0x603001
jmp 0x1430
movl $0x1f3f7d, %ebx         # imm = 0x1F3F7D
jmp 0x1430
movl $0x241609, %ebx         # imm = 0x241609
jmp 0x1430
leaq 0x30c7b(%rip), %rdi     # 0x32056
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1080
jmp 0x1430
movl $0x797b7a, %ebx         # imm = 0x797B7A
jmp 0x1430
movl $0x483000, %ebx         # imm = 0x483000
jmp 0x1430
movl $0xe2c38, %ebx          # imm = 0xE2C38
jmp 0x1430
movzbl 0x2400(%rdi,%rax), %eax
leaq 0x32c96(%rip), %rcx     # 0x340a0
movl (%rcx,%rax,4), %ebx
jmp 0x1430
movl $0x6b030f, %ebx         # imm = 0x6B030F
jmp 0x1430
movl $0x9f5000, %ebx         # imm = 0x9F5000
jmp 0x1430
movl $0x613000, %ebx         # imm = 0x613000
jmp 0x1430
movl $0x606260, %ebx         # imm = 0x606260
jmp 0x1430
movl $0x3f2200, %ebx         # imm = 0x3F2200
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/cath-mawr[P]rscmapgen/mapdump.c
// Function: write_tga
int write_tga(const char *outname, const uint32_t *pixels)
{
	unsigned i;
	FILE *f;

	if ((f = fopen(outname, "w")) == NULL) {
		return 1;
	}
	fputc(0, f); /* id len */
	fputc(0, f); /* maptype */
	fputc(2, f); /* uncompressed trucolour */
	fputc(0, f); /* map entry index */
	fputc(0, f); /* map entry index */
	fputc(0, f); /* map len */
	fputc(0, f); /* map len */
	fputc(0, f); /* map bpp */
	fputc(0, f); /* x-origin */
	fputc(0, f); /* x-origin */
	fputc(0, f); /* y-origin */
	fputc(0, f); /* y-origin */
	fputc((uint8_t)(XSIZE >> 0), f); /* width */
	fputc((uint8_t)(XSIZE >> 8), f); /* width */
	fputc((uint8_t)(YSIZE >> 0), f); /* height */
	fputc((uint8_t)(YSIZE >> 8), f); /* height */
	fputc(24, f); /* bpp */
	fputc(0x20, f); /* desc */
	for (i = 0; i < IMGSIZE; ++i) {
		fputc((uint8_t)(pixels[i] >> 0), f);
		fputc((uint8_t)(pixels[i] >> 8), f);
		fputc((uint8_t)(pixels[i] >> 16), f);
	}
	fclose(f);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x308d8(%rip), %rsi     # 0x32076
callq 0x10d0
testq %rax, %rax
je 0x18bc
movq %rax, %r14
xorl %r15d, %r15d
xorl %edi, %edi
movq %rax, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
movl $0x2, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x10b0
movl $0x90, %edi
movq %r14, %rsi
callq 0x10b0
movl $0x9, %edi
movq %r14, %rsi
callq 0x10b0
movl $0x90, %edi
movq %r14, %rsi
callq 0x10b0
movl $0x9, %edi
movq %r14, %rsi
callq 0x10b0
movl $0x18, %edi
movq %r14, %rsi
callq 0x10b0
movl $0x20, %edi
movq %r14, %rsi
callq 0x10b0
movzbl (%rbx,%r15,4), %edi
movq %r14, %rsi
callq 0x10b0
movzbl 0x1(%rbx,%r15,4), %edi
movq %r14, %rsi
callq 0x10b0
movzbl 0x2(%rbx,%r15,4), %edi
movq %r14, %rsi
callq 0x10b0
incq %r15
cmpq $0x5b7100, %r15         # imm = 0x5B7100
jne 0x187b
movq %r14, %rdi
callq 0x1070
xorl %eax, %eax
jmp 0x18c1
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/plvhx[P]dummy-vm/src/ast.c
// Function: vm_ast_create
vm_ast_t *vm_ast_create(unsigned short kind_type, const void *ast_value) {
  vm_ast_t *ret = vm_ast_alloc(vm_ast_calculate_child(4));

  ret->kind_type = kind_type;
  ret->num_childs = 0;
  ret->num_childs_alloc_size = 4;

  switch (ret->kind_type) {
  case VM_AST_REGISTER:
    ret->regs.name = (unsigned char *)ast_value;
    break;
  case VM_AST_MNEMONIC:
    ret->mnemonic.name = (unsigned char *)ast_value;
    break;
  case VM_AST_INTEGER_VALUE:
    ret->number.val = (unsigned char *)ast_value;
    break;
  }

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
movl $0x50, %edi
callq 0x1130
testq %rax, %rax
je 0x13c4
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x10(%rax)
movw %r14w, (%rax)
movq $0x0, 0x20(%rax)
movq $0x4, 0x28(%rax)
decl %r14d
cmpw $0x2, %r14w
ja 0x13bf
movzwl %r14w, %ecx
leaq 0x3cf9(%rip), %rdx      # 0x50b0
movq (%rdx,%rcx,8), %rcx
movq %rbx, (%rax,%rcx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3c39(%rip), %rdi      # 0x5004
leaq 0x3c3e(%rip), %rsi      # 0x5010
leaq 0x3c41(%rip), %rcx      # 0x501a
movl $0xc, %edx
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O1/plvhx[P]dummy-vm/src/ast.c
// Function: vm_ast_create_multi_ex
vm_ast_t *vm_ast_create_multi_ex(unsigned short kind_type,
                                 const void *ast_value, ...) {
  va_list ap;
  vm_ast_t *ret;

  va_start(ap, ast_value);
  ret = vm_ast_create_from_va_list(kind_type, ast_value, ap);
  va_end(ap);

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
leaq -0xd0(%rbp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x142f
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r10, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x20(%rbp)
callq 0x135c
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x1466
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x1472
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rsi
testq %rsi, %rsi
je 0x1484
movq %rax, %rdi
callq 0x148d
jmp 0x144e
addq $0xd0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/plvhx[P]dummy-vm/src/ast.c
// Function: vm_ast_add_child
vm_ast_t *vm_ast_add_child(vm_ast_t *ast, vm_ast_t *child) {
  if (ast->num_childs >= ast->num_childs_alloc_size) {
    ast =
        vm_ast_realloc(ast, vm_ast_calculate_child(ast->num_childs_alloc_size),
                       vm_ast_calculate_child(ast->num_childs_alloc_size + 4));

    ast->num_childs_alloc_size += 4;
  }

  ast->childs[ast->num_childs++] = child;
  return ast;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdi), %rax
cmpq %rax, 0x20(%rdi)
jb 0x14e6
leaq 0x30(,%rax,8), %r12
leaq 0x50(,%rax,8), %rsi
movq %rsi, %r15
subq %r12, %r15
jbe 0x1503
movq %r14, %rdi
callq 0x1140
testq %rax, %rax
je 0x1522
movq %rax, %r14
imulq $0x38, %r12, %rdi
addq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x10c0
addq $0x4, 0x28(%r14)
movq 0x20(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%r14)
movq %rbx, 0x30(%r14,%rax,8)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3b2f(%rip), %rdi      # 0x5039
leaq 0x3aff(%rip), %rsi      # 0x5010
leaq 0x3b35(%rip), %rcx      # 0x504d
movl $0x13, %edx
callq 0x10b0
leaq 0x3adb(%rip), %rdi      # 0x5004
leaq 0x3ae0(%rip), %rsi      # 0x5010
leaq 0x3b16(%rip), %rcx      # 0x504d
movl $0x15, %edx
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O1/plvhx[P]dummy-vm/src/ast.c
// Function: vm_ast_dtor
void vm_ast_dtor(vm_ast_t *ast) {
  if (ast == NULL) {
    return;
  }

  for (int i = 0; i < ast->num_childs; i++) {
    vm_ast_dtor(ast->childs[i]);
  }

  free(ast);
}

// Assembly:
testq %rdi, %rdi
je 0x2ab5
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
je 0x2aa9
xorl %r14d, %r14d
movq 0x30(%rbx,%r14,8), %rdi
callq 0x2a7d
incq %r14
cmpq %r14, 0x20(%rbx)
ja 0x2a96
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
retq
nop
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: ControlXonXoffSerialPort
void ControlXonXoffSerialPort(ISP_ENVIRONMENT *IspEnvironment, unsigned char XonXoff)
{
    if(tcgetattr(IspEnvironment->fdCom, &IspEnvironment->newtio))
    {
       DebugPrintf(1, "Could not get serial port behaviour\n");
       exit(3);
    }

    if(XonXoff)
    {
      IspEnvironment->newtio.c_iflag |= IXON;
      IspEnvironment->newtio.c_iflag |= IXOFF;
    }
    else
    {
      IspEnvironment->newtio.c_iflag &= ~IXON;
      IspEnvironment->newtio.c_iflag &= ~IXOFF;
    }

    if(tcsetattr(IspEnvironment->fdCom, TCSANOW, &IspEnvironment->newtio))
    {
       DebugPrintf(1, "Could not set serial port behaviour\n");
       exit(3);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl 0x80(%rdi), %edi
leaq 0xc0(%r14), %rbx
movq %rbx, %rsi
callq 0x41d0
testl %eax, %eax
jne 0x43d7
movl $0xffffebff, %eax       # imm = 0xFFFFEBFF
andl 0xc0(%r14), %eax
xorl %ecx, %ecx
testb %bpl, %bpl
movl $0x1400, %edx           # imm = 0x1400
cmovel %ecx, %edx
orl %eax, %edx
movl %edx, 0xc0(%r14)
movl 0x80(%r14), %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x41e0
testl %eax, %eax
jne 0x43e0
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x4c3e(%rip), %rsi      # 0x901c
jmp 0x43e7
leaq 0x4c5a(%rip), %rsi      # 0x9041
movl $0x1, %edi
xorl %eax, %eax
callq 0x43fd
movl $0x3, %edi
callq 0x4240
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: DebugPrintf
void DebugPrintf(int level, const char *fmt, ...)
{
    va_list ap;

    if (level <= debug_level)
    {
        char pTemp[2000];
        va_start(ap, fmt);
        //vprintf(fmt, ap);
        vsprintf(pTemp, fmt, ap);
        TRACE(pTemp);
        va_end(ap);
        fflush(stdout);
    }
}

// Assembly:
pushq %rbx
subq $0x8a0, %rsp            # imm = 0x8A0
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x4454
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl %edi, 0x9cf6(%rip)      # 0xe150
jl 0x44b1
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0x8b0(%rsp), %rax
movq %rax, 0x8(%rdx)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rdx)
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
callq 0x41c0
leaq 0x6974(%rip), %rdi      # 0xae0c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x40c0
movq 0x9b2f(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x4180
addq $0x8a0, %rsp            # imm = 0x8A0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: DumpString
void DumpString(int level, const void *b, size_t size, const char *prefix_string)
{
    size_t i;
    const char * s = (const char*) b;
    unsigned char c;

    DebugPrintf(level, prefix_string);

    DebugPrintf(level, "'");
    for (i = 0; i < size; i++)
    {
        c = s[i];
        if (c >= 0x20 && c <= 0x7e) /*isprint?*/
        {
            DebugPrintf(level, "%c", c);
        }
        else
        {
            DebugPrintf(level, "(%02X)", c);
        }
    }
    DebugPrintf(level, "'\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebx
movq %rcx, %rsi
xorl %eax, %eax
callq 0x43fd
leaq 0x4b70(%rip), %rsi      # 0x909b
movl %ebx, %edi
xorl %eax, %eax
callq 0x43fd
testq %r14, %r14
je 0x456c
leaq 0x4b5d(%rip), %r12      # 0x909d
leaq 0x4b59(%rip), %r13      # 0x90a0
xorl %ebp, %ebp
movzbl (%r15,%rbp), %edx
leal -0x20(%rdx), %eax
movq %r12, %rsi
cmpb $0x5f, %al
jb 0x455b
movq %r13, %rsi
movl %ebx, %edi
xorl %eax, %eax
callq 0x43fd
incq %rbp
cmpq %rbp, %r14
jne 0x4549
leaq 0x60fc(%rip), %rsi      # 0xa66f
movl %ebx, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x43fd
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: PrepareKeyboardTtySettings
void PrepareKeyboardTtySettings(void)
{
#if defined COMPILE_FOR_LINUX || defined COMPILE_FOR_CYGWIN
    /* store the current tty settings */
    if (!tcgetattr(0, &keyboard_origtty))
    {
        struct termios tty;
        /* start with the current settings */
        tty = keyboard_origtty;
        /* make modifications to put it in raw mode, turn off echo */
        tty.c_lflag &= ~ICANON;
        tty.c_lflag &= ~ECHO;
        tty.c_lflag &= ~ISIG;
        tty.c_cc[VMIN] = 1;
        tty.c_cc[VTIME] = 0;

        /* put the settings into effect */
        tcsetattr(0, TCSADRAIN, &tty);
    }
#endif
}

// Assembly:
subq $0x48, %rsp
leaq 0xcab1(%rip), %rsi      # 0x11100
xorl %edi, %edi
callq 0x41d0
testl %eax, %eax
jne 0x469e
movups 0xca9f(%rip), %xmm0     # 0x11100
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movups 0xcaa2(%rip), %xmm0     # 0x11110
movaps %xmm0, 0x10(%rdx)
movups 0xcab3(%rip), %xmm0     # 0x1112c
movups %xmm0, 0x2c(%rdx)
movups 0xca9c(%rip), %xmm0     # 0x11120
movaps %xmm0, 0x20(%rdx)
andb $-0xc, 0xc(%rdx)
movw $0x100, 0x16(%rdx)      # imm = 0x100
xorl %edi, %edi
movl $0x1, %esi
callq 0x41e0
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: ClearSerialPortBuffers
void ClearSerialPortBuffers(ISP_ENVIRONMENT *IspEnvironment)
{
#if defined COMPILE_FOR_LINUX
    /* variables to store the current tty state, create a new one */
    struct termios origtty, tty;

    /* store the current tty settings */
    tcgetattr(IspEnvironment->fdCom, &origtty);

    // Flush input and output buffers
    tty=origtty;
    tcsetattr(IspEnvironment->fdCom, TCSAFLUSH, &tty);

    /* reset the tty to its original settings */
    tcsetattr(IspEnvironment->fdCom, TCSADRAIN, &origtty);
#endif // defined COMPILE_FOR_LINUX
#if defined COMPILE_FOR_WINDOWS || defined COMPILE_FOR_CYGWIN
    PurgeComm(IspEnvironment->hCom, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR);
#endif // defined COMPILE_FOR_WINDOWS || defined COMPILE_FOR_CYGWIN
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movl 0x80(%rdi), %edi
leaq 0x3c(%rsp), %r14
movq %r14, %rsi
callq 0x41d0
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x2c(%r14), %xmm3
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm1, 0x10(%rdx)
movaps %xmm2, 0x20(%rdx)
movups %xmm3, 0x2c(%rdx)
movl 0x80(%rbx), %edi
movl $0x2, %esi
callq 0x41e0
movl 0x80(%rbx), %edi
movl $0x1, %esi
movq %r14, %rdx
callq 0x41e0
addq $0x78, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: ReceiveComPortBlockComplete
int ReceiveComPortBlockComplete(ISP_ENVIRONMENT *IspEnvironment,
                                                    void *block, size_t size, unsigned timeout)
{
    unsigned long realsize = 0, read;
    char *result;
    char tmp_string[32];

    result = (char*) block;

    SerialTimeoutSet(IspEnvironment, timeout);

    do
    {
        ReceiveComPortBlock(IspEnvironment, result + realsize, size - realsize, &read);

        realsize += read;

    } while ((realsize < size) && (SerialTimeoutCheck(IspEnvironment) == 0));

    sprintf(tmp_string, "Answer(Length=%ld): ", realsize);
    DumpString(3, result, realsize, tmp_string);

    if (realsize != size)
    {
        return 1;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movl %ecx, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
movl %eax, 0xfc(%rdi)
xorl %r15d, %r15d
leaq 0x8(%rsp), %r13
leaq (%r14,%r15), %rsi
movq %rbx, %rdx
subq %r15, %rdx
movq %r12, %rdi
movq %r13, %rcx
callq 0x48de
addq 0x8(%rsp), %r15
cmpq %rbx, %r15
jae 0x4a4b
cmpl $0x0, 0xfc(%r12)
jne 0x4a21
leaq 0x461d(%rip), %rsi      # 0x906f
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4230
movl $0x3, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x4507
xorl %eax, %eax
cmpq %rbx, %r15
setne %al
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: CloseSerialPort
static void CloseSerialPort(ISP_ENVIRONMENT *IspEnvironment)
{
    tcflush(IspEnvironment->fdCom, TCOFLUSH);
    tcflush(IspEnvironment->fdCom, TCIFLUSH);
    tcsetattr(IspEnvironment->fdCom, TCSANOW, &IspEnvironment->oldtio);

    close(IspEnvironment->fdCom);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x80(%rdi), %edi
movl $0x1, %esi
callq 0x40b0
movl 0x80(%rbx), %edi
xorl %esi, %esi
callq 0x40b0
movl 0x80(%rbx), %edi
leaq 0x84(%rbx), %rdx
xorl %esi, %esi
callq 0x41e0
movl 0x80(%rbx), %edi
popq %rbx
jmp 0x4100
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: LoadFiles1
static int LoadFiles1(ISP_ENVIRONMENT *IspEnvironment, const FILE_LIST *file)
{
    int ret_val;

    if( file->prev != 0)
    {
        DebugPrintf( 3, "Follow file list %s\n", file->name);

        ret_val = LoadFiles1( IspEnvironment, file->prev);
    if( ret_val != 0)
    {
      return ret_val;
    }
    }

    DebugPrintf( 3, "Attempt to read File %s\n", file->name);
    if(file->hex_flag != 0)
    {
        ret_val = LoadFile(IspEnvironment, file->name, FORMAT_HEX);
    }
    else
    {
    ret_val = LoadFile(IspEnvironment, file->name, FORMAT_BINARY);
    }
    if( ret_val != 0)
    {
    return ret_val;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x8(%rsi)
je 0x5622
movq (%r14), %rdx
leaq 0x3ba7(%rip), %rsi      # 0x91a5
movl $0x3, %edi
xorl %eax, %eax
callq 0x43fd
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x55e3
testl %eax, %eax
je 0x5622
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%r14), %rdx
leaq 0x3b8e(%rip), %rsi      # 0x91ba
movl $0x3, %edi
xorl %eax, %eax
callq 0x43fd
xorl %edx, %edx
cmpb $0x0, 0x10(%r14)
setne %dl
movq (%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5651
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: Ascii2Hex
static unsigned char Ascii2Hex(unsigned char c)
{
    if (c >= '0' && c <= '9')
    {
        return (unsigned char)(c - '0');
    }

    if (c >= 'A' && c <= 'F')
    {
        return (unsigned char)(c - 'A' + 10);
    }

    if (c >= 'a' && c <= 'f')
    {
        return (unsigned char)(c - 'a' + 10);
    }

    DebugPrintf(1, "Wrong Hex-Nibble %c (%02X)\n", c, c);
    exit(1);

    return 0;  // this "return" will never be reached, but some compilers give a warning if it is not present
}

// Assembly:
leal -0x30(%rdi), %eax
cmpb $0xa, %al
jb 0x5c8b
leal -0x41(%rdi), %eax
cmpb $0x5, %al
ja 0x5c7e
addb $-0x37, %dil
jmp 0x5c89
leal -0x61(%rdi), %eax
cmpb $0x5, %al
ja 0x5c8c
addb $-0x57, %dil
movl %edi, %eax
retq
pushq %rax
movzbl %dil, %ecx
leaq 0x3759(%rip), %rsi      # 0x93f1
movl $0x1, %edi
movl %ecx, %edx
xorl %eax, %eax
callq 0x43fd
movl $0x1, %edi
callq 0x4240
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: AddFileHex
static int AddFileHex(ISP_ENVIRONMENT *IspEnvironment, const char *arg)
{
    FILE_LIST *entry;

    // Add file to list.  If cannot allocate storage for node return an error.
    entry = malloc(sizeof(FILE_LIST));
    if( entry == 0)
    {
        DebugPrintf(1, "Error %d Could not allocated memory for file node %s\n", ERR_ALLOC_FILE_LIST, arg);
        return  ERR_ALLOC_FILE_LIST;
    }

    // Build up entry and insert it at the start of the list.
    entry->name = arg;
    entry->prev = IspEnvironment->f_list;
    entry->hex_flag = 1;
    IspEnvironment->f_list = entry;

    return 0;       // Success.
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x4160
testq %rax, %rax
je 0x5ce0
movq %rbx, (%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, 0x10(%rax)
movq %rax, 0x10(%r14)
xorl %ebp, %ebp
jmp 0x5d00
leaq 0x42ee(%rip), %rsi      # 0x9fd5
movl $0x3c, %ebp
movl $0x1, %edi
movl $0x3c, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x43fd
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: AddFileBinary
static int AddFileBinary(ISP_ENVIRONMENT *IspEnvironment, const char *arg)
{
    FILE_LIST *entry;

    // Add file to list. If cannot allocate storage for node return an error.
    entry = malloc(sizeof(FILE_LIST));
    if( entry == 0)
    {
        DebugPrintf( 1, "Error %d Could not allocated memory for file node %s\n", ERR_ALLOC_FILE_LIST, arg);
        return  ERR_ALLOC_FILE_LIST;
    }

    // Build up entry and insert it at the start of the list.
    entry->name = arg;
    entry->prev = IspEnvironment->f_list;
    entry->hex_flag = 0;
    IspEnvironment->f_list = entry;

    return 0;       // Success.
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x4160
testq %rax, %rax
je 0x5d37
movq %rbx, (%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rax, 0x10(%r14)
xorl %ebp, %ebp
jmp 0x5d57
leaq 0x4297(%rip), %rsi      # 0x9fd5
movl $0x3c, %ebp
movl $0x1, %edi
movl $0x3c, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x43fd
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/adprog.c
// Function: AnalogDevicesDownload
int AnalogDevicesDownload(ISP_ENVIRONMENT *IspEnvironment)
{
    AnalogDevicesSync(IspEnvironment);
    AnalogDevicesErase(IspEnvironment);
    if (IspEnvironment->BinaryLength > 0x80000)
    {
        DebugPrintf(2, "Note:  Flash remapped 0x80000 to 0.\n");
        AnalogDevicesWrite(IspEnvironment, IspEnvironment->BinaryContent + 0x80000, 0, IspEnvironment->BinaryLength-0x80000);
    }
    else
    {
        AnalogDevicesWrite(IspEnvironment, IspEnvironment->BinaryContent, 0, IspEnvironment->BinaryLength);
    }
    return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
callq 0x46b6
leaq 0x42b0(%rip), %rsi      # 0xa030
movl $0x2, %edi
xorl %eax, %eax
callq 0x43fd
leaq 0x4(%rsp), %r14
movb $0x8, (%r14)
movl $0x5, %ebp
leaq 0x5(%rsp), %r15
leaq 0x429e(%rip), %r12      # 0xa044
leaq 0x42bc(%rip), %r13      # 0xa069
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44ba
movl $0x18, %edx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1f4, %ecx            # imm = 0x1F4
callq 0x49f0
testl %eax, %eax
je 0x5de7
movl $0x3, %edi
movq %r13, %rsi
xorl %eax, %eax
callq 0x43fd
jmp 0x5e06
cmpl $0x43754441, 0x5(%rsp)  # imm = 0x43754441
je 0x5e2f
movl $0x18, %edx
movl $0x3, %edi
movq %r15, %rsi
movq %r12, %rcx
callq 0x4507
movq %rbx, %rdi
callq 0x46b6
decl %ebp
jne 0x5dad
leaq 0x427b(%rip), %rsi      # 0xa094
movl $0x1, %edi
xorl %eax, %eax
callq 0x43fd
movl $0x4, %edi
callq 0x4240
leaq 0x428b(%rip), %rsi      # 0xa0c1
movl $0x2, %edi
xorl %eax, %eax
callq 0x43fd
leaq 0x5(%rsp), %rsi
movq $0x45060e07, (%rsi)     # imm = 0x45060E07
movw $0xb500, 0x8(%rsi)      # imm = 0xB500
movq %rbx, %rdi
callq 0x6042
leaq 0x426a(%rip), %rsi      # 0xa0cd
movl $0x2, %edi
xorl %eax, %eax
callq 0x43fd
movq 0x60(%rbx), %rdx
cmpq $0x80001, %rdx          # imm = 0x80001
jb 0x5ea5
leaq 0x4188(%rip), %rsi      # 0xa00b
movl $0x2, %edi
xorl %eax, %eax
callq 0x43fd
movl $0x80000, %esi          # imm = 0x80000
addq 0x58(%rbx), %rsi
movq $-0x80000, %rdx         # imm = 0xFFF80000
addq 0x60(%rbx), %rdx
jmp 0x5ea9
movq 0x58(%rbx), %rsi
movq %rbx, %rdi
callq 0x5ec5
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/adprog.c
// Function: AnalogDevicesWrite
static void AnalogDevicesWrite(ISP_ENVIRONMENT *IspEnvironment,
                                         const void *data, long address, size_t bytes)
{
    AD_PACKET packet;
    const BINARY *prog_data;

    DebugPrintf(2, "Writing %d bytes ", bytes);
    prog_data = (const BINARY*) data;
    while (bytes > AD_PACKET_SIZE)
    {
        AnalogDevicesFormPacket(IspEnvironment, 'W', AD_PACKET_SIZE, address, prog_data, &packet);
        AnalogDevicesSendPacket(IspEnvironment, &packet);
        address += AD_PACKET_SIZE;
        prog_data += AD_PACKET_SIZE;
        bytes -= AD_PACKET_SIZE;
        DebugPrintf(2, ".");
    }
    if (bytes > 0)
    {
        AnalogDevicesFormPacket(IspEnvironment, 'W', bytes, address, prog_data, &packet);
        AnalogDevicesSendPacket(IspEnvironment, &packet);
        DebugPrintf(2, ".");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x42ac(%rip), %rsi      # 0xa192
xorl %r12d, %r12d
movl $0x2, %edi
xorl %eax, %eax
callq 0x43fd
cmpq $0xfb, %r15
jb 0x5f54
leaq 0x5(%rsp), %r13
movl $0xfa, %ebp
xorl %r12d, %r12d
leaq (%r14,%r12), %rcx
movl $0x57, %edi
movl $0xfa, %esi
movl %r12d, %edx
movq %r13, %r8
callq 0x5fa4
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6042
addq %rbp, %r12
addq $-0xfa, %r15
movl $0x2, %edi
leaq 0x4bf4(%rip), %rsi      # 0xab39
xorl %eax, %eax
callq 0x43fd
cmpq %rbp, %r15
ja 0x5f0b
addq %r12, %r14
testq %r15, %r15
je 0x5f92
leaq 0x5(%rsp), %r13
movl $0x57, %edi
movl %r15d, %esi
movl %r12d, %edx
movq %r14, %rcx
movq %r13, %r8
callq 0x5fa4
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6042
leaq 0x4bb3(%rip), %rsi      # 0xab39
movl $0x2, %edi
xorl %eax, %eax
callq 0x43fd
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/adprog.c
// Function: AnalogDevicesSendPacket
static void AnalogDevicesSendPacket(ISP_ENVIRONMENT *IspEnvironment,
                                                const AD_PACKET * packet)
{
    BINARY response;
    int retry = 0;

    do {
        retry++;

        /*  Make sure we don't read garbage later instead of    */
        /* the response we expect from the micro.               */
        ClearSerialPortBuffers(IspEnvironment);

        /*  Send the packet, the size is the number of data     */
        /* bytes in the packet plus 3 bytes worth of header     */
        /* plus checksum.                                       */
        SendComPortBlock(IspEnvironment, packet, packet->bytes + 4);

        /*  Receive the response and check, return to caller    */
        /* if successful.                                       */
        if (ReceiveComPortBlockComplete(IspEnvironment, &response, 1, 5000) == 0)
        {
            if (response == ANALOG_DEVICES_ACK)
            {
                DebugPrintf(3, "Packet Sent\n");
                return;
            }
            if (response != ANALOG_DEVICES_NAK)
            {
                DebugPrintf(3, "Unexpected response to packet (%x)\n", (int)response);
            }
            DebugPrintf(2, "*");
        }
    } while (retry < 3);

    DebugPrintf(1, "Send packet failed\n");
    exit(-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3, %ebp
leaq 0x7(%rsp), %r15
leaq 0x4118(%rip), %r12      # 0xa17c
leaq 0x40ed(%rip), %r13      # 0xa158
movq %r14, %rdi
callq 0x46b6
movzbl 0x2(%rbx), %edx
addq $0x4, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44ba
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
movl $0x1388, %ecx           # imm = 0x1388
callq 0x49f0
testl %eax, %eax
jne 0x60cc
movzbl 0x7(%rsp), %edx
cmpl $0x7, %edx
je 0x60bd
cmpl $0x6, %edx
je 0x60ed
movl $0x3, %edi
movq %r13, %rsi
xorl %eax, %eax
callq 0x43fd
movl $0x2, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x43fd
decl %ebp
jne 0x606b
leaq 0x40a7(%rip), %rsi      # 0xa17e
movl $0x1, %edi
xorl %eax, %eax
callq 0x43fd
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4240
leaq 0x4057(%rip), %rsi      # 0xa14b
movl $0x3, %edi
xorl %eax, %eax
callq 0x43fd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/bokunimowakaru[P]petit15term/lpc21isp/lpcprog.c
// Function: FormatCommand
static void FormatCommand(const char *In, char *Out)
{
  size_t i, j;
  for (i = 0, j = 0; In[j] != '\0'; i++, j++)
  {
    if ((In[j] == '\r') || (In[j] == '\n'))
    {
      if (i > 0) // Ignore leading line breaks (they must be leftovers from a previous answer)
      {
        Out[i] = '\n';
      }
      else
      {
        i--;
      }
      while ((In[j+1] == '\r') || (In[j+1] == '\n'))
      {
        j++;
      }
    }
    else
    {
      Out[i] = In[j];
    }
  }
  Out[i] = '\0';
}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %edx
cmpl $0xa, %edx
je 0x7e53
cmpl $0xd, %edx
je 0x7e53
testl %edx, %edx
je 0x7e81
movb %dl, (%rsi,%rax)
jmp 0x7e79
testq %rax, %rax
je 0x7e5e
movb $0xa, (%rsi,%rax)
jmp 0x7e6a
movq $-0x1, %rax
jmp 0x7e6a
incq %rcx
movzbl 0x1(%rdi,%rcx), %edx
cmpl $0xd, %edx
je 0x7e67
cmpl $0xa, %edx
je 0x7e67
incq %rax
incq %rcx
jmp 0x7e3c
movb $0x0, (%rsi,%rax)
retq