LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/compile_x86.c
// Function: op_addr_to_addr
void op_addr_to_addr(X86Code* ocode, x86_op_t opcode, const AddrNode* an1, const AddrNode* an2) {
    if((an1->addr_type == ADDR_CONST) != (an2->addr_type == ADDR_CONST)) {
        X86Instr* onode = x86_instr_new2(opcode, NULL, NULL);
        load_index_if_needed(ocode, an1, "si");
        load_index_if_needed(ocode, an2, "di");
        addr_to_x86_arg(an1, onode->arg1, true, "rsi");
        addr_to_x86_arg(an2, onode->arg2, true, "rdi");
        x86_code_append(ocode, onode);
    }
    else {
        op_addr_to_reg(ocode, X86_OP_mov, 0, an2);
        op_reg_to_addr(ocode, opcode, an1, 0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
cmpl $0x2, 0x14(%rdx)
sete %al
cmpl $0x2, 0x14(%rcx)
setne %cl
xorb %al, %cl
je 0xcdda
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
callq 0xcc9d
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xcd15
movl %r12d, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xc5f6
movq %rax, %r12
leaq 0x3069(%rip), %rdx      # 0xfe59
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcc1d
leaq 0x305b(%rip), %rdx      # 0xfe5d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcc1d
leaq 0x4(%r12), %rsi
leaq 0x303f(%rip), %rcx      # 0xfe58
movq %r15, %rdi
movl $0x1, %edx
callq 0xca58
leaq 0x22(%r12), %rsi
leaq 0x302a(%rip), %rcx      # 0xfe5c
movq %r14, %rdi
movl $0x1, %edx
callq 0xca58
movq %rbx, %rdi
movq %r12, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc8b4
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/compile_x86.c
// Function: op_apply
void op_apply(X86Code* ocode, x86_op_t opcode, const AddrNode* an) {
    X86Instr* onode = x86_instr_new(opcode);
    load_index_if_needed(ocode, an, "si");
    addr_to_x86_arg(an, onode->arg1, true, "rsi");
    x86_code_append(ocode, onode);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, %edi
callq 0xc5c9
movq %rax, %r15
leaq 0x2fe6(%rip), %rdx      # 0xfe59
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcc1d
leaq 0x4(%r15), %rsi
leaq 0x2fcf(%rip), %rcx      # 0xfe58
movq %rbx, %rdi
movl $0x1, %edx
callq 0xca58
movq %r14, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xc8b4
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/compile_x86.c
// Function: check_arg
bool check_arg(const AddrNode* an) {
    if(an != NULL && an->type != TYPE_INTEGER && an->type != TYPE_BOOLEAN) {
        print_error("x86_codegen", ERROR, -1, an->line, an->col, TYPE_STRS[an->type],
            "BAD_TYPE", "Bad type of argument");
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movb $0x1, %bl
testq %rdi, %rdi
je 0xcf01
movl 0x18(%rdi), %eax
movl %eax, %ecx
orl $0x2, %ecx
cmpl $0x3, %ecx
je 0xcf01
movl 0x20(%rdi), %ecx
movl 0x24(%rdi), %r8d
leaq 0x8ced(%rip), %rdx      # 0x15bc0
movq (%rdx,%rax,8), %r9
leaq 0x2f8e(%rip), %rax      # 0xfe6c
leaq 0x28d4(%rip), %r10      # 0xf7b9
leaq 0x2f74(%rip), %rdi      # 0xfe60
xorl %ebx, %ebx
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
pushq %rax
pushq %r10
callq 0x93bc
addq $0x10, %rsp
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sharmaeklavya2[P]cerplag/codegen.c
// Function: optimize_ircode
void optimize_ircode(IRCode* code) {
    IRInstr* instr = code->first;
    IRInstr* instr2 = NULL;
    for(; instr != NULL; instr = instr2) {
        instr2 = instr->next;
        while(instr2 != NULL && instr->res != NULL && instr->res->addr_type == ADDR_TEMP && instr2->op == OP_MOV) {
            instr->res = instr2->res;
            instr2 = instr2->next;
            ircode_remove(code, instr->next);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0xdced
movq 0x28(%r14), %rax
testq %rax, %rax
je 0xdced
movq %rdi, %rbx
leaq 0x28(%r14), %r15
movq %r14, %r12
movq %rax, %r14
movq 0x18(%r12), %rax
testq %rax, %rax
je 0xdce0
cmpl $0x1, 0x14(%rax)
jne 0xdce0
cmpl $0xc, (%r14)
jne 0xdce0
movq 0x18(%r14), %rax
movq %rax, 0x18(%r12)
movq 0x28(%r14), %r14
movq (%r15), %rsi
movq %rbx, %rdi
callq 0xc449
testq %r14, %r14
jne 0xdcab
jmp 0xdced
leaq 0x28(%r14), %r15
movq 0x28(%r14), %rax
testq %rax, %rax
jne 0xdca5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/utils/sort/test/test_sort.c
// Function: test_int
boolean test_int() {
    boolean pass = T;
    int     nums[8] = {5, 1, 4, 2,8, 7, 3, 6};

    sort(0, 7, nums, compare_int, swap_int);
    for (int i = 0; i < 8; i++) {
        if (nums[i] != i + 1) {
            print_err("Error at a[%d]=%d want %d\n", i, nums[i], i + 1);
            pass = F;
        }
    }
    return pass;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
leaq 0xacd(%rip), %rax       # 0x2004
movl (%rax), %ebx
movaps 0xb50(%rip), %xmm0      # 0x2090
movq %rsp, %rdx
movaps %xmm0, 0x10(%rdx)
movaps 0xb32(%rip), %xmm0      # 0x2080
movaps %xmm0, (%rdx)
leaq -0x54(%rip), %rcx       # 0x1504
leaq -0x4e(%rip), %r8        # 0x1511
xorl %edi, %edi
movl $0x7, %esi
callq 0x13c4
leaq 0xa96(%rip), %rax       # 0x2008
movl (%rax), %r12d
movl $0x1, %r14d
leaq 0xb1e(%rip), %r15       # 0x20a0
xorl %ebp, %ebp
movl -0x4(%rsp,%r14,4), %edx
cmpq %rdx, %r14
je 0x15a0
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x1070
movl %r12d, %ebx
incl %ebp
incq %r14
cmpq $0x9, %r14
jne 0x1584
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/utils/sort/test/test_sort.c
// Function: pair
boolean pair() {
    boolean pass = T;
    char    keys[7] = {'a', 'b', 'c', 'd', 'e', 'f', 'g'};
    int     values[7] = {5, 1, 4, 2, 7, 3, 6};
    void *  args[] = {keys, values};

    char want[7] = {'b', 'd', 'f', 'c', 'a', 'g', 'e'};

    sort(0, 6, args, compare_int, swap_int);
    for (int i = 0; i < 7; i++) {
        if (keys[i] != want[i] || values[i] != i + 1) {
            print_err("Error at %d(%c,%d) want %c\n", i, keys[i], values[i],
                      want[i]);
            pass = F;
        }
    }
    return pass;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
leaq 0x9fe(%rip), %rax       # 0x2004
movl (%rax), %ebx
leaq 0x8(%rsp), %rax
movl $0x67666564, 0x3(%rax)  # imm = 0x67666564
movl $0x64636261, (%rax)     # imm = 0x64636261
movups 0xafb(%rip), %xmm0      # 0x211c
leaq 0x10(%rsp), %rcx
movups %xmm0, 0xc(%rcx)
movaps 0xadf(%rip), %xmm0      # 0x2110
movaps %xmm0, (%rcx)
leaq 0x30(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
leaq -0x143(%rip), %rcx      # 0x1504
leaq -0x13d(%rip), %r8       # 0x1511
xorl %edi, %edi
movl $0x6, %esi
callq 0x13c4
leaq 0x9a7(%rip), %rax       # 0x2008
movl (%rax), %ebp
leaq 0xac2(%rip), %r15       # 0x212c
leaq 0xa4a(%rip), %r14       # 0x20bb
xorl %esi, %esi
movsbl 0x8(%rsp,%rsi), %edx
movsbl (%rsi,%r15), %r8d
cmpb %r8b, %dl
sete %al
movl 0x10(%rsp,%rsi,4), %ecx
leaq 0x1(%rsi), %r12
movl %ecx, %edi
cmpq %rdi, %r12
sete %dil
testb %dil, %al
jne 0x16a5
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
movl %ebp, %ebx
movq %r12, %rsi
cmpq $0x7, %r12
jne 0x1673
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/utils/sort/test/test_sort.c
// Function: main
int main() {
    boolean pass = T;

    pass &= test_int();

    if (pass) {
        print_ok("All testcases passed\n");
    } else {
        print_err("Some errors!\n");
    }
}

// Assembly:
pushq %rbx
leaq 0x93f(%rip), %rbx       # 0x2004
callq 0x1524
testl %eax, (%rbx)
je 0x16de
leaq 0xa02(%rip), %rdi       # 0x20d7
xorl %eax, %eax
callq 0x1301
jmp 0x16ec
leaq 0xa08(%rip), %rdi       # 0x20ed
xorl %eax, %eax
callq 0x1070
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/ibkvser.c
// Function: main
int
main(int argc, char ** argv)
{
  if (argc < 6) {
    fprintf(stderr, "Usage: %s <ib-port> <host> <port> <depth> api ...\n", argv[0]);
    kvmap_api_helper_message();
    exit(0);
  }

  struct ib_port * const port = ib_port_create(atoi(argv[1]));
  if (port == NULL) {
    fprintf(stderr, "ib_port_create() failed\n");
    exit(0);
  }

  const char * const host = argv[2];
  const int pn = atoi(argv[3]);
  const u64 depth = strtoull(argv[4], NULL, 10);
  struct kvmap_api * api = NULL;
  struct oalloc * const oa = oalloc_create();
  struct kvmap_mm mm = { .af = (kv_alloc_func)oalloc_alloc, .ap = oa, };
  const int n1 = kvmap_api_helper(argc - 5, argv + 5, &api, &mm, false);
  if (n1 < 0 || api == NULL) {
    fprintf(stderr, "kvmap_api_helper() failed\n");
    exit(0);
  }
  struct worker_info wi;
  wi.api = api;
  wi.port = port;
  wi.depth = depth;
  struct server * const ser = server_create(host, pn, kv_worker, &wi);
  if (ser == NULL) {
    fprintf(stderr, "server_create() failed\n");
    exit(0);
  }
  server_wait(ser);
  kvmap_api_destroy(api);
  oalloc_destroy(oa);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
cmpl $0x5, %edi
jle 0x70eb
movl %edi, %r13d
movq 0x8(%r15), %rdi
callq 0x63e0
movslq %eax, %rdi
callq 0x13f70
testq %rax, %rax
je 0x70f3
movq %rax, %rbx
movq 0x10(%r15), %rax
movq %rax, -0x48(%rbp)
movq 0x18(%r15), %rdi
callq 0x63e0
movl %eax, -0x2c(%rbp)
movq 0x20(%r15), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x6580
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %r14
movq $0x0, (%r14)
callq 0x870b
vxorps %xmm0, %xmm0, %xmm0
leaq -0xb0(%rbp), %rcx
vmovups %ymm0, 0x30(%rcx)
vmovups %ymm0, 0x10(%rcx)
movq %rax, %r12
leaq 0x16f7(%rip), %rax      # 0x875a
movq %rax, (%rcx)
movq %r12, 0x8(%rcx)
addl $-0x5, %r13d
addq $0x28, %r15
movl %r13d, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
vzeroupper
callq 0xbe0a
testl %eax, %eax
js 0x70f8
movq -0x38(%rbp), %rax
testq %rax, %rax
je 0x70f8
leaq -0x60(%rbp), %rcx
movq %rax, (%rcx)
movq %rbx, 0x8(%rcx)
movq -0x40(%rbp), %rax
movq %rax, 0x10(%rcx)
leaq 0x55(%rip), %rdx        # 0x7102
movq -0x48(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0xb446
testq %rax, %rax
je 0x70fd
movq %rax, %rdi
callq 0xb6cb
movq -0x38(%rbp), %rdi
callq 0xbde1
movq %r12, %rdi
callq 0x8971
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x6795
callq 0x676e
callq 0x6747
callq 0x6720
// File: /workspace/github_c_makefile_star2_O3/codeplea[P]tinyexpr/example2.c
// Function: main
int main(int argc, char *argv[])
{
    if (argc < 2) {
        printf("Usage: example2 \"expression\"\n");
        return 0;
    }

    const char *expression = argv[1];
    printf("Evaluating:\n\t%s\n", expression);

    /* This shows an example where the variables
     * x and y are bound at eval-time. */
    double x, y;
    te_variable vars[] = {{"x", &x}, {"y", &y}};

    /* This will compile the expression and check for errors. */
    int err;
    te_expr *n = te_compile(expression, vars, 2, &err);

    if (n) {
        /* The variables can be changed here, and eval can be called as many
         * times as you like. This is fairly efficient because the parsing has
         * already been done. */
        x = 3; y = 4;
        const double r = te_eval(n); printf("Result:\n\t%f\n", r);

        te_free(n);
    } else {
        /* Show the user where the error is at. */
        printf("\t%*s^\nError near here", err-1, "");
    }


    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
cmpl $0x1, %edi
jg 0x11d9
leaq 0x1e6d(%rip), %rdi      # 0x303c
callq 0x1060
jmp 0x12a0
movq 0x8(%rsi), %rbx
leaq 0x1e20(%rip), %rdi      # 0x3004
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1080
leaq 0x1e1d(%rip), %rax      # 0x3015
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsi)
movl %r14d, 0x10(%rsi)
movq %r14, 0x18(%rsi)
leaq 0x1dff(%rip), %rax      # 0x3017
movq %rax, 0x20(%rsi)
leaq 0x10(%rsp), %rax
movq %rax, 0x28(%rsi)
movl %r14d, 0x30(%rsi)
movq %r14, 0x38(%rsi)
leaq 0xc(%rsp), %rcx
movq %rbx, %rdi
movl $0x2, %edx
callq 0x1cb2
testq %rax, %rax
je 0x1285
movq %rax, %rbx
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
movq %rax, 0x18(%rsp)
movabsq $0x4010000000000000, %rax # imm = 0x4010000000000000
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x16b9
leaq 0x1da5(%rip), %rdi      # 0x3019
movb $0x1, %al
callq 0x1080
movq %rbx, %rdi
callq 0x139b
jmp 0x12a0
movl 0xc(%rsp), %esi
decl %esi
leaq 0x1d94(%rip), %rdi      # 0x3026
leaq 0x1d8c(%rip), %rdx      # 0x3025
xorl %eax, %eax
callq 0x1080
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/attractivechaos[P]rb-eval/rb-cpp.cpp
// Function: test_int(int)
int test_int(int n)
{
	int i, present, cnt = 0;
	uint64_t x = 11;
	intmap_t::node_t *p;
	intmap_t *h = new intmap_t;

	for (i = 0; i < n; ++i) {
		unsigned y = x % (n>>1);
		x = kad_splitmix64(x);
		p = h->find(y);
		if (p == 0) {
			p = h->insert(y, &present);
			p->value = i;
			++cnt;
		} else {
			p = h->erase(y);
			free(p);
			--cnt;
		}
	}
	delete h;
	return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebp
movl $0x18, %edi
callq 0x1030
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
testl %ebp, %ebp
jle 0x12d3
movq %r12, %rbx
addq $0x8, %rbx
movl %ebp, 0x10(%rsp)
movl %ebp, %r15d
shrl %r15d
movl $0xb, %r13d
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %r13, %rax
xorl %edx, %edx
divq %r15
movl %edx, 0xc(%rsp)
movq (%rbx), %rax
testq %rax, %rax
je 0x1245
xorl %ecx, %ecx
xorl %esi, %esi
cmpl %edx, 0x10(%rax)
setb %cl
seta %sil
subl %esi, %ecx
js 0x1240
je 0x1261
addq $0x8, %rax
movq (%rax), %rax
jmp 0x1223
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x14(%rsp), %rdx
callq 0x12fe
movl %ebp, 0x14(%rax)
movl $0x1, %eax
jmp 0x127b
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x1490
movq %rax, %rdi
callq 0x1050
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %eax, %r14d
movabsq $-0x61c8864680b583eb, %rax # imm = 0x9E3779B97F4A7C15
addq %rax, %r13
movq %r13, %rax
shrq $0x1e, %rax
xorq %r13, %rax
movabsq $-0x40a7b892e31b1a47, %rcx # imm = 0xBF58476D1CE4E5B9
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $-0x6b2fb644ecceee15, %rax # imm = 0x94D049BB133111EB
imulq %rax, %rcx
movq %rcx, %r13
shrq $0x1f, %r13
xorq %rcx, %r13
incl %ebp
cmpl 0x10(%rsp), %ebp
jne 0x1214
jmp 0x12d6
xorl %r14d, %r14d
movq %r12, %rdi
callq 0x17b8
movl $0x18, %esi
movq %r12, %rdi
callq 0x1040
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/attractivechaos[P]rb-eval/./rb.hpp
// Function: rbtree_t<unsigned int, rbnode_map_t<unsigned int, int>, int_cmp>::~rbtree_t()
~rbtree_t() {
		node_t *p, *q;
		for (p = root; p != NULL; p = q) {
			if (p->rb_link[0] == NULL) {
				q = p->rb_link[1];
				::free(p);
			} else {
				q = p->rb_link[0];
				p->rb_link[0] = q->rb_link[1];
				q->rb_link[1] = p;
			}
		}
	}

// Assembly:
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x17e9
pushq %rbx
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x17d7
movq 0x8(%rbx), %rax
movq %rax, (%rdi)
movq %rdi, 0x8(%rbx)
jmp 0x17e0
movq 0x8(%rdi), %rbx
callq 0x1050
movq %rbx, %rdi
testq %rbx, %rbx
jne 0x17c2
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: perrorf
void perrorf(const char *fmt, ...) {
  int errsv = errno;
  va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap);
  fputs(": ", stderr);
  errno = errsv; perror(NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x2504
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x2030
movq %rax, %r14
movl (%rax), %ebp
movq %rsp, %rdx
movq %r15, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0xaaa3(%rip), %r15      # 0xcfd8
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x2320
movq (%r15), %rsi
leaq 0x72bd(%rip), %rdi      # 0x9807
callq 0x2250
movl %ebp, (%r14)
xorl %edi, %edi
callq 0x2180
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: verifyOnly
void verifyOnly() {
  vfy_t vfy;
  size_t n;
  static char buffer[65536];
  unsigned long long length;
  unsigned long long position;

  length = atoll(queryGetParam(header, "SZ")) - 522;
  fputs("Verifying otrkey...\n", stderr);
  verifyFile_init(&vfy, 1);
  for (position = 0; position < length; position += n) {
    showProgress(position, length);
    n = MIN(length - position, sizeof(buffer));
    if (fread(buffer, 1, n, file) < n) break;
    verifyFile_data(&vfy, buffer, n);
  }
  if (position < length) {
    if (!feof(file)) PERROR("fread");
    if (!logfilemode) fputc('\n', stderr);
    fputs("file is too short\n", stderr);
  }
  else
    showProgress(1, 0);

  if (fread(buffer, 1, 1, file) > 0)
    fputs("file contains trailing garbage\n", stderr);
  else if (!feof(file))
    PERROR("fread");
  verifyFile_final(&vfy);
  fputs("file is OK\n", stderr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq 0xaa33(%rip), %rdi      # 0xd2f8
leaq 0x7195(%rip), %rsi      # 0x9a61
callq 0x4f51
movq %rax, %rdi
callq 0x2150
movq %rax, %rbx
movq 0xa6f5(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
leaq 0x7177(%rip), %rdi      # 0x9a64
callq 0x2250
leaq 0xc(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x6196
addq $-0x20a, %rbx           # imm = 0xFDF6
je 0x2965
xorl %r14d, %r14d
movl $0x10000, %r12d         # imm = 0x10000
leaq 0xac38(%rip), %r15      # 0xd550
leaq 0xc(%rsp), %r13
movq %r14, %rdi
movq %rbx, %rsi
callq 0x513d
movq %rbx, %rbp
subq %r14, %rbp
cmpq %r12, %rbp
cmovaeq %r12, %rbp
movq 0xa9a4(%rip), %rcx      # 0xd2e0
movq %r15, %rdi
pushq $0x1
popq %rsi
movq %rbp, %rdx
callq 0x2370
cmpq %rbp, %rax
jb 0x2978
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3c05
addq %rbp, %r14
cmpq %rbx, %r14
jb 0x291d
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x513d
movq 0xa662(%rip), %r14      # 0xcfd8
jmp 0x29b6
movq 0xa961(%rip), %rdi      # 0xd2e0
callq 0x2380
testl %eax, %eax
je 0x2a20
cmpb $0x0, 0xa8f9(%rip)      # 0xd28c
movq 0xa63e(%rip), %r14      # 0xcfd8
jne 0x29a7
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x22d0
movq (%r14), %rsi
leaq 0x70ce(%rip), %rdi      # 0x9a7f
callq 0x2250
movq 0xa923(%rip), %rcx      # 0xd2e0
leaq 0xab8c(%rip), %rdi      # 0xd550
pushq $0x1
popq %rdx
movq %rdx, %rsi
callq 0x2370
testq %rax, %rax
jne 0x29e6
movq 0xa905(%rip), %rdi      # 0xd2e0
callq 0x2380
testl %eax, %eax
jne 0x29f5
jmp 0x2a27
movq (%r14), %rsi
leaq 0x70a2(%rip), %rdi      # 0x9a92
callq 0x2250
leaq 0xc(%rsp), %rdi
callq 0x6288
movq (%r14), %rsi
leaq 0x70a9(%rip), %rdi      # 0x9ab2
callq 0x2250
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa5b1(%rip), %r14      # 0xcfd8
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x22d0
movq (%r14), %rcx
leaq 0x703d(%rip), %rdi      # 0x9a79
pushq $0x5
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x2480
movq (%r14), %rcx
leaq 0x6db3(%rip), %rdi      # 0x9807
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x2480
xorl %edi, %edi
callq 0x2180
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/md5.c
// Function: MD5_Update
void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size)
{
	MD5_u32plus saved_lo;
	unsigned long used, free;

	saved_lo = ctx->lo;
	if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
		ctx->hi++;
	ctx->hi += size >> 29;

	used = saved_lo & 0x3f;

	if (used) {
		free = 64 - used;

		if (size < free) {
			memcpy(&ctx->buffer[used], data, size);
			return;
		}

		memcpy(&ctx->buffer[used], data, free);
		data = (unsigned char *)data + free;
		size -= free;
		body(ctx, ctx->buffer, 64);
	}

	if (size >= 64) {
		data = body(ctx, data, size & ~(unsigned long)0x3f);
		size &= 0x3f;
	}

	memcpy(ctx->buffer, data, size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
leal (%rdx,%rax), %ecx
andl $0x1fffffff, %ecx       # imm = 0x1FFFFFFF
movl %ecx, (%rdi)
movq %rdx, %rdi
shrq $0x1d, %rdi
cmpl %eax, %ecx
adcl %edi, 0x4(%rbx)
movq %rsi, %r14
andq $0x3f, %rax
je 0x3c51
movl $0x40, %r12d
subq %rax, %r12
movq %rdx, %r15
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
subq %r12, %r15
jae 0x3c56
movq %r14, %rsi
jmp 0x3ca4
movq %rdx, %r15
jmp 0x3c78
leaq 0x18(%rbx), %r13
movq %r14, %rsi
movq %r12, %rdx
callq 0x2170
addq %r12, %r14
movl $0x40, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3cb2
cmpq $0x40, %r15
jb 0x3c97
movq %r15, %rdx
andq $-0x40, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3cb2
movq %rax, %r14
andl $0x3f, %r15d
addq $0x18, %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2170
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/md5.c
// Function: MD5
unsigned char * MD5(const unsigned char *d, unsigned long n,
										unsigned char *md) {
	/* This function was added by PyroPeter to allow reusal of old
	 * openssl-dependent code */
	
	MD5_CTX ctx;
	memset(&ctx, 0, sizeof(MD5_CTX));
	MD5_Init(&ctx);
	
	MD5_Update(&ctx, (void *) d, n);
	
	unsigned char *result = (md ? md : (unsigned char *) staticmd);
	MD5_Final(result, &ctx);
	return staticmd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %r14
movups %xmm0, 0x88(%r14)
movups %xmm0, 0x78(%r14)
movups %xmm0, 0x68(%r14)
movups %xmm0, 0x58(%r14)
movups %xmm0, 0x48(%r14)
movups %xmm0, 0x38(%r14)
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x18(%r14)
movabsq $0x1032547698badcfe, %rax # imm = 0x1032547698BADCFE
movq %rax, 0x10(%r14)
movaps 0x3949(%rip), %xmm0     # 0x8010
movaps %xmm0, (%r14)
movq %r14, %rdi
callq 0x3c05
testq %rbx, %rbx
leaq 0x8b93(%rip), %r15      # 0xd270
cmoveq %r15, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4545
movq %r15, %rax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/blowfish.c
// Function: bf_init
void bf_init(bf_state_t *st, void *key_, size_t keylen)
{
  uint8_t *key = key_;
  int i, j;
  size_t ki;
  uint32_t k;
  uint32_t xL, xR;

  if (keylen < 1 || keylen > 56)
    return;

  /* step 1 */
  memcpy(st->S, S0, sizeof(S0));
  memcpy(st->P, P0, sizeof(P0));

  /* step 2 */
  ki = 0;
  for (i=0; i<18; i++) {
    k = 0;
    for (j=0; j<4; j++) {
      k = (k << 8) | key[ki];
      if (++ki >= keylen) ki = 0;
    }
    st->P[i] ^= k;
  }

  /* steps 3 to 7 */
  xL = xR = 0;
  for (i=0; i<18; i+=2) {
    BF_ENCRYPT(st, xL, xR);
    st->P[i] = xL;
    st->P[i+1] = xR;
  }
  for (i=0; i<4; i++) {
    for (j=0; j<256; j+=2) {
      BF_ENCRYPT(st, xL, xR);
      st->S[i][j] = xL;
      st->S[i][j+1] = xR;
    }
  }
}

// Assembly:
leaq -0x39(%rdx), %rax
cmpq $-0x38, %rax
jb 0x48be
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x3901(%rip), %rsi      # 0x8020
movl $0x1000, %edx           # imm = 0x1000
callq 0x2170
leaq 0x1000(%rbx), %rax
leaq 0x48e9(%rip), %rsi      # 0x9020
movl $0x12, %ecx
movq %rax, %rdi
rep  movsl (%rsi), %es:(%rdi)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movl $0x4, %edi
xorl %r8d, %r8d
movl %r8d, %r9d
shll $0x8, %r9d
movzbl (%r15,%rsi), %r8d
orl %r9d, %r8d
incq %rsi
cmpq %r14, %rsi
cmovaeq %rcx, %rsi
decl %edi
jne 0x474f
xorl %r8d, (%rax,%rdx,4)
incq %rdx
cmpq $0x12, %rdx
jne 0x4747
xorl %edx, %edx
movl $0xff, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
xorl %edi, %edi
movl %ecx, %eax
movl %r8d, %ecx
movl %eax, %r8d
movl %ecx, %eax
xorl 0x1000(%rbx,%rdi,4), %eax
movl %eax, %r9d
shrl $0x18, %r9d
movl %eax, %ecx
shrl $0xe, %ecx
andl $0x3fc, %ecx            # imm = 0x3FC
movl 0x400(%rbx,%rcx), %ecx
addl (%rbx,%r9,4), %ecx
movl %eax, %r9d
shrl $0x8, %r9d
andl %esi, %r9d
xorl 0x800(%rbx,%r9,4), %ecx
movl %eax, %r9d
andl %esi, %r9d
addl 0xc00(%rbx,%r9,4), %ecx
xorl %r8d, %ecx
incq %rdi
cmpq $0x10, %rdi
jne 0x478e
xorl 0x1040(%rbx), %ecx
xorl 0x1044(%rbx), %eax
movl %eax, 0x1000(%rbx,%rdx,4)
movl %ecx, 0x1004(%rbx,%rdx,4)
leaq 0x2(%rdx), %rdi
cmpq $0x10, %rdx
movq %rdi, %rdx
jb 0x4784
xorl %edx, %edx
movl $0xff, %esi
movq %rdx, %rdi
shlq $0xa, %rdi
addq %rbx, %rdi
xorl %r8d, %r8d
movl %eax, %r10d
xorl %r9d, %r9d
movl %ecx, %eax
movl %r10d, %ecx
movl %eax, %r10d
movl %ecx, %eax
xorl 0x1000(%rbx,%r9,4), %eax
movl %eax, %r11d
shrl $0x18, %r11d
movl %eax, %ecx
shrl $0xe, %ecx
andl $0x3fc, %ecx            # imm = 0x3FC
movl 0x400(%rbx,%rcx), %ecx
addl (%rbx,%r11,4), %ecx
movl %eax, %r11d
shrl $0x8, %r11d
andl %esi, %r11d
xorl 0x800(%rbx,%r11,4), %ecx
movl %eax, %r11d
andl %esi, %r11d
addl 0xc00(%rbx,%r11,4), %ecx
xorl %r10d, %ecx
incq %r9
cmpq $0x10, %r9
jne 0x482d
xorl 0x1040(%rbx), %ecx
xorl 0x1044(%rbx), %eax
movl %eax, (%rdi,%r8,4)
movl %ecx, 0x4(%rdi,%r8,4)
leaq 0x2(%r8), %r9
cmpq $0xfe, %r8
movq %r9, %r8
jb 0x4822
incq %rdx
cmpq $0x4, %rdx
jne 0x4815
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/blowfish.c
// Function: bf_cbc_encrypt
void bf_cbc_encrypt(const bf_state_t *st, void *data_, size_t len, void *iv_)
{
  uint8_t *data = data_;
  uint8_t *iv = iv_;
  uint32_t xL, xR;
  uint32_t ivL, ivR;
  size_t i;

  ivL = load_uint32le(iv);
  ivR = load_uint32le(iv+4);

  for (i=0; i<=len-8; i+=8) {
    xL = load_uint32le(data+i) ^ ivL;
    xR = load_uint32le(data+i+4) ^ ivR;
    BF_ENCRYPT(st, xL, xR);
    store_uint32le(data+i, xL);
    store_uint32le(data+i+4, xR);
    ivL = xL;
    ivR = xR;
  }

  store_uint32le(iv, ivL);
  store_uint32le(iv+4, ivR);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl (%rcx), %r9d
movq %rcx, -0x8(%rsp)
movl 0x4(%rcx), %r10d
addq $-0x8, %rdx
xorl %eax, %eax
movl $0xff, %r8d
xorl (%rsi,%rax), %r9d
xorl 0x4(%rsi,%rax), %r10d
xorl %r11d, %r11d
movl %r10d, %ecx
movl %r9d, %r10d
xorl 0x1000(%rdi,%r11,4), %r10d
movl %r10d, %ebx
shrl $0x18, %ebx
movl %r10d, %r9d
shrl $0xe, %r9d
andl $0x3fc, %r9d            # imm = 0x3FC
movl 0x400(%rdi,%r9), %r9d
addl (%rdi,%rbx,4), %r9d
movl %r10d, %ebx
shrl $0x8, %ebx
andl %r8d, %ebx
xorl 0x800(%rdi,%rbx,4), %r9d
movl %r10d, %ebx
andl %r8d, %ebx
addl 0xc00(%rdi,%rbx,4), %r9d
xorl %ecx, %r9d
incq %r11
cmpq $0x10, %r11
jne 0x49c0
xorl 0x1040(%rdi), %r9d
movl %r10d, %r11d
xorl 0x1044(%rdi), %r11d
movl %r11d, %ebx
shrl $0x10, %ebx
movl %r11d, %ebp
shrl $0x18, %ebp
movb %bpl, 0x3(%rsi,%rax)
movb %bl, 0x2(%rsi,%rax)
movl %r11d, %r14d
shrl $0x8, %r14d
movb %r14b, 0x1(%rsi,%rax)
movb %r11b, (%rsi,%rax)
movl %r9d, %r15d
shrl $0x10, %r15d
movl %r9d, %r12d
shrl $0x18, %r12d
movb %r12b, 0x7(%rsi,%rax)
movb %r15b, 0x6(%rsi,%rax)
movl %r9d, %r13d
shrl $0x8, %r13d
movb %r13b, 0x5(%rsi,%rax)
movl %r9d, %ecx
movb %r9b, 0x4(%rsi,%rax)
addq $0x8, %rax
movl %r9d, %r10d
movl %r11d, %r9d
cmpq %rdx, %rax
jbe 0x49b4
movq -0x8(%rsp), %rax
movb %bpl, 0x3(%rax)
movb %bl, 0x2(%rax)
movb %r14b, 0x1(%rax)
movb %r11b, (%rax)
movb %r12b, 0x7(%rax)
movb %r15b, 0x6(%rax)
movb %r13b, 0x5(%rax)
movb %cl, 0x4(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/blowfish.c
// Function: bf_cbc_decrypt
void bf_cbc_decrypt(const bf_state_t *st, void *data_, size_t len, void *iv_)
{
  uint8_t *data = data_;
  uint8_t *iv = iv_;
  uint32_t xL, xR;
  uint32_t ivL, ivR, ivLn, ivRn;
  size_t i;

  ivL = load_uint32le(iv);
  ivR = load_uint32le(iv+4);

  for (i=0; i<=len-8; i+=8) {
    xL = ivLn = load_uint32le(data+i);
    xR = ivRn = load_uint32le(data+i+4);
    BF_DECRYPT(st, xL, xR);
    store_uint32le(data+i, xL ^ ivL);
    store_uint32le(data+i+4, xR ^ ivR);
    ivL = ivLn;
    ivR = ivRn;
  }

  store_uint32le(iv, ivL);
  store_uint32le(iv+4, ivR);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl (%rcx), %eax
movq %rcx, -0x10(%rsp)
movl 0x4(%rcx), %ebx
addq $-0x8, %rdx
movq %rdx, -0x8(%rsp)
xorl %ecx, %ecx
movl $0xff, %r8d
movzwl 0x2(%rsi,%rcx), %r10d
movl %r10d, %r11d
shll $0x10, %r11d
movzwl (%rsi,%rcx), %edx
movl %edx, -0x1c(%rsp)
orl %edx, %r11d
movzwl 0x6(%rsi,%rcx), %r14d
movl %r14d, -0x18(%rsp)
shll $0x10, %r14d
movzwl 0x4(%rsi,%rcx), %edx
movl %edx, -0x14(%rsp)
orl %edx, %r14d
movl $0x411, %r12d           # imm = 0x411
movl %r11d, %r15d
movl %r14d, %r13d
movl %r13d, %ebp
movl %r15d, %r13d
xorl (%rdi,%r12,4), %r13d
movl %r13d, %r9d
shrl $0x18, %r9d
movl %r13d, %r15d
shrl $0xe, %r15d
andl $0x3fc, %r15d           # imm = 0x3FC
movl 0x400(%rdi,%r15), %r15d
addl (%rdi,%r9,4), %r15d
movl %r13d, %r9d
shrl $0x8, %r9d
andl %r8d, %r9d
xorl 0x800(%rdi,%r9,4), %r15d
movl %r13d, %r9d
andl %r8d, %r9d
addl 0xc00(%rdi,%r9,4), %r15d
xorl %ebp, %r15d
leaq -0x1(%r12), %r9
addq $-0x400, %r12           # imm = 0xFC00
cmpq $0x2, %r12
movq %r9, %r12
ja 0x4b1f
xorl 0x1000(%rdi), %eax
xorl %r13d, %eax
movl %eax, %r9d
shrl $0x10, %r9d
movl %eax, %ebp
shrl $0x18, %ebp
xorl 0x1004(%rdi), %ebx
movb %bpl, 0x3(%rsi,%rcx)
movb %r9b, 0x2(%rsi,%rcx)
movb %ah, 0x1(%rsi,%rcx)
movb %al, (%rsi,%rcx)
xorl %r15d, %ebx
movl %ebx, %edx
shrl $0x10, %edx
movl %ebx, %r9d
shrl $0x18, %r9d
movb %r9b, 0x7(%rsi,%rcx)
movb %dl, 0x6(%rsi,%rcx)
movb %bh, 0x5(%rsi,%rcx)
movb %bl, 0x4(%rsi,%rcx)
addq $0x8, %rcx
movl %r14d, %ebx
movl %r11d, %eax
cmpq -0x8(%rsp), %rcx
jbe 0x4ae0
movq -0x10(%rsp), %rax
movw %r10w, 0x2(%rax)
movl -0x1c(%rsp), %ecx
movb %ch, 0x1(%rax)
movb %cl, (%rax)
movl -0x18(%rsp), %ecx
movb %ch, 0x7(%rax)
movb %cl, 0x6(%rax)
movl -0x14(%rsp), %ecx
movb %ch, 0x5(%rax)
movb %cl, 0x4(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: bin2hex
char * bin2hex(void *data_, int len) {
  unsigned char *data = data_;
  unsigned char *result = malloc(sizeof(char) * len * 2 + 1);
  result[len * 2] = 0;
  int foo;
  for (len-- ; len >= 0 ; len--) {
    foo = data[len] % 16;
    result[len*2 + 1] = foo > 9 ? 0x37 + foo : 0x30 + foo;
    foo = data[len] >> 4;
    result[len*2] = foo > 9 ? 0x37 + foo : 0x30 + foo;
  }
  return (char*)result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r14
leaq 0x1(,%r14,2), %rdi
callq 0x2310
movb $0x0, (%rax,%r14,2)
testl %r14d, %r14d
jle 0x4c8f
movl %ebp, %ecx
incq %rcx
movb -0x2(%rbx,%rcx), %dl
movl %edx, %esi
andb $0xf, %sil
leal 0x37(%rsi), %edi
leal 0x30(%rsi), %r8d
cmpb $0xa, %sil
movzbl %dil, %esi
movzbl %r8b, %edi
cmovael %esi, %edi
movl %edx, %esi
shrb $0x4, %sil
leal 0x37(%rsi), %r8d
orb $0x30, %sil
cmpb $-0x60, %dl
movzbl %r8b, %edx
movzbl %sil, %esi
cmovael %edx, %esi
movb %dil, -0x3(%rax,%rcx,2)
movb %sil, -0x4(%rax,%rcx,2)
decq %rcx
cmpq $0x1, %rcx
ja 0x4c40
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: hex2bin
void * hex2bin(char *data_) {
  int len = strlen(data_) / 2;
  unsigned char *data = (unsigned char*)data_;
  // never tested with lowercase letters!
  unsigned char *result = malloc(sizeof(char) * len + 1);
  int foo, bar;
  result[len] = 0;
  for (len-- ; len >= 0 ; len--) {
    foo = data[len*2];
    if (foo < 0x41) {
      // is a digit
      bar = foo - 0x30;
    } else if (foo < 0x61) {
      // is a uppercase letter
      bar = foo - 0x37;
    } else {
      // is a lowercase letter
      bar = foo - 0x57;
    }
    result[len] = bar << 4;
    
    foo = data[len*2 + 1];
    if (foo < 0x41) {
      // is a digit
      bar = foo - 0x30;
    } else if (foo < 0x61) {
      // is a uppercase letter
      bar = foo - 0x37;
    } else {
      // is a lowercase letter
      bar = foo - 0x57;
    }
    result[len] += bar;
  }
  return (void*)result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x20c0
movq %rax, %r14
shrq %r14
movslq %r14d, %r15
leaq 0x1(%r15), %rdi
callq 0x2310
movb $0x0, (%rax,%r15)
testl %r15d, %r15d
jle 0x4d14
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
incq %r14
movl $0xd0, %ecx
movb -0x4(%rbx,%r14,2), %dl
movb -0x3(%rbx,%r14,2), %sil
xorl %edi, %edi
cmpb $0x41, %dl
setae %dil
leal (%rdi,%rdi,8), %edi
addb %dl, %dil
shlb $0x4, %dil
cmpb $0x61, %sil
setb %dl
shlb $0x5, %dl
addb $-0x57, %dl
cmpb $0x41, %sil
movzbl %dl, %edx
cmovbl %ecx, %edx
addb %sil, %dil
addb %dl, %dil
movb %dil, -0x2(%rax,%r14)
decq %r14
cmpq $0x1, %r14
ja 0x4ccc
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: base64Encode
char * base64Encode(void *data_, int len) {
  unsigned char *data = data_;
  static const char *b64 = "\
ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz\
0123456789+/";
  int blocks = (len + 2) / 3;
  int newlen = blocks * 4 + 1;
  char *result = malloc(newlen);
  char *resptr = result;
  int i;
  
  for (i = len / 3 ; i > 0 ; i--) {
    resptr[0] = b64[  data[0]             >> 2 ];
    resptr[1] = b64[ (data[0] &     B_11) << 4
                    | data[1]             >> 4 ];
    resptr[2] = b64[ (data[1] &   B_1111) << 2
                    | data[2]             >> 6 ];
    resptr[3] = b64[  data[2] & B_111111       ];
    resptr += 4;
    data += 3;
  }
  
  if (len < blocks * 3 - 1) {
    resptr[0] = b64[  data[0]             >> 2 ];
    resptr[1] = b64[ (data[0] &     B_11) << 4 ];
    resptr[2] = '=';
    resptr[3] = '=';
    resptr += 4;
  } else if (len < blocks * 3) {
    resptr[0] = b64[  data[0]             >> 2 ];
    resptr[1] = b64[ (data[0] &     B_11) << 4
                    | data[1]             >> 4 ];
    resptr[2] = b64[ (data[1] &   B_1111) << 2 ];
    resptr[3] = '=';
    resptr += 4;
  }
  
  *resptr = 0;
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %eax
cltq
imulq $0x55555556, %rax, %r15 # imm = 0x55555556
movq %r15, %rax
shrq $0x3f, %rax
shrq $0x20, %r15
addl %eax, %r15d
leal 0x1(,%r15,4), %eax
movslq %eax, %rdi
callq 0x2310
cmpl $0x3, %r14d
jl 0x4ddb
movl %r14d, %ecx
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rcx, %rdx
shrq $0x21, %rdx
incl %edx
leaq 0x4559(%rip), %rsi      # 0x92cc
movq %rax, %rcx
movzbl (%rbx), %edi
movl %edi, %r8d
shrl $0x2, %r8d
movb (%r8,%rsi), %r8b
movb %r8b, (%rcx)
shll $0x4, %edi
andl $0x30, %edi
movzbl 0x1(%rbx), %r8d
movl %r8d, %r9d
shrl $0x4, %r9d
orl %edi, %r9d
movb (%r9,%rsi), %dil
movb %dil, 0x1(%rcx)
andl $0xf, %r8d
movzbl 0x2(%rbx), %edi
movl %edi, %r9d
shrl $0x6, %r9d
leal (%r9,%r8,4), %r8d
movb (%r8,%rsi), %r8b
movb %r8b, 0x2(%rcx)
andl $0x3f, %edi
movb (%rdi,%rsi), %dil
movb %dil, 0x3(%rcx)
addq $0x4, %rcx
addq $0x3, %rbx
decl %edx
cmpl $0x1, %edx
ja 0x4d76
jmp 0x4dde
movq %rax, %rcx
leal (%r15,%r15,2), %edx
decl %edx
cmpl %r14d, %edx
jle 0x4e0f
movzbl (%rbx), %edx
movl %edx, %esi
shrl $0x2, %esi
leaq 0x44d4(%rip), %rdi      # 0x92cc
movb (%rsi,%rdi), %sil
movb %sil, (%rcx)
shll $0x4, %edx
andl $0x30, %edx
movb (%rdx,%rdi), %dl
movb %dl, 0x1(%rcx)
movb $0x3d, %dl
jmp 0x4e4f
leal (%r15,%r15,2), %edx
cmpl %r14d, %edx
jle 0x4e5a
movzbl (%rbx), %edx
movl %edx, %esi
shrl $0x2, %esi
leaq 0x44a5(%rip), %rdi      # 0x92cc
movb (%rsi,%rdi), %sil
movb %sil, (%rcx)
shll $0x4, %edx
andl $0x30, %edx
movzbl 0x1(%rbx), %esi
movl %esi, %r8d
shrl $0x4, %r8d
orl %edx, %r8d
movb (%r8,%rdi), %dl
movb %dl, 0x1(%rcx)
andl $0xf, %esi
movb (%rdi,%rsi,4), %dl
movb %dl, 0x2(%rcx)
movb $0x3d, 0x3(%rcx)
addq $0x4, %rcx
movb $0x0, (%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: base64Decode
void * base64Decode(char *text, int *outlen) {
  static const unsigned char b64dec[] = {
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //00
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //10
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0, 62,  0,  0,  0, 63, //20
  52, 53, 54, 55, 56, 57, 58, 59,  60, 61,  0,  0,  0,  0,  0,  0, //30
   0,  0,  1,  2,  3,  4,  5,  6,   7,  8,  9, 10, 11, 12, 13, 14, //40
  15, 16, 17, 18, 19, 20, 21, 22,  23, 24, 25,  0,  0,  0,  0,  0, //50
   0, 26, 27, 28, 29, 30, 31, 32,  33, 34, 35, 36, 37, 38, 39, 40, //60
  41, 42, 43, 44, 45, 46, 47, 48,  49, 50, 51,  0,  0,  0,  0,  0, //70
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //80
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //90
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //a0
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //b0
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //c0
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //d0
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0, //e0
   0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0,  0,  0,  0,  0  //f0
  };
  // this functions treats invalid characters as 'A'. deal with it :-P
  int inlen = (strlen(text) >> 2) << 2;
  int blocks = inlen >> 2;
  *outlen = blocks * 3 - (text[inlen-2] == '='
      ? 2 : (text[inlen-1] == '=' ? 1 : 0));
  char *result = malloc(blocks * 3);
  char *resptr = result;
  uint8_t *text_ = (uint8_t*)text;
  int i;
  
  for (i = 0 ; i < blocks ; i++) {
    resptr[0] = b64dec[text_[0]] << 2 | b64dec[text_[1]] >> 4;
    resptr[1] = b64dec[text_[1]] << 4 | b64dec[text_[2]] >> 2;
    resptr[2] = b64dec[text_[2]] << 6 | b64dec[text_[3]];
    
    text_ += 4;
    resptr += 3;
  }
  
  return (void*)result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
callq 0x20c0
movq %rax, %r14
movslq %r14d, %rdx
sarl $0x2, %r14d
leal (%r14,%r14,2), %eax
andq $-0x4, %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmpb $0x3d, -0x2(%rbx,%rdx)
je 0x4e9d
xorl %ecx, %ecx
cmpb $0x3d, -0x1(%rbx,%rdx)
sete %cl
negl %ecx
addl %eax, %ecx
movl %ecx, (%r15)
movslq %eax, %rdi
callq 0x2310
testl %r14d, %r14d
jle 0x4f1b
movl %r14d, %ecx
xorl %edx, %edx
leaq 0x42f5(%rip), %rsi      # 0x91b0
movq %rax, %rdi
movzbl (%rbx,%rdx,4), %r8d
movb (%r8,%rsi), %r8b
shlb $0x2, %r8b
movzbl 0x1(%rbx,%rdx,4), %r9d
movb (%r9,%rsi), %r9b
movl %r9d, %r10d
shrb $0x4, %r10b
orb %r8b, %r10b
movb %r10b, (%rdi)
shlb $0x4, %r9b
movzbl 0x2(%rbx,%rdx,4), %r8d
movb (%r8,%rsi), %r8b
movl %r8d, %r10d
shrb $0x2, %r10b
orb %r9b, %r10b
movb %r10b, 0x1(%rdi)
shlb $0x6, %r8b
movzbl 0x3(%rbx,%rdx,4), %r9d
orb (%r9,%rsi), %r8b
movb %r8b, 0x2(%rdi)
incq %rdx
addq $0x3, %rdi
cmpl %edx, %ecx
jne 0x4ebe
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: queryGetParam
char * queryGetParam(char *query, char *name) {
  char *begin = strchr(query, '&');
  char *end;
  int nameLen = strlen(name);
  
  while (begin != NULL) {
    begin++;
    if (strncmp(begin, name, nameLen) == 0 && begin[nameLen] == '=') {
      begin += nameLen + 1;
      end = strchr(begin, '&');
      if (end == NULL)
        end = begin + strlen(begin);
      char *result = malloc(end - begin + 1);
      strncpy(result, begin, end - begin);
      result[end - begin] = 0;
      return result;
    }
    begin = strchr(begin, '&');
  }
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movl $0x26, %esi
callq 0x2090
testq %rax, %rax
je 0x4fb7
movq %rax, %rbx
movq %r14, %rdi
callq 0x20c0
movslq %eax, %r12
movq %rax, %r13
shlq $0x20, %r13
xorl %r15d, %r15d
incq %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20e0
testl %eax, %eax
jne 0x4fa0
cmpb $0x3d, (%rbx,%r12)
je 0x4fbc
movq %rbx, %rdi
movl $0x26, %esi
callq 0x2090
movq %rax, %rbx
testq %rax, %rax
jne 0x4f84
jmp 0x5015
xorl %r15d, %r15d
jmp 0x5015
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r13
sarq $0x20, %r13
addq %r13, %rbx
movq %rbx, %rdi
movl $0x26, %esi
callq 0x2090
movq %rax, %r14
testq %rax, %rax
jne 0x4ff3
movq %rbx, %rdi
callq 0x20c0
movq %rax, %r14
addq %rbx, %r14
subq %rbx, %r14
leaq 0x1(%r14), %rdi
callq 0x2310
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x20f0
movb $0x0, (%r15,%r14)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: quote
void quote(char *message) {
  char line[LINE_LENGTH + 1];
  line[0] = '>';
  line[1] = ' ';
  int index = 2;
  
  while (*message != 0) {
    if (*message < 0x20 || *message > 0x7E) {
      line[index++] = ' ';
    } else {
      line[index++] = *message;
    }
    if (index == LINE_LENGTH) {
      line[index++] = '\n';
      fwrite(line, index, 1, stderr);
      line[0] = '>';
      line[1] = ' ';
      index = 2;
    }
    message++;
  }
  line[index++] = '\n';
  if (index != 3) fwrite(line, index, 1, stderr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movw $0x203e, (%rsp)         # imm = 0x203E
movb (%rdi), %al
testb %al, %al
je 0x509e
movq %rdi, %rbx
leaq 0x1(%rsp), %r14
leaq 0x50(%rsp), %r15
incq %rbx
movl $0x2, %edi
movl $0x20, %ebp
movq %rsp, %r12
leal -0x7f(%rax), %ecx
cmpb $-0x5f, %cl
movzbl %al, %eax
cmovbl %ebp, %eax
movslq %edi, %rdi
movb %al, (%rsp,%rdi)
incl %edi
cmpl $0x50, %edi
je 0x507b
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x5057
jmp 0x5090
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2a84
movl $0x2, %edi
jmp 0x5070
movslq %edi, %rax
incl %edi
movb $0xa, (%rsp,%rax)
cmpl $0x3, %edi
jne 0x50ab
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rsi
callq 0x2ab8
jmp 0x509e
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: dumpQuerystring
void dumpQuerystring(char *query) {
  char line[LINE_LENGTH + 1];
  int index = 0;

  if (*query == '&') {
    line[0] = '&';
    index++;
    query++;
  }

  for (; *query; query++) {
    if (*query == '&') {
      line[index] = '\n';
      fwrite(line, index + 1, 1, stderr);
      index = 0;
    }
    line[index] = *query;

    index++;
    if (index == LINE_LENGTH) {
      line[index] = '\n';
      fwrite(line, index + 1, 1, stderr);
      line[0] = ' ';
      index = 1;
    }
  }
  line[index] = '\n';
  if (index != LINE_LENGTH) fwrite(line, index + 1, 1, stderr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
xorl %esi, %esi
cmpb $0x26, (%rdi)
jne 0x50d4
movb $0x26, (%rsp)
incq %rbx
movl $0x1, %esi
leaq 0x50(%rsp), %r14
movq %rsp, %r15
movzbl (%rbx), %eax
movslq %esi, %rcx
leaq (%rsp,%rcx), %rdi
cmpl $0x26, %eax
je 0x50fd
testl %eax, %eax
je 0x511c
movb %al, (%rdi)
incl %esi
cmpl $0x50, %esi
je 0x510a
incq %rbx
jmp 0x50dc
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2ad9
jmp 0x5115
movq %r14, %rdi
movq %r15, %rsi
callq 0x2b30
movl $0x1, %esi
jmp 0x50f8
movb $0xa, (%rdi)
cmpl $0x50, %esi
jne 0x512e
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rax
movl %esi, %edi
movq %rax, %rsi
callq 0x2b0d
jmp 0x5124
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: showProgress
void showProgress(long long position, long long length) {
  static long long oldpos = 0;
  static unsigned int blocknum = 0;
  const char progressbar[41] = "========================================";
  const char *rotatingFoo = "|/-\\";

  if (logfilemode)
    return;
  if (length > 0) {
    if (oldpos > position) {
      oldpos = 0;
      blocknum = 0;
    }
    if (position - oldpos >= 2097152 || position == 0) {
      if (opts.guimode == 0) {
        fprintf(stderr, "[%-40.*s] %3i%% %c\r", (int)(position*40/length),
            progressbar, (int)(position*100/length),
            rotatingFoo[blocknum++ % 4]);
      } else {
        fprintf(stdout, "gui> %7.3f\n", position*100.0/length);
        fflush(stdout);
      }
      fflush(stderr);
      oldpos = position;
    }
  } else {
    if (opts.guimode == 0) {
      fputs("[========================================] 100%    \n", stderr);
    } else {
      fputs("gui> Finished\n", stdout);
      fflush(stdout);
    }
    oldpos = 0;
    blocknum = 0;
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movups 0x4f3e(%rip), %xmm0     # 0xa089
movups %xmm0, 0x19(%rsp)
movaps 0x4f29(%rip), %xmm0     # 0xa080
movaps %xmm0, 0x10(%rsp)
movapd 0x4f0c(%rip), %xmm0     # 0xa070
movapd %xmm0, (%rsp)
cmpb $0x0, 0x811c(%rip)      # 0xd28c
jne 0x525d
testq %rsi, %rsi
jle 0x5221
movq %rdi, %rbx
movq 0x80f7(%rip), %rax      # 0xd280
cmpq %rdi, %rax
jle 0x51a5
movq $0x0, 0x80e7(%rip) # 0xd280
movl $0x0, 0x80e5(%rip)      # 0xd288
xorl %eax, %eax
movq %rbx, %rcx
subq %rax, %rcx
cmpq $0x200000, %rcx         # imm = 0x200000
setl %al
testq %rbx, %rbx
setne %cl
testb %al, %cl
jne 0x525d
cmpb $0x0, 0x80d6(%rip)      # 0xd2a0
je 0x526c
movq 0x7dd9(%rip), %r14      # 0xcfb0
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
mulsd 0x3f49(%rip), %xmm0     # 0x9130
movq (%r14), %rdi
cvtsi2sd %rsi, %xmm1
divsd %xmm1, %xmm0
leaq 0x417e(%rip), %rsi      # 0x9378
movb $0x1, %al
callq 0x2340
movq (%r14), %rdi
callq 0x2270
movq 0x7dc8(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
callq 0x2270
movq %rbx, 0x8061(%rip)      # 0xd280
jmp 0x525d
cmpb $0x0, 0x8078(%rip)      # 0xd2a0
je 0x5265
movq 0x7d7f(%rip), %rbx      # 0xcfb0
movq (%rbx), %rsi
leaq 0x417e(%rip), %rdi      # 0x93b9
callq 0x2250
movq (%rbx), %rdi
callq 0x2270
movq $0x0, 0x802d(%rip) # 0xd280
movl $0x0, 0x802b(%rip)      # 0xd288
addq $0x38, %rsp
popq %rbx
popq %r14
retq
callq 0x2b54
jmp 0x5248
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x2b6a
jmp 0x5209
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: createThread
thread_t createThread(void *(*start_routine)(void *), void *arg) {
  pthread_t tid;
  errno = pthread_create(&tid, NULL, start_routine, arg);
  if (errno != 0) PERROR("pthread_create");
  return tid;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rcx
movq %rdi, %rdx
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x2440
movl %eax, %ebx
callq 0x2030
movl %ebx, (%rax)
testl %ebx, %ebx
jne 0x52a8
movq 0x8(%rsp), %rax
addq $0x10, %rsp
popq %rbx
retq
callq 0x2bc4
// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: joinThread
void *joinThread(thread_t tid) {
  void *res;
  errno = pthread_join(tid, &res);
  if (errno != 0) PERROR("pthread_join");
  return res;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rsi
callq 0x21b0
movl %eax, %ebx
callq 0x2030
movl %ebx, (%rax)
testl %ebx, %ebx
jne 0x52d4
movq 0x8(%rsp), %rax
addq $0x10, %rsp
popq %rbx
retq
callq 0x2c16