LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/zecoxao[P]ps3_decrypt_tools/lib/eid.c
// Function: eid2_generate_block
void eid2_generate_block(s8 *file_in, u32 blocktype, s8 *file_out) {
    u32 length;
    u8 *eid2 = _read_buffer(file_in, &length);

    if (eid2 != NULL) {
        u8 *block = eid2_generate_block_buffer(eid2, blocktype);
        if (block != NULL) {
            switch (blocktype) {
                case EID2_BLOCKTYPE_P:
                    _write_buffer(file_out, block, 0x80);
                    free(block);
                    break;
                case EID2_BLOCKTYPE_S:
                    _write_buffer(file_out, block, 0x690);
                    free(block);
                    break;
            }

        }

        free(eid2);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
leaq 0x4(%rsp), %rsi
callq 0x5588
testq %rax, %rax
je 0x645d
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0x6338
testq %rax, %rax
je 0x6455
movq %rax, %r15
cmpl $0x1, %ebp
je 0x643d
cmpl $0x2, %ebp
jne 0x6455
movl $0x690, %edx            # imm = 0x690
jmp 0x6442
movl $0x80, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x5611
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
cmpl $0x8, %esi
jb 0x650f
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0xa153(%rip), %rax      # 0x105e0
movsd (%rax), %xmm0
movaps %xmm0, (%rsp)
leaq 0xa084(%rip), %rsi      # 0x10520
leaq 0x2c(%rsp), %rdi
callq 0x4579
cmpl $0x10, %ebx
jb 0x64ff
shrl $0x3, %ebx
decl %ebx
shlq $0x3, %rbx
xorl %r13d, %r13d
leaq 0x2c(%rsp), %r15
leaq (%r14,%r13), %r12
movsd (%r14,%r13), %xmm0
movaps %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0x4772
testq %r13, %r13
je 0x64ed
movsd (%r12), %xmm0
xorps (%rsp), %xmm0
movlps %xmm0, (%r12)
addq $0x8, %r13
movaps 0x10(%rsp), %xmm0
movaps %xmm0, (%rsp)
cmpq %r13, %rbx
jne 0x64bc
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9f18(%rip), %rdi      # 0x10440
leaq 0x50(%rsp), %r8
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5654
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 0x125c
leaq 0x9f9d(%rip), %r8       # 0x10500
leaq 0x10(%rsp), %r12
movl $0x10, %edx
movq %r15, %rdi
movl $0x1, %esi
movq %r14, %rcx
movq %r12, %r9
callq 0x1eab
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf0, %edx
movq %r12, %rcx
movl $0x80, %r8d
callq 0x5010
movdqu 0xf0(%rbx), %xmm0
pcmpeqb (%r14), %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x65c2
leaq 0x68c9(%rip), %rdi      # 0xce86
callq 0x1050
leaq 0x158(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movl $0x80, %edx
callq 0x154d
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 0x1eab
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
leaq 0x9efd(%rip), %rsi      # 0x10510
movq %r14, %rdi
movl $0x80, %edx
callq 0x154d
movl $0xd0, %edx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
movq %r15, %r8
movq %r15, %r9
callq 0x1eab
leaq 0x30(%rsp), %r14
movl $0xb8, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x3dd3
movdqu 0xd8(%rbx), %xmm0
movd 0x10(%r14), %xmm1
movd 0xe8(%rbx), %xmm2
pcmpeqb (%r14), %xmm0
pcmpeqb %xmm1, %xmm2
pand %xmm2, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x6687
leaq 0x682b(%rip), %rdi      # 0xcead
callq 0x1050
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5588
testq %rax, %rax
je 0x66cf
movq %rax, %r14
movq %rax, %rdi
callq 0x6510
movq %rbx, %rdi
movq %r14, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x5611
movq %r14, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9d93(%rip), %rdi      # 0x10480
leaq 0x10(%rsp), %r8
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5654
leaq 0x30(%rsp), %r14
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
movl $0x20, %edx
movq %r14, %rcx
movl $0x100, %r8d            # imm = 0x100
callq 0x5010
movdqu 0x20(%rbx), %xmm0
pcmpeqb (%r15), %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x673f
leaq 0x6799(%rip), %rdi      # 0xced3
callq 0x1050
leaq 0x110(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x154d
leaq 0x20(%rsp), %rcx
movl $0x20, %edx
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %r8
movq %rbx, %r9
callq 0x1eab
addq $0x340, %rsp            # imm = 0x340
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5588
testq %rax, %rax
je 0x67b7
movq %rax, %r14
movq %rax, %rdi
callq 0x66d7
movq %rbx, %rdi
movq %r14, %rsi
movl $0x30, %edx
callq 0x5611
movq %r14, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
leaq 0x6739(%rip), %rdi      # 0xcf10
xorl %esi, %esi
callq 0x5588
leaq 0x9ddb(%rip), %rbx      # 0x105c0
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 0x51b8
movq (%rbx), %rdi
leaq 0x20(%rdi), %rsi
leaq 0x20(%rsp), %r14
movq %rsp, %rbx
movq %r14, %rdx
movq %rbx, %rcx
callq 0x525f
movq 0x97bb(%rip), %r13      # 0xffe0
movq (%r13), %rdi
leaq 0x66f2(%rip), %rsi      # 0xcf22
xorl %edx, %edx
movq %r12, %rcx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
leaq 0x66e5(%rip), %rsi      # 0xcf33
xorl %edx, %edx
movq %r15, %rcx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
leaq 0x66d8(%rip), %rsi      # 0xcf44
xorl %edx, %edx
movq %r14, %rcx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r13), %rdi
leaq 0x66cb(%rip), %rsi      # 0xcf55
xorl %edx, %edx
movq %rbx, %rcx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x5478
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6656(%rip), %rdi      # 0xcf10
xorl %esi, %esi
callq 0x5588
leaq 0x9cf8(%rip), %rcx      # 0x105c0
movq %rax, (%rcx)
leaq 0x6694(%rip), %rdi      # 0xcf66
callq 0x57ac
leaq 0x6690(%rip), %rdi      # 0xcf6e
leaq 0x6692(%rip), %rsi      # 0xcf77
callq 0x5cac
leaq 0x6698(%rip), %rdi      # 0xcf89
leaq 0x669a(%rip), %rsi      # 0xcf92
callq 0x62f7
leaq 0x66a4(%rip), %r14      # 0xcfa8
leaq 0x66a6(%rip), %r15      # 0xcfb1
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x63fc
leaq 0x66a2(%rip), %rbx      # 0xcfc4
movq %r14, %rdi
movl $0x2, %esi
movq %rbx, %rdx
callq 0x63fc
movq %r15, %rdi
xorl %esi, %esi
callq 0x5588
movq %rax, %r14
movq %rax, %rdi
movl $0x80, %esi
callq 0x6468
leaq 0x10(%r14), %rsi
movl $0x60, %edx
movq %r14, %rdi
callq 0x10f0
leaq 0x6673(%rip), %rdi      # 0xcfd7
movq %r14, %rsi
movl $0x60, %edx
callq 0x5611
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5588
movq %rax, %rbx
movq %rax, %rdi
movl $0x690, %esi            # imm = 0x690
callq 0x6468
leaq 0x10(%rbx), %rsi
movl $0x670, %edx            # imm = 0x670
movq %rbx, %rdi
callq 0x10f0
leaq 0x6646(%rip), %rdi      # 0xcfe9
movq %rbx, %rsi
movl $0x670, %edx            # imm = 0x670
callq 0x5611
leaq 0x6644(%rip), %rdi      # 0xcffb
leaq 0x6646(%rip), %rsi      # 0xd004
callq 0x6696
leaq 0x6650(%rip), %rdi      # 0xd01a
leaq 0x6652(%rip), %rsi      # 0xd023
popq %rbx
popq %r14
popq %r15
jmp 0x677e
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rsi, %rsi
je 0x6abe
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
negq %rbx
movl $0x1, %r12d
movl $0xa, %ebp
leaq 0x6657(%rip), %r15      # 0xd0e1
movsbl -0x1(%r14,%r12), %esi
testb $0xf, %r12b
movl $0x20, %edx
cmovel %ebp, %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1090
leaq (%rbx,%r12), %rax
incq %rax
incq %r12
cmpq $0x1, %rax
jne 0x6a8a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x2b0, %rsp            # imm = 0x2B0
leaq 0x618b(%rip), %rdi      # 0xcf10
xorl %esi, %esi
callq 0x5588
leaq 0x982d(%rip), %rcx      # 0x105c0
movq %rax, (%rcx)
xorps %xmm0, %xmm0
movq %rsp, %rbx
movaps %xmm0, (%rbx)
leaq 0x95fa(%rip), %rdi      # 0x103a0
leaq 0x40(%rsp), %r14
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x5654
movaps 0x20(%r14), %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movl $0x80, %edx
callq 0x125c
movaps 0x10(%r14), %xmm0
leaq 0x30(%rsp), %rcx
movaps %xmm0, (%rcx)
leaq 0x92d1(%rip), %r8       # 0x100c0
leaq 0x10(%rsp), %r14
movl $0x10, %edx
movq %r15, %rdi
movl $0x1, %esi
movq %r14, %r9
callq 0x1eab
movq 0x91d0(%rip), %r15      # 0xffe0
movq (%r15), %rdi
leaq 0x6347(%rip), %rsi      # 0xd161
xorl %edx, %edx
movq %r14, %rcx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r15), %rdi
leaq 0x6339(%rip), %rsi      # 0xd170
xorl %edx, %edx
movq %rbx, %rcx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x5478
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
leaq 0x60a4(%rip), %rdi      # 0xcf10
xorl %esi, %esi
callq 0x5588
leaq 0x9746(%rip), %rcx      # 0x105c0
movq %rax, (%rcx)
leaq 0x951c(%rip), %rdi      # 0x103a0
leaq 0x30(%rsp), %r14
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x5654
movaps 0x20(%r14), %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x78(%rsp), %r15
movq %r15, %rdi
movl $0x80, %edx
callq 0x125c
movaps 0x10(%r14), %xmm0
leaq 0x20(%rsp), %rbx
movaps %xmm0, (%rbx)
leaq 0x9206(%rip), %r8       # 0x100d0
movq %rsp, %r12
movl $0x10, %edx
movq %r15, %rdi
movl $0x1, %esi
movq %rbx, %rcx
movq %r12, %r9
callq 0x1eab
movaps 0x10(%r14), %xmm0
movaps %xmm0, (%rbx)
movq 0x90ec(%rip), %r14      # 0xffe0
movq (%r14), %rdi
leaq 0x6280(%rip), %rsi      # 0xd17e
xorl %edx, %edx
movq %r12, %rcx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x5478
movq (%r14), %rdi
leaq 0x6273(%rip), %rsi      # 0xd18e
xorl %edx, %edx
movq %rbx, %rcx
movl $0x10, %r8d
xorl %r9d, %r9d
callq 0x5478
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
leaq 0x627b(%rip), %rdi      # 0xd1c3
callq 0x1050
leaq 0x5d4e(%rip), %rdi      # 0xcca2
leaq 0x4(%rsp), %rbx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1130
movl (%rbx), %eax
cmpq $0x6, %rax
ja 0x700a
leaq 0x5f7e(%rip), %rcx      # 0xcef4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x68ae
jmp 0x7026
callq 0x67c0
jmp 0x7026
leaq 0x5f76(%rip), %rbx      # 0xcf10
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5588
leaq 0x9615(%rip), %r14      # 0x105c0
movq %rax, (%r14)
leaq 0x6084(%rip), %rdi      # 0xd039
leaq 0x6099(%rip), %rsi      # 0xd055
callq 0x5db6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5588
movq %rax, (%r14)
leaq 0x609c(%rip), %rdi      # 0xd071
leaq 0x60b1(%rip), %rsi      # 0xd08d
callq 0x5e4b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5588
movq %rax, (%r14)
leaq 0x60b4(%rip), %rdi      # 0xd0a9
leaq 0x60c9(%rip), %rsi      # 0xd0c5
callq 0x5ee0
jmp 0x702b
callq 0x6ac8
jmp 0x7026
leaq 0x618c(%rip), %rdi      # 0xd19d
xorl %eax, %eax
callq 0x1090
jmp 0x702b
callq 0x6d72
jmp 0x7026
callq 0x6e57
callq 0x10c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x395e(%rip), %rax      # 0x5f60
callq *(%rax)
testb %al, %al
je 0x269b
xorl %eax, %eax
movl %eax, 0x4(%rsp)
movq %rsp, %r14
movl %eax, (%r14)
movq 0x3929(%rip), %rax      # 0x5f48
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 0x2655
leaq 0x1a6d(%rip), %rsi      # 0x40b2
xorl %edi, %edi
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2250
movl (%rsp), %ebp
movq 0x38b4(%rip), %rax      # 0x5f10
leaq 0x4(%rsp), %r15
movl %ebx, %edi
movl %ebp, %esi
movq %r15, %rdx
movq %r14, %rcx
callq *(%rax)
cmpl $0x0, (%r15)
jle 0x2688
leaq 0x1a6f(%rip), %rsi      # 0x40e9
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 0x1a67(%rip), %rsi      # 0x4109
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_O3/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 0x3889(%rip), %rax      # 0x5f50
callq *(%rax)
testb %al, %al
je 0x2760
xorl %eax, %eax
movl %eax, 0x4(%rsp)
movq %rsp, %r14
movl %eax, (%r14)
movq 0x3834(%rip), %rax      # 0x5f18
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 0x271a
leaq 0x1a1e(%rip), %rsi      # 0x4128
xorl %edi, %edi
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2250
movl (%rsp), %ebp
movq 0x386f(%rip), %rax      # 0x5f90
leaq 0x4(%rsp), %r15
movl %ebx, %edi
movl %ebp, %esi
movq %r15, %rdx
movq %r14, %rcx
callq *(%rax)
cmpl $0x0, (%r15)
jle 0x274d
leaq 0x1a21(%rip), %rsi      # 0x4160
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 0x1a17(%rip), %rsi      # 0x417e
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_O3/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 0x1a14(%rip), %rsi      # 0x419f
callq 0x2240
testq %rax, %rax
je 0x27f8
movq %rax, %rbx
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
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 0x27fb
movq %rax, %r12
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2130
cmpq %r15, %rax
jne 0x27f8
movq %rbx, %rdi
callq 0x2110
movb $0x0, (%r12,%r15)
movq %r12, %r14
jmp 0x27fb
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x37b9(%rip), %rax      # 0x5fd8
callq *(%rax)
movl %eax, %ebp
movq 0x378e(%rip), %rax      # 0x5fb8
movl %ebp, %edi
movl $0x1, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq *(%rax)
movq 0x3739(%rip), %rax      # 0x5f78
movl %ebp, %edi
callq *(%rax)
movl %ebp, (%rbx)
leaq 0xc(%rsp), %rbx
movl $0x0, (%rbx)
movq 0x36f1(%rip), %rax      # 0x5f48
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_O3/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 0x33e2(%rip), %rax      # 0x5ff0
movl 0x356c(%rip), %edi      # 0x6180
callq *(%rax)
movq 0x3363(%rip), %rbx      # 0x5f80
movl 0x3535(%rip), %edi      # 0x6158
movss 0x1419(%rip), %xmm0     # 0x4044
callq *(%rbx)
movq 0x32cc(%rip), %rax      # 0x5f00
movl 0x351a(%rip), %edi      # 0x6154
movl 0x351c(%rip), %esi      # 0x615c
movl 0x351a(%rip), %edx      # 0x6160
callq *(%rax)
movl 0x3502(%rip), %edi      # 0x6150
xorps %xmm0, %xmm0
cvtsd2ss 0x8(%rsp), %xmm0
callq *(%rbx)
movl $0x4, %edi
movl $0x6, %esi
movl $0x1405, %edx           # imm = 0x1405
xorl %ecx, %ecx
addq $0x10, %rsp
popq %rbx
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movq 0x32ec(%rip), %rbx      # 0x5f68
leaq 0x3509(%rip), %rsi      # 0x618c
movl $0x1, %edi
callq *(%rbx)
leaq 0x34f7(%rip), %rsi      # 0x6188
movl $0x1, %edi
callq *(%rbx)
movq 0x3311(%rip), %rax      # 0x5fb0
leaq 0x34de(%rip), %rsi      # 0x6184
movl $0x1, %edi
callq *(%rax)
movq 0x32d4(%rip), %rax      # 0x5f88
movl 0x34c6(%rip), %edi      # 0x6180
popq %rbx
jmpq *(%rax)
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movq %rsi, %rbx
cmpl $0x2, %edi
jge 0x1211
movq (%rbx), %rdx
movq 0x2e02(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xe04(%rip), %rsi       # 0x2004
xorl %eax, %eax
callq 0x1060
movl $0x1, %edi
callq 0x1080
movl %edi, %ebp
movq 0x8(%rbx), %rdi
callq 0x1272
cmpl $0x2, %ebp
je 0x1250
movl %ebp, %r14d
movl $0x2, %r15d
movq 0x2da7(%rip), %r12      # 0x3fd8
movq (%r12), %rsi
movl $0xa, %edi
callq 0x1050
movq (%rbx,%r15,8), %rdi
callq 0x1272
incq %r15
cmpl %r15d, %r14d
jne 0x1231
xorl %edi, %edi
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/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 0xd8f(%rip), %rsi       # 0x2019
movq %rdi, 0x8(%rsp)
callq 0x1070
testq %rax, %rax
je 0x1355
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x1040
testq %rax, %rax
je 0x1343
movl $0x1, %r15d
movabsq $-0x3333333333333333, %rbx # imm = 0xCCCCCCCCCCCCCCCD
leaq 0xd6d(%rip), %r13       # 0x203f
leaq 0x10(%rsp), %rbp
xorl %r12d, %r12d
movq %r12, %rax
mulq %rbx
shrq $0x2, %rdx
andq $-0x2, %rdx
leaq (%rdx,%rdx,4), %rax
movq %r15, %rcx
subq %rax, %rcx
cmpq $0x1, %rcx
jne 0x1318
movq %r15, %rax
mulq %rbx
shrq $0x3, %rdx
incq %rdx
leaq 0xd23(%rip), %rdi       # 0x202f
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x1030
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1030
incq %r15
movq %rbp, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x1040
incq %r12
testq %rax, %rax
jne 0x12da
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
callq 0x10bb
// File: /workspace/github_c_makefile_star2_O3/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 0x5ec(%rip), %xmm0      # 0x2300
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x10(%rdi)
callq 0x11f0
testl %eax, %eax
js 0x1dc7
movl %eax, %ebp
movq %rsp, %rdi
callq 0x1080
movl $0x2000, %ecx           # imm = 0x2000
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1170
movl %eax, %r15d
callq 0x1070
movq %rax, %r14
cmpl $0x4, (%rax)
je 0x1d64
testl %r15d, %r15d
jne 0x1da8
xorl %r15d, %r15d
addq $0x2000, %r15           # imm = 0x2000
cmpq $0x100000, %r15         # imm = 0x100000
jb 0x1d8a
movl %ebp, %edi
xorl %esi, %esi
callq 0x1120
movl $0x0, %r15d
testl %eax, %eax
jne 0x1de6
incq (%rbx)
movl $0x2000, %ecx           # imm = 0x2000
movl %ebp, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1170
cmpl $0x4, (%r14)
je 0x1d67
testl %eax, %eax
je 0x1d67
leaq 0x53f(%rip), %rdi       # 0x22ee
leaq 0x4f2(%rip), %rsi       # 0x22a8
leaq 0x4fe(%rip), %rcx       # 0x22bb
movl $0x1a, %edx
callq 0x1130
leaq 0x4d2(%rip), %rdi       # 0x22a0
leaq 0x4d3(%rip), %rsi       # 0x22a8
leaq 0x4df(%rip), %rcx       # 0x22bb
movl $0x14, %edx
callq 0x1130
leaq 0x501(%rip), %rdi       # 0x22ee
leaq 0x4b4(%rip), %rsi       # 0x22a8
leaq 0x4c0(%rip), %rcx       # 0x22bb
movl $0x1e, %edx
callq 0x1130
// File: /workspace/github_c_makefile_star2_O3/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 0x448c
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x451f
xorl %edi, %edi
testq %rbx, %rbx
setne %dil
leaq 0x164f(%rip), %rsi      # 0x5318
leaq 0x17ae(%rip), %rcx      # 0x547e
leaq 0x1651(%rip), %r8       # 0x5328
movl $0x11, %edx
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3d25
movq %rbx, %rdi
callq 0x44b6
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x161a(%rip), %rsi      # 0x5318
leaq 0x1779(%rip), %rcx      # 0x547e
leaq 0x162a(%rip), %r8       # 0x5336
movl $0x12, %edx
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3d25
movq %rbx, %rdi
popq %rbx
jmp 0x4527
callq 0x2e2b
// File: /workspace/github_c_makefile_star2_O3/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 0x448c
movq %rax, %rbx
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x21b0
movq %rax, %rbp
movl $0x1, %r13d
leaq 0x15bf(%rip), %r15      # 0x5318
leaq 0x171e(%rip), %r12      # 0x547e
movq %rax, %r14
cmpq $0x3e9, %r13            # imm = 0x3E9
je 0x3e17
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44ee
movq %rbx, %rdi
callq 0x44b6
movl %eax, %eax
xorl %edi, %edi
cmpq %rax, %r13
sete %dil
movq %r15, %rsi
movl $0x1f, %edx
movq %r12, %rcx
leaq 0x15ad(%rip), %r8       # 0x534d
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3e12
movq %rbx, %rdi
callq 0x44be
xorl %edi, %edi
cmpq %rbp, %rax
sete %dil
movq %r15, %rsi
movl $0x20, %edx
movq %r12, %rcx
leaq 0x1598(%rip), %r8       # 0x5366
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3e12
movq %rbx, %rdi
callq 0x44d6
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
movq %r15, %rsi
movl $0x21, %edx
movq %r12, %rcx
leaq 0x158a(%rip), %r8       # 0x5386
xorl %eax, %eax
callq 0x25cc
incq %r13
addq $0x4, %r14
testl %eax, %eax
jne 0x3d63
callq 0x2e2b
movq %rbx, %rdi
callq 0x4527
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_O3/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 0x448c
movq %rax, %rbx
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x21b0
movq %rax, %rbp
leaq (%r14,%rbp), %rsi
movq %rbx, %rdi
callq 0x44ee
addq $0x4, %r14
cmpq $0xfa0, %r14            # imm = 0xFA0
jne 0x3e5a
movl $0x3e7, %r13d           # imm = 0x3E7
leaq 0x1498(%rip), %r15      # 0x5318
leaq 0x15f7(%rip), %r12      # 0x547e
movq %rbp, %r14
movq %rbx, %rdi
callq 0x44be
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
movq %r15, %rsi
movl $0x33, %edx
movq %r12, %rcx
leaq 0x14f8(%rip), %r8       # 0x53a5
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3f18
movq %rbx, %rdi
callq 0x4515
movq %rbx, %rdi
callq 0x44b6
movl %eax, %eax
xorl %edi, %edi
cmpq %rax, %r13
sete %dil
movq %r15, %rsi
movl $0x35, %edx
movq %r12, %rcx
leaq 0x14e0(%rip), %r8       # 0x53c5
xorl %eax, %eax
callq 0x25cc
testl %eax, %eax
je 0x3f18
addq $0x4, %r14
addq $-0x1, %r13
jb 0x3e8a
movq %rbx, %rdi
callq 0x4527
movq %rbp, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
callq 0x2e2b
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x8, %edi
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x453c
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4598
movq (%rbx), %r14
movl $0x10, %edi
callq 0x21b0
movq %r15, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, (%rax)
movq %rax, (%r14)
incl 0x10(%rbx)
cmpq %r14, 0x8(%rbx)
jne 0x45bc
movq %rax, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x45d5
movq (%rbx), %r14
movq (%r14), %r15
testq %r15, %r15
je 0x460d
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x45ec
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 0x4607
movq %r14, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x17fa(%rip), %rdi      # 0x5e0e
leaq 0x1803(%rip), %rsi      # 0x5e1e
leaq 0x1821(%rip), %rcx      # 0x5e43
movl $0x4d, %edx
callq 0x2120
// File: /workspace/github_c_makefile_star2_O3/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), %r15
testq %r15, %r15
je 0x46d4
movq %r15, %r14
movq (%r15), %r15
cmpq (%rbx), %r14
je 0x46ca
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x46ca
movq 0x8(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x2030
jmp 0x46ab
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O3/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 0x2230
testq %rax, %rax
je 0x3920
popq %rcx
retq
callq 0x2a12
// File: /workspace/github_c_makefile_star2_O3/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 0x3932
popq %rcx
retq
callq 0x2a2a
// File: /workspace/github_c_makefile_star2_O3/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 0x3959
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2a42
// File: /workspace/github_c_makefile_star2_O3/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
movq %r14, %rsi
movl $0xa, %edx
callq 0x2200
movq (%r14), %rcx
cmpb $0x0, (%rcx)
jne 0x39b7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2a64
// File: /workspace/github_c_makefile_star2_O3/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 0x39d2
movq %rdx, %rdi
movl %eax, %edx
jmp 0x2090
movq %rsi, %rdi
movl %eax, %esi
jmp 0x21a0
// File: /workspace/github_c_makefile_star2_O3/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:
movq %rdx, %rax
movss (%rdi,%rcx,4), %xmm0
cmpq %rcx, %rdx
jge 0x3a4e
leaq -0x1(%rax), %rdx
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x3a3b
movss 0x4(%rdi,%rdx,4), %xmm2
movss %xmm1, 0x4(%rdi,%rdx,4)
movss %xmm2, (%rdi,%rax,4)
movq 0x8(%rsi,%rdx,8), %r8
movq (%rsi,%rax,8), %r9
movq %r9, 0x8(%rsi,%rdx,8)
incq %rdx
movq %r8, (%rsi,%rax,8)
incq %rax
cmpq %rax, %rcx
jne 0x3a0b
movss (%rdi,%rcx,4), %xmm0
incq %rdx
movq %rdx, %rax
movss (%rdi,%rax,4), %xmm1
movss %xmm0, (%rdi,%rax,4)
movss %xmm1, (%rdi,%rcx,4)
movq (%rsi,%rax,8), %rdx
movq (%rsi,%rcx,8), %rdi
movq %rdi, (%rsi,%rax,8)
movq %rdx, (%rsi,%rcx,8)
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: quickSort
void quickSort(float* pVal, uint64_t* pEnd,
    int64_t low, int64_t high) {
  if (low < high) {
    int64_t idx = partition(pVal, pEnd, low, high);
    quickSort(pVal, pEnd, low, idx - 1);
    quickSort(pVal, pEnd, idx + 1, high);
  }
}

// Assembly:
cmpq %rcx, %rdx
jge 0x3ac2
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x39fa
movq %rax, %r13
leaq -0x1(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3a6e
incq %r13
movq %r13, %r12
cmpq %rbx, %r13
jl 0x3a88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: lookup
float lookup(float* pVal, uint64_t low, uint64_t high,
    float* qVal, float p) {
  if (low == high)
    return qVal[low];
  uint64_t idx = (low + high) / 2;
  if (pVal[idx] == p)
    return qVal[idx];
  if (pVal[idx] > p)
    return lookup(pVal, low, idx - 1, qVal, p);
  return lookup(pVal, idx + 1, high, qVal, p);
}

// Assembly:
cmpq %rdx, %rsi
jne 0x3acd
movq %rsi, %rdx
jmp 0x3aff
leaq (%rdx,%rsi), %rax
shrq %rax
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x3ae0
jnp 0x3afc
jbe 0x3aef
decq %rax
movq %rax, %rdx
cmpq %rax, %rsi
jne 0x3acd
jmp 0x3ac8
incq %rax
movq %rax, %rsi
cmpq %rdx, %rax
jne 0x3acd
jmp 0x3aff
movq %rax, %rdx
movss (%rcx,%rdx,4), %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: jenkins_one_at_a_time_hash
uint32_t jenkins_one_at_a_time_hash(float f) {
  uint32_t hash = 0;
  unsigned char* p = (unsigned char*) &f;
  for (int i = 0; i < sizeof(float); i++) {
    hash += p[i];
    hash += hash << 10;
    hash ^= hash >> 6;
  }
  hash += hash << 3;
  hash ^= hash >> 11;
  hash += hash << 15;
  return hash % HASH_SIZE;
}

// Assembly:
movss %xmm0, -0x4(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
movzbl -0x4(%rsp,%rax), %edx
addl %ecx, %edx
movl %edx, %esi
shll $0xa, %esi
addl %edx, %esi
movl %esi, %ecx
shrl $0x6, %ecx
xorl %esi, %ecx
incq %rax
cmpq $0x4, %rax
jne 0x3db6
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0xf, %eax
addl %ecx, %eax
movl $0xccd8ec3d, %ecx       # imm = 0xCCD8EC3D
imulq %rax, %rcx
shrq $0x34, %rcx
imull $0x13fed1, %ecx, %ecx   # imm = 0x13FED1
subl %ecx, %eax
retq