LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-cli.c
// Function: showLatencyDistLegend
void showLatencyDistLegend(void) {
    int j;

    printf("---------------------------------------------\n");
    printf(". - * #          .01 .125 .25 .5 milliseconds\n");
    printf("1,2,3,...,9      from 1 to 9     milliseconds\n");
    printf("A,B,C,D,E        10,20,30,40,50  milliseconds\n");
    printf("F,G,H,I,J        .1,.2,.3,.4,.5       seconds\n");
    printf("K,L,M,N,O,P,Q,?  1,2,4,8,16,30,60,>60 seconds\n");
    printf("From 0 to 100%%: ");
    for (j = 0; j < spectrum_palette_size; j++) {
        printf("\033[48;5;%dm ", spectrum_palette[j]);
    }
    printf("\033[0m\n");
    printf("---------------------------------------------\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x2f334(%rip), %rdi     # 0x49bb3
callq 0x110e0
leaq 0x2f23d(%rip), %rdi     # 0x49ac8
callq 0x110e0
leaq 0x2f25f(%rip), %rdi     # 0x49af6
callq 0x110e0
leaq 0x2f281(%rip), %rdi     # 0x49b24
callq 0x110e0
leaq 0x2f2a3(%rip), %rdi     # 0x49b52
callq 0x110e0
leaq 0x2f2c5(%rip), %rdi     # 0x49b80
callq 0x110e0
leaq 0x2d51e(%rip), %rdi     # 0x47de5
xorl %eax, %eax
callq 0x11200
cmpl $0x0, 0x45b67(%rip)     # 0x6043c
jle 0x1a905
leaq 0x2d519(%rip), %rbx     # 0x47df7
xorl %r14d, %r14d
movq 0x45b58(%rip), %rax     # 0x60440
movl (%rax,%r14,4), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x11200
incq %r14
movslq 0x45b3c(%rip), %rax     # 0x6043c
cmpq %rax, %r14
jl 0x1a8e1
leaq 0x2f2a2(%rip), %rdi     # 0x49bae
callq 0x110e0
leaq 0x2f29b(%rip), %rdi     # 0x49bb3
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x110e0
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-cli.c
// Function: powerLawRand
long long powerLawRand(long long min, long long max, double alpha) {
    double pl, r;

    max += 1;
    r = ((double)rand()) / RAND_MAX;
    pl = pow(
        ((pow(max,alpha+1) - pow(min,alpha+1))*r + pow(min,alpha+1)),
        (1.0/(alpha+1)));
    return (max-1-(long long)pl)+min;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movsd %xmm0, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1(%rsi), %r15
callq 0x116f0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x2971b(%rip), %xmm0    # 0x441b8
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
movsd (%rsp), %xmm1
addsd 0x29708(%rip), %xmm1    # 0x441c0
movsd %xmm1, (%rsp)
callq 0x111a0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm1
callq 0x111a0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x111a0
addsd 0x8(%rsp), %xmm0
movsd 0x296ac(%rip), %xmm1    # 0x441c0
divsd (%rsp), %xmm1
callq 0x111a0
cvttsd2si %xmm0, %rax
addq %r14, %rbx
subq %rax, %rbx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-cli.c
// Function: cliSelect
static int cliSelect(void) {
    redisReply *reply;
    if (config.dbnum == 0) return REDIS_OK;

    reply = redisCommand(context,"SELECT %d",config.dbnum);
    if (reply != NULL) {
        int result = REDIS_OK;
        if (reply->type == REDIS_REPLY_ERROR) result = REDIS_ERR;
        freeReplyObject(reply);
        return result;
    }
    return REDIS_ERR;
}

// Assembly:
pushq %rbx
movl 0x42ac3(%rip), %edx     # 0x60470
testl %edx, %edx
je 0x1d9df
movq 0x42be0(%rip), %rdi     # 0x60598
leaq 0x2b37b(%rip), %rsi     # 0x48d3a
xorl %eax, %eax
callq 0x21909
testq %rax, %rax
je 0x1d9e3
xorl %ebx, %ebx
cmpl $0x6, (%rax)
sete %bl
negl %ebx
movq %rax, %rdi
callq 0x1fcac
jmp 0x1d9e8
xorl %ebx, %ebx
jmp 0x1d9e8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-cli.c
// Function: reconnectingRedisCommand
static redisReply *reconnectingRedisCommand(redisContext *c, const char *fmt, ...) {
    redisReply *reply = NULL;
    int tries = 0;
    va_list ap;

    assert(!c->err);
    while(reply == NULL) {
        while (c->err & (REDIS_ERR_IO | REDIS_ERR_EOF)) {
            printf("\r\x1b[0K"); /* Cursor to left edge + clear line. */
            printf("Reconnecting... %d\r", ++tries);
            fflush(stdout);

            redisFree(c);
            c = redisConnect(config.hostip,config.hostport);
            usleep(1000000);
        }

        va_start(ap,fmt);
        reply = redisvCommand(c,fmt,ap);
        va_end(ap);

        if (c->err && !(c->err & (REDIS_ERR_IO | REDIS_ERR_EOF))) {
            fprintf(stderr, "Error: %s\n", c->errstr);
            exit(1);
        } else if (tries > 0) {
            printf("\r\x1b[0K"); /* Cursor to left edge + clear line. */
        }
    }

    context = c;
    return reply;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, 0x8(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x58(%rsp)
testb %al, %al
je 0x1da54
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
cmpl $0x0, (%rdi)
jne 0x1db4d
movq %rdi, %r14
leaq 0x2b394(%rip), %r12     # 0x48dfb
leaq 0x2b393(%rip), %r13     # 0x48e01
movq 0x4054b(%rip), %rbx     # 0x5dfc0
xorl %ebp, %ebp
testb $0x3, (%r14)
je 0x1dac6
movq %r12, %rdi
xorl %eax, %eax
callq 0x11200
incl %ebp
movq %r13, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x11200
movq (%rbx), %rdi
callq 0x11480
movq %r14, %rdi
callq 0x20fe8
movq 0x4299c(%rip), %rdi     # 0x60448
movl 0x4299e(%rip), %esi     # 0x60450
callq 0x21040
movq %rax, %r14
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x11730
jmp 0x1da77
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x18(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, 0x10(%rsp)
movq %r14, %rdi
movq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x218cf
movq %rax, %r15
movl (%r14), %eax
testl %eax, %eax
sete %cl
testb $0x3, %al
setne %al
orb %cl, %al
je 0x1db45
testl %ebp, %ebp
jle 0x1db20
movq %r12, %rdi
xorl %eax, %eax
callq 0x11200
testq %r15, %r15
je 0x1da77
movq %r14, 0x42a68(%rip)     # 0x60598
movq %r15, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x11e92
leaq 0x2b24b(%rip), %rdi     # 0x48d9f
leaq 0x2b24c(%rip), %rsi     # 0x48da7
leaq 0x2b251(%rip), %rcx     # 0x48db3
movl $0x3b0, %edx            # imm = 0x3B0
callq 0x11260
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-cli.c
// Function: cliRefreshPrompt
static void cliRefreshPrompt(void) {
    int len;

    if (config.eval_ldb) return;
    if (config.hostsocket != NULL)
        len = snprintf(config.prompt,sizeof(config.prompt),"redis %s",
                       config.hostsocket);
    else
        len = anetFormatAddr(config.prompt, sizeof(config.prompt),
                           config.hostip, config.hostport);
    /* Add [dbnum] if needed */
    if (config.dbnum != 0)
        len += snprintf(config.prompt+len,sizeof(config.prompt)-len,"[%d]",
            config.dbnum);
    snprintf(config.prompt+len,sizeof(config.prompt)-len,"> ");
}

// Assembly:
cmpl $0x0, 0x4276b(%rip)     # 0x60580
je 0x1de18
retq
pushq %rbx
movq 0x42638(%rip), %rcx     # 0x60458
testq %rcx, %rcx
je 0x1de41
leaq 0x426cc(%rip), %rdi     # 0x604f8
leaq 0x2b0b4(%rip), %rdx     # 0x48ee7
movl $0x80, %esi
xorl %eax, %eax
callq 0x11210
jmp 0x1de5f
movq 0x42600(%rip), %rdx     # 0x60448
movl 0x42602(%rip), %ecx     # 0x60450
leaq 0x426a3(%rip), %rdi     # 0x604f8
movl $0x80, %esi
callq 0x19d2e
movl %eax, %ebx
movl 0x42609(%rip), %ecx     # 0x60470
testl %ecx, %ecx
je 0x1de98
movslq %ebx, %rbx
leaq 0x425d3(%rip), %rax     # 0x60448
leaq (%rbx,%rax), %rdi
addq $0xb0, %rdi
movl $0x80, %esi
subq %rbx, %rsi
leaq 0x2b061(%rip), %rdx     # 0x48ef0
xorl %eax, %eax
callq 0x11210
addl %eax, %ebx
movslq %ebx, %rax
leaq 0x425a6(%rip), %rcx     # 0x60448
leaq (%rax,%rcx), %rdi
addq $0xb0, %rdi
movl $0x80, %esi
subq %rax, %rsi
leaq 0x2b821(%rip), %rdx     # 0x496dd
xorl %eax, %eax
popq %rbx
jmp 0x11210
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-cli.c
// Function: issueCommandRepeat
static int issueCommandRepeat(int argc, char **argv, long repeat) {
    while (1) {
        config.cluster_reissue_command = 0;
        if (cliSendCommand(argc,argv,repeat) != REDIS_OK) {
            cliConnect(1);

            /* If we still cannot send the command print error.
             * We'll try to reconnect the next time. */
            if (cliSendCommand(argc,argv,repeat) != REDIS_OK) {
                cliPrintContextError();
                return REDIS_ERR;
            }
         }
         /* Issue the command again if we got redirected in cluster mode */
         if (config.cluster_mode && config.cluster_reissue_command) {
            cliConnect(1);
         } else {
             break;
        }
    }
    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r15d, %r15d
movl $0x0, 0x41d2c(%rip)     # 0x604a4
movl %ebp, %edi
movq %r14, %rsi
movl %ebx, %edx
callq 0x1e7fe
testl %eax, %eax
je 0x1e7a2
movl $0x1, %edi
callq 0x1d05e
movl %ebp, %edi
movq %r14, %rsi
movl %ebx, %edx
callq 0x1e7fe
testl %eax, %eax
jne 0x1e7c0
cmpl $0x0, 0x41cf7(%rip)     # 0x604a0
je 0x1e7d2
cmpl $0x0, 0x41cf2(%rip)     # 0x604a4
je 0x1e7d2
movl $0x1, %edi
callq 0x1d05e
jmp 0x1e76e
movq 0x41dd1(%rip), %rdx     # 0x60598
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rdx, %rdx
jne 0x1e7e0
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x3f811(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
addq $0x4, %rdx
leaq 0x2a620(%rip), %rsi     # 0x48e15
xorl %eax, %eax
callq 0x113c0
jmp 0x1e7d2
// File: /workspace/github_c_makefile_star2_O1/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:
leaq 0xdbd(%rip), %rax       # 0x2010
leaq 0xfb6(%rip), %rdx       # 0x2210
testl %esi, %esi
cmovneq %rax, %rdx
movq (%rdi), %rsi
xorl %eax, %eax
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
xorl %r9d, %r9d
movq %r8, %r10
movl %eax, %ecx
shrq %cl, %r10
movb (%rdx,%rax,8), %cl
decb %cl
movq %rsi, %r11
shlq %cl, %r11
sarq $0x3f, %r11
andq %r10, %r11
addq %r11, %r9
incq %rax
cmpq $0x40, %rax
jne 0x1272
movq %r9, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
movq (%rdi), %r9
leaq 0x1156(%rip), %r10      # 0x2410
xorl %eax, %eax
xorl %r8d, %r8d
movb (%r10), %cl
addb $0x1f, %cl
movq %r9, %r11
shlq %cl, %r11
movq %rdx, %rbx
movl %eax, %ecx
shrq %cl, %rbx
sarq $0x3f, %r11
andq %rbx, %r11
addq %r11, %r8
incq %rax
addq $0x8, %r10
cmpq $0x30, %rax
jne 0x12bf
xorq %rsi, %r8
xorl %eax, %eax
leaq 0x139a(%rip), %r9       # 0x2690
xorl %esi, %esi
leal (%rax,%rax), %ecx
leal (%rcx,%rcx,2), %ecx
movq %r8, %r10
shlq %cl, %r10
addb $0x5, %cl
movq %r8, %r11
shlq %cl, %r11
shrq $0x3e, %r10
movl $0x3, %ecx
sarq $0x3f, %r11
xorl %ebx, %ebx
movl %ecx, %ebp
xorl $0x2, %ebp
andl %r11d, %ebp
addl %ebp, %ebx
addl $-0x1, %ecx
jb 0x131c
andl $-0x2, %r10d
movl %ebx, %ecx
movq %rax, %r11
shlq $0x9, %r11
addq %r9, %r11
shll $0x7, %r10d
addq %r11, %r10
movq (%r10,%rcx,8), %r10
leal (,%rax,4), %r11d
movb $0x3c, %cl
subb %r11b, %cl
shlq %cl, %r10
addq %r10, %rsi
incq %rax
cmpq $0x8, %rax
jne 0x12f8
leaq 0x1227(%rip), %r9       # 0x2590
xorl %eax, %eax
xorl %r8d, %r8d
movb (%r9), %cl
decb %cl
movq %rsi, %r10
shlq %cl, %r10
movq %rdx, %r11
movl %eax, %ecx
shrq %cl, %r11
sarq $0x3f, %r10
andq %r11, %r10
addq %r10, %r8
incq %rax
addq $0x8, %r9
cmpq $0x20, %rax
jne 0x136e
movq (%rdi), %rax
xorq %rax, %r8
shrdq $0x20, %rax, %r8
movq %r8, (%rdi)
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x142e
xorl %ecx, %ecx
xorl %eax, %eax
movq %rax, %rdx
shlq $0x8, %rdx
movsbq (%rbx,%rcx), %rax
orq %rdx, %rax
incq %rcx
cmpq $0x8, %rcx
jne 0x13bc
xorl %ecx, %ecx
xorl %edx, %edx
movl %ecx, %esi
notl %esi
testb $0x7, %sil
jne 0x13f3
movq %rax, %rsi
shlq %cl, %rsi
testl %edx, %edx
jne 0x140a
testq %rsi, %rsi
jns 0x140f
jmp 0x141c
movq %rax, %rsi
shlq %cl, %rsi
testq %rsi, %rsi
jns 0x1411
xorl %esi, %esi
testl %edx, %edx
sete %sil
movl %esi, %edx
jmp 0x1411
testq %rsi, %rsi
jns 0x141c
xorl %edx, %edx
incq %rcx
cmpq $0x40, %rcx
jne 0x13d8
jmp 0x142e
incl %ecx
leaq 0x262b(%rip), %rdi      # 0x3a50
movl %ecx, %esi
xorl %eax, %eax
callq 0x1070
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x8(%rsp)
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %rsp, %rdi
movl $0x1, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x1030
testq %rax, %rax
je 0x159d
movq %rax, %r12
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rsp, %r15
cmpq $0x8, %r12
je 0x14c2
leal (,%r12,8), %eax
movb $0x40, %cl
subb %al, %cl
shlq %cl, (%rsp)
movq (%rsp), %rdx
leaq 0xb43(%rip), %rsi       # 0x2010
xorl %eax, %eax
xorl %edi, %edi
movl (%rsi), %ecx
addl %ebp, %ecx
movq %rdx, %r8
shlq %cl, %r8
movq %r13, %r9
movl %eax, %ecx
shrq %cl, %r9
sarq $0x3f, %r8
andq %r9, %r8
addq %r8, %rdi
incq %rax
addq $0x8, %rsi
cmpq $0x40, %rax
jne 0x14d1
movq %rdi, (%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp,%rbx,8), %rsi
movq %r15, %rdi
callq 0x12a4
incq %rbx
cmpq $0x10, %rbx
jne 0x1500
movq (%rsp), %rsi
leaq 0xcef(%rip), %rdi       # 0x2210
xorl %eax, %eax
xorl %edx, %edx
movl (%rdi), %ecx
addl %ebp, %ecx
movq %rsi, %r8
shlq %cl, %r8
movq %r13, %r9
movl %eax, %ecx
shrq %cl, %r9
sarq $0x3f, %r8
andq %r9, %r8
addq %r8, %rdx
incq %rax
addq $0x8, %rdi
cmpq $0x40, %rax
jne 0x1525
leal (,%r12,8), %ecx
negb %cl
shlq %cl, %rdx
movq %rdx, (%rsp)
movl $0x1, %esi
movq %r15, %rdi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
callq 0x10b0
movq $0x0, (%rsp)
movl $0x1, %esi
movl $0x8, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x1030
movq %rax, %r12
testq %rax, %rax
jne 0x14ac
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x1030
testq %rax, %rax
je 0x16cd
movq %rax, %r12
leaq 0x8(%rsp), %r15
movabsq $-0x8000000000000000, %rbp # imm = 0x8000000000000000
rolq $0x20, 0x8(%rsp)
movl $0xf, %r13d
movq 0x10(%rsp,%r13,8), %rsi
movq %r15, %rdi
callq 0x12a4
addq $-0x1, %r13
jb 0x1632
movq 0x8(%rsp), %rsi
leaq 0xbbf(%rip), %rdi       # 0x2210
xorl %eax, %eax
xorl %edx, %edx
movb (%rdi), %cl
decb %cl
movq %rsi, %r8
shlq %cl, %r8
movq %rbp, %r9
movl %eax, %ecx
shrq %cl, %r9
sarq $0x3f, %r8
andq %r9, %r8
addq %r8, %rdx
incq %rax
addq $0x8, %rdi
cmpq $0x40, %rax
jne 0x1655
leal (,%r12,8), %ecx
negb %cl
shlq %cl, %rdx
movq %rdx, 0x8(%rsp)
movl $0x1, %esi
movq %r15, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x10b0
movq $0x0, 0x8(%rsp)
movl $0x1, %esi
movl $0x8, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x1030
movq %rax, %r12
testq %rax, %rax
jne 0x1626
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x163f(%rip), %r15      # 0x6de8
leaq 0x1646(%rip), %r12      # 0x6df6
movq 0x4829(%rip), %r13      # 0x9fe0
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x31c0
cmpl $0x67, %eax
jg 0x57d8
cmpl $-0x1, %eax
je 0x57ed
cmpl $0x3f, %eax
jne 0x57b7
jmp 0x585e
cmpl $0x69, %eax
je 0x57e7
cmpl $0x68, %eax
jne 0x57b7
jmp 0x5870
movq (%r13), %r15
jmp 0x57b7
movq 0x47e4(%rip), %r12      # 0x9fd8
cmpl %ebp, (%r12)
je 0x585e
leaq 0x8(%rsp), %r13
movl $0x50000002, (%r13)     # imm = 0x50000002
movq %r15, %rdi
callq 0x3120
movl %eax, 0x4(%r13)
movq %r13, 0x4ade(%rip)      # 0xa2f8
xorl %eax, %eax
callq 0x330c
leaq 0x76(%rip), %rsi        # 0x589e
xorl %edi, %edi
callq 0x3a8f
movslq (%r12), %rax
leaq (%r14,%rax,8), %rsi
movq (%rsi), %rdi
movq %rbx, %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x33ae
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
callq 0x587f
movl $0x1, %edi
callq 0x31e0
movq (%r14), %rdi
callq 0x587f
xorl %edi, %edi
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
xorl %eax, %eax
callq 0x39f2
cmpq $0x2a, %rax
jne 0x5927
movl $0x1, %edi
callq 0x3a1b
movq %rsp, %rbx
movl $0x10, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3afe
movl 0x4(%rbx), %edi
callq 0x3080
leaq 0x1544(%rip), %rdi      # 0x6e20
movq %rax, %rsi
xorl %eax, %eax
callq 0x30a0
movq 0x4a0b(%rip), %rax      # 0xa2f8
movl 0x4(%rax), %edi
callq 0x3080
leaq 0x1539(%rip), %rdi      # 0x6e35
movq %rax, %rsi
xorl %eax, %eax
callq 0x30a0
movq 0x49eb(%rip), %rbx      # 0xa2f8
movl $0x1, %edi
callq 0x3a1b
movl $0x10, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3b60
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq 0x1b22b(%rip), %rbx     # 0x1dff8
movq (%rbx), %rdi
movq 0x29661(%rip), %rdx     # 0x2c438
leaq 0x122e7(%rip), %rsi     # 0x150c5
xorl %eax, %eax
callq 0x2130
movq (%rbx), %rcx
leaq 0x12305(%rip), %rdi     # 0x150f4
movl $0x1d, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rcx
leaq 0x1230a(%rip), %rdi     # 0x15112
movl $0x1f, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rcx
leaq 0x12311(%rip), %rdi     # 0x15132
movl $0x1b, %esi
movl $0x1, %edx
callq 0x22b0
movq (%rbx), %rcx
leaq 0x12314(%rip), %rdi     # 0x1514e
movl $0x15, %esi
movl $0x1, %edx
callq 0x22b0
xorl %edi, %edi
callq 0x2290
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %ebx
movl $0xfffc0bc0, %eax       # imm = 0xFFFC0BC0
addl 0x8(%rdi), %eax
cmpl $0x6, %eax
ja 0x3256
movq %rsi, %r14
movzwl 0xc(%rdi), %ebp
leaq 0x12032(%rip), %rcx     # 0x151a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl %bp, %r15d
btl $0xa, %r15d
jae 0x318d
cmpl $0x0, 0x44(%r14)
je 0x3266
movw %bp, 0x28(%r14)
movl %r15d, %eax
andl $0x440, %eax            # imm = 0x440
cmpl $0x400, %eax            # imm = 0x400
jne 0x31a6
callq 0x6770
xorl %ebx, %ebx
testb $0x1, %r15b
je 0x3256
testb $0x40, 0x2c(%r14)
movzwl 0x28(%r14), %eax
jne 0x322c
orl $0x8000, %eax           # imm = 0x8000
movw %ax, 0x28(%r14)
jmp 0x3256
movw %bp, 0x2c(%r14)
jmp 0x31d9
movw %bp, 0x2a(%r14)
xorl %ebx, %ebx
jmp 0x3256
xorl %ebx, %ebx
testb $0x4, %bpl
je 0x3256
movq %rsp, %rsi
movl $0x100, %edx            # imm = 0x100
movl $0x1156, %edi           # imm = 0x1156
callq 0x682c
testl %eax, %eax
jle 0x3270
cmpb $0x0, (%rsp)
je 0x3270
movq 0x1adf0(%rip), %rcx     # 0x1dff8
movq (%rcx), %rdi
cvtsi2sd %eax, %xmm0
divsd 0x11f81(%rip), %xmm0    # 0x15198
leaq 0x11fcb(%rip), %rsi     # 0x151e9
movq %rsp, %rcx
movl %eax, %edx
movb $0x1, %al
callq 0x2130
jmp 0x3279
andl $0xffffff7e, %eax       # imm = 0xFFFFFF7E
incl %eax
movw %ax, 0x28(%r14)
leaq -0x103(%rip), %rax      # 0x313c
movq %rax, 0x30(%r14)
leaq 0x51(%rip), %rax        # 0x329b
movq %rax, 0x38(%r14)
movl $0x0, 0x48(%r14)
movl %ebx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x239a
jmp 0x318d
testl %eax, %eax
jns 0x3279
callq 0x2378
movq 0x1ad78(%rip), %rax     # 0x1dff8
movq (%rax), %rcx
leaq 0x11f94(%rip), %rdi     # 0x1521e
movl $0xa, %esi
movl $0x1, %edx
callq 0x22b0
jmp 0x3256
// File: /workspace/github_c_makefile_star2_O1/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 -0x1e6(%rip), %rcx      # 0x313c
movq %rcx, 0x30(%rdi)
testl %esi, %esi
je 0x3337
orl $0x8080, %eax           # imm = 0x8080
movw %ax, 0x28(%rdi)
orw %si, 0x2c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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, %ebp
movl %esi, %r14d
movq %rdi, %rbx
incl %ebp
movl $0x1, %r15d
decl %ebp
testl %ebp, %ebp
jle 0x3393
movl %r15d, %edi
andl %r14d, %edi
callq 0x67d9
addl %r15d, %r15d
movl 0x48(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x48(%rbx)
cmpl $0x6bf, %eax            # imm = 0x6BF
jl 0x334f
movl $0x8080, %eax           # imm = 0x8080
orl 0x28(%rbx), %eax
leaq -0x246(%rip), %rcx      # 0x313c
movq %rcx, 0x30(%rbx)
andl $0xfffe, %eax           # imm = 0xFFFE
movw %ax, 0x28(%rbx)
orb $-0x80, 0x2d(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x33b6
xorl %eax, %eax
jmp 0x33bb
movl 0x40(%rbx), %eax
incl %eax
movw %ax, 0x40(%rbx)
cmpw $0x2, %ax
jne 0x33d0
leaq -0x131(%rip), %rax      # 0x329b
movq %rax, 0x38(%rbx)
testb %sil, %sil
je 0x340c
movzbl %sil, %ebp
cmpb $0x9, %bpl
jb 0x33fb
movzbl 0x42(%rbx), %esi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x3338
addl $-0x8, %ebp
testb $-0x80, 0x28(%rbx)
je 0x33d9
jmp 0x340c
movzbl 0x42(%rbx), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x3338
notb 0x42(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3454
cmpl $0x1, %esi
je 0x3437
testl %esi, %esi
jne 0x3460
leaq -0x80(%rip), %rax       # 0x33a8
movq %rax, 0x38(%rdi)
movw $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 -0x313(%rip), %rax      # 0x313c
movq %rax, 0x30(%rdi)
retq
leaq -0xbd(%rip), %rax       # 0x339e
movq %rax, 0x38(%rdi)
retq
movl $0x8080, %eax           # imm = 0x8080
orl 0x28(%rdi), %eax
leaq -0x333(%rip), %rcx      # 0x313c
movq %rcx, 0x30(%rdi)
andl $0xfffe, %eax           # imm = 0xFFFE
movw %ax, 0x28(%rdi)
orb $0x4, 0x2d(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x34a3
movl $0x8, %edx
callq 0x3338
addw $-0x8, 0x40(%rbx)
jmp 0x34b3
callq 0x3338
leaq -0x214(%rip), %rax      # 0x329b
movq %rax, 0x38(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2672
testl %eax, %eax
je 0x3541
movl $0x8080, %eax           # imm = 0x8080
orl 0x28(%rbx), %eax
leaq -0x3f2(%rip), %rcx      # 0x313c
movq %rcx, 0x30(%rbx)
andl $0xfffe, %eax           # imm = 0xFFFE
movw %ax, 0x28(%rbx)
orb $0x10, 0x2d(%rbx)
jmp 0x3558
testb $0x1, 0x28(%rbx)
je 0x3552
movzbl 0xc(%r14), %esi
movq %rbx, %rdi
callq *0x38(%rbx)
testb $0x1, 0x28(%rbx)
jne 0x3560
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_O1/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
leaq 0xc(%rsp), %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x2220
testl %eax, %eax
jle 0x35b3
movl 0xc(%rsp), %eax
testb $0x7f, %al
setne %cl
testl $0xff00, %eax           # imm = 0xFF00
sete %al
orb %cl, %al
je 0x3660
testb $0x4, 0x29(%rbx)
jne 0x35ed
decl 0x4c(%rbx)
jne 0x35ff
movl $0x1, 0x4c(%rbx)
cmpl $0x12c, 0x44(%rbx)      # imm = 0x12C
je 0x3674
cmpl $0x1, 0x44(%rbx)
je 0x367e
movl 0x44(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
subl %ecx, %eax
movl %eax, 0x44(%rbx)
jmp 0x35ff
movl 0x44(%rbx), %eax
xorl %ecx, %ecx
cmpl $0x12c, %eax            # imm = 0x12C
setl %cl
addl %eax, %ecx
movl %ecx, 0x44(%rbx)
cmpl $0x12c, 0x44(%rbx)      # imm = 0x12C
movzwl 0x2c(%rbx), %eax
jl 0x361d
testb $0x40, %al
je 0x366a
callq 0x677b
movl 0x2c(%rbx), %eax
orl $0x40, %eax
jmp 0x3622
andl $0xffbf, %eax           # imm = 0xFFBF
movw %ax, 0x2c(%rbx)
movzwl 0x28(%rbx), %eax
testb $0x40, %al
je 0x365a
testb $0x1, %al
jne 0x364f
orl $0x8080, %eax           # imm = 0x8080
leaq -0x502(%rip), %rcx      # 0x313c
movq %rcx, 0x30(%rbx)
andl $-0x2, %eax
movw %ax, 0x28(%rbx)
orb $0x40, 0x2d(%rbx)
jmp 0x365a
leaq -0xe1(%rip), %rax       # 0x3575
movq %rax, 0x30(%rbx)
addq $0x10, %rsp
popq %rbx
retq
callq 0x23b6
jmp 0x35b3
movq %rbx, %rdi
callq 0x241c
jmp 0x3610
callq 0x23d8
jmp 0x35d2
callq 0x23fa
jmp 0x35dc
// File: /workspace/github_c_makefile_star2_O1/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 0x6416
testl %eax, %eax
je 0x36a6
movq %rbx, %rdi
callq 0x357a
testb $0x1, 0x28(%rbx)
je 0x36b5
movq %rbx, %rdi
movq %r14, %rsi
callq *0x30(%rbx)
movl 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_O1/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 0x25d6f(%rip), %eax     # 0x2c4f0
cmpl $0xabdf, %eax           # imm = 0xABDF
jg 0x67d8
leal 0x1(%rax), %ecx
movl %ecx, 0x25d5f(%rip)     # 0x2c4f0
movl $0x6c0, %esi            # imm = 0x6C0
movl %esi, 0x25d58(%rip)     # 0x2c4f4
imull $0x6c0, %eax, %ecx      # imm = 0x6C0
movslq %ecx, %rcx
leaq 0x25d54(%rip), %rdx     # 0x2c500
movslq %esi, %rdi
decq %rdi
cmpl $0xabdf, %eax           # imm = 0xABDF
je 0x67ca
cmpl $0x6c0, %esi            # imm = 0x6C0
jg 0x67ca
addq %rcx, %rdi
movb $-0x1, (%rdx,%rdi)
movl %esi, %edi
leal -0x1(%rdi), %esi
cmpl $0x1, %edi
jg 0x67ac
movl %esi, 0x25d1c(%rip)     # 0x2c4f4
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x25cae(%rip), %eax     # 0x2c4f0
leal 0x2(%rbx), %ecx
cmpl %ecx, %eax
jle 0x68b2
movq %rdx, %r15
subl %ebx, %eax
movl %eax, 0x25c9c(%rip)     # 0x2c4f0
movq %rsp, %r12
movl $0x64, %esi
movq %r12, %rdi
callq 0x64df
leaq 0xefd3(%rip), %rdx      # 0x1583e
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x20c0
callq 0x22e0
testl %eax, %eax
je 0x68c8
movslq 0x25c65(%rip), %r14     # 0x2c4f0
imulq $0x6c0, %r14, %rsi      # imm = 0x6C0
leaq 0x25c67(%rip), %rdi     # 0x2c500
addq %rdi, %rsi
imull $0x6c0, %ebx, %eax      # imm = 0x6C0
movslq %eax, %rdx
callq 0x2210
movl %ebx, 0x25c40(%rip)     # 0x2c4f0
jmp 0x68b9
movb $0x0, (%r14)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x68f4
movl 0x25c1d(%rip), %ecx     # 0x2c4f0
leaq 0x48a8426(%rip), %rsi   # 0x48aed00
movq %r14, %rdi
movl $0x6c0, %edx            # imm = 0x6C0
callq 0x109bc
xorl %edi, %edi
testl %eax, %eax
setne %dil
callq 0x2290
// File: /workspace/github_c_makefile_star2_O1/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
cmpq $0x8, %rsi
jb 0x91c9
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl $0xff, %ecx
leaq 0xc993(%rip), %rdx      # 0x15ab0
leaq 0xcd8c(%rip), %r8       # 0x15eb0
leaq 0xd185(%rip), %r9       # 0x162b0
leaq 0xd57e(%rip), %r10      # 0x166b0
leaq 0xd977(%rip), %r11      # 0x16ab0
leaq 0xdd70(%rip), %rbx      # 0x16eb0
leaq 0xe169(%rip), %r14      # 0x172b0
leaq 0xe562(%rip), %r15      # 0x176b0
movzbl (%rdi), %eax
movl %r12d, %r13d
andl %ecx, %r13d
xorl %eax, %r13d
movzbl 0x1(%rdi), %eax
movl %r12d, %ebp
shrl $0x8, %ebp
andl %ecx, %ebp
xorl %eax, %ebp
movl (%r8,%rbp,4), %eax
xorl (%rdx,%r13,4), %eax
movzbl 0x2(%rdi), %ebp
movl %r12d, %r13d
shrl $0x10, %r13d
andl %ecx, %r13d
xorl %ebp, %r13d
xorl (%r9,%r13,4), %eax
movzbl 0x3(%rdi), %ebp
shrl $0x18, %r12d
xorl %ebp, %r12d
xorl (%r10,%r12,4), %eax
movzbl 0x4(%rdi), %r12d
xorl (%r11,%r12,4), %eax
movzbl 0x5(%rdi), %r12d
xorl (%rbx,%r12,4), %eax
movzbl 0x6(%rdi), %r12d
xorl (%r14,%r12,4), %eax
movzbl 0x7(%rdi), %r12d
xorl (%r15,%r12,4), %eax
addq $0x8, %rdi
addq $-0x8, %rsi
movl %eax, %r12d
cmpq $0x7, %rsi
ja 0x914e
testq %rsi, %rsi
je 0x91f1
xorl %ecx, %ecx
leaq 0xe4d9(%rip), %rdx      # 0x176b0
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
cmpq %rcx, %rsi
jne 0x91d7
notl %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movq %rsi, %rax
movq %rsi, %rcx
subq %rdi, %rcx
setbe %dl
cmpq $0xc, %rcx
setb %sil
orb %dl, %sil
jne 0x935b
movzbl (%rdi), %edx
cmpq $0x89, %rdx
jne 0x932b
cmpb $0x50, 0x1(%rdi)
jne 0x932b
cmpb $0x4e, 0x2(%rdi)
jne 0x932b
cmpb $0x47, 0x3(%rdi)
jne 0x932b
cmpb $0xd, 0x4(%rdi)
jne 0x932b
cmpb $0xa, 0x5(%rdi)
jne 0x932b
cmpb $0x1a, 0x6(%rdi)
jne 0x932b
cmpb $0xa, 0x7(%rdi)
jne 0x932b
addq $0x8, %rdi
movq %rdi, %rax
retq
shll $0x18, %edx
movzbl 0x1(%rdi), %esi
shll $0x10, %esi
orl %edx, %esi
movzbl 0x2(%rdi), %edx
shll $0x8, %edx
orl %esi, %edx
movzbl 0x3(%rdi), %esi
leaq (%rdx,%rsi), %r8
addq %rsi, %rdx
addq $0xc, %rdx
cmpq %rcx, %rdx
leaq 0xc(%rdi,%r8), %rcx
cmovbeq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %rcx
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x11aa9
testl %eax, %eax
jne 0x95c4
movq 0x8(%rsp), %r15
testq %r14, %r14
je 0x95ba
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2160
movq %r15, %rdi
callq 0x92a9
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %r8, %rax
movq %rcx, %r8
movl 0x240(%rsp), %ecx
movq %rsp, %rbx
movq $0x1, 0x38(%rbx)
movl $0x1000000, %r10d       # imm = 0x1000000
movq %r10, 0x40(%rbx)
movq %r10, 0x48(%rbx)
movabsq $0x100000000, %r10      # imm = 0x100000000
movq %r10, 0x30(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps 0x7767(%rip), %xmm1     # 0x15860
movaps %xmm1, 0x50(%rbx)
movabsq $0x100000080, %r10      # imm = 0x100000080
movq %r10, 0x60(%rbx)
movups %xmm0, 0x68(%rbx)
xorl %r10d, %r10d
movq %r10, 0x78(%rbx)
movabsq $0x500000001, %r11      # imm = 0x500000001
movq %r11, 0x84(%rbx)
movl $0x1, %r11d
movl %r11d, 0x80(%rbx)
movaps %xmm0, 0x90(%rbx)
movl %r11d, 0xa0(%rbx)
movaps %xmm0, 0xc0(%rbx)
movabsq $0x800000006, %r14      # imm = 0x800000006
movq %r14, 0xa8(%rbx)
movaps %xmm0, 0xb0(%rbx)
movups %xmm0, 0xf8(%rbx)
movq %r14, 0xe0(%rbx)
movups %xmm0, 0xe8(%rbx)
movl %r10d, 0xd8(%rbx)
movq %r10, 0xd0(%rbx)
movl %r10d, 0x174(%rbx)
movl %r10d, 0x184(%rbx)
movl %r10d, 0x18c(%rbx)
movl %r10d, 0x1b0(%rbx)
movl %r10d, 0x1b8(%rbx)
movl %r10d, 0x158(%rbx)
movups %xmm0, 0x148(%rbx)
movups %xmm0, 0x138(%rbx)
movups %xmm0, 0x128(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x108(%rbx)
movaps %xmm0, 0x1c0(%rbx)
movl %r10d, 0x214(%rbx)
movups %xmm0, 0x204(%rbx)
movups %xmm0, 0x1f4(%rbx)
movups %xmm0, 0x1e4(%rbx)
movups %xmm0, 0x1d4(%rbx)
movl %r11d, 0x218(%rbx)
movl %r9d, 0xa8(%rbx)
movl %ecx, 0xac(%rbx)
movq %r10, 0x38(%rbx)
movq %rbx, %rcx
movq %rax, %r9
callq 0xd0f1
movl %eax, %ebp
movq %rbx, %rdi
callq 0xe36b
movl %ebp, %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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), %rcx
leaq -0x101(%rcx), %rdx
movl $0x44, %eax
cmpq $-0x100, %rdx
jb 0x100a2
movq %rdi, %rsi
leaq (%rcx,%rcx,2), %rdx
leaq 0x7f2f(%rip), %rcx      # 0x17f79
leaq 0x8(%rsp), %rdi
callq 0x11aa9
testl %eax, %eax
jne 0x100a2
cmpq $0x0, 0x10(%rbx)
je 0x10096
movq 0x8(%rsp), %rax
addq $0xa, %rax
xorl %ecx, %ecx
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
cmpq 0x10(%rbx), %rcx
jne 0x1006a
movq 0x8(%rsp), %rdi
callq 0x92a9
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %ebx
cmpq %rsi, %r15
jae 0x10a33
movq %rdi, %r14
shrq %r15
addq %rsi, %r15
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x21d0
testq %rax, %rax
je 0x10a31
movq %r15, 0x10(%r14)
movq %rax, (%r14)
jmp 0x10a33
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10a6d
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0x10abc
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %r9
leaq 0x9(%r9), %r10
movq %r10, 0x18(%rdi)
addb $-0x9, %cl
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
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
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/lodepng.c
// Function: writeBitsReversed
static void writeBitsReversed(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  size_t i;
  for(i = 0; i != nbits; ++i) {
    /* TODO: increase output size only once here rather than in each WRITEBIT */
    WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u));
  }
}

// Assembly:
testq %rdx, %rdx
je 0x11974
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testb $0x7, 0x8(%r14)
jne 0x11945
movq (%r14), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
movq %rsi, 0x8(%rdi)
callq 0x109fc
testl %eax, %eax
je 0x11970
movq (%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
decq %rbx
xorl %eax, %eax
btl %ebx, %ebp
setb %al
movb 0x8(%r14), %cl
andb $0x7, %cl
shll %cl, %eax
movq (%r14), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
incb 0x8(%r14)
testq %rbx, %rbx
jne 0x11918
popq %rbx
popq %r14
popq %rbp
retq