LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/eid.c
// Function: eid2_decrypt_block
void eid2_decrypt_block(u8 *block, u32 length) {
    u8 tmp[0x08], iv[0x08];
    int block_size = 8;
    int num_blocks = (int) (length / block_size);

    memcpy(iv, eid2_des_iv, 0x08);

    if (num_blocks > 0) {
        int i, j;
        des_context ctx;
        des_setkey_dec(&ctx, eid2_des_key);
        for (i = 0; i < num_blocks - 1; ++i) {
            u8 *ptr = block + i * block_size;
            memcpy(tmp, ptr, block_size);
            des_crypt_ecb(&ctx, ptr, ptr);
            if (i > 0) {
                for (j = 0; j < block_size; ++j)
                    ptr[j] = ptr[j] ^ iv[j];
            }
            memcpy(iv, tmp, block_size);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq 0x92ee(%rip), %rax      # 0xf5f0
movq (%rax), %rax
movq %rax, 0x8(%rsp)
cmpl $0x8, %esi
jae 0x6321
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %ebx
movq %rdi, %r14
shrl $0x3, %ebx
leaq 0x9200(%rip), %rsi      # 0xf530
leaq 0x14(%rsp), %r15
movq %r15, %rdi
callq 0x4462
decl %ebx
xorl %r12d, %r12d
movq %r14, %r13
cmpq %rbx, %r12
je 0x630f
leaq (%r14,%r12,8), %rdx
movq (%rdx), %rbp
movq %r15, %rdi
movq %rdx, %rsi
callq 0x4653
testq %r12, %r12
je 0x6377
xorl %eax, %eax
cmpq $0x8, %rax
je 0x6377
movb 0x8(%rsp,%rax), %cl
xorb %cl, (%r13,%rax)
incq %rax
jmp 0x6363
movq %rbp, 0x8(%rsp)
incq %r12
addq $0x8, %r13
jmp 0x6345
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/eid.c
// Function: eid3_decrypt_buffer
void eid3_decrypt_buffer(u8 *eid3) {
    u8 indiv[INDIV_SIZE];
    u8 key[0x10], iv[0x10];
    aes_context aes_ctxt;

    //Generate individuals.
    indiv_gen(eid3_indiv_seed, NULL, NULL, NULL, indiv);

    //Generate key.
    memset(iv, 0, 0x10);
    aes_setkey_enc(&aes_ctxt, indiv + 0x20, 0x100);
    aes_crypt_cbc(&aes_ctxt, AES_ENCRYPT, 0x10, iv, eid3_keyseed, key);

    //Calculate eid3 aes omac1.
    u8 digest[AES_OMAC1_DIGEST_SIZE];
    aes_omac1(digest, eid3, 0xF0, key, 0x80);



    if (memcmp(digest, eid3 + 0xF0, AES_OMAC1_DIGEST_SIZE) != 0)
        printf("warning: eid3 omac1 hash check failed!\n");

    //Decrypt eid3.
    aes_setkey_dec(&aes_ctxt, key, 0x80);
    memcpy(iv, eid3 + 0x10, 0x10);
    aes_crypt_cbc(&aes_ctxt, AES_DECRYPT, 0xD0, iv, eid3 + 0x20, eid3 + 0x20);

    //Decrypt second layer.
    memset(iv, 0, 0x10);
    aes_setkey_dec(&aes_ctxt, eid3_static_key, 0x80);
    aes_crypt_cbc(&aes_ctxt, AES_DECRYPT, 0xD0, iv, eid3 + 0x20, eid3 + 0x20);


    u8 sha1_digest[20];
    sha1(eid3 + 0x20, 0xB8, sha1_digest);



    if (memcmp(sha1_digest, eid3 + 0x20 + 0xB8, 20) != 0)
        printf("warning: eid3 sha1 hash check failed!\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movq %rdi, %rbx
leaq 0x90b3(%rip), %rdi      # 0xf450
leaq 0x50(%rsp), %r8
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x54fc
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
leaq 0x70(%rsp), %rsi
leaq 0x158(%rsp), %r15
movq %r15, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x126c
leaq 0x9138(%rip), %r8       # 0xf510
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movq %r14, %rcx
movq %r12, %r9
callq 0x1de8
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf0, %edx
movq %r12, %rcx
movl $0x80, %r8d
callq 0x4ee8
movdqu 0xf0(%rbx), %xmm0
pcmpeqb (%r14), %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x6433
leaq 0x5a48(%rip), %rdi      # 0xbe76
callq 0x1050
leaq 0x158(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movl $0x80, %edx
callq 0x1541
movups 0x10(%rbx), %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
leaq 0x20(%rbx), %r15
movl $0xd0, %edx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
movq %r15, %r8
movq %r15, %r9
callq 0x1de8
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
leaq 0x909c(%rip), %rsi      # 0xf520
movq %r14, %rdi
movl $0x80, %edx
callq 0x1541
movl $0xd0, %edx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
movq %r15, %r8
movq %r15, %r9
callq 0x1de8
leaq 0x30(%rsp), %r14
movl $0xb8, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x3d17
addq $0xd8, %rbx
pushq $0x14
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1110
testl %eax, %eax
je 0x64e3
leaq 0x59bf(%rip), %rdi      # 0xbe9d
callq 0x1050
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/eid.c
// Function: eid3_decrypt
void eid3_decrypt(s8 *file_in, s8 *file_out) {
    u32 length;
    u8 *eid3 = _read_buffer(file_in, &length);

    if (eid3 != NULL) {
        eid3_decrypt_buffer(eid3);
        _write_buffer(file_out, eid3, EID3_SIZE);
        free(eid3);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %rsi
callq 0x5437
testq %rax, %rax
je 0x652b
movq %rax, %r14
movq %rax, %rdi
callq 0x6385
movq %rbx, %rdi
movq %r14, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x54bc
movq %r14, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/eid.c
// Function: eid4_decrypt_buffer
void eid4_decrypt_buffer(u8 *eid4) {
    u8 indiv[INDIV_SIZE];
    aes_context aes_ctxt;

    //Generate individuals.
    indiv_gen(eid4_indiv_seed, NULL, NULL, NULL, indiv);

    //Calculate eid4 aes omac1.
    u8 digest[AES_OMAC1_DIGEST_SIZE];
    aes_omac1(digest, eid4, 0x20, indiv + INDIV_EID4_KEY_OFFSET, 0x100);

    if (memcmp(digest, eid4 + 0x20, AES_OMAC1_DIGEST_SIZE) != 0)
        printf("warning: eid4 hash check failed!\n");

    //Decrypt eid4.
    aes_setkey_dec(&aes_ctxt, indiv + INDIV_EID4_KEY_OFFSET, 0x100);
    aes_crypt_cbc(&aes_ctxt, AES_DECRYPT, 0x20, indiv + INDIV_EID4_IV_OFFSET, eid4, eid4);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x340, %rsp            # imm = 0x340
movq %rdi, %rbx
leaq 0x8f47(%rip), %rdi      # 0xf490
leaq 0x10(%rsp), %r8
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x54fc
leaq 0x30(%rsp), %r14
movq %rsp, %r15
pushq $0x20
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
movl $0x100, %r8d            # imm = 0x100
callq 0x4ee8
movdqu 0x20(%rbx), %xmm0
pcmpeqb (%r15), %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x6599
leaq 0x592f(%rip), %rdi      # 0xbec3
callq 0x1050
leaq 0x110(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1541
leaq 0x20(%rsp), %rcx
pushq $0x20
popq %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %r8
movq %rbx, %r9
callq 0x1de8
addq $0x340, %rsp            # imm = 0x340
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/eid.c
// Function: eid4_decrypt
void eid4_decrypt(s8 *file_in, s8 *file_out) {
    u32 length;
    u8 *eid4 = _read_buffer(file_in, &length);

    if (eid4 != NULL) {
        eid4_decrypt_buffer(eid4);
        _write_buffer(file_out, eid4, EID4_SIZE);
        free(eid4);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %rsi
callq 0x5437
testq %rax, %rax
je 0x660d
movq %rax, %r14
movq %rax, %rdi
callq 0x6533
pushq $0x30
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x54bc
movq %r14, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/main.c
// Function: generate_hdd_individuals
void generate_hdd_individuals() {
    u8 ata_k1[0x20], ata_k2[0x20], edec_k1[0x20], edec_k2[0x20];

    //fetching root_key
    eid_root_key = _read_buffer((s8*) "data/eid_root_key", NULL);

    //Generate keys.
    generate_ata_keys(eid_root_key, eid_root_key + 0x20, ata_k1, ata_k2);
    generate_encdec_keys(eid_root_key, eid_root_key + 0x20, edec_k1, edec_k2);

    _hexdump(stdout, "ATA-DATA-KEY    ", 0, ata_k1, 0x20, 0);
    _hexdump(stdout, "ATA-TWEAK-KEY   ", 0, ata_k2, 0x20, 0);
    _hexdump(stdout, "ENCDEC-DATA-KEY ", 0, edec_k1, 0x20, 0);
    _hexdump(stdout, "ENCDEC-TWEAK-KEY", 0, edec_k2, 0x20, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
leaq 0x58d0(%rip), %rdi      # 0xbf00
xorl %esi, %esi
callq 0x5437
leaq 0x8f92(%rip), %rbx      # 0xf5d0
movq %rax, (%rbx)
leaq 0x20(%rax), %rsi
leaq 0x60(%rsp), %r12
leaq 0x40(%rsp), %r15
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x5048
movq (%rbx), %rdi
leaq 0x20(%rdi), %rsi
leaq 0x20(%rsp), %r14
movq %rsp, %rbx
movq %r14, %rdx
movq %rbx, %rcx
callq 0x50ec
movq 0x8962(%rip), %r13      # 0xefe0
movq (%r13), %rdi
leaq 0x5889(%rip), %rsi      # 0xbf12
pushq $0x20
popq %rbp
xorl %edx, %edx
movq %r12, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
movq (%r13), %rdi
leaq 0x587c(%rip), %rsi      # 0xbf23
xorl %edx, %edx
movq %r15, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
movq (%r13), %rdi
leaq 0x5872(%rip), %rsi      # 0xbf34
xorl %edx, %edx
movq %r14, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
movq (%r13), %rdi
leaq 0x5868(%rip), %rsi      # 0xbf45
xorl %edx, %edx
movq %rbx, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/main.c
// Function: decrypt_eid
void decrypt_eid() {
    //fetching root_key
    eid_root_key = _read_buffer((s8*) "data/eid_root_key", NULL);

    //unpacking eid
    eid_unpack((s8*) "eid/eid");

    //decrypting
    eid0_decrypt((s8*) "eid/eid0", (s8*) "eid/eid0decrypted");
    eid1_decrypt((s8*) "eid/eid1", (s8*) "eid/eid1decrypted.bin");
    eid2_generate_block((s8*) "eid/eid2", EID2_BLOCKTYPE_P, (s8*) "eid/eid2pblock.bin");
    eid2_generate_block((s8*) "eid/eid2", EID2_BLOCKTYPE_S, (s8*) "eid/eid2sblock.bin");
    u8* pblock = _read_buffer("eid/eid2pblock.bin", NULL);
    eid2_decrypt_block(pblock, 0x80);
    memcpy(pblock, pblock + 0x10, 0x60);
    _write_buffer((s8*) "eid/pblockdec.bin", pblock, 0x60);
    u8* sblock = _read_buffer("eid/eid2sblock.bin", NULL);
    eid2_decrypt_block(sblock, 0x690);
    memcpy(sblock, sblock + 0x10, 0x670);
    _write_buffer((s8*) "eid/sblockdec.bin", sblock, 0x670);
    eid3_decrypt((s8*) "eid/eid3", (s8*) "eid/eid3decrypted.bin");
    eid4_decrypt((s8*) "eid/eid4", (s8*) "eid/eid4decrypted.bin");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x57f5(%rip), %rdi      # 0xbf00
xorl %esi, %esi
callq 0x5437
leaq 0x8eb7(%rip), %rcx      # 0xf5d0
movq %rax, (%rcx)
leaq 0x5833(%rip), %rdi      # 0xbf56
callq 0x5650
leaq 0x582f(%rip), %rdi      # 0xbf5e
leaq 0x5831(%rip), %rsi      # 0xbf67
callq 0x5b44
leaq 0x5837(%rip), %rdi      # 0xbf79
leaq 0x5839(%rip), %rsi      # 0xbf82
callq 0x6179
leaq 0x5843(%rip), %r14      # 0xbf98
leaq 0x5845(%rip), %r15      # 0xbfa1
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x627e
leaq 0x5843(%rip), %rbx      # 0xbfb4
pushq $0x2
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x627e
movq %r15, %rdi
xorl %esi, %esi
callq 0x5437
movq %rax, %r14
movq %rax, %rdi
movl $0x80, %esi
callq 0x62ea
leaq 0x10(%r14), %rsi
pushq $0x60
popq %rdx
movq %r14, %rdi
callq 0x10f0
leaq 0x5818(%rip), %rdi      # 0xbfc7
pushq $0x60
popq %rdx
movq %r14, %rsi
callq 0x54bc
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5437
movq %rax, %rbx
movq %rax, %rdi
movl $0x690, %esi            # imm = 0x690
callq 0x62ea
leaq 0x10(%rbx), %rsi
movl $0x670, %edx            # imm = 0x670
movq %rbx, %rdi
callq 0x10f0
leaq 0x57ed(%rip), %rdi      # 0xbfd9
movq %rbx, %rsi
movl $0x670, %edx            # imm = 0x670
callq 0x54bc
leaq 0x57eb(%rip), %rdi      # 0xbfeb
leaq 0x57ed(%rip), %rsi      # 0xbff4
callq 0x64f2
leaq 0x57f7(%rip), %rdi      # 0xc00a
leaq 0x57f9(%rip), %rsi      # 0xc013
popq %rbx
popq %r14
popq %r15
jmp 0x65d6
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/main.c
// Function: hexDump
void hexDump(const void *data, size_t size) {
  size_t i;
  for (i = 0; i < size; i++) {
    printf("%02hhX%c", ((char *)data)[i], (i + 1) % 16 ? ' ' : '\n');
  }
  printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
negq %rbx
pushq $0x1
popq %r12
pushq $0xa
popq %rbp
pushq $0x20
popq %r13
leaq 0x5800(%rip), %r15      # 0xc0d1
leaq (%rbx,%r12), %rax
cmpq $0x1, %rax
je 0x68fa
movsbl -0x1(%r14,%r12), %esi
testb $0xf, %r12b
movl %r13d, %edx
cmovel %ebp, %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1090
incq %r12
jmp 0x68d1
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/main.c
// Function: gen_vtrm
void gen_vtrm(){
	//fetching root_key
    eid_root_key = _read_buffer((s8*) "data/eid_root_key", NULL);
	
	aes_context aes_ctxt;
    u8 iv[0x10];
	u8 indiv[0x40];
	u8 key[0x10];
	u8 block_key[0x10];
	u8 block_iv[0x10]={0x0};
	
	
	indiv_gen(eid1_indiv_seed, NULL, NULL, NULL, indiv);
	
    //Generate VTRM Block Key.
	memcpy(key, indiv + 0x20, 0x10);
    aes_setkey_enc(&aes_ctxt, key, KEY_BITS(0x10));
    memcpy(iv, indiv + 0x10, 0x10);
    aes_crypt_cbc(&aes_ctxt, AES_ENCRYPT, 0x10, iv, keyseed_for_srk2, block_key);
	
	_hexdump(stdout, "Block Key:    ", 0, block_key, 0x10, 0);
	_hexdump(stdout, "Block Iv:    ", 0, block_iv, 0x10, 0);
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
leaq 0x531e(%rip), %rdi      # 0xbf00
xorl %esi, %esi
callq 0x5437
leaq 0x89e0(%rip), %rcx      # 0xf5d0
movq %rax, (%rcx)
xorps %xmm0, %xmm0
movq %rsp, %rbx
movaps %xmm0, (%rbx)
leaq 0x87ad(%rip), %rdi      # 0xf3b0
leaq 0x40(%rsp), %r14
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x54fc
movaps 0x20(%r14), %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movl $0x80, %edx
callq 0x126c
movaps 0x10(%r14), %xmm0
leaq 0x30(%rsp), %rcx
movaps %xmm0, (%rcx)
leaq 0x8484(%rip), %r8       # 0xf0d0
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
leaq 0x10(%rsp), %r14
movq %r15, %rdi
movq %r14, %r9
callq 0x1de8
movq 0x8377(%rip), %r15      # 0xefe0
movq (%r15), %rdi
leaq 0x54de(%rip), %rsi      # 0xc151
pushq $0x10
popq %rbp
xorl %edx, %edx
movq %r14, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
movq (%r15), %rdi
leaq 0x54d0(%rip), %rsi      # 0xc160
xorl %edx, %edx
movq %rbx, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/main.c
// Function: gen_backup
void gen_backup(){
	//fetching root_key
    eid_root_key = _read_buffer((s8*) "data/eid_root_key", NULL);
	
	aes_context aes_ctxt;
    u8 iv[0x10];
	u8 indiv[0x40];
	u8 key[0x10];
	u8 backup_key[0x10];
	
	
	indiv_gen(eid1_indiv_seed, NULL, NULL, NULL, indiv);
	
    //Generate Backup Key.
	memcpy(key, indiv + 0x20, 0x10);
    aes_setkey_enc(&aes_ctxt, key, KEY_BITS(0x10));
    memcpy(iv, indiv + 0x10, 0x10);
    aes_crypt_cbc(&aes_ctxt, AES_ENCRYPT, 0x10, iv, seed_for_backup, backup_key);
	memcpy(iv, indiv + 0x10, 0x10);
	
	_hexdump(stdout, "Backup Key:    ", 0, backup_key, 0x10, 0);
	_hexdump(stdout, "Backup Iv:    ", 0, iv, 0x10, 0);
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2a0, %rsp            # imm = 0x2A0
leaq 0x523c(%rip), %rdi      # 0xbf00
xorl %esi, %esi
callq 0x5437
leaq 0x88fe(%rip), %rcx      # 0xf5d0
movq %rax, (%rcx)
leaq 0x86d4(%rip), %rdi      # 0xf3b0
leaq 0x30(%rsp), %r14
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x54fc
movaps 0x20(%r14), %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movl $0x80, %edx
callq 0x126c
movaps 0x10(%r14), %xmm0
leaq 0x20(%rsp), %rbx
movaps %xmm0, (%rbx)
leaq 0x83be(%rip), %r8       # 0xf0e0
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
movq %rsp, %r12
movq %r15, %rdi
movq %rbx, %rcx
movq %r12, %r9
callq 0x1de8
movaps 0x10(%r14), %xmm0
movaps %xmm0, (%rbx)
movq 0x8298(%rip), %r14      # 0xefe0
movq (%r14), %rdi
leaq 0x541c(%rip), %rsi      # 0xc16e
pushq $0x10
popq %rbp
xorl %edx, %edx
movq %r12, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
movq (%r14), %rdi
leaq 0x540f(%rip), %rsi      # 0xc17e
xorl %edx, %edx
movq %rbx, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x5300
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/zecoxao[P]ps3_decrypt_tools/lib/main.c
// Function: main
int main() {
    int i;
    printf("Select an option\n1-Decrypt eEID(missing eid5)\n2-Encrypt All eEID0 sections \n3-Generate Syscon AUTH seeds(Acording to wiki)\n4-Generate HDD Keys\n5-Generate VTRM Keys\n6-Generate Backup Keys\n0-Exit\n");
    scanf("%d", &i);
    switch (i) {
        case 1:
            decrypt_eid();
			getchar();
            break;
        case 2:
			encrypt_eid0_section_0();
			encrypt_eid0_section_6();
            encrypt_eid0_section_A();
			//getchar();
            break;
        case 3:
            syscon_auth();
			getchar();
            break;
        case 4:
            generate_hdd_individuals();
			getchar();
            break;
		case 5:
            gen_vtrm();
			getchar();
            break;
		case 6:
            gen_backup();
			getchar();
        case 0:
            break;
        default:
            printf("Incorrect Option Selected! Try Again.");
            break;
    }
    return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x5418(%rip), %rdi      # 0xc1b3
callq 0x1050
leaq 0x4eeb(%rip), %rdi      # 0xbc92
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1140
movl (%rbx), %eax
cmpq $0x6, %rax
ja 0x6df4
leaq 0x511f(%rip), %rcx      # 0xbee4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x66ff
jmp 0x6e10
callq 0x6618
jmp 0x6e10
callq 0x6824
callq 0x6851
callq 0x687e
jmp 0x6e15
callq 0x6910
jmp 0x6e10
leaq 0x5392(%rip), %rdi      # 0xc18d
xorl %eax, %eax
callq 0x1090
jmp 0x6e15
callq 0x6bce
jmp 0x6e10
callq 0x6cae
callq 0x10c0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]plasma/src/gl_rgb_plasma.c
// Function: InitSDL
int InitSDL(void) {
    SDL_Init(SDL_INIT_VIDEO);

    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
                        SDL_GL_CONTEXT_PROFILE_CORE);

    if (SDL_GetDesktopDisplayMode(0, &gDisplayMode) != 0) {
        return -1;
    }

    gWindow = SDL_CreateWindow(
        WINDOW_TITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, gWidth,
        gHeight, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
    if (gWindow == NULL) {
        return -1;
    }
    LogInfo("window created with size %dx%d", gWidth, gHeight);

    gContext = SDL_GL_CreateContext(gWindow);
    if (gContext == NULL) {
        return -1;
    }

    GLenum glewError = glewInit();
    if (glewError != GLEW_OK) {
        LogError("error initializing GLEW! %s", glewGetErrorString(glewError));
    }

    if (SDL_GL_SetSwapInterval(1) < 0) {
        LogInfo("warning: unable to set vsync. %s", SDL_GetError());
    }

    if (gFullscreen) {
        SDL_SetWindowFullscreen(gWindow, SDL_WINDOW_FULLSCREEN_DESKTOP);
    }

    SDL_ShowCursor(SDL_DISABLE);

    return 0;
}

// Assembly:
pushq %rbx
pushq $0x20
popq %rdi
callq 0x2260
pushq $0x11
popq %rdi
pushq $0x3
popq %rbx
movl %ebx, %esi
callq 0x21e0
pushq $0x12
popq %rdi
movl %ebx, %esi
callq 0x21e0
pushq $0x15
popq %rdi
pushq $0x1
popq %rsi
callq 0x21e0
leaq 0x2d13(%rip), %rsi      # 0x5198
xorl %edi, %edi
callq 0x2150
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0x2497
movl %ebx, %eax
popq %rbx
retq
movl 0x2cbf(%rip), %ecx      # 0x515c
movl 0x2cbc(%rip), %r8d      # 0x5160
leaq 0xb9d(%rip), %rdi       # 0x3048
pushq $0x26
popq %r9
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
callq 0x2100
movq %rax, 0x2cab(%rip)      # 0x5170
testq %rax, %rax
je 0x2493
movl 0x2c8c(%rip), %edx      # 0x515c
movl 0x2c8a(%rip), %ecx      # 0x5160
leaq 0xb79(%rip), %rsi       # 0x3056
xorl %edi, %edi
xorl %eax, %eax
callq 0x21b0
movq 0x2c83(%rip), %rdi      # 0x5170
callq 0x2180
movq %rax, 0x2c7f(%rip)      # 0x5178
testq %rax, %rax
je 0x2493
callq 0x2230
testl %eax, %eax
je 0x2521
movl %eax, %edi
callq 0x20b0
leaq 0xb60(%rip), %rsi       # 0x3075
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2250
pushq $0x1
popq %rdi
callq 0x2140
testl %eax, %eax
jns 0x2545
callq 0x21f0
leaq 0xb58(%rip), %rsi       # 0x3091
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21b0
cmpl $0x0, 0x2c44(%rip)      # 0x5190
je 0x255f
movq 0x2c1b(%rip), %rdi      # 0x5170
movl $0x1001, %esi           # imm = 0x1001
callq 0x2040
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2190
jmp 0x2493
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]plasma/src/gl_rgb_plasma.c
// Function: LogShaderError
void LogShaderError(GLuint shader) {
    if (glIsShader(shader)) {
        int infoLogLength = 0;
        int maxLength = infoLogLength;

        glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &maxLength);

        char *infoLog = malloc(maxLength * sizeof(*infoLog));
        if (infoLog == NULL) {
            LogError("failed to malloc error log for gl shader %d of size %d",
                     shader, maxLength);
        }

        glGetShaderInfoLog(shader, maxLength, &infoLogLength, infoLog);
        if (infoLogLength > 0) {
            LogError("failed to compile shader %d:\n%s", shader, infoLog);
        }

        free(infoLog);
    } else {
        LogError("name shader %d is not a shader", shader);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x29e3(%rip), %rax      # 0x4f60
callq *(%rax)
testb %al, %al
je 0x2616
andl $0x0, 0x4(%rsp)
movq %rsp, %r14
andl $0x0, (%r14)
movq 0x29ae(%rip), %rax      # 0x4f48
movl %ebx, %edi
movl $0x8b84, %esi           # imm = 0x8B84
movq %r14, %rdx
callq *(%rax)
movl (%r14), %ebp
movslq %ebp, %rdi
callq 0x21c0
movq %rax, %r14
testq %rax, %rax
jne 0x25d0
leaq 0xaf2(%rip), %rsi       # 0x30b2
xorl %edi, %edi
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2250
movl (%rsp), %ebp
movq 0x2939(%rip), %rax      # 0x4f10
leaq 0x4(%rsp), %r15
movl %ebx, %edi
movl %ebp, %esi
movq %r15, %rdx
movq %r14, %rcx
callq *(%rax)
cmpl $0x0, (%r15)
jle 0x2603
leaq 0xaf4(%rip), %rsi       # 0x30e9
xorl %edi, %edi
movl %ebx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2250
movq %r14, %rdi
callq 0x2070
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaec(%rip), %rsi       # 0x3109
xorl %edi, %edi
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2250
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]plasma/src/gl_rgb_plasma.c
// Function: LogProgramError
void LogProgramError(GLuint program) {
    if (glIsProgram(program)) {
        int infoLogLength = 0;
        int maxLength = infoLogLength;

        glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength);

        char *infoLog = malloc(maxLength * sizeof(*infoLog));
        if (infoLog == NULL) {
            LogError("failed to malloc error log for gl program %d of size %d",
                     program, maxLength);
        }

        glGetProgramInfoLog(program, maxLength, &infoLogLength, infoLog);
        if (infoLogLength > 0) {
            LogError("failed to link program %d:\n%s", program, infoLog);
        }

        free(infoLog);
    } else {
        LogError("name program %d is not a program", program);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x290e(%rip), %rax      # 0x4f50
callq *(%rax)
testb %al, %al
je 0x26db
andl $0x0, 0x4(%rsp)
movq %rsp, %r14
andl $0x0, (%r14)
movq 0x28b9(%rip), %rax      # 0x4f18
movl %ebx, %edi
movl $0x8b84, %esi           # imm = 0x8B84
movq %r14, %rdx
callq *(%rax)
movl (%r14), %ebp
movslq %ebp, %rdi
callq 0x21c0
movq %rax, %r14
testq %rax, %rax
jne 0x2695
leaq 0xaa3(%rip), %rsi       # 0x3128
xorl %edi, %edi
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2250
movl (%rsp), %ebp
movq 0x28f4(%rip), %rax      # 0x4f90
leaq 0x4(%rsp), %r15
movl %ebx, %edi
movl %ebp, %esi
movq %r15, %rdx
movq %r14, %rcx
callq *(%rax)
cmpl $0x0, (%r15)
jle 0x26c8
leaq 0xaa6(%rip), %rsi       # 0x3160
xorl %edi, %edi
movl %ebx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2250
movq %r14, %rdi
callq 0x2070
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa9c(%rip), %rsi       # 0x317e
xorl %edi, %edi
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2250
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]plasma/src/gl_rgb_plasma.c
// Function: ReadFile
char *ReadFile(const char *filepath) {
    FILE *file = fopen(filepath, "rb");
    if (file == NULL) {
        return NULL;
    }

    fseek(file, 0, SEEK_END);
    long fileSize = ftell(file);
    rewind(file);

    char *buffer = malloc((fileSize + 1) * sizeof(*buffer));
    if (buffer == NULL) {
        return NULL;
    }

    size_t result = fread(buffer, 1, fileSize, file);
    if ((long)result != fileSize) {
        return NULL;
    }

    fclose(file);

    buffer[fileSize] = 0;
    return buffer;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xa99(%rip), %rsi       # 0x319f
callq 0x2240
testq %rax, %rax
je 0x276f
movq %rax, %rbx
xorl %r14d, %r14d
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x2220
movq %rbx, %rdi
callq 0x20a0
movq %rax, %r15
movq %rbx, %rdi
callq 0x2270
leaq 0x1(%r15), %rdi
callq 0x21c0
testq %rax, %rax
je 0x2772
movq %rax, %r12
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2130
cmpq %r15, %rax
jne 0x276f
movq %rbx, %rdi
callq 0x2110
movb $0x0, (%r12,%r15)
movq %r12, %r14
jmp 0x2772
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]plasma/src/gl_rgb_plasma.c
// Function: compileShader
GLboolean compileShader(GLenum type, const GLchar *source[],
                        GLuint *outShader) {
    GLuint shader = glCreateShader(type);
    glShaderSource(shader, 1, source, NULL);
    glCompileShader(shader);

    *outShader = shader;

    GLint shaderCompiled = GL_FALSE;
    glGetShaderiv(shader, GL_COMPILE_STATUS, &shaderCompiled);
    if (shaderCompiled != GL_TRUE) {
        return GL_FALSE;
    }

    return GL_TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq 0x2842(%rip), %rax      # 0x4fd8
callq *(%rax)
movl %eax, %ebp
movq 0x2817(%rip), %rax      # 0x4fb8
pushq $0x1
popq %rsi
movl %ebp, %edi
movq %r14, %rdx
xorl %ecx, %ecx
callq *(%rax)
movq 0x27c4(%rip), %rax      # 0x4f78
movl %ebp, %edi
callq *(%rax)
movl %ebp, (%rbx)
leaq 0xc(%rsp), %rbx
andl $0x0, (%rbx)
movq 0x277f(%rip), %rax      # 0x4f48
movl %ebp, %edi
movl $0x8b81, %esi           # imm = 0x8B81
movq %rbx, %rdx
callq *(%rax)
cmpl $0x1, (%rbx)
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]plasma/src/gl_rgb_plasma.c
// Function: DrawFrame
void DrawFrame(double elapsedTimeSecs) {
    glClear(GL_COLOR_BUFFER_BIT);

    glUseProgram(gProgramId);

    glUniform1f(gUniformScaleLocation, 20.0f);
    glUniform2i(gUniformResolutionLocation, gWidth, gHeight);
    glUniform1f(gUniformTimeLocation, elapsedTimeSecs);

    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2160
movq 0x24e8(%rip), %rax      # 0x4ff0
movl 0x2672(%rip), %edi      # 0x5180
callq *(%rax)
movq 0x2469(%rip), %rbx      # 0x4f80
movl 0x263b(%rip), %edi      # 0x5158
movss 0x51f(%rip), %xmm0      # 0x3044
callq *(%rbx)
movq 0x23d2(%rip), %rax      # 0x4f00
movl 0x2620(%rip), %edi      # 0x5154
movl 0x2622(%rip), %esi      # 0x515c
movl 0x2620(%rip), %edx      # 0x5160
callq *(%rax)
movl 0x2608(%rip), %edi      # 0x5150
cvtsd2ss 0x8(%rsp), %xmm0
callq *(%rbx)
pushq $0x4
popq %rdi
pushq $0x6
popq %rsi
movl $0x1405, %edx           # imm = 0x1405
xorl %ecx, %ecx
addq $0x10, %rsp
popq %rbx
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]plasma/src/gl_rgb_plasma.c
// Function: DestroyGL
void DestroyGL(void) {
    glDeleteBuffers(1, &gEBO);
    glDeleteBuffers(1, &gVBO);
    glDeleteVertexArrays(1, &gVAO);
    glDeleteProgram(gProgramId);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x23f6(%rip), %r14      # 0x4f68
leaq 0x2613(%rip), %rsi      # 0x518c
pushq $0x1
popq %rbx
movl %ebx, %edi
callq *(%r14)
leaq 0x2600(%rip), %rsi      # 0x5188
movl %ebx, %edi
callq *(%r14)
movq 0x241c(%rip), %rax      # 0x4fb0
leaq 0x25e9(%rip), %rsi      # 0x5184
movl %ebx, %edi
callq *(%rax)
movq 0x23e2(%rip), %rax      # 0x4f88
movl 0x25d4(%rip), %edi      # 0x5180
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_7/exercise_7_08/print.c
// Function: main
int main(int argc, char *argv[])
{
  if (!parse_arg_list(argc, argv))
  {
    exit(EXIT_FAILURE);
  }

  while (--argc > 0)
  {
    print_file(*++argv);

    if (argc != 1)
    {
      putc('\n', stdout);
    }
  }

  exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x11e4
testl %eax, %eax
jne 0x11a9
pushq $0x1
popq %rdi
callq 0x1080
addq $0x8, %rbx
movq 0x2e24(%rip), %r15      # 0x3fd8
pushq $0xa
popq %r14
cmpl $0x2, %ebp
jl 0x11dd
movq (%rbx), %rdi
callq 0x1210
cmpl $0x2, %ebp
je 0x11d5
movq (%r15), %rsi
movl %r14d, %edi
callq 0x1050
addq $0x8, %rbx
decl %ebp
jmp 0x11b8
xorl %edi, %edi
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_7/exercise_7_08/print.c
// Function: parse_arg_list
boolean parse_arg_list(int argc, char *argv[])
{
  const char *program_name = argv[0];

  if (argc < 2)
  {
    fprintf(stderr, "Usage: %s [FILE]...\n", program_name);
    return false;
  }

  return true;
}

// Assembly:
pushq %rbx
cmpl $0x1, %edi
jle 0x11f1
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
movq (%rsi), %rdx
movq 0x2dfd(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xdff(%rip), %rsi       # 0x2004
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1060
jmp 0x11ed
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_7/exercise_7_08/print.c
// Function: print_file
void print_file(char *file_name)
{
  FILE *file_p;
  if ((file_p = fopen(file_name, "r")) == NULL)
  {
    fprintf(stderr, "%s: can't open %s.\n", program_name, file_name);
    exit(EXIT_FAILURE);
  }

  size_t line_number = 1;
  char line[MAX_LINE_LEN];
  while (fgets(line, MAX_LINE_LEN, file_p) != NULL)
  {
    if ((line_number - 1) % LINES_PER_PAGE == 0)
    {
      printf("[%s]: page %zu\n", file_name, line_number / LINES_PER_PAGE + 1);
    }

    printf("%zu: %s", line_number, line);
    ++line_number;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
leaq 0xdf1(%rip), %rsi       # 0x2019
movq %rdi, 0x8(%rsp)
callq 0x1070
testq %rax, %rax
je 0x12cb
movq %rax, %r14
pushq $0x1
popq %r15
leaq 0x10(%rsp), %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %r13, %rax
xorl %edx, %edx
pushq $0xa
popq %rcx
divq %rcx
movq %rax, %rbx
movq %r12, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x1040
testq %rax, %rax
je 0x12b9
imulq $0xa, %rbx, %rax
addq %rbp, %rax
jne 0x129a
movq %r15, %rax
xorl %edx, %edx
pushq $0xa
popq %rcx
divq %rcx
leaq 0x1(%rax), %rdx
leaq 0xda1(%rip), %rdi       # 0x202f
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x1030
leaq 0xd9e(%rip), %rdi       # 0x203f
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
incq %r15
decq %rbp
incq %r13
jmp 0x124c
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d26(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq 0x2d84(%rip), %rdx      # 0x4060
leaq 0xd38(%rip), %rsi       # 0x201b
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x1060
pushq $0x1
popq %rdi
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/fallocate2.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char tmpfile[] = "/tmp/willitscale.XXXXXX";
	int fd = mkstemp(tmpfile);
	unsigned long place = 0;
	assert(fd >= 0);
	unlink(tmpfile);

	while (1) {
		int ret = fallocate(fd, 0, place, BUFLEN);
		if (errno != EINTR)
			assert(ret == 0);
		place += BUFLEN;
		if (place >= FILESIZE) {
			ret = ftruncate(fd, 0);
			assert(ret == 0);
			place = 0;
		}
		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movaps 0x6fc(%rip), %xmm0      # 0x22d0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x10(%rdi)
callq 0x11f0
testl %eax, %eax
js 0x1c49
movl %eax, %ebp
movq %rsp, %rdi
callq 0x1080
xorl %r14d, %r14d
movl $0x2000, %ecx           # imm = 0x2000
movl %ebp, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1170
movl %eax, %r15d
callq 0x1070
cmpl $0x4, (%rax)
je 0x1c21
testl %r15d, %r15d
jne 0x1c62
addq $0x2000, %r14           # imm = 0x2000
cmpq $0x100000, %r14         # imm = 0x100000
jb 0x1c44
movl %ebp, %edi
xorl %esi, %esi
callq 0x1120
movl $0x0, %r14d
testl %eax, %eax
jne 0x1c7b
incq (%rbx)
jmp 0x1bfe
leaq 0x620(%rip), %rdi       # 0x2270
leaq 0x621(%rip), %rsi       # 0x2278
leaq 0x62d(%rip), %rcx       # 0x228b
pushq $0x14
jmp 0x1c92
leaq 0x655(%rip), %rdi       # 0x22be
leaq 0x608(%rip), %rsi       # 0x2278
leaq 0x614(%rip), %rcx       # 0x228b
pushq $0x1a
jmp 0x1c92
leaq 0x63c(%rip), %rdi       # 0x22be
leaq 0x5ef(%rip), %rsi       # 0x2278
leaq 0x5fb(%rip), %rcx       # 0x228b
pushq $0x1e
popq %rdx
callq 0x1130
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTQueue_test.c
// Function: test_create
void test_create(void) {
	Queue queue = queue_create(NULL);
	queue_set_destroy_value(queue, NULL);

	TEST_ASSERT(queue != NULL);
	TEST_ASSERT(queue_size(queue) == 0);

	queue_destroy(queue);
}

// Assembly:
pushq %rbx
xorl %edi, %edi
callq 0x4214
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x42a5
xorl %edi, %edi
testq %rbx, %rbx
setne %dil
leaq 0x1882(%rip), %rsi      # 0x5318
leaq 0x19e1(%rip), %rcx      # 0x547e
leaq 0x1884(%rip), %r8       # 0x5328
pushq $0x11
popq %rdx
xorl %eax, %eax
callq 0x239c
testl %eax, %eax
je 0x3aee
movq %rbx, %rdi
callq 0x423c
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x184f(%rip), %rsi      # 0x5318
leaq 0x19ae(%rip), %rcx      # 0x547e
leaq 0x185f(%rip), %r8       # 0x5336
pushq $0x12
popq %rdx
xorl %eax, %eax
callq 0x239c
testl %eax, %eax
je 0x3aee
movq %rbx, %rdi
popq %rbx
jmp 0x42ad
callq 0x2bc0
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTQueue_test.c
// Function: test_insert
void test_insert(void) {
	Queue queue = queue_create(NULL);
	int N = 1000;
	int* array = malloc(N * sizeof(*array));					// Στο queue θα προσθέσουμε pointers προς τα στοιχεία αυτού του πίνακα

	// insert 1000 στοιχεία
	for (int i = 0; i < 1000; i++) {
		queue_insert_back(queue, &array[i]);
		TEST_ASSERT(queue_size(queue) == i+1);			// Το size πρέπει να μεγαλώσει
		TEST_ASSERT(queue_front(queue) == &array[0]);	// Το μπροστινό στοιχείο στην κορυφή είναι πάντα το array[0]
		TEST_ASSERT(queue_back(queue) == &array[i]);		// Το πίσω στοιχείο είναι αυτό που μόλις βάλαμε
	}

	queue_destroy(queue);
	free(array);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %edi, %edi
callq 0x4214
movq %rax, %rbx
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x21b0
movq %rax, %r13
pushq $0x1
popq %rbp
leaq 0x17f9(%rip), %r15      # 0x5318
leaq 0x1958(%rip), %r12      # 0x547e
movq %rax, %r14
cmpq $0x3e9, %rbp            # imm = 0x3E9
je 0x3bd7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4274
movq %rbx, %rdi
callq 0x423c
movl %eax, %eax
xorl %edi, %edi
cmpq %rax, %rbp
sete %dil
movq %r15, %rsi
pushq $0x1f
popq %rdx
movq %r12, %rcx
leaq 0x17e9(%rip), %r8       # 0x534d
xorl %eax, %eax
callq 0x239c
testl %eax, %eax
je 0x3bd2
movq %rbx, %rdi
callq 0x4244
xorl %edi, %edi
cmpq %r13, %rax
sete %dil
movq %r15, %rsi
pushq $0x20
popq %rdx
movq %r12, %rcx
leaq 0x17d6(%rip), %r8       # 0x5366
xorl %eax, %eax
callq 0x239c
testl %eax, %eax
je 0x3bd2
movq %rbx, %rdi
callq 0x425c
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
movq %r15, %rsi
pushq $0x21
popq %rdx
movq %r12, %rcx
leaq 0x17ca(%rip), %r8       # 0x5386
xorl %eax, %eax
callq 0x239c
incq %rbp
addq $0x4, %r14
testl %eax, %eax
jne 0x3b29
callq 0x2bc0
movq %rbx, %rdi
callq 0x42ad
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTQueue_test.c
// Function: test_remove
void test_remove(void) {
	Queue queue = queue_create(NULL);
	int N = 1000;
	int* array = malloc(N * sizeof(*array));

	// insert για προσθήκη δεδομένων, χωρίς ελέγχους (έχουμε ξεχωριστό test για το insert)
	for (int i = 0; i < 1000; i++)
		queue_insert_back(queue, &array[i]);

	// Διαδοχικά remove, πρέπει να βγουν με την ίδια σειρά που είναι στο array
	for (int i = 0; i < 1000; i++) {
		TEST_ASSERT(queue_front(queue) == &array[i]);
		queue_remove_front(queue);
		TEST_ASSERT(queue_size(queue) == 999-i);
	}

	queue_destroy(queue);
	free(array);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x4214
movq %rax, %rbx
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x21b0
movq %rax, %rbp
cmpq $0xfa0, %r14            # imm = 0xFA0
je 0x3c35
leaq (%r14,%rbp), %rsi
movq %rbx, %rdi
callq 0x4274
addq $0x4, %r14
jmp 0x3c1a
movl $0x3e7, %r13d           # imm = 0x3E7
leaq 0x16d6(%rip), %r15      # 0x5318
leaq 0x1835(%rip), %r12      # 0x547e
movq %rbp, %r14
cmpq $-0x1, %r13
je 0x3cc0
movq %rbx, %rdi
callq 0x4244
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
movq %r15, %rsi
pushq $0x33
popq %rdx
movq %r12, %rcx
leaq 0x1732(%rip), %r8       # 0x53a5
xorl %eax, %eax
callq 0x239c
testl %eax, %eax
je 0x3cbb
movq %rbx, %rdi
callq 0x429b
movq %rbx, %rdi
callq 0x423c
movl %eax, %eax
xorl %edi, %edi
cmpq %rax, %r13
sete %dil
movq %r15, %rsi
pushq $0x35
popq %rdx
movq %r12, %rcx
leaq 0x171c(%rip), %r8       # 0x53c5
xorl %eax, %eax
callq 0x239c
decq %r13
addq $0x4, %r14
testl %eax, %eax
jne 0x3c4c
callq 0x2bc0
movq %rbx, %rdi
callq 0x42ad
movq %rbp, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/lib/../modules/UsingADTList/ADTQueue.c
// Function: queue_create
Queue queue_create(DestroyFunc destroy_value) {
	// Φτιάχνουμε ένα struct και αποθηκεύουμε μέσα μια νέα λίστα
	//
	Queue queue = malloc(sizeof(*queue));
	queue->list = list_create(destroy_value);
	return queue;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x8
popq %rdi
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x42c4
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/lib/../modules/UsingLinkedList/ADTList.c
// Function: list_create
List list_create(DestroyFunc destroy_value) {
	// Πρώτα δημιουργούμε το stuct
	List list = malloc(sizeof(*list));
	list->size = 0;
	list->destroy_value = destroy_value;

	// Χρησιμοποιούμε dummy κόμβο, ώστε ακόμα και μια άδεια λίστα να έχει ένα κόμβο
	// (απλοποιεί τους αλγορίθμους). Οπότε πρέπει να τον δημιουργήσουμε.
	//
	list->dummy = malloc(sizeof(*list->dummy));
	list->dummy->next = NULL;		// άδεια λίστα, ο dummy δεν έχει επόμενο

	// Σε μια κενή λίστα, τελευταίος κόμβος είναι επίσης ο dummy
	list->last = list->dummy;

	return list;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x21b0
movq %rax, %r14
andl $0x0, 0x10(%rax)
movq %rbx, 0x18(%rax)
pushq $0x10
popq %rdi
callq 0x21b0
andq $0x0, (%rax)
movq %rax, (%r14)
movq %rax, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/lib/../modules/UsingLinkedList/ADTList.c
// Function: list_insert_next
void list_insert_next(List list, ListNode node, Pointer value) {
	// Αν το node είναι NULL απλά εισάγουμε μετά τον dummy κόμβο!
	// Αυτή ακριβώς είναι η αξία του dummy, δε χρειαζόμαστε ξεχωριστή υλοποίηση.
	if (node == NULL)
		node = list->dummy;

	// Δημιουργία του νέου κόμβου
	ListNode new = malloc(sizeof(*new));
	new->value = value;

	// Σύνδεση του new ανάμεσα στο node και το node->next
	new->next = node->next;
	node->next = new;

	// Ενημέρωση των size & last
	list->size++;
	if (list->last == node)
		list->last = new;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
jne 0x4316
movq (%rbx), %r14
pushq $0x10
popq %rdi
callq 0x21b0
movq %r15, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, (%rax)
movq %rax, (%r14)
incl 0x10(%rbx)
cmpq %r14, 0x8(%rbx)
jne 0x4338
movq %rax, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/lib/../modules/UsingLinkedList/ADTList.c
// Function: list_remove_next
void list_remove_next(List list, ListNode node) {
	// Αν το node είναι NULL απλά διαγράφουμε μετά τον dummy κόμβο!
	// Αυτή ακριβώς είναι η αξία του dummy, δε χρειαζόμαστε ξεχωριστή υλοποίηση.
	if (node == NULL)
		node = list->dummy;

	// Ο κόμβος προς διαγραφή είναι ο επόμενος του node, ο οποίος πρέπει να υπάρχει
	ListNode removed = node->next;
	assert(removed != NULL);		// LCOV_EXCL_LINE

	if (list->destroy_value != NULL)
		list->destroy_value(removed->value);

	// Σύνδεση του node με τον επόμενο του removed
	node->next = removed->next;		// πριν το free!

	free(removed);

	// Ενημέρωση των size & last
	list->size--;
	if (list->last == removed)
		list->last = node;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
jne 0x4351
movq (%rbx), %r14
movq (%r14), %r15
testq %r15, %r15
je 0x4389
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x4368
movq 0x8(%r15), %rdi
callq *%rax
movq (%r15), %rax
movq %rax, (%r14)
movq %r15, %rdi
callq 0x2030
decl 0x10(%rbx)
cmpq %r15, 0x8(%rbx)
jne 0x4383
movq %r14, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1a7e(%rip), %rdi      # 0x5e0e
leaq 0x1a87(%rip), %rsi      # 0x5e1e
leaq 0x1aa5(%rip), %rcx      # 0x5e43
pushq $0x4d
popq %rdx
callq 0x2120
// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/lib/../modules/UsingLinkedList/ADTList.c
// Function: list_destroy
void list_destroy(List list) {
	// Διασχίζουμε όλη τη λίστα και κάνουμε free όλους τους κόμβους,
	// συμπεριλαμβανομένου και του dummy!
	//
	ListNode node = list->dummy;
	while (node != NULL) {				// while αντί για for, γιατί θέλουμε να διαβάσουμε
		ListNode next = node->next;		// το node->next _πριν_ κάνουμε free!

		// Καλούμε τη destroy_value, αν υπάρχει (προσοχή, όχι στον dummy!)
		if (node != list->dummy && list->destroy_value != NULL)
			list->destroy_value(node->value);

		free(node);
		node = next;
	}

	// Τέλος free το ίδιο το struct
	free(list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x4424
movq (%r14), %r15
cmpq (%rbx), %r14
je 0x4417
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x4417
movq 0x8(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x2030
movq %r15, %r14
jmp 0x43fb
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: memalloc
void* memalloc(size_t size) {
  void* ans = malloc(size);
  if (ans == NULL)
    exit(error("", ERRMEM));
  return ans;
}

// Assembly:
pushq %rax
callq 0x2220
testq %rax, %rax
je 0x275f
popq %rcx
retq
leaq 0xf3a9(%rip), %rdi      # 0x11b0f
pushq $0x4
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: memrealloc
void* memrealloc(void* ptr, size_t size) {
  void* ans = realloc(ptr, size);
  if (ans == NULL)
    exit(error("", ERRMEM));
  return ans;
}

// Assembly:
pushq %rax
callq 0x2250
testq %rax, %rax
je 0x2783
popq %rcx
retq
leaq 0xf385(%rip), %rdi      # 0x11b0f
pushq $0x4
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: getFloat
float getFloat(char* in) {
  char* endptr;
  float ans = strtof(in, &endptr);
  if (*endptr != '\0')
    exit(error(in, ERRFLOAT));
  return ans;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0x2130
movq (%r14), %rax
cmpb $0x0, (%rax)
jne 0x27bc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: getInt
int getInt(char* in) {
  char* endptr;
  int ans = (int) strtol(in, &endptr, 10);
  if (*endptr != '\0')
    exit(error(in, ERRINT));
  return ans;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
pushq $0xa
popq %rdx
movq %r14, %rsi
callq 0x21f0
movq (%r14), %rcx
cmpb $0x0, (%rcx)
jne 0x27f4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: getLong
uint64_t getLong(char* in) {
  char* endptr;
  uint64_t ans = (uint64_t) strtol(in, &endptr, 10);
  if (*endptr != '\0')
    exit(error(in, ERRINT));
  return ans;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
pushq $0xa
popq %rdx
movq %r14, %rsi
callq 0x21f0
movq (%r14), %rcx
cmpb $0x0, (%rcx)
jne 0x282c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: getLine
char* getLine(char* line, int size, File in, bool gz) {
  if (gz)
    return gzgets(in.gzf, line, size);
  else
    return fgets(line, size, in.f);
}

// Assembly:
movl %esi, %eax
movq %rdi, %rsi
testl %ecx, %ecx
je 0x2852
movq %rdx, %rdi
movl %eax, %edx
jmp 0x2090
movq %rsi, %rdi
movl %eax, %esi
jmp 0x2190
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: partition
int64_t partition(float* pVal, uint64_t* pEnd,
    int64_t low, int64_t high) {
  float pivot = pVal[high];  // pivot value: last elt
  int64_t idx = low - 1;

  for (int64_t j = low; j < high; j++) {
    if (pVal[j] < pivot) {
      idx++;
      swapFloat(pVal + idx, pVal + j);
      swapInt(pEnd + idx, pEnd + j);  // swap int values too
    }
  }
  idx++;
  swapFloat(pVal + idx, pVal + high);
  swapInt(pEnd + idx, pEnd + high);
  return idx;
}

// Assembly:
movss (%rdi,%rcx,4), %xmm0
leaq -0x1(%rdx), %r8
cmpq %rcx, %rdx
jge 0x28bf
movss (%rdi,%rdx,4), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x28ba
movss 0x4(%rdi,%r8,4), %xmm2
movss %xmm1, 0x4(%rdi,%r8,4)
movss %xmm2, (%rdi,%rdx,4)
movq 0x8(%rsi,%r8,8), %rax
movq (%rsi,%rdx,8), %r9
movq %r9, 0x8(%rsi,%r8,8)
incq %r8
movq %rax, (%rsi,%rdx,8)
incq %rdx
jmp 0x2883
leaq 0x1(%r8), %rax
movss 0x4(%rdi,%r8,4), %xmm0
movss (%rdi,%rcx,4), %xmm1
movss %xmm1, 0x4(%rdi,%r8,4)
movss %xmm0, (%rdi,%rcx,4)
movq 0x8(%rsi,%r8,8), %rdx
movq (%rsi,%rcx,8), %rdi
movq %rdi, 0x8(%rsi,%r8,8)
movq %rdx, (%rsi,%rcx,8)
retq