LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/CheneyThinker[P]jbyte/src/jbyte_method.c
// Function: analyzer_methods
void analyzer_methods(FILE* pReadFile, u1** constant_pool) {
  PRINTF_U2(methods_count)
  if (methods_count > 0) {
    for (u2 methods_count_index = 0; methods_count_index < methods_count; methods_count_index++) {
      PRINTF_U2(access_flags)
      PRINTF_U2(name_index)
      PRINTF_U2(descriptor_index)
      analyzer_attributes(pReadFile, constant_pool);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x30(%rbp), %r15
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
callq 0x1080
movzwl (%r15), %r12d
movl %r12d, %r15d
rolw $0x8, %r15w
movzwl %r15w, %esi
leaq 0x292c(%rip), %rdi      # 0x926c
xorl %eax, %eax
callq 0x10b0
testw %r12w, %r12w
je 0x69f5
pushq $0x1
popq %r12
pushq $0x2
popq %r13
subw $0x1, %r15w
jb 0x69f5
leaq -0x2e(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1080
movzwl -0x2e(%rbp), %eax
rolw $0x8, %ax
movzwl %ax, %esi
leaq 0x1c8e(%rip), %rdi      # 0x8616
xorl %eax, %eax
callq 0x10b0
leaq -0x2c(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1080
movzwl -0x2c(%rbp), %eax
rolw $0x8, %ax
movzwl %ax, %esi
leaq 0x1fb4(%rip), %rdi      # 0x8967
xorl %eax, %eax
callq 0x10b0
leaq -0x2a(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1080
movzwl -0x2a(%rbp), %eax
rolw $0x8, %ax
movzwl %ax, %esi
leaq 0x1d02(%rip), %rdi      # 0x86e0
xorl %eax, %eax
callq 0x10b0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x12b3
jmp 0x6959
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/CheneyThinker[P]jbyte/src/jbyte_generator.c
// Function: jbyte_generator
int jbyte_generator(int argc, char** argv) {
  FILE* pWriteFile = fopen(argv[2], "w+b");
  if (pWriteFile != NULL) {
    PUT_U4(magic, MAGIC)
    PUT_U2(minor_version, 0x0000)
    PUT_U2(major_version, JDK13)
    generator_constant_pool(pWriteFile);
    PUT_U2(access_flags, ACC_PUBLIC | ACC_SUPER)
    PUT_U2(this_class, 0x0012)
    PUT_U2(super_class, 0x0013)
    u2 interfaces_count_value = 0x0000;
    PUT_U2(interfaces_count, interfaces_count_value)
    for (u2 interfaces_count_index = 0; interfaces_count_index < interfaces_count_value; interfaces_count_index++) {
      //PUT_U2(interfaces, )
    }
    generator_fields(pWriteFile);
    generator_methods(pWriteFile);
    generator_attributes(pWriteFile);
  }
  fclose(pWriteFile);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x10(%rsi), %rdi
leaq 0x26bd(%rip), %rsi      # 0x930b
callq 0x1100
movq %rax, %rbx
testq %rax, %rax
je 0x6d35
leaq -0x24(%rbp), %r15
movl $0xbebafeca, (%r15)     # imm = 0xBEBAFECA
pushq $0x4
popq %rsi
pushq $0x1
popq %r14
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1120
andw $0x0, (%r15)
leaq -0x24(%rbp), %r12
pushq $0x2
popq %r15
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1120
movw $0x3900, (%r12)         # imm = 0x3900
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1120
movq %rbx, %rdi
callq 0x55f4
movw $0x2100, (%r12)         # imm = 0x2100
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1120
movw $0x1200, (%r12)         # imm = 0x1200
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1120
movw $0x1300, (%r12)         # imm = 0x1300
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1120
andw $0x0, (%r12)
leaq -0x24(%rbp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1120
movq %rbx, %rdi
callq 0x63a0
movq %rbx, %rdi
callq 0x64c8
movq %rbx, %rdi
callq 0x122c
movq %rbx, %rdi
callq 0x1090
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/CheneyThinker[P]jbyte/src/jbyte.c
// Function: main
int main(int argc, char** argv)
{
  if (!strcasecmp(argv[1], "--analyzer")) {
    return jbyte_analyzer(argc, argv);
  } else if (!strcasecmp(argv[1], "--generator")) {
    return jbyte_generator(argc, argv);
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movq 0x8(%rsi), %r15
leaq 0x25a8(%rip), %rsi      # 0x930f
movq %r15, %rdi
callq 0x1050
testl %eax, %eax
je 0x6d93
leaq 0x25a0(%rip), %rsi      # 0x931a
movq %r15, %rdi
callq 0x1050
testl %eax, %eax
je 0x6da8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6a04
movl %r14d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6c34
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/des/des/des.c
// Function: permutation
void permutation(uint64_t *data, bool initial)
{
  uint64_t dtmp = 0;
  for(int i=0; i<64; i++)
  {
    if(initial)
      addbit(&dtmp, *data, IP[i] -1, i);
    else
      addbit(&dtmp, *data, IP_1[i] -1, i);
  }
  *data = dtmp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq (%rdi), %r9
xorl %r10d, %r10d
leaq 0xe12(%rip), %r11       # 0x2010
leaq 0x100b(%rip), %rbx      # 0x2210
xorl %eax, %eax
xorl %r14d, %r14d
cmpq $0x40, %rax
je 0x1241
testb %sil, %sil
je 0x121b
movl (%r10,%r11), %ecx
jmp 0x121f
movl (%r10,%rbx), %ecx
addl %r8d, %ecx
movq %r9, %r15
shlq %cl, %r15
testq %r15, %r15
jns 0x1238
movq %rdx, %r15
movl %eax, %ecx
shrq %cl, %r15
addq %r15, %r14
incq %rax
addq $0x8, %r10
jmp 0x120a
movq %r14, (%rdi)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/des/des/des.c
// Function: rounds
void rounds(uint64_t *data, uint64_t key)
{
  uint64_t right_block = 0;
  uint64_t right_block_tmp = 0;

  // block expansion
  for(int i=0; i<48; i++)
    addbit(&right_block, *data, (EP[i] + 31), i);

  // xor with key
  right_block = right_block^key;

  // substitution
  int coordx, coordy;
  uint64_t substitued;

  for(int i=0; i<8; i++)
  {
    coordx = ((right_block << 6 * i) & FIRSTBIT) == FIRSTBIT ? 2:0;

    coordy = 0;
    for(int j=1; j<5; j++) {
      if(((right_block<<(6*i + 5)) & FIRSTBIT) == FIRSTBIT)
        coordy += 2^(4-j);
    }

    substitued = sbox[i][coordx][coordy];
    substitued  = substitued << (60 - (4*i));
    right_block_tmp += substitued;
  }

  //Right Block completed
  right_block = right_block_tmp;

  //Permuation
  right_block_tmp = 0;

  for(int i=0; i<32; i++)
    addbit(&right_block_tmp, right_block, PF[i]-1, i);

  right_block = right_block_tmp;

  // xor with left block
  right_block = right_block ^ *data;

  //combine the new block and the right block
  *data = (*data<< 32) + (right_block>>32);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
movq (%rdi), %rdx
leaq 0x11a7(%rip), %r10      # 0x2410
xorl %eax, %eax
xorl %r9d, %r9d
cmpq $0x30, %rax
je 0x129b
movb (%r10), %cl
addb $0x1f, %cl
movq %rdx, %r11
shlq %cl, %r11
movq %r8, %rbx
movl %eax, %ecx
shrq %cl, %rbx
sarq $0x3f, %r11
andq %rbx, %r11
addq %r11, %r9
incq %rax
addq $0x8, %r10
jmp 0x126e
xorq %rsi, %r9
xorl %eax, %eax
movl $0x3, %r10d
leaq 0x13e3(%rip), %r11      # 0x2690
xorl %esi, %esi
cmpq $0x8, %rax
je 0x131a
imull $0x6, %eax, %ecx
movq %r9, %rbx
shlq %cl, %rbx
addb $0x5, %cl
movq %r9, %r14
shlq %cl, %r14
shrq $0x3e, %rbx
xorl %ecx, %ecx
sarq $0x3f, %r14
movl %r10d, %ebp
cmpl $-0x1, %ebp
je 0x12ea
movl %ebp, %r15d
xorl $0x2, %r15d
andl %r14d, %r15d
addl %r15d, %ecx
decl %ebp
jmp 0x12d4
andl $-0x2, %ebx
movl %ecx, %ecx
movq %rax, %r14
shlq $0x9, %r14
addq %r11, %r14
shll $0x7, %ebx
addq %r14, %rbx
movq (%rbx,%rcx,8), %rbx
leal (,%rax,4), %ebp
movb $0x3c, %cl
subb %bpl, %cl
shlq %cl, %rbx
addq %rbx, %rsi
incq %rax
jmp 0x12af
leaq 0x126f(%rip), %r10      # 0x2590
xorl %eax, %eax
xorl %r9d, %r9d
cmpq $0x20, %rax
je 0x1352
movb (%r10), %cl
decb %cl
movq %rsi, %r11
shlq %cl, %r11
movq %r8, %rbx
movl %eax, %ecx
shrq %cl, %rbx
sarq $0x3f, %r11
andq %rbx, %r11
addq %r11, %r9
incq %rax
addq $0x8, %r10
jmp 0x1326
xorq %rdx, %r9
shrdq $0x20, %rdx, %r9
movq %r9, (%rdi)
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/des/des/des.c
// Function: key_convert
uint64_t key_convert(const char *key)
{ 
  if(strlen(key)>9)
    return 0; 
  uint64_t keyval = 0;
  for(int i=0;i < 8;i++){
    keyval = (keyval<<8)|key[i];
  }
  if(key_parity_verify(keyval))
    return keyval;
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1050
cmpq $0x9, %rax
ja 0x13e8
xorl %ecx, %ecx
xorl %eax, %eax
cmpq $0x8, %rcx
je 0x138e
shlq $0x8, %rax
movsbq (%rbx,%rcx), %rdx
orq %rdx, %rax
incq %rcx
jmp 0x1377
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x40, %rcx
je 0x13e8
movl %ecx, %esi
notl %esi
testb $0x7, %sil
jne 0x13b3
movq %rax, %rsi
shlq %cl, %rsi
testl %edx, %edx
jne 0x13ca
testq %rsi, %rsi
jns 0x13cf
jmp 0x13d6
movq %rax, %rsi
shlq %cl, %rsi
testq %rsi, %rsi
jns 0x13d1
xorl %esi, %esi
testl %edx, %edx
sete %sil
movl %esi, %edx
jmp 0x13d1
testq %rsi, %rsi
jns 0x13d6
xorl %edx, %edx
incq %rcx
jmp 0x1392
incl %ecx
leaq 0x2671(%rip), %rdi      # 0x3a50
movl %ecx, %esi
xorl %eax, %eax
callq 0x1070
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/des/des/des.c
// Function: encrypt
void encrypt(FILE *ifile, FILE *ofile, uint64_t key)
{
  size_t size;
  uint64_t data;
  uint64_t sub_key[ROUNDS]={0};
  get_subkey(key, sub_key);

  while((size = fread(&data,1,8, ifile)) > 0)
  {
    if(size != 8)
      data = data << (8*(8-size));

    permutation(&data, true);
    for(int i=0;i< ROUNDS;i++)
      rounds(&data, sub_key[i]);

    permutation(&data, false);

    if(size != 8)
      data = data<< (8*(8-size));

    fwrite(&data, 1, size, ofile);
    data = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq %rdx, %rdi
callq 0x14de
leaq 0x8(%rsp), %r15
pushq $0x1
popq %r12
movq %r15, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
movq %r14, %rcx
callq 0x1030
testq %rax, %rax
je 0x14cc
movq %rax, %rbp
cmpq $0x8, %rax
je 0x146a
leal (,%rbp,8), %eax
movb $0x40, %cl
subb %al, %cl
shlq %cl, 0x8(%rsp)
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0x11dc
xorl %r13d, %r13d
cmpq $0x10, %r13
je 0x1490
movq 0x10(%rsp,%r13,8), %rsi
movq %r15, %rdi
callq 0x124f
incq %r13
jmp 0x1478
movq %r15, %rdi
xorl %esi, %esi
callq 0x11dc
cmpq $0x8, %rbp
je 0x14b0
leal (,%rbp,8), %eax
movb $0x40, %cl
subb %al, %cl
shlq %cl, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x10b0
andq $0x0, 0x8(%rsp)
jmp 0x143b
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/des/des/des.c
// Function: get_subkey
static void get_subkey(uint64_t key, uint64_t sub_key[])
{
  sub_key[0] = key;
  uint64_t nxt_key;

  for(int i =0; i<ROUNDS; i++)
  {
    key_schedule(&sub_key[i], &nxt_key, i);
    if(i != 15)
      sub_key[i+1] = nxt_key;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, (%rsi)
xorl %r14d, %r14d
cmpq $0x10, %r14
je 0x1505
movq %rbx, %rdi
movl %r14d, %edx
callq 0x124a
incq %r14
addq $0x8, %rbx
jmp 0x14eb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/des/des/des.c
// Function: decrypt
void decrypt(FILE *ifile, FILE *ofile, uint64_t key)
{
  size_t size;
  uint64_t data;
  uint64_t sub_key[ROUNDS]={0};
  get_subkey(key, sub_key);

  while((size = fread(&data,1,8, ifile)) > 0)
  {
    data = (data<<32) + (data>>32);
    for(int i=ROUNDS-1; i >=0; i--)
      rounds(&data, sub_key[i]);

    permutation(&data, false);

    if(size != 8)
      data = data<< (8*(8-size));

    fwrite(&data, 1, size, ofile);
    data = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq %rdx, %rdi
callq 0x14de
leaq 0x8(%rsp), %r15
pushq $0x1
popq %r12
movq %r15, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
movq %r14, %rcx
callq 0x1030
testq %rax, %rax
je 0x15d2
movq %rax, %rbp
rolq $0x20, 0x8(%rsp)
pushq $0xf
popq %r13
testl %r13d, %r13d
js 0x1599
movl %r13d, %eax
movq 0x10(%rsp,%rax,8), %rsi
movq %r15, %rdi
callq 0x124f
decl %r13d
jmp 0x157f
movq %r15, %rdi
xorl %esi, %esi
callq 0x11dc
cmpq $0x8, %rbp
je 0x15b9
leal (,%rbp,8), %eax
movb $0x40, %cl
subb %al, %cl
shlq %cl, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x10b0
andq $0x0, 0x8(%rsp)
jmp 0x155c
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/des/des/main.c
// Function: help
static void help(int status)
{
  if(status == EXIT_SUCCESS)
  {
    fprintf(stdout,"Usage: des -i <filename> -o <filename> -k <key> -t <task>\n"
        "encrypt or decrypt with DES...\n"
        "-k, --key=KEY      64 bits key\n"
        "-t, --task         'e' for encryption or 'd' for decryption\n"
        "-o, --output=FILE  write result to FILE\n"
        "-i, --input=FILE   read from the FILE\n"
        "--help         display this help\n");
  }
  else
  {
    fprintf(stderr, "Try './des --help' for more information.\n");
  }
  exit(status);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
testl %edi, %edi
je 0x1836
movq 0x47de(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0x246d(%rip), %rdi      # 0x3c91
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x10b0
movl %ebx, %edi
callq 0x10a0
movq 0x4793(%rip), %rax      # 0x5fd0
movq (%rax), %rcx
leaq 0x2326(%rip), %rdi      # 0x3b6d
pushq $0x1
popq %rdx
movl $0x123, %esi            # imm = 0x123
jmp 0x182a
// File: /workspace/github_c_makefile_star2_O2/seojangho[P]clee/warning.c
// Function: main
int main(int argc, char **argv, char **envp) {
    int param_opt;
    char *ip = "121.189.57.82"; /* warning.or.kr */
    while ((param_opt = getopt(argc, argv, "i:h")) != -1) {
        switch (param_opt) {
            case 'i':
                ip = optarg;
                break;
            case 'h':
                showhelp(argv[0]);
                exit(0);
            case '?':
                showhelp(argv[0]);
                exit(1);
        }
    }

    if (optind == argc) {
        showhelp(argv[0]);
        exit(1);
    }

    struct sockaddr_in serverAddr;
    serverAddr.sin_family = AF_INET;
    serverAddr.sin_port = htons(80);
    serverAddr.sin_addr.s_addr = inet_addr(ip);
    vector = &serverAddr;

    clee_init();
    clee_set_trigger(syscall_entry, onSyscallEntry);
    clee(argv[optind], argv + optind, envp, next_syscall, NULL, 0);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1acf(%rip), %r15      # 0x6dd0
leaq 0x1ad6(%rip), %r12      # 0x6dde
movq 0x4cd1(%rip), %r13      # 0x9fe0
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x31c0
cmpl $-0x1, %eax
je 0x533b
cmpl $0x69, %eax
je 0x5335
cmpl $0x3f, %eax
je 0x53aa
cmpl $0x68, %eax
jne 0x530f
jmp 0x53ba
movq (%r13), %r15
jmp 0x530f
movq 0x4c96(%rip), %r12      # 0x9fd8
cmpl %ebp, (%r12)
je 0x53aa
leaq 0x8(%rsp), %r13
movl $0x50000002, (%r13)     # imm = 0x50000002
movq %r15, %rdi
callq 0x3120
movl %eax, 0x4(%r13)
movq %r13, 0x4f90(%rip)      # 0xa2f8
xorl %eax, %eax
callq 0x330c
leaq 0x72(%rip), %rsi        # 0x53e8
xorl %edi, %edi
callq 0x3a24
movslq (%r12), %rax
leaq (%r14,%rax,8), %rsi
movq (%rsi), %rdi
pushq $0x4
popq %rcx
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x33b4
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
callq 0x53c9
pushq $0x1
popq %rdi
callq 0x31e0
movq (%r14), %rdi
callq 0x53c9
xorl %edi, %edi
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O2/seojangho[P]clee/warning.c
// Function: onSyscallEntry
void onSyscallEntry() {
    if (clee_syscall_num() == 42) {
        struct sockaddr_in original;
        clee_read((void*)clee_get_arg(1), &original, sizeof(struct sockaddr_in));
        printf("connecting to %s -> ", inet_ntoa(original.sin_addr));
        printf("manipulating request to %s\n", inet_ntoa(vector->sin_addr));
        clee_write(vector, (void*)clee_get_arg(1), sizeof(struct sockaddr_in));
        return;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
xorl %eax, %eax
callq 0x3987
cmpq $0x2a, %rax
jne 0x5473
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x39b0
movq %rsp, %r15
pushq $0x10
popq %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3a93
movl 0x4(%r15), %edi
callq 0x3080
leaq 0x19db(%rip), %rdi      # 0x6e08
movq %rax, %rsi
xorl %eax, %eax
callq 0x30a0
movq 0x4eba(%rip), %rax      # 0xa2f8
movl 0x4(%rax), %edi
callq 0x3080
leaq 0x19d0(%rip), %rdi      # 0x6e1d
movq %rax, %rsi
xorl %eax, %eax
callq 0x30a0
movq 0x4e9a(%rip), %r15      # 0xa2f8
movl %ebx, %edi
callq 0x39b0
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x3af0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp11.c
// Function: usage
void
usage(void)
{
	fprintf(stderr, "usage: %s [-p port] [-s time(ms)] [-d] server\n", argv0);
	fprintf(stderr, "\tserver: host running pdp-10\n");
	fprintf(stderr, "\t-p: pdp-10 port; default 1110\n");
	fprintf(stderr, "\t-s: sleep (ms); default=0\n");
	fprintf(stderr, "\t-d: write debug log\n");
	exit(0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x1a4b7(%rip), %r14     # 0x1cff8
movq (%r14), %rdi
movq 0x288fd(%rip), %rdx     # 0x2b448
leaq 0x10573(%rip), %rsi     # 0x130c5
xorl %eax, %eax
callq 0x2140
movq (%r14), %rcx
leaq 0x10591(%rip), %rdi     # 0x130f4
pushq $0x1d
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22c0
movq (%r14), %rcx
leaq 0x10597(%rip), %rdi     # 0x13112
pushq $0x1f
popq %rsi
movq %rbx, %rdx
callq 0x22c0
movq (%r14), %rcx
leaq 0x105a2(%rip), %rdi     # 0x13132
pushq $0x1b
popq %rsi
movq %rbx, %rdx
callq 0x22c0
movq (%r14), %rcx
leaq 0x105a9(%rip), %rdi     # 0x1314e
pushq $0x15
popq %rsi
movq %rbx, %rdx
callq 0x22c0
xorl %edi, %edi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: dato_xgp
int
dato_xgp(Bus *bus, void *dev)
{
	char file[256];
	XGP *xgp = dev;
	int offset, lines;
	word d;

	d = bus->data;
	switch(bus->addr){
	case XCR:
		if((d & FMOT) != 0 && xgp->speed == 0)
			fprintf(stderr, "Paper in motion\n");
		xgp->xcr = d;
		if((xgp->xcr & FMOT) != 0 && (xgp->xcr & FRDY) == 0)
			print_start();
		if(d & FGO) {
			if(xgp->xsr & FRDY) {
				xgp->xcr |= FGO;
				xgp->xcr &= ~FDONE;
				xgp->go = xgp_idle;
				xgp->mode = xgp_char;
				xgp->dots = 0;
			} else
				xgp->xcr |= FERR;
		}
		return 0;
	case MAR:
		xgp->mar = d;
		return 0;
	case XSR:
		xgp->xsr = d;
		return 0;
	case XCUT:
		if(bus->data & FCUTI) {
			offset = MKTOCT * 100000 / 60 / 775;
			lines = print_finish(offset, file, sizeof file);
			if(lines > 0 && *file != 0)
				fprintf(stderr, "Printed %d lines, %.1f inches to %s\n",
					lines, lines / 200.0, file);
			else if(lines < 0)
				fprintf(stderr, "Printing error\n");
			fprintf(stderr, "Paper cut\n");
		}
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
pushq $0x1
popq %rbx
movl $0xfffc0bc0, %eax       # imm = 0xFFFC0BC0
addl 0x8(%rdi), %eax
cmpl $0x6, %eax
ja 0x2f05
movq %rsi, %r14
movzwl 0xc(%rdi), %ebp
leaq 0x10388(%rip), %rcx     # 0x131a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl %bp, %r15d
btl $0xa, %r15d
jae 0x2e37
cmpl $0x0, 0x44(%r14)
je 0x2f15
movw %bp, 0x28(%r14)
movl %r15d, %eax
andl $0x440, %eax            # imm = 0x440
cmpl $0x400, %eax            # imm = 0x400
jne 0x2e50
callq 0x6428
xorl %ebx, %ebx
testb $0x1, %r15b
je 0x2f05
testb $0x40, 0x2c(%r14)
movzwl 0x28(%r14), %eax
jne 0x2ede
orl $0x8000, %eax           # imm = 0x8000
movw %ax, 0x28(%r14)
jmp 0x2f05
movw %bp, 0x2c(%r14)
jmp 0x2e83
movw %bp, 0x2a(%r14)
xorl %ebx, %ebx
jmp 0x2f05
xorl %ebx, %ebx
testb $0x4, %bpl
je 0x2f05
movq %rsp, %rsi
movl $0x100, %edx            # imm = 0x100
movl $0x1156, %edi           # imm = 0x1156
callq 0x64c6
testl %eax, %eax
jle 0x2f36
cmpb $0x0, (%rsp)
je 0x2f36
movq 0x1a13e(%rip), %rcx     # 0x1cff8
movq (%rcx), %rdi
cvtsi2sd %eax, %xmm0
divsd 0x102cf(%rip), %xmm0    # 0x13198
leaq 0x10319(%rip), %rsi     # 0x131e9
movq %rsp, %rcx
movl %eax, %edx
movb $0x1, %al
callq 0x2140
jmp 0x2f56
andl $0xffffff7e, %eax       # imm = 0xFFFFFF7E
incl %eax
movw %ax, 0x28(%r14)
leaq -0x109(%rip), %rax      # 0x2de8
movq %rax, 0x30(%r14)
leaq 0x78(%rip), %rax        # 0x2f74
movq %rax, 0x38(%r14)
andl $0x0, 0x48(%r14)
movl %ebx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x1a0dc(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0x102b2(%rip), %rdi     # 0x131d8
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
jmp 0x2e37
testl %eax, %eax
jns 0x2f56
movq 0x1a0b7(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0x102c3(%rip), %rdi     # 0x1320e
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
movq 0x1a09b(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0x102b7(%rip), %rdi     # 0x1321e
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
jmp 0x2f05
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: dati_xgp
int
dati_xgp(Bus *bus, void *dev)
{
	XGP *xgp = dev;

	switch(bus->addr){
	case XCR:
		bus->data = xgp->xcr;
		return 0;
	case MAR:
		bus->data = xgp->mar;
		return 0;
	case XSR:
		bus->data = xgp->xsr;
		return 0;
	case XCUT:
		return 0;
	}
	return 1;
}

// Assembly:
movl $0xfffc0bc0, %ecx       # imm = 0xFFFC0BC0
addl 0x8(%rdi), %ecx
cmpl $0x6, %ecx
ja 0x2fdb
xorl %eax, %eax
leaq 0x101ff(%rip), %rdx     # 0x131bc
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzwl 0x28(%rsi), %ecx
jmp 0x2fd6
movzwl 0x2a(%rsi), %ecx
jmp 0x2fd6
movzwl 0x2c(%rsi), %ecx
movw %cx, 0xc(%rdi)
retq
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: xgp_done
void
xgp_done(XGP *xgp, uint16 errors)
{
	xgp->xcr |= FDONE;
	xgp->xcr &= ~FGO;
	xgp->go = xgp_idle;
	if(errors) {
		xgp->xcr |= FERR;
		xgp->xsr |= errors;
	}
}

// Assembly:
movzwl 0x28(%rdi), %eax
andl $0xff7e, %eax           # imm = 0xFF7E
leal 0x80(%rax), %ecx
movw %cx, 0x28(%rdi)
leaq -0x211(%rip), %rcx      # 0x2de8
movq %rcx, 0x30(%rdi)
testl %esi, %esi
je 0x300e
orl $0x8080, %eax           # imm = 0x8080
movw %ax, 0x28(%rdi)
orw %si, 0x2c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: xgp_output
void
xgp_output(XGP *xgp, uint8 data, int n)
{
	int m = 1;
	while(n-- > 0) {
		print_dot(data & m);
		m <<= 1;
		xgp->dots++;
		if(xgp->dots >= MAX_WIDTH) {
			xgp_done(xgp, FOS);
			return;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
incl %ebx
pushq $0x1
popq %r15
decl %ebx
testl %ebx, %ebx
jle 0x305f
movl %r15d, %edi
andl %ebp, %edi
callq 0x6473
addl %r15d, %r15d
movl 0x48(%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x48(%r14)
cmpl $0x6bf, %eax            # imm = 0x6BF
jl 0x3023
movq %r14, %rdi
movl $0x8000, %esi           # imm = 0x8000
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2fdf
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: xgp_vector
void
xgp_vector(XGP *xgp, uint8 data)
{
	if(data == 0)
		xgp->cnt++;
	else
		xgp->cnt = 0;

	if(xgp->cnt == 2)
		xgp->mode = xgp_char;

	if(data == 0)
		return;

	while(data > 8) {
		xgp_output(xgp, xgp->bw, 8);
		data -= 8;
		if(xgp->xcr & FDONE)
			return;
	}
	xgp_output(xgp, xgp->bw, data);

	xgp->bw ^= 0xFF;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x30aa
andw $0x0, 0x40(%rbx)
movzbl %sil, %ebp
pushq $0x8
popq %r14
cmpb $0x9, %bpl
jb 0x30c6
movzbl 0x42(%rbx), %esi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x300f
addl $-0x8, %ebp
testb $-0x80, 0x28(%rbx)
je 0x308a
jmp 0x30d7
movl 0x40(%rbx), %eax
incl %eax
movw %ax, 0x40(%rbx)
cmpw $0x2, %ax
jne 0x30d7
leaq -0x14c(%rip), %rax      # 0x2f74
movq %rax, 0x38(%rbx)
jmp 0x30d7
movzbl 0x42(%rbx), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x300f
notb 0x42(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: xgp_command
void
xgp_command(XGP *xgp, uint8 data)
{
	switch(data) {
	case 0x00:
		xgp->mode = xgp_vector;
		xgp->cnt = 0;
		xgp->bw = 0;
		break;
	case 0x01:
		xgp_done(xgp, 0);
		break;
	case 0x02:
		xgp->mode = xgp_image;
		break;
	default:
		xgp_done(xgp, FBCB);
		break;
	}
}

// Assembly:
cmpl $0x2, %esi
je 0x311c
cmpl $0x1, %esi
je 0x30ff
testl %esi, %esi
jne 0x3128
leaq -0x7f(%rip), %rax       # 0x3072
movq %rax, 0x38(%rdi)
andw $0x0, 0x40(%rdi)
movb $0x0, 0x42(%rdi)
retq
movl $0xffffff7e, %eax       # imm = 0xFFFFFF7E
andl 0x28(%rdi), %eax
orl $0x80, %eax
movw %ax, 0x28(%rdi)
leaq -0x32f(%rip), %rax      # 0x2de8
movq %rax, 0x30(%rdi)
retq
leaq -0xb9(%rip), %rax       # 0x306a
movq %rax, 0x38(%rdi)
retq
movl $0x400, %esi            # imm = 0x400
jmp 0x2fdf
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: xgp_char_data
void
xgp_char_data(XGP *xgp, uint8 data)
{
	if(xgp->cnt > 8) {
		xgp_output(xgp, data, 8);
		xgp->cnt -= 8;
	} else {
		xgp_output(xgp, data, xgp->cnt);
		xgp->mode = xgp_char;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzwl 0x40(%rdi), %edx
movzbl %sil, %esi
cmpl $0x9, %edx
jb 0x3155
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x300f
addw $-0x8, 0x40(%rbx)
jmp 0x3168
movq %rbx, %rdi
callq 0x300f
leaq -0x1f0(%rip), %rax      # 0x2f74
movq %rax, 0x38(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: xgp_read
void
xgp_read(XGP *xgp, Bus *bus)
{
	bus->addr = xgp->mar;
	xgp->mar += 2;
	if(dati_bus(bus)) goto be;
	xgp_byte(xgp, bus->data & 0xFF);
	xgp_byte(xgp, bus->data >> 8);
	return;	

be:
	xgp_done(xgp, FNXM);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x2a(%rdi), %eax
movl %eax, 0x8(%rsi)
addl $0x2, %eax
movw %ax, 0x2a(%rdi)
movq %rsi, %rdi
callq 0x243f
testl %eax, %eax
je 0x31e1
movq %rbx, %rdi
movl $0x1000, %esi           # imm = 0x1000
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2fdf
testb $0x1, 0x28(%rbx)
je 0x31f8
movzbl 0xc(%r14), %esi
movq %rbx, %rdi
callq *0x38(%rbx)
testb $0x1, 0x28(%rbx)
jne 0x3200
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movzbl 0xd(%r14), %esi
movq 0x38(%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: xgp_sync
void
xgp_sync(XGP *xgp)
{
	int wstatus;
	if(waitpid(-1, &wstatus, WNOHANG) > 0) {
		if(WIFEXITED(wstatus) && WEXITSTATUS(wstatus) != 0)
			fprintf(stderr, "Printing error\n");
	}

	if(xgp->xcr & FMOT)
		xgp->speed += (xgp->speed < SPEED_READY);
	else if (--xgp->stopping == 0) {
		xgp->stopping = 1;
		if(xgp->speed == SPEED_READY)
			fprintf(stderr, "XGP stopping\n");
		if(xgp->speed == 1)
			fprintf(stderr, "XGP stopped\n");
		xgp->speed -= (xgp->speed > 0);
	}

	if(xgp->speed >= SPEED_READY) {
		if((xgp->xsr & FRDY) == 0) {
			fprintf(stderr, "Paper up to speed\n");
			xgp->stopping = 3*MKTOCT;
		}
		print_line();
		xgp->xsr |= FRDY;
	} else
		xgp->xsr &= ~FRDY;

	if((xgp->xcr & FRDY) == 0)
		return;

	if(xgp->xcr & FGO)
		xgp->go = xgp_go;
	else
		xgp_done(xgp, FSYN);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
pushq $-0x1
popq %rdi
leaq 0xc(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2230
testl %eax, %eax
jle 0x324e
movl 0xc(%rsp), %eax
testb $0x7f, %al
setne %cl
testw $0xff00, %ax            # imm = 0xFF00
sete %al
orb %cl, %al
je 0x32ed
testb $0x4, 0x29(%rbx)
jne 0x325e
decl 0x4c(%rbx)
je 0x3270
movl 0x44(%rbx), %eax
jmp 0x329a
movl 0x44(%rbx), %ecx
xorl %eax, %eax
cmpl $0x12c, %ecx            # imm = 0x12C
setl %al
addl %ecx, %eax
jmp 0x3297
movl $0x1, 0x4c(%rbx)
movl 0x44(%rbx), %eax
cmpl $0x12c, %eax            # imm = 0x12C
je 0x3336
cmpl $0x1, %eax
je 0x335a
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
subl %ecx, %eax
movl %eax, 0x44(%rbx)
movzwl 0x2c(%rbx), %ecx
cmpl $0x12c, %eax            # imm = 0x12C
jl 0x32b7
testb $0x40, %cl
je 0x330e
callq 0x6430
movl 0x2c(%rbx), %ecx
orl $0x40, %ecx
jmp 0x32bd
andl $0xffbf, %ecx           # imm = 0xFFBF
movw %cx, 0x2c(%rbx)
movzwl 0x28(%rbx), %eax
testb $0x40, %al
je 0x32e7
testb $0x1, %al
jne 0x32dc
movq %rbx, %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x2fdf
jmp 0x32e7
leaq -0xce(%rip), %rax       # 0x3215
movq %rax, 0x30(%rbx)
addq $0x10, %rsp
popq %rbx
retq
movq 0x19d04(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0xff10(%rip), %rdi      # 0x1320e
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
jmp 0x324e
movq 0x19ce3(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0xff25(%rip), %rdi      # 0x13244
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
movl $0x1830, 0x4c(%rbx)     # imm = 0x1830
jmp 0x32aa
movq 0x19cbb(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0xfee2(%rip), %rdi      # 0x13229
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
movl 0x44(%rbx), %eax
jmp 0x3285
movq 0x19c97(%rip), %rax     # 0x1cff8
movq (%rax), %rcx
leaq 0xfecc(%rip), %rdi      # 0x13237
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
movl 0x44(%rbx), %eax
jmp 0x328e
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/xgp.c
// Function: svc_xgp
int
svc_xgp(Bus *bus, void *dev)
{
	XGP *xgp = dev;
	if(handleclock(&xgp->clk))
		xgp_sync(xgp);
	if(xgp->xcr & FGO)
		xgp->go(xgp, bus);
	if((xgp->xcr & (FDONE|FDIE)) == (FDONE|FDIE))
		return 5;
	else
		return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x601a
testl %eax, %eax
je 0x339c
movq %rbx, %rdi
callq 0x321a
movzwl 0x28(%rbx), %eax
testb $0x1, %al
je 0x33b1
movq %rbx, %rdi
movq %r14, %rsi
callq *0x30(%rbx)
movzwl 0x28(%rbx), %eax
notl %eax
xorl %ecx, %ecx
testb $-0x40, %al
sete %cl
leal (%rcx,%rcx,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/print.c
// Function: print_line
void print_line()
{
	if(lines >= PAPER_MAX)
		return;

	lines++;

	// Clear the line
	position = PAGE_WIDTH;
	do {
		--position;
		print_dot(0);
		--position;
	} while(position > 0);
}

// Assembly:
movl 0x250ca(%rip), %eax     # 0x2b500
cmpl $0xabdf, %eax           # imm = 0xABDF
jg 0x6472
pushq %rax
incl %eax
movl %eax, 0x250ba(%rip)     # 0x2b500
movl $0x6c0, %eax            # imm = 0x6C0
decl %eax
movl %eax, 0x250b1(%rip)     # 0x2b504
xorl %edi, %edi
callq 0x6473
movl 0x250a4(%rip), %ecx     # 0x2b504
leal -0x1(%rcx), %eax
movl %eax, 0x2509b(%rip)     # 0x2b504
cmpl $0x1, %ecx
jg 0x644b
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/print.c
// Function: print_finish
int print_finish(int offset, char *file, size_t n)
{
	char time[100];
	int error;

	if(lines <= offset + 2) {
		*file = 0;
		return 0;
	}
	lines -= offset;

	timestamp(time, sizeof time);
	snprintf(file, n, "xgp-%s.png", time);
	if(fork()) {
		error = lines;
	} else {
		make_page();
		error = lodepng_encode32_file(file, page, PAGE_WIDTH, lines);
		exit(error == 0 ? 0 : 1);
	}

	memmove(paper, paper + PAGE_WIDTH*lines, PAGE_WIDTH*offset);
	lines = offset;

	return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movl %edi, %ebx
movl 0x25024(%rip), %eax     # 0x2b500
leal 0x2(%rbx), %ecx
cmpl %ecx, %eax
jle 0x654a
movq %rdx, %r15
subl %ebx, %eax
movl %eax, 0x25012(%rip)     # 0x2b500
movq %rsp, %r12
pushq $0x64
popq %rsi
movq %r12, %rdi
callq 0x60db
leaq 0xd33b(%rip), %rdx      # 0x1383e
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x20c0
callq 0x22f0
testl %eax, %eax
je 0x6560
movslq 0x24fdd(%rip), %r14     # 0x2b500
imulq $0x6c0, %r14, %rsi      # imm = 0x6C0
leaq 0x24fdf(%rip), %rdi     # 0x2b510
addq %rdi, %rsi
imull $0x6c0, %ebx, %eax      # imm = 0x6C0
movslq %eax, %rdx
callq 0x2220
movl %ebx, 0x24fb8(%rip)     # 0x2b500
jmp 0x6551
movb $0x0, (%r14)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x658c
movl 0x24f95(%rip), %ecx     # 0x2b500
leaq 0x48a779e(%rip), %rsi   # 0x48add10
movq %r14, %rdi
movl $0x6c0, %edx            # imm = 0x6C0
callq 0xeef5
xorl %edi, %edi
testl %eax, %eax
setne %dil
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: lodepng_crc32
unsigned lodepng_crc32(const unsigned char* data, size_t length) {
  /*Using the Slicing by Eight algorithm*/
  unsigned r = 0xffffffffu;
  while(length >= 8) {
    r = lodepng_crc32_table7[(data[0] ^ (r & 0xffu))] ^
        lodepng_crc32_table6[(data[1] ^ ((r >> 8) & 0xffu))] ^
        lodepng_crc32_table5[(data[2] ^ ((r >> 16) & 0xffu))] ^
        lodepng_crc32_table4[(data[3] ^ ((r >> 24) & 0xffu))] ^
        lodepng_crc32_table3[data[4]] ^
        lodepng_crc32_table2[data[5]] ^
        lodepng_crc32_table1[data[6]] ^
        lodepng_crc32_table0[data[7]];
    data += 8;
    length -= 8;
  }
  while(length--) {
    r = lodepng_crc32_table0[(r ^ *data++) & 0xffu] ^ (r >> 8);
  }
  return r ^ 0xffffffffu;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xff, %edx
leaq 0xb52b(%rip), %r8       # 0x13ad0
leaq 0xb924(%rip), %r9       # 0x13ed0
leaq 0xbd1d(%rip), %r10      # 0x142d0
leaq 0xc116(%rip), %r11      # 0x146d0
leaq 0xc50f(%rip), %rbx      # 0x14ad0
leaq 0xc908(%rip), %r14      # 0x14ed0
leaq 0xcd01(%rip), %r15      # 0x152d0
leaq 0xd0fa(%rip), %rcx      # 0x156d0
cmpq $0x7, %rsi
jbe 0x8650
movzbl (%rdi), %ebp
movl %eax, %r12d
andl %edx, %r12d
xorl %ebp, %r12d
movzbl 0x1(%rdi), %ebp
movl %eax, %r13d
shrl $0x8, %r13d
andl %edx, %r13d
xorl %ebp, %r13d
movl (%r9,%r13,4), %ebp
xorl (%r8,%r12,4), %ebp
movzbl 0x2(%rdi), %r12d
movl %eax, %r13d
shrl $0x10, %r13d
andl %edx, %r13d
xorl %r12d, %r13d
xorl (%r10,%r13,4), %ebp
movzbl 0x3(%rdi), %r12d
shrl $0x18, %eax
xorl %r12d, %eax
xorl (%r11,%rax,4), %ebp
movzbl 0x4(%rdi), %eax
xorl (%rbx,%rax,4), %ebp
movzbl 0x5(%rdi), %eax
xorl (%r14,%rax,4), %ebp
movzbl 0x6(%rdi), %eax
xorl (%r15,%rax,4), %ebp
movzbl 0x7(%rdi), %eax
xorl (%rcx,%rax,4), %ebp
addq $0x8, %rdi
addq $-0x8, %rsi
movl %ebp, %eax
jmp 0x85d6
xorl %edx, %edx
cmpq %rdx, %rsi
je 0x866e
movb (%rdi,%rdx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rcx,%r8,4), %eax
incq %rdx
jmp 0x8652
notl %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: lodepng_chunk_next
unsigned char* lodepng_chunk_next(unsigned char* chunk, unsigned char* end) {
  size_t available_size = (size_t)(end - chunk);
  if(chunk >= end || available_size < 12) return end; /*too small to contain a chunk*/
  if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47
    && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) {
    /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */
    return chunk + 8;
  } else {
    size_t total_chunk_length;
    if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end;
    if(total_chunk_length > available_size) return end; /*outside of range*/
    return chunk + total_chunk_length;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rsi, %r15
subq %rdi, %r15
setbe %al
cmpq $0xc, %r15
setb %cl
orb %al, %cl
jne 0x880a
movq %rdi, %r14
cmpb $-0x77, (%rdi)
jne 0x87f0
cmpb $0x50, 0x1(%r14)
jne 0x87f0
cmpb $0x4e, 0x2(%r14)
jne 0x87f0
cmpb $0x47, 0x3(%r14)
jne 0x87f0
cmpb $0xd, 0x4(%r14)
jne 0x87f0
cmpb $0xa, 0x5(%r14)
jne 0x87f0
cmpb $0x1a, 0x6(%r14)
jne 0x87f0
cmpb $0xa, 0x7(%r14)
jne 0x87f0
addq $0x8, %r14
movq %r14, %rbx
jmp 0x880a
movq %r14, %rdi
callq 0x867d
movl %eax, %eax
leaq 0xc(%rax), %rcx
cmpq %r15, %rcx
leaq 0xc(%r14,%rax), %rax
cmovbeq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: lodepng_chunk_next_const
const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk, const unsigned char* end) {
  size_t available_size = (size_t)(end - chunk);
  if(chunk >= end || available_size < 12) return end; /*too small to contain a chunk*/
  if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47
    && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) {
    /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */
    return chunk + 8;
  } else {
    size_t total_chunk_length;
    if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end;
    if(total_chunk_length > available_size) return end; /*outside of range*/
    return chunk + total_chunk_length;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rsi, %r15
subq %rdi, %r15
setbe %al
cmpq $0xc, %r15
setb %cl
orb %al, %cl
jne 0x888b
movq %rdi, %r14
cmpb $-0x77, (%rdi)
jne 0x8871
cmpb $0x50, 0x1(%r14)
jne 0x8871
cmpb $0x4e, 0x2(%r14)
jne 0x8871
cmpb $0x47, 0x3(%r14)
jne 0x8871
cmpb $0xd, 0x4(%r14)
jne 0x8871
cmpb $0xa, 0x5(%r14)
jne 0x8871
cmpb $0x1a, 0x6(%r14)
jne 0x8871
cmpb $0xa, 0x7(%r14)
jne 0x8871
addq $0x8, %r14
movq %r14, %rbx
jmp 0x888b
movq %r14, %rdi
callq 0x867d
movl %eax, %eax
leaq 0xc(%rax), %rcx
cmpq %r15, %rcx
leaq 0xc(%r14,%rax), %rax
cmovbeq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: lodepng_chunk_createv
static unsigned lodepng_chunk_createv(ucvector* out,
                                      size_t length, const char* type, const unsigned char* data) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, length, type));

  /*3: the data*/
  lodepng_memcpy(chunk + 8, data, length);

  /*4: CRC (of the chunkname characters and the data)*/
  lodepng_chunk_generate_crc(chunk);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %rcx
movq %rsi, %r14
movq %rdi, %rsi
movq %rsp, %rdi
movq %r14, %rdx
callq 0xff7b
movl %eax, %ebp
testl %eax, %eax
jne 0x8a37
movq (%rsp), %r15
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8adc
movq %r15, %rdi
callq 0x8765
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: lodepng_decode_memory
unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in,
                               size_t insize, LodePNGColorType colortype, unsigned bitdepth) {
  unsigned error;
  LodePNGState state;
  lodepng_state_init(&state);
  state.info_raw.colortype = colortype;
  state.info_raw.bitdepth = bitdepth;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  /*disable reading things that this function doesn't output*/
  state.decoder.read_text_chunks = 0;
  state.decoder.remember_unknown_chunks = 0;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
  error = lodepng_decode(out, w, h, &state, in, insize);
  lodepng_state_cleanup(&state);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movl %r9d, %ebx
movq %r8, (%rsp)
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xccaa
movl %ebx, 0xa8(%r14)
movl 0x260(%rsp), %eax
movl %eax, 0xac(%r14)
andq $0x0, 0x38(%r14)
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
movq (%rsp), %r9
callq 0xbe9e
movl %eax, %ebx
movq %r14, %rdi
callq 0xcd22
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: addChunk_PLTE
static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) {
  unsigned char* chunk;
  size_t i, j = 8;

  if(info->palettesize == 0 || info->palettesize > 256) {
    return 68; /*invalid palette size, it is only allowed to be 1-256*/
  }

  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, info->palettesize * 3, "PLTE"));

  for(i = 0; i != info->palettesize; ++i) {
    /*add all channels except alpha channel*/
    chunk[j++] = info->palette[i * 4 + 0];
    chunk[j++] = info->palette[i * 4 + 1];
    chunk[j++] = info->palette[i * 4 + 2];
  }

  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq 0x10(%rsi), %rax
leaq -0x101(%rax), %rcx
cmpq $-0x100, %rcx
jae 0xecdf
pushq $0x44
popq %rax
jmp 0xed3b
movq %rdi, %rsi
leaq (%rax,%rax,2), %rdx
leaq 0x72ac(%rip), %rcx      # 0x15f99
leaq 0x8(%rsp), %rdi
callq 0xff7b
testl %eax, %eax
jne 0xed3b
movq 0x8(%rsp), %rdi
leaq 0xa(%rdi), %rax
xorl %ecx, %ecx
cmpq 0x10(%rbx), %rcx
je 0xed34
movq 0x8(%rbx), %rdx
movb (%rdx,%rcx,4), %dl
movb %dl, -0x2(%rax)
movq 0x8(%rbx), %rdx
movb 0x1(%rdx,%rcx,4), %dl
movb %dl, -0x1(%rax)
movq 0x8(%rbx), %rdx
movb 0x2(%rdx,%rcx,4), %dl
movb %dl, (%rax)
incq %rcx
addq $0x3, %rax
jmp 0xed06
callq 0x8765
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: ensureBits9
static LODEPNG_INLINE void ensureBits9(LodePNGBitReader* reader, size_t nbits) {
  size_t start = reader->bp >> 3u;
  size_t size = reader->size;
  if(start + 1u < size) {
    reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u);
    reader->buffer >>= (reader->bp & 7u);
  } else {
    reader->buffer = 0;
    if(start + 0u < size) reader->buffer = reader->data[start + 0];
    reader->buffer >>= (reader->bp & 7u);
  }
  (void)nbits;
}

// Assembly:
movq 0x8(%rdi), %r8
movq 0x18(%rdi), %rcx
movq %rcx, %rsi
shrq $0x3, %rsi
leaq 0x1(%rsi), %rax
cmpq %r8, %rax
jae 0xef55
movq (%rdi), %rax
movzwl (%rax,%rsi), %eax
addq $0x20, %rdi
movq %rdi, %rdx
jmp 0xef6b
andl $0x0, 0x20(%rdi)
leaq 0x20(%rdi), %rdx
xorl %eax, %eax
cmpq %r8, %rsi
jae 0xef6b
movq (%rdi), %rax
movzbl (%rax,%rsi), %eax
andb $0x7, %cl
shrl %cl, %eax
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: ucvector_reserve
static unsigned ucvector_reserve(ucvector* p, size_t size) {
  if(size > p->allocsize) {
    size_t newsize = size + (p->allocsize >> 1u);
    void* data = lodepng_realloc(p->data, newsize);
    if(data) {
      p->allocsize = newsize;
      p->data = (unsigned char*)data;
    }
    else return 0; /*error: not enough memory*/
  }
  return 1; /*success*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %r15
pushq $0x1
popq %rbx
cmpq %rsi, %r15
jae 0xefae
movq %rdi, %r14
shrq %r15
addq %rsi, %r15
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x21e0
testq %rax, %rax
je 0xefac
movq %r15, 0x10(%r14)
movq %rax, (%r14)
jmp 0xefae
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: ensureBits32
static LODEPNG_INLINE void ensureBits32(LodePNGBitReader* reader, size_t nbits) {
  size_t start = reader->bp >> 3u;
  size_t size = reader->size;
  if(start + 4u < size) {
    reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) |
                     ((unsigned)reader->data[start + 2] << 16u) | ((unsigned)reader->data[start + 3] << 24u);
    reader->buffer >>= (reader->bp & 7u);
    reader->buffer |= (((unsigned)reader->data[start + 4] << 24u) << (8u - (reader->bp & 7u)));
  } else {
    reader->buffer = 0;
    if(start + 0u < size) reader->buffer |= reader->data[start + 0];
    if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u);
    if(start + 2u < size) reader->buffer |= ((unsigned)reader->data[start + 2] << 16u);
    if(start + 3u < size) reader->buffer |= ((unsigned)reader->data[start + 3] << 24u);
    reader->buffer >>= (reader->bp & 7u);
  }
  (void)nbits;
}

// Assembly:
movq 0x8(%rdi), %rsi
movq 0x18(%rdi), %rcx
movq %rcx, %rax
shrq $0x3, %rax
leaq 0x4(%rax), %rdx
cmpq %rsi, %rdx
jae 0xeff0
movq (%rdi), %rdx
movl (%rdx,%rax), %esi
andb $0x7, %cl
shrl %cl, %esi
movl %esi, 0x20(%rdi)
movzbl 0x4(%rdx,%rax), %edx
shll $0x18, %edx
movb $0x8, %al
subb %cl, %al
movl %eax, %ecx
shll %cl, %edx
orl %esi, %edx
jmp 0xf055
andl $0x0, 0x20(%rdi)
xorl %edx, %edx
cmpq %rsi, %rax
jae 0xf005
movq (%rdi), %rdx
movzbl (%rdx,%rax), %edx
movl %edx, 0x20(%rdi)
leaq 0x1(%rax), %r8
cmpq %rsi, %r8
jae 0xf020
movq (%rdi), %r9
movzbl (%r9,%r8), %r8d
shll $0x8, %r8d
orl %r8d, %edx
movl %edx, 0x20(%rdi)
leaq 0x2(%rax), %r8
cmpq %rsi, %r8
jae 0xf03b
movq (%rdi), %r9
movzbl (%r9,%r8), %r8d
shll $0x10, %r8d
orl %r8d, %edx
movl %edx, 0x20(%rdi)
addq $0x3, %rax
cmpq %rsi, %rax
jae 0xf050
movq (%rdi), %rsi
movzbl (%rsi,%rax), %eax
shll $0x18, %eax
orl %eax, %edx
andb $0x7, %cl
shrl %cl, %edx
movl %edx, 0x20(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/lodepng.c
// Function: huffmanDecodeSymbol
static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) {
  unsigned short code = peekBits(reader, FIRSTBITS);
  unsigned short l = codetree->table_len[code];
  unsigned short value = codetree->table_value[code];
  if(l <= FIRSTBITS) {
    advanceBits(reader, l);
    return value;
  } else {
    advanceBits(reader, FIRSTBITS);
    value += peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[value] - FIRSTBITS);
    return codetree->table_value[value];
  }
}

// Assembly:
movl 0x20(%rdi), %eax
movl %eax, %r9d
andl $0x1ff, %r9d            # imm = 0x1FF
movq 0x18(%rsi), %r8
movq 0x20(%rsi), %rdx
movzbl (%r8,%r9), %ecx
movl %r9d, %esi
movzwl (%rdx,%rsi,2), %esi
cmpq $0x9, %rcx
ja 0xf08b
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0xf0d8
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %r9
leaq 0x9(%r9), %r10
movq %r10, 0x18(%rdi)
addb $-0x9, %cl
pushq $-0x1
popq %r10
shll %cl, %r10d
notl %r10d
andl %eax, %r10d
addl %r10d, %esi
movzwl %si, %esi
movzbl (%r8,%rsi), %r8d
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
addq %r8, %rcx
movl %ecx, %r8d
shrl %cl, %eax
movl %eax, 0x20(%rdi)
leaq (%r8,%r9), %rax
addq $0x9, %rax
movq %rax, 0x18(%rdi)
movzwl (%rdx,%rsi,2), %esi
movzwl %si, %eax
retq