LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jogolden[P]ps4flashtool/southbridge.c
// Function: flash_locate_eap_kbl
struct bldr_hdr *flash_locate_eap_kbl(unsigned char *flashdata) {
    struct bldr_hdr *blhdr = NULL;
    struct slb2_header *slbhdr = (struct slb2_header *)(flashdata + 0xC4000);
    struct slb2_entry *entry = NULL;
    int i;

    if(slbhdr->magic != SLB2_MAGIC) {
        printf("error: invalid KBL SLB2 magic!\n");
        return NULL;
    }

    for(i = 0; i < slbhdr->file_count; i++) {
        entry = &slbhdr->entry_list[i];

        if(!strcmp(entry->file_name, "C0010001") || !strcmp(entry->file_name, "eap_kbl")) {
            break;
        }
    }
    
    return (struct bldr_hdr *)(flashdata + 0xC4000 + (entry->block_offset << 9));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0xc4000, %rax          # imm = 0xC4000
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x32424c53, (%rax)     # imm = 0x32424C53
je 0x9d11
leaq 0x3523(%rip), %rdi      # 0xd220
movb $0x0, %al
callq 0x2080
movq $0x0, -0x8(%rbp)
jmp 0x9d98
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x9d7c
movq -0x20(%rbp), %rax
addq $0x20, %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
leaq 0x2712(%rip), %rsi      # 0xc45c
callq 0x20c0
cmpl $0x0, %eax
je 0x9d6d
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
leaq 0x34dd(%rip), %rsi      # 0xd240
callq 0x20c0
cmpl $0x0, %eax
jne 0x9d6f
jmp 0x9d7c
jmp 0x9d71
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9d18
movq -0x10(%rbp), %rax
addq $0xc4000, %rax          # imm = 0xC4000
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
shll $0x9, %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jogolden[P]ps4flashtool/southbridge.c
// Function: decrypt_emc_ipl
int decrypt_emc_ipl(unsigned char *flashdata, unsigned char **data, unsigned int *length) {
    struct bldr_hdr *blhdr = flash_locate_emc_ipl(flashdata, 0);
    unsigned char *hdraeskey = keymgr_getkey("emciplaes", KEY_TYPE_AES_128);
    
    if(verbose) {
        printf("* EMC IPL header aes key: ");
        hexdump(hdraeskey, 0x10, 0);
    }

    struct bldr_hdr dechdr;
    unsigned char *decbody = (unsigned char *)malloc(blhdr->body_len);

    // copy the header on to the stack, we dont want to modify anything
    memcpy(&dechdr, blhdr, blhdr->hdr_len);
    aes128_cbc_iv_zero_decrypt(hdraeskey, &blhdr->crypteddata, &dechdr.crypteddata, 0x50);
    aes128_cbc_iv_zero_decrypt(dechdr.crypteddata.iplbodyaeskey, &blhdr->bodystart, decbody, blhdr->body_len);

    if(data) {
        *data = decbody;
    }

    if(length) {
        *length = blhdr->body_len;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9b10
movq %rax, -0x20(%rbp)
leaq 0x310b(%rip), %rdi      # 0xd248
movl $0xa1, %esi
callq 0x7200
movq %rax, -0x28(%rbp)
leaq 0x61f2(%rip), %rax      # 0x10344
cmpl $0x0, (%rax)
je 0xa175
leaq 0x30ff(%rip), %rdi      # 0xd25d
movb $0x0, %al
callq 0x2080
movq -0x28(%rbp), %rdi
movl $0x10, %esi
xorl %edx, %edx
callq 0x5650
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
callq 0x2100
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0xa9(%rbp), %rdi
callq 0x20f0
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x30, %rsi
leaq -0xa9(%rbp), %rdx
addq $0x30, %rdx
movl $0x50, %ecx
callq 0x3b60
leaq -0xa9(%rbp), %rdi
addq $0x30, %rdi
movq -0x20(%rbp), %rsi
addq $0x80, %rsi
movq -0xb8(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
callq 0x3b60
cmpq $0x0, -0x10(%rbp)
je 0xa202
movq -0xb8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0xa216
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
xorl %eax, %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jogolden[P]ps4flashtool/southbridge.c
// Function: decrypt_eap_kbl
int decrypt_eap_kbl(unsigned char *flashdata, unsigned char **data, unsigned int *length) {
    struct bldr_hdr *blhdr = flash_locate_eap_kbl(flashdata);
    unsigned char *hdraeskey = keymgr_getkey("eapkblaes", KEY_TYPE_AES_128);
    
    if(verbose) {
        printf("* EAP KBL header aes key: ");
        hexdump(hdraeskey, 0x10, 0);
    }

    struct bldr_hdr dechdr;
    unsigned char *decbody = (unsigned char *)malloc(blhdr->body_len);

    // copy the header on to the stack, we dont want to modify anything
    memcpy(&dechdr, blhdr, blhdr->hdr_len);
    aes128_cbc_iv_zero_decrypt(hdraeskey, &blhdr->crypteddata, &dechdr.crypteddata, 0x50);
    aes128_cbc_iv_zero_decrypt(dechdr.crypteddata.iplbodyaeskey, &blhdr->bodystart, decbody, blhdr->body_len);

    if(data) {
        *data = decbody;
    }

    if(length) {
        *length = blhdr->body_len;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9cc0
movq %rax, -0x20(%rbp)
leaq 0x2d52(%rip), %rdi      # 0xd47d
movl $0xa1, %esi
callq 0x7200
movq %rax, -0x28(%rbp)
leaq 0x5c04(%rip), %rax      # 0x10344
cmpl $0x0, (%rax)
je 0xa763
leaq 0x2d46(%rip), %rdi      # 0xd492
movb $0x0, %al
callq 0x2080
movq -0x28(%rbp), %rdi
movl $0x10, %esi
xorl %edx, %edx
callq 0x5650
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
callq 0x2100
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0xa9(%rbp), %rdi
callq 0x20f0
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x30, %rsi
leaq -0xa9(%rbp), %rdx
addq $0x30, %rdx
movl $0x50, %ecx
callq 0x3b60
leaq -0xa9(%rbp), %rdi
addq $0x30, %rdi
movq -0x20(%rbp), %rsi
addq $0x80, %rsi
movq -0xb8(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
callq 0x3b60
cmpq $0x0, -0x10(%rbp)
je 0xa7f0
movq -0xb8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0xa804
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
xorl %eax, %eax
addq $0xc0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jogolden[P]ps4flashtool/southbridge.c
// Function: mersenne_init
int mersenne_init(int *ptr, unsigned int seed) {
    int *v2; // r4
    signed int v3; // r0
    int v4; // r2
    unsigned int v5; // r1
    unsigned char *v6; // r3
    int v7; // r5
    signed int v8; // r5

    v2 = ptr;
    v3 = 1;
    v4 = 0;
    v2[1] = seed;
    do {
        v5 = seed ^ (seed >> 30);
        v6 = (unsigned char *)&v2[v4];
        v7 = v4++ + 0x6C078965 * v5;
        seed = v3++ + 0x6C078965 * v5;
        *(unsigned int *)(v6 + 8) = v7 + 1;
    } while(v4 != 0x26F);

    v8 = 0x270;
    *v2 = 0;
    do {
        mersenne_twister(v2);
        --v8;
    }
    while(v8);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %eax
movl -0xc(%rbp), %ecx
shrl $0x1e, %ecx
xorl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
imull $0x6c078965, -0x24(%rbp), %ecx # imm = 0x6C078965
addl %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x1c(%rbp)
imull $0x6c078965, -0x24(%rbp), %ecx # imm = 0x6C078965
addl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
cmpl $0x26f, -0x20(%rbp)     # imm = 0x26F
jne 0xac1f
movl $0x270, -0x38(%rbp)     # imm = 0x270
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rdi
callq 0xaaa0
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0xac95
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]libcperciva/tests/optional_mutex/pthread/../main.c
// Function: test_pthread
static int
test_pthread(void)
{
	pthread_t thr[NUM_THREADS];
	int rc;
	int i;

	/* Create threads. */
	for (i = 0; i < NUM_THREADS; i++) {
		if ((rc = pthread_create(&thr[i], NULL, inc_dec_counter, NULL))
		    != 0) {
			warn0("pthread_create: %s", strerror(rc));
			goto err0;
		}
	}

	/* Wait for threads to finish. */
	for (i = 0; i < NUM_THREADS; i++) {
		if ((rc = pthread_join(thr[i], NULL)) != 0) {
			warn0("pthread_join: %s", strerror(rc));
			goto err0;
		}
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl $0x0, -0x68(%rbp)
cmpl $0xa, -0x68(%rbp)
jge 0x1344
movslq -0x68(%rbp), %rax
leaq -0x60(%rbp), %rdi
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq 0x181(%rip), %rdx       # 0x1480
movq %rcx, %rsi
callq 0x10e0
movl %eax, -0x64(%rbp)
cmpl $0x0, %eax
je 0x1337
jmp 0x1311
movl -0x64(%rbp), %edi
callq 0x1140
movq %rax, %rsi
leaq 0xce1(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x18d0
callq 0x1060
movl $0x0, (%rax)
jmp 0x13a9
jmp 0x1339
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x12df
movl $0x0, -0x68(%rbp)
cmpl $0xa, -0x68(%rbp)
jge 0x13a0
movslq -0x68(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1120
movl %eax, -0x64(%rbp)
cmpl $0x0, %eax
je 0x1393
jmp 0x136d
movl -0x64(%rbp), %edi
callq 0x1140
movq %rax, %rsi
leaq 0xc98(%rip), %rdi       # 0x2017
movb $0x0, %al
callq 0x18d0
callq 0x1060
movl $0x0, (%rax)
jmp 0x13a9
jmp 0x1395
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x134b
movl $0x0, -0x4(%rbp)
jmp 0x13b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.5/detached.c
// Function: thread_function
void* thread_function (void* thread_arg)
{
	/* Do work here... */
	struct DatosCliente cliente;
	FILE *cuentaPtr, *salida;
	float total = 0;

	salida = fopen("deuda_total.txt", "w");
	
	if ((cuentaPtr = fopen("../../src/capitulo_4/4.5/cliente.dat","r")) == NULL)
		printf("No se puede abrir el archivo\n");
	else
	{
		while (!feof(cuentaPtr))
		{
			fread(&cliente, sizeof(struct DatosCliente), 1, cuentaPtr);
			if (cliente.id != 0){
				total += cliente.deuda;
			}
		}
	}

	fprintf(salida, "%.2f\n", total);
	
	fclose(cuentaPtr);
	fclose(salida);

	complete = 1;

	printf("La deuda total es: %.2f\n", total);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x5c(%rbp)
leaq 0xe25(%rip), %rdi       # 0x2010
leaq 0xe2e(%rip), %rsi       # 0x2020
callq 0x10b0
movq %rax, -0x58(%rbp)
leaq 0xe20(%rip), %rdi       # 0x2022
leaq 0xe3e(%rip), %rsi       # 0x2047
callq 0x10b0
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x1228
leaq 0xe2a(%rip), %rdi       # 0x2049
movb $0x0, %al
callq 0x1050
jmp 0x1271
jmp 0x122a
movq -0x50(%rbp), %rdi
callq 0x1080
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1241
jmp 0x126f
movq -0x50(%rbp), %rcx
leaq -0x44(%rbp), %rdi
movl $0x3c, %esi
movl $0x1, %edx
callq 0x1030
cmpl $0x0, -0x44(%rbp)
je 0x126d
movss -0xc(%rbp), %xmm0
addss -0x5c(%rbp), %xmm0
movss %xmm0, -0x5c(%rbp)
jmp 0x122a
jmp 0x1271
movq -0x58(%rbp), %rdi
movss -0x5c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xdf5(%rip), %rsi       # 0x207a
movb $0x1, %al
callq 0x1070
movq -0x50(%rbp), %rdi
callq 0x1040
movq -0x58(%rbp), %rdi
callq 0x1040
movl $0x1, 0x2dd4(%rip)      # 0x407c
movss -0x5c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xdaf(%rip), %rdi       # 0x2067
movb $0x1, %al
callq 0x1050
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.5/detached.c
// Function: main
int main ()
{
	pthread_attr_t attr;
	pthread_t thread;
	pthread_attr_init (&attr);
	pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
	pthread_create (&thread, &attr, &thread_function, NULL);
	pthread_attr_destroy (&attr);

	/* Do work here...*/

	struct DatosCliente cliente;
	FILE *cuentaPtr, *salida;

	salida = fopen("deudas_altas.txt", "w");
	
	if ((cuentaPtr = fopen("../../src/capitulo_4/4.5/cliente.dat","r")) == NULL)
		printf("No se puede abrir el archivo\n");
	else
	{
		while (!feof(cuentaPtr))
		{
			fread(&cliente, sizeof(struct DatosCliente), 1, cuentaPtr);
			if (cliente.id != 0){
				if(cliente.deuda > 6000.0)
					fprintf(salida, "%d; %s; %.2f\n", cliente.id,cliente.nombre, cliente.deuda);
			}
		}
	}
	fclose(cuentaPtr);
	fclose(salida);

	while(!complete);

	/* No need to join the second thread.*/

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1060
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x1090
leaq -0x48(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x138(%rip), %rdx      # 0x11d0
xorl %eax, %eax
movl %eax, %ecx
callq 0x10a0
leaq -0x40(%rbp), %rdi
callq 0x10c0
leaq 0xd5f(%rip), %rdi       # 0x2080
leaq 0xcf8(%rip), %rsi       # 0x2020
callq 0x10b0
movq %rax, -0x98(%rbp)
leaq 0xce7(%rip), %rdi       # 0x2022
leaq 0xd05(%rip), %rsi       # 0x2047
callq 0x10b0
movq %rax, -0x90(%rbp)
cmpq $0x0, %rax
jne 0x1367
leaq 0xcee(%rip), %rdi       # 0x2049
movb $0x0, %al
callq 0x1050
jmp 0x13f8
jmp 0x1369
movq -0x90(%rbp), %rdi
callq 0x1080
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1383
jmp 0x13f6
movq -0x90(%rbp), %rcx
leaq -0x84(%rbp), %rdi
movl $0x3c, %esi
movl $0x1, %edx
callq 0x1030
cmpl $0x0, -0x84(%rbp)
je 0x13f1
movss -0x4c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xc4e(%rip), %xmm1      # 0x2008
ucomisd %xmm1, %xmm0
jbe 0x13ef
movq -0x98(%rbp), %rdi
movl -0x84(%rbp), %edx
leaq -0x84(%rbp), %rcx
addq $0x4, %rcx
movss -0x4c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xca9(%rip), %rsi       # 0x2091
movb $0x1, %al
callq 0x1070
jmp 0x13f1
jmp 0x1369
jmp 0x13f8
movq -0x90(%rbp), %rdi
callq 0x1040
movq -0x98(%rbp), %rdi
callq 0x1040
cmpl $0x0, 0x2c65(%rip)      # 0x407c
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1422
jmp 0x1424
jmp 0x1410
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis-cli.c
// Function: intrinsicLatencyMode
static void intrinsicLatencyMode(void) {
    long long test_end, run_time, max_latency = 0, runs = 0;

    run_time = config.intrinsic_latency_duration*1000000;
    test_end = ustime() + run_time;

    while(1) {
        long long start, end, latency;

        start = ustime();
        compute_something_fast();
        end = ustime();
        latency = end-start;
        runs++;
        if (latency <= 0) continue;

        /* Reporting */
        if (latency > max_latency) {
            max_latency = latency;
            printf("Max latency so far: %lld microseconds.\n", max_latency);
        }

        if (end > test_end) {
            printf("\n%lld total runs (avg %lld microseconds per run).\n",
                runs, run_time/runs);
            printf("Worst run took %.02fx times the avarege.\n",
                (double) max_latency / (run_time/runs));
            exit(0);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
imull $0xf4240, 0x4d10e(%rip), %eax # imm = 0xF4240
cltq
movq %rax, -0x10(%rbp)
callq 0x14500
addq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
callq 0x14500
movq %rax, -0x28(%rbp)
callq 0x11b80
callq 0x14500
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x38(%rbp)
jg 0x13d5d
jmp 0x13d25
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jle 0x13d81
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x3b514(%rip), %rdi     # 0x4f28e
movb $0x0, %al
callq 0xd1c0
movq -0x30(%rbp), %rax
cmpq -0x8(%rbp), %rax
jle 0x13dd8
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
cqto
idivq -0x20(%rbp)
movq %rax, %rdx
leaq 0x3b513(%rip), %rdi     # 0x4f2b6
movb $0x0, %al
callq 0xd1c0
cvtsi2sdq -0x18(%rbp), %xmm0
movq -0x10(%rbp), %rax
cqto
idivq -0x20(%rbp)
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
leaq 0x3b51f(%rip), %rdi     # 0x4f2e9
movb $0x1, %al
callq 0xd1c0
xorl %edi, %edi
callq 0xd5c0
jmp 0x13d25
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis-cli.c
// Function: cliSelect
static int cliSelect() {
    redisReply *reply;
    if (config.dbnum == 0) return REDIS_OK;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x4c961(%rip)     # 0x60de0
jne 0x1448a
movl $0x0, -0x4(%rbp)
jmp 0x144c9
movq 0x4ca5f(%rip), %rdi     # 0x60ef0
movl 0x4c949(%rip), %edx     # 0x60de0
leaq 0x3a401(%rip), %rsi     # 0x4e89f
movb $0x0, %al
callq 0x1a490
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x144c2
movq -0x10(%rbp), %rdi
callq 0x182e0
movl $0x0, -0x4(%rbp)
jmp 0x144c9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis-cli.c
// Function: cliRefreshPrompt
static void cliRefreshPrompt(void) {
    int len;

    if (config.hostsocket != NULL)
        len = snprintf(config.prompt,sizeof(config.prompt),"redis %s",
                       config.hostsocket);
    else
        len = snprintf(config.prompt,sizeof(config.prompt),
                       strchr(config.hostip,':') ? "[%s]:%d" : "%s:%d",
                       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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0x4c5b8(%rip)     # 0x60dc8
je 0x1483f
movq 0x4c5af(%rip), %rcx     # 0x60dc8
leaq 0x4c598(%rip), %rdi     # 0x60db8
addq $0xa0, %rdi
movl $0x80, %esi
leaq 0x3a1a3(%rip), %rdx     # 0x4e9d6
movb $0x0, %al
callq 0xd1d0
movl %eax, -0x4(%rbp)
jmp 0x14894
movq 0x4c572(%rip), %rdi     # 0x60db8
movl $0x3a, %esi
callq 0xd1b0
movq %rax, %rcx
leaq 0x3a18d(%rip), %rdx     # 0x4e9e7
leaq 0x3a17e(%rip), %rax     # 0x4e9df
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movq 0x4c548(%rip), %rcx     # 0x60db8
movl 0x4c549(%rip), %r8d     # 0x60dc0
leaq 0x4c53a(%rip), %rdi     # 0x60db8
addq $0xa0, %rdi
movl $0x80, %esi
movb $0x0, %al
callq 0xd1d0
movl %eax, -0x4(%rbp)
cmpl $0x0, 0x4c545(%rip)     # 0x60de0
je 0x148d8
movslq -0x4(%rbp), %rax
leaq 0x4c510(%rip), %rdi     # 0x60db8
addq $0xa0, %rdi
addq %rax, %rdi
movslq -0x4(%rbp), %rax
movl $0x80, %esi
subq %rax, %rsi
movl 0x4c51c(%rip), %ecx     # 0x60de0
leaq 0x3a122(%rip), %rdx     # 0x4e9ed
movb $0x0, %al
callq 0xd1d0
addl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movslq -0x4(%rbp), %rax
leaq 0x4c4d5(%rip), %rdi     # 0x60db8
addq $0xa0, %rdi
addq %rax, %rdi
movslq -0x4(%rbp), %rax
movl $0x80, %esi
subq %rax, %rsi
leaq 0x3aa3a(%rip), %rdx     # 0x4f33a
movb $0x0, %al
callq 0xd1d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis-cli.c
// Function: cliOutputGenericHelp
static void cliOutputGenericHelp() {
    sds version = cliVersion();
    printf(
        "redis-cli %s\r\n"
        "Type: \"help @<group>\" to get a list of commands in <group>\r\n"
        "      \"help <command>\" for help on <command>\r\n"
        "      \"help <tab>\" to get a list of possible help topics\r\n"
        "      \"quit\" to exit\r\n",
        version
    );
    sdsfree(version);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x14340
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x38ce8(%rip), %rdi     # 0x4f444
movb $0x0, %al
callq 0xd1c0
movq -0x8(%rbp), %rdi
callq 0xf070
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: free_with_mmap
static void free_with_mmap(void const * what) {
    if (what == NULL) return;
    size_t const * sizes = what;
    sizes--;
    assert(sizes[0] != 0);
    assert(!(sizes[0] & (PAGE_SIZE - 1)));
    munmap((void *)sizes, sizes[0]); }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x12b8
jmp 0x133b
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x12d8
jmp 0x12f7
leaq 0x1d21(%rip), %rdi      # 0x3000
leaq 0x1d28(%rip), %rsi      # 0x300e
movl $0x75, %edx
leaq 0x1d25(%rip), %rcx      # 0x3017
callq 0x10a0
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0xfff, %rax            # imm = 0xFFF
cmpq $0x0, %rax
jne 0x130c
jmp 0x132b
leaq 0x1d26(%rip), %rdi      # 0x3039
leaq 0x1cf4(%rip), %rsi      # 0x300e
movl $0x76, %edx
leaq 0x1cf1(%rip), %rcx      # 0x3017
callq 0x10a0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x1140
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: unexec
int unexec(const char * path, struct new_environment * env) {
    long persona;
    persona = personality(0xffffffff);
    if (persona < 0) return -1;
#define NR_SIGS 64
    struct sigaction sigs[64];
    stack_t stack;
    for (int i = 1; i < NR_SIGS; i++) {
        if (validsignr(i) && sigaction(i, NULL, &sigs[i]) < 0) {
            return -1; } }
    if (sigaltstack(NULL, &stack) < 0) return -1;
    int r = unexec_core(path, env);
    if (r == 0) {
        /* XXX not clear if returning an error, with the process
         * half-restored, is the right answer here. Might be cleaner
         * to just abort(). */
        if (personality(persona) < 0) return -1;
        for (int i = 1; i < NR_SIGS; i++) {
            if (validsignr(i) && sigaction(i, &sigs[i], NULL) < 0) {
                return -1; } }
        if (sigaltstack(&stack, NULL) < 0) return -1; }
    return r; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2650, %rsp           # imm = 0x2650
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1030
cltq
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0x1386
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14e5
movl $0x1, -0x263c(%rbp)
cmpl $0x40, -0x263c(%rbp)
jge 0x13f5
movl -0x263c(%rbp), %edi
callq 0x1500
testb $0x1, %al
jne 0x13aa
jmp 0x13e2
movl -0x263c(%rbp), %edi
movslq -0x263c(%rbp), %rax
leaq -0x2620(%rbp), %rdx
imulq $0x98, %rax, %rax
addq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x1050
cmpl $0x0, %eax
jge 0x13e2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14e5
jmp 0x13e4
movl -0x263c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x263c(%rbp)
jmp 0x1390
xorl %eax, %eax
movl %eax, %edi
leaq -0x2638(%rbp), %rsi
callq 0x1180
cmpl $0x0, %eax
jge 0x1416
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14e5
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1540
movl %eax, -0x2640(%rbp)
cmpl $0x0, -0x2640(%rbp)
jne 0x14dc
movq -0x20(%rbp), %rdi
callq 0x1030
cmpl $0x0, %eax
jge 0x1450
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14e5
movl $0x1, -0x2644(%rbp)
cmpl $0x40, -0x2644(%rbp)
jge 0x14bc
movl -0x2644(%rbp), %edi
callq 0x1500
testb $0x1, %al
jne 0x1474
jmp 0x14a9
movl -0x2644(%rbp), %edi
movslq -0x2644(%rbp), %rax
leaq -0x2620(%rbp), %rsi
imulq $0x98, %rax, %rax
addq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1050
cmpl $0x0, %eax
jge 0x14a9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14e5
jmp 0x14ab
movl -0x2644(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2644(%rbp)
jmp 0x145a
leaq -0x2638(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1180
cmpl $0x0, %eax
jge 0x14da
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14e5
jmp 0x14dc
movl -0x2640(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2650, %rsp           # imm = 0x2650
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: read_file
static char * read_file(const char * path) {
    int fd = open(path, O_RDONLY);
    if (fd < 0) return NULL;
    ssize_t res_sz = 16370;
    char * res = alloc_with_mmap(res_sz);
    while (true) {
        ssize_t sz = read(fd, res, res_sz);
        if (sz < res_sz) {
            close(fd);
            if (sz < 0) {
                free_with_mmap(res);
                return NULL; }
            else {
                res[sz] = '\0';
                return res; } }
        lseek(fd, 0, SEEK_SET);
        res_sz = sz * 2;
        free_with_mmap(res);
        res = alloc_with_mmap(res_sz); } }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x1160
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x174f
movq $0x0, -0x8(%rbp)
jmp 0x17ee
movq $0x3ff2, -0x20(%rbp)    # imm = 0x3FF2
movq -0x20(%rbp), %rdi
callq 0x25a0
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %edi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x10e0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x17ba
movl -0x14(%rbp), %edi
callq 0x10c0
cmpq $0x0, -0x30(%rbp)
jge 0x17a4
movq -0x28(%rbp), %rdi
callq 0x12a0
movq $0x0, -0x8(%rbp)
jmp 0x17ee
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x17ee
movl -0x14(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1090
movq -0x30(%rbp), %rax
shlq %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
callq 0x12a0
movq -0x20(%rbp), %rdi
callq 0x25a0
movq %rax, -0x28(%rbp)
jmp 0x1764
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: place_phdrs
static void place_phdrs(struct trampoline * tramp) {
    /* Need a phdr for the trampoline itself, which isn't included in
     * the basic mappings list, one for the GNUSTACK note, and one for
     * a dummy which sets initial brk. */
    unsigned nr_phdrs = 3;
    for (unsigned x = 0; x < tramp->nrmappings; x++) {
        nr_phdrs += tramp->mappings[x].path == tramp->procselfexe; }
    /* Leave space for headers */
    uint64_t offset = sizeof(Elf64_Ehdr) + sizeof(Elf64_Phdr) * nr_phdrs;
    /* Page align */
    offset = (offset + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
    for (unsigned x = 0; x < tramp->nrmappings; x++) {
        if (tramp->mappings[x].path != tramp->procselfexe) continue;
        tramp->mappings[x].offset = offset;
        offset += tramp->mappings[x].size;
        tramp->mappings[x].path = tramp->procselfexe; }
    tramp->nrphdrs = nr_phdrs;
    tramp->landingoffset = offset; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x3, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x1e8d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x10(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x28(%rcx), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1e4a
movl -0xc(%rbp), %eax
imulq $0x38, %rax, %rax
addq $0x40, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1000, %rax           # imm = 0x1000
subq $0x1, %rax
andq $-0x1000, %rax          # imm = 0xF000
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x1f51
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x1c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x28(%rcx), %rax
je 0x1eed
jmp 0x1f43
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x1c(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x1c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x1c(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1ebb
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: alloc_with_mmap
static void * alloc_with_mmap(size_t sz) {
    sz = (sz + sizeof(size_t) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
    void * res = mmap(NULL,
                      sz,
                      PROT_READ|PROT_WRITE,
                      MAP_PRIVATE|MAP_ANONYMOUS,
                      -1,
                      0);
    assert(res != MAP_FAILED);
    size_t * res_sz = res;
    res_sz[0] = sz;
    return res_sz + 1; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
addq $0x1000, %rax           # imm = 0x1000
subq $0x1, %rax
andq $-0x1000, %rax          # imm = 0xF000
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq %r9, %rdi
callq 0x1080
movq %rax, -0x10(%rbp)
movq $-0x1, %rax
cmpq %rax, -0x10(%rbp)
je 0x25fc
jmp 0x261b
leaq 0xaaa(%rip), %rdi       # 0x30ad
leaq 0xa04(%rip), %rsi       # 0x300e
movl $0x6c, %edx
leaq 0xaa9(%rip), %rcx       # 0x30bf
callq 0x10a0
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
addq $0x8, %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: alloc_in_trampoline
static void * alloc_in_trampoline(size_t sz, struct trampoline * tramp) {
    static char failure[PAGE_SIZE];
    assert(sz < sizeof(failure));
    tramp->used += sz;
    if (tramp->used > tramp->allocated) return failure;
    else return tramp->allocator + tramp->used - sz; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x1000, -0x10(%rbp)    # imm = 0x1000
jae 0x265c
jmp 0x267b
leaq 0xaef(%rip), %rdi       # 0x3152
leaq 0x9a4(%rip), %rsi       # 0x300e
movl $0x8f, %edx
leaq 0xaf1(%rip), %rcx       # 0x3167
callq 0x10a0
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jbe 0x26a8
leaq 0x2a4e(%rip), %rax      # 0x50f0
movq %rax, -0x8(%rbp)
jmp 0x26c9
movq -0x18(%rbp), %rax
addq $0x80, %rax
movq -0x18(%rbp), %rcx
movl 0x4(%rcx), %ecx
addq %rcx, %rax
xorl %ecx, %ecx
subq -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: strdup_in_trampoline
static char * strdup_in_trampoline(const char *what, struct trampoline * tramp){
    size_t sz = strlen(what);
    void * res = alloc_in_trampoline(sz + 1, tramp);
    memcpy(res, what, sz + 1);
    return res; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rsi
callq 0x2640
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x1, %rdx
callq 0x1130
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: write_ehdr
static int write_ehdr(int fd, const struct trampoline * tramp) {
    Elf64_Ehdr hdr = {};
    hdr.e_ident[EI_MAG0] = ELFMAG0;
    hdr.e_ident[EI_MAG1] = ELFMAG1;
    hdr.e_ident[EI_MAG2] = ELFMAG2;
    hdr.e_ident[EI_MAG3] = ELFMAG3;
    hdr.e_ident[EI_CLASS] = ELFCLASS64;
    hdr.e_ident[EI_DATA] = ELFDATA2LSB;
    hdr.e_ident[EI_OSABI] = ELFOSABI_LINUX;
    hdr.e_type = ET_EXEC;
    hdr.e_machine = EM_X86_64;
    hdr.e_version = EV_CURRENT;
    hdr.e_entry = (unsigned long)tramp->trampoline;
    hdr.e_phoff = sizeof(hdr);
    hdr.e_shoff = 0;
    hdr.e_flags = 0;
    hdr.e_ehsize = sizeof(hdr);
    hdr.e_phentsize = sizeof(Elf64_Phdr);
    hdr.e_phnum = tramp->nrphdrs;
    hdr.e_shentsize = sizeof(Elf64_Shdr);
    hdr.e_shnum = 0;
    hdr.e_shstrndx = SHN_UNDEF;
    if (write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) return -1;
    else return 0; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x10b0
movb $0x7f, -0x50(%rbp)
movb $0x45, -0x4f(%rbp)
movb $0x4c, -0x4e(%rbp)
movb $0x46, -0x4d(%rbp)
movb $0x2, -0x4c(%rbp)
movb $0x1, -0x4b(%rbp)
movb $0x3, -0x49(%rbp)
movw $0x2, -0x40(%rbp)
movw $0x3e, -0x3e(%rbp)
movl $0x1, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x40, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x20(%rbp)
movw $0x40, -0x1c(%rbp)
movw $0x38, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movw %ax, -0x18(%rbp)
movw $0x40, -0x16(%rbp)
movw $0x0, -0x14(%rbp)
movw $0x0, -0x12(%rbp)
movl -0x8(%rbp), %edi
leaq -0x50(%rbp), %rsi
movl $0x40, %edx
callq 0x1060
cmpq $0x40, %rax
je 0x2b6a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b71
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: write_phdr
static int write_phdr(int fd, const struct mapping * mapping) {
    Elf64_Phdr phdr = {
        .p_type = PT_NULL,
        .p_vaddr = 0,
        .p_memsz = 0,
        .p_filesz = mapping->size,
        .p_offset = mapping->offset,
        .p_flags = 0,
        .p_align = 0 };
    if (write(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) return -1;
    else return 0; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movl -0x8(%rbp), %edi
leaq -0x48(%rbp), %rsi
movl $0x38, %edx
callq 0x1060
cmpq $0x38, %rax
je 0x2bf5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2bfc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: write_trampoline_phdr
static int write_trampoline_phdr(int fd, const struct trampoline * tramp) {
    Elf64_Phdr phdr = {
        .p_type = PT_LOAD,
        .p_vaddr = (unsigned long)tramp,
        .p_memsz = tramp->allocated + sizeof(*tramp),
        .p_filesz = tramp->allocated + sizeof(*tramp),
        .p_offset = tramp->landingoffset,
        .p_flags = PF_R | PF_X,
        .p_align = 0 };
    if (write(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) return -1;
    else return 0; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x48(%rbp)
movl $0x5, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addq $0x80, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addq $0x80, %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movl -0x8(%rbp), %edi
leaq -0x48(%rbp), %rsi
movl $0x38, %edx
callq 0x1060
cmpq $0x38, %rax
je 0x2c91
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c98
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: write_stack_phdr
static int write_stack_phdr(int fd) {
    Elf64_Phdr phdr = {
        .p_type = PT_GNU_STACK,
        .p_vaddr = 0,
        .p_memsz = 0,
        .p_filesz = 0,
        .p_offset = 0,
        .p_flags = PF_R,
        .p_align = 0 };
    if (write(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) return -1;
    else return 0; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x10b0
movl $0x6474e551, -0x40(%rbp) # imm = 0x6474E551
movl $0x4, -0x3c(%rbp)
movl -0x8(%rbp), %edi
leaq -0x40(%rbp), %rsi
movl $0x38, %edx
callq 0x1060
cmpq $0x38, %rax
je 0x2cf9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2d00
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: write_brk_phdr
static int write_brk_phdr(int fd, const struct trampoline * tramp) {
    Elf64_Phdr phdr = {
        .p_type = PT_LOAD,
        .p_vaddr = (unsigned long)tramp->initialbrk - PAGE_SIZE,
        .p_memsz = PAGE_SIZE,
        .p_filesz = 0,
        .p_offset = 0,
        .p_flags = PF_R | PF_W,
        .p_align = 0 };
    if (write(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) return -1;
    else return 0; }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x48(%rbp)
movl $0x6, -0x44(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1000, %rax           # imm = 0x1000
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x1000, -0x20(%rbp)    # imm = 0x1000
movq $0x0, -0x18(%rbp)
movl -0x8(%rbp), %edi
leaq -0x48(%rbp), %rsi
movl $0x38, %edx
callq 0x1060
cmpq $0x38, %rax
je 0x2d87
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2d8e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sos22[P]unexec/unexec.c
// Function: translate_new_environment
static const void * translate_new_environment(const void * bounce_area,
                                              const void * ptr,
                                              unsigned long rsp) {
    return (const void *)((unsigned long)ptr -
                          rsp +
                          8 +
                          (unsigned long)bounce_area); }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x18, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
subq -0x18(%rbp), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
addq %rcx, %rax
addq $0x18, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentFreeReplies
EXPORT_SYMBOL void redditCommentFreeReplies (RedditComment *comment)
{
    int i;
    if (comment == NULL)
        return ;
    for (i = 0; i < comment->replyCount; i++)
        redditCommentFree(comment->replies[i]);

    free(comment->replies);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x23c3
jmp 0x240a
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x23fc
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20f0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x23cb
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentFree
EXPORT_SYMBOL void redditCommentFree (RedditComment *comment)
{
    if (comment == NULL)
        return ;

    free(comment->body);
    free(comment->bodyEsc);
    free(comment->wbodyEsc);
    free(comment->id);
    free(comment->author);
    free(comment->parentId);
    free(comment->linkId);
    redditCommentFreeChildren(comment);
    free(comment->childrenId);
    redditCommentFreeReplies(comment);
    free(comment);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
jne 0x2421
jmp 0x24a4
movq (%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x2040
movq (%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x2040
movq (%rsp), %rax
movq 0x48(%rax), %rdi
callq 0x2040
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq (%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x2040
movq (%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x2040
movq (%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x2040
movq (%rsp), %rdi
callq 0x24b0
movq (%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x2040
movq (%rsp), %rdi
callq 0x2120
movq (%rsp), %rdi
callq 0x2040
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentFreeChildren
static void redditCommentFreeChildren (RedditComment *comment)
{
    int i;
    if (comment == NULL || comment->directChildrenIds == NULL)
        return ;

    for (i = 0; i < comment->directChildrenCount; i++)
        free(comment->directChildrenIds[i]);

    free(comment->directChildrenIds);
    comment->directChildrenIds = NULL;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x24cd
movq 0x10(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x24cf
jmp 0x2524
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x60(%rcx), %eax
jge 0x2509
movq 0x10(%rsp), %rax
movq 0x70(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2040
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x24d7
movq 0x10(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
movq $0x0, 0x70(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentAddReply
EXPORT_SYMBOL void redditCommentAddReply (RedditComment *comment, RedditComment *reply)
{
    comment->replyCount++;
    RedditComment* ptr = comment;
    while (ptr != NULL) {
        ptr->totalReplyCount += reply->totalReplyCount + 1;
        ptr = ptr->parent;
    }
    comment->replies = rrealloc(comment->replies, (comment->replyCount) * sizeof(RedditComment*));
    comment->replies[comment->replyCount - 1] = reply;
    reply->parent = comment;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x257d
movq 0x8(%rsp), %rax
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movq (%rsp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
jmp 0x2553
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rsp), %rax
movslq (%rax), %rsi
shlq $0x3, %rsi
callq 0x43e0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/comment.c
// Function: redditCommentListFree
EXPORT_SYMBOL void redditCommentListFree (RedditCommentList *list)
{
    if (list == NULL)
        return ;
    redditCommentFree(list->baseComment);
    redditLinkFree(list->post);
    free(list->permalink);
    free(list->id);
    free(list);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
jne 0x261e
jmp 0x265a
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x20f0
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x21b0
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq (%rsp), %rdi
callq 0x2040
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/comment.c
// Function: getCommentReplies
DEF_TOKEN_CALLBACK(getCommentReplies)
{
    ARG_COMMENT_LISTING
    char *kindStr = NULL;

    TokenIdent ids[] = {
        ADD_TOKEN_IDENT_STRING("kind", kindStr),
        ADD_TOKEN_IDENT_FUNC  ("data", getCommentListHelper),
        {0}
    };

    parseTokens(parser, ids, list, comment);
    free(kindStr);
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x20(%rsp)
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x28, %eax
ja 0x2d23
movq 0x20(%rsp), %rcx
movl 0x2c(%rsp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, 0x18(%rsp)
jmp 0x2d3c
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xe8(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %eax
movl %eax, 0x14(%rsp)
cmpl $0x28, %eax
ja 0x2d7f
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, (%rsp)
jmp 0x2d97
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, (%rsp)
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
leaq 0x55f5(%rip), %rax      # 0x83ae
movq %rax, 0x30(%rsp)
movl $0x2, 0x38(%rsp)
movl $0x0, 0x3c(%rsp)
leaq 0xd8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movb $0x1, 0x5c(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x55a9(%rip), %rax      # 0x83b3
movq %rax, 0x68(%rsp)
movl $0x3, 0x70(%rsp)
movl $0x2, 0x74(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
movl $0x0, 0x90(%rsp)
movb $0x0, 0x94(%rsp)
leaq 0x266(%rip), %rax       # 0x30c0
movq %rax, 0x98(%rsp)
leaq 0x30(%rsp), %rdi
addq $0x70, %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x2100
movq 0x100(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq 0xe8(%rsp), %rdx
movq 0xe0(%rsp), %rcx
movb $0x0, %al
callq 0x69c0
movq 0xd8(%rsp), %rdi
callq 0x2040
addq $0x108, %rsp            # imm = 0x108
retq