LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_ADD_A_n
static inline void ASM_ADD_A_n(CPU* cpu, uint8_t* reg) {
    uint16_t result = cpu->A + *reg;
    CPU_setFlagZ(cpu, ((uint8_t) result) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, (((cpu->A & 0xF) + (*reg & 0xF)) & 0x10) == 0x10);
    CPU_setFlagC(cpu, result > 0xFF);
    cpu->A = (uint8_t) result;
    cpu->PC += 1;
}

// Assembly:
movzbl 0x3(%rdi), %edx
movzbl (%rsi), %eax
addl %edx, %eax
cmpw $0x100, %ax             # imm = 0x100
setae %cl
testb %al, %al
sete %r8b
movb 0x2(%rdi), %r9b
andb $0x3f, %r9b
shlb $0x7, %r8b
orb %r9b, %r8b
movb %r8b, 0x2(%rdi)
andb $0xf, %dl
movb (%rsi), %sil
andb $0xf, %sil
addb %dl, %sil
cmpb $0x10, %sil
setae %dl
andb $-0x71, %r8b
shlb $0x5, %dl
shlb $0x4, %cl
orb %dl, %cl
orb %r8b, %cl
movb %cl, 0x2(%rdi)
movb %al, 0x3(%rdi)
incw 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_ADD_A_m
static inline void ASM_ADD_A_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint16_t result = cpu->A + MEM_getByte(mem, address);
    CPU_setFlagZ(cpu, ((uint8_t) result) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, (((cpu->A & 0xF) + (MEM_getByte(mem, address) & 0xF)) & 0x10) == 0x10);
    CPU_setFlagC(cpu, result > 0xFF);
    cpu->A = (uint8_t) result;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x3(%rdi), %r12d
movq %rsi, %rdi
movl %edx, %esi
callq 0x6168
movzbl %al, %r15d
addl %r12d, %r15d
cmpw $0x100, %r15w           # imm = 0x100
setae %r12b
testb %r15b, %r15b
sete %al
movb 0x2(%rbx), %cl
movb 0x3(%rbx), %r13b
andb $0x3f, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rbx)
andb $0xf, %r13b
movq %r14, %rdi
movl %ebp, %esi
callq 0x6168
andb $0xf, %al
addb %r13b, %al
cmpb $0x10, %al
setae %al
movb 0x2(%rbx), %cl
andb $-0x31, %cl
shlb $0x5, %al
shlb $0x4, %r12b
orb %cl, %r12b
orb %al, %r12b
movb %r12b, 0x2(%rbx)
movb %r15b, 0x3(%rbx)
incw 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_ADC_A_n
static inline void ASM_ADC_A_n(CPU* cpu, uint8_t* reg) {
    int carry = CPU_getFlagC(cpu);
    uint16_t result = cpu->A + *reg + carry;
    CPU_setFlagZ(cpu, ((uint8_t) result) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, (((cpu->A & 0xF) + (*reg & 0xF) + (carry & 0xF)) & 0x10) == 0x10);
    CPU_setFlagC(cpu, result > 0xFF);
    cpu->A = (uint8_t) result;
    cpu->PC += 1;
}

// Assembly:
movzbl 0x2(%rdi), %r8d
movl %r8d, %ecx
shrl $0x4, %ecx
andl $0x1, %ecx
movzbl 0x3(%rdi), %r9d
movzbl (%rsi), %eax
addl %r9d, %eax
addl %ecx, %eax
cmpl $0x100, %eax            # imm = 0x100
setae %dl
testb %al, %al
sete %r10b
andb $0x3f, %r8b
shlb $0x7, %r10b
orb %r8b, %r10b
movb %r10b, 0x2(%rdi)
andb $0xf, %r9b
movb (%rsi), %sil
andb $0xf, %sil
addb %r9b, %sil
addb %cl, %sil
cmpb $0x10, %sil
setae %cl
andb $-0x71, %r10b
shlb $0x5, %cl
shlb $0x4, %dl
orb %cl, %dl
orb %r10b, %dl
movb %dl, 0x2(%rdi)
movb %al, 0x3(%rdi)
incw 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_ADC_A_m
static inline void ASM_ADC_A_m(CPU* cpu, Memory* mem, uint16_t address) {
    int carry = CPU_getFlagC(cpu);
    uint16_t result = cpu->A + MEM_getByte(mem, address) + carry;
    CPU_setFlagZ(cpu, ((uint8_t) result) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, (((cpu->A & 0xF) + (MEM_getByte(mem, address) & 0xF) + (carry & 0xF)) & 0x10) == 0x10);
    CPU_setFlagC(cpu, result > 0xFF);
    cpu->A = (uint8_t) result;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, 0x4(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x2(%rdi), %r12d
shrl $0x4, %r12d
andl $0x1, %r12d
movzbl 0x3(%rdi), %r13d
movq %rsi, %rdi
movl %edx, %esi
callq 0x6168
movzbl %al, %r15d
addl %r13d, %r15d
addl %r12d, %r15d
cmpl $0x100, %r15d           # imm = 0x100
setae %r13b
testb %r15b, %r15b
sete %al
movb 0x2(%rbx), %cl
movb 0x3(%rbx), %bpl
andb $0x3f, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rbx)
andb $0xf, %bpl
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x6168
andb $0xf, %al
addb %bpl, %al
addb %r12b, %al
cmpb $0x10, %al
setae %al
movb 0x2(%rbx), %cl
andb $-0x31, %cl
shlb $0x5, %al
shlb $0x4, %r13b
orb %cl, %r13b
orb %al, %r13b
movb %r13b, 0x2(%rbx)
movb %r15b, 0x3(%rbx)
incw 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_AND_n
static inline void ASM_AND_n(CPU* cpu, uint8_t* reg) {
    uint8_t result = cpu->A & *reg;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 1);
    CPU_setFlagC(cpu, 0);
    cpu->A = result;
    cpu->PC += 1;
}

// Assembly:
movb (%rsi), %al
andb %al, 0x3(%rdi)
sete %al
movb 0x2(%rdi), %cl
andb $0xf, %cl
shlb $0x7, %al
orb %cl, %al
orb $0x20, %al
movb %al, 0x2(%rdi)
incw 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_AND_m
static inline void ASM_AND_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t result = cpu->A & MEM_getByte(mem, address);
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 1);
    CPU_setFlagC(cpu, 0);
    cpu->A = result;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x3(%rdi), %bpl
movq %rsi, %rdi
movl %edx, %esi
callq 0x6168
andb %bpl, %al
sete %cl
movb 0x2(%rbx), %dl
andb $0xf, %dl
shlb $0x7, %cl
orb %dl, %cl
orb $0x20, %cl
movb %cl, 0x2(%rbx)
movb %al, 0x3(%rbx)
incw 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_XOR_n
static inline void ASM_XOR_n(CPU* cpu, uint8_t* reg) {
    uint8_t result = *reg ^ cpu->A;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, 0);
    cpu->A = result;
    cpu->PC += 1;
}

// Assembly:
movb (%rsi), %al
movb 0x2(%rdi), %cl
movb 0x3(%rdi), %dl
movl %edx, %esi
xorb %al, %sil
cmpb %dl, %al
sete %al
andb $0xf, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rdi)
movb %sil, 0x3(%rdi)
incw 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_OR_m
static inline void ASM_OR_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t result = MEM_getByte(mem, address) | cpu->A;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, 0);
    cpu->A = result;
    cpu->PC += 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6168
orb %al, 0x3(%rbx)
sete %al
movb 0x2(%rbx), %cl
andb $0xf, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rbx)
incw 0xc(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_RET_cc
static inline int ASM_RET_cc(CPU* cpu, Memory* mem, int ccCode) {
    int cond = 0;
    switch (ccCode) {
        case PARAM_CC_Z:
            cond = CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_NZ:
            cond = !CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_C:
            cond = CPU_getFlagC(cpu);
            break;
        case PARAM_CC_NC:
            cond = !CPU_getFlagC(cpu);
            break;
    }
    if (cond) {
        cpu->PC = MEM_popFromStack(mem, &(cpu->SP));
        return 1;
    } else {
        cpu->PC += 1;
        return 0;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzbl 0x2(%rdi), %eax
addl $-0x64, %edx
leaq 0x2a5c(%rip), %rcx      # 0x78c0
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
xorl %ecx, %ecx
testb %al, %al
setns %cl
jmp 0x4e7d
xorl %ecx, %ecx
testb $0x10, %al
sete %cl
movl %ecx, %eax
jmp 0x4e8c
shrl $0x4, %eax
andl $0x1, %eax
jmp 0x4e8c
shrl $0x7, %eax
testl %eax, %eax
je 0x4ea8
leaq 0xa(%rbx), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x62eb
movw %ax, 0xc(%rbx)
pushq $0x1
popq %rax
jmp 0x4eae
incw 0xc(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_CALL_cc_nn
static inline int ASM_CALL_cc_nn(CPU* cpu, Memory* mem, int ccCode) {
    int cond = 0;
    switch (ccCode) {
        case PARAM_CC_Z:
            cond = CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_NZ:
            cond = !CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_C:
            cond = CPU_getFlagC(cpu);
            break;
        case PARAM_CC_NC:
            cond = !CPU_getFlagC(cpu);
            break;
    }
    if (cond) {
        uint16_t jumpAddress = (MEM_getByte(mem, cpu->PC + 2) << 8) | MEM_getByte(mem, cpu->PC + 1);
        uint16_t nextAddress = cpu->PC + 3;
        MEM_pushToStack(mem, &(cpu->SP), nextAddress);
        cpu->PC = jumpAddress;
        return 1;
    } else {
        cpu->PC += 3;
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x2(%rdi), %eax
addl $-0x64, %edx
leaq 0x29cf(%rip), %rcx      # 0x78d0
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
xorl %ecx, %ecx
testb %al, %al
setns %cl
jmp 0x4f1a
xorl %ecx, %ecx
testb $0x10, %al
sete %cl
movl %ecx, %eax
jmp 0x4f29
shrl $0x4, %eax
andl $0x1, %eax
jmp 0x4f29
shrl $0x7, %eax
movzwl 0xc(%rbx), %ebp
testl %eax, %eax
je 0x4f7f
addl $0x2, %ebp
movl $0xffff, %r15d          # imm = 0xFFFF
andl %r15d, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x6168
movzbl %al, %r12d
shll $0x8, %r12d
movl 0xc(%rbx), %esi
incl %esi
andl %r15d, %esi
movq %r14, %rdi
callq 0x6168
movzbl %al, %ebp
orl %r12d, %ebp
movl 0xc(%rbx), %edx
addl $0x3, %edx
leaq 0xa(%rbx), %rsi
andl %r15d, %edx
movq %r14, %rdi
callq 0x62a4
pushq $0x1
popq %rax
jmp 0x4f84
addl $0x3, %ebp
xorl %eax, %eax
movw %bp, 0xc(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_RLC_n
static inline void ASM_RLC_n(CPU* cpu, uint8_t* reg) {
    uint8_t bit7 = getBit(*reg, 7);
    *reg = (*reg << 1) | bit7;
    CPU_setFlagZ(cpu, *reg == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit7);
    cpu->PC += 2;
}

// Assembly:
movb (%rsi), %al
movl %eax, %ecx
rolb %cl
movb %cl, (%rsi)
testb %al, %al
sete %cl
movb 0x2(%rdi), %dl
andb $0xf, %dl
shlb $0x7, %cl
shrb $0x3, %al
andb $0x10, %al
orb %cl, %al
orb %dl, %al
movb %al, 0x2(%rdi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_RRC_n
static inline void ASM_RRC_n(CPU* cpu, uint8_t* reg) {
    uint8_t bit0 = *reg & 1;
    *reg = (*reg >> 1) | (bit0 << 7);
    CPU_setFlagZ(cpu, *reg == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit0);
    cpu->PC += 2;
}

// Assembly:
movb (%rsi), %al
movl %eax, %ecx
rorb %cl
movb %cl, (%rsi)
testb %al, %al
sete %cl
movb 0x2(%rdi), %dl
andb $0xf, %dl
shlb $0x7, %cl
shlb $0x4, %al
andb $0x10, %al
orb %cl, %al
orb %dl, %al
movb %al, 0x2(%rdi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_SWAP_n
static inline void ASM_SWAP_n(CPU* cpu, uint8_t* reg) {
    *reg = (*reg << 4) | (*reg & 0xF0) >> 4;
    CPU_setFlagZ(cpu, *reg == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, 0);
    cpu->PC += 2;
}

// Assembly:
movb (%rsi), %al
movl %eax, %ecx
rolb $0x4, %cl
movb %cl, (%rsi)
testb %al, %al
sete %al
movb 0x2(%rdi), %cl
andb $0xf, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rdi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/asm.h
// Function: ASM_BIT_b_r
static inline void ASM_BIT_b_r(CPU* cpu, int bit, uint8_t* reg) {
    CPU_setFlagZ(cpu, !((*reg & (1 << bit)) >> bit));
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 1);
    cpu->PC += 2;
}

// Assembly:
movzbl (%rdx), %eax
movb 0x2(%rdi), %cl
btl %esi, %eax
setae %al
andb $0x1f, %cl
shlb $0x7, %al
orb %cl, %al
orb $0x20, %al
movb %al, 0x2(%rdi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/gpu.c
// Function: GPU_destroy
void GPU_destroy(GPU* gpu) {
    free(gpu->backgroundMap);
    gpu->backgroundMap = NULL;
    free(gpu->framebuffer);
    gpu->framebuffer = NULL;
    free(gpu);
    gpu = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x21b0
andq $0x0, 0x18(%rbx)
movq 0x8(%rbx), %rdi
callq 0x21b0
movq %rbx, %rdi
popq %rbx
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/joypad.c
// Function: JOY_update
void JOY_update(Joypad* joy, Memory* mem) {
    uint8_t* JOYP = &(mem->logicalMemory[REG_JOYP]);
    *JOYP |= 0xCF;

    if (!getBit(*JOYP, 5)) {
        // Action buttons
        if (joy->a) *JOYP = setBit(*JOYP, 0, 0);
        if (joy->b) *JOYP = setBit(*JOYP, 1, 0);
        if (joy->select) *JOYP = setBit(*JOYP, 2, 0);
        if (joy->start) *JOYP = setBit(*JOYP, 3, 0);
    }
    if (!getBit(*JOYP, 4)) {
        // Direction buttons
        if (joy->right) *JOYP = setBit(*JOYP, 0, 0);
        if (joy->left) *JOYP = setBit(*JOYP, 1, 0);
        if (joy->up) *JOYP = setBit(*JOYP, 2, 0);
        if (joy->down) *JOYP = setBit(*JOYP, 3, 0);
    }

    if ((*JOYP & 0xF) != 0xF) {
        // Request joypad interrupt
        mem->logicalMemory[REG_IF] |= 0x10;
    }
}

// Assembly:
movb 0xff00(%rsi), %cl
movl %ecx, %eax
orb $-0x31, %al
movb %al, 0xff00(%rsi)
testb $0x20, %cl
jne 0x5a78
cmpl $0x0, (%rdi)
je 0x5a4e
andb $-0x22, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0x4(%rdi)
je 0x5a5c
andb $-0x3, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0xc(%rdi)
je 0x5a6a
andb $-0x5, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0x8(%rdi)
je 0x5a78
andb $-0x9, %al
movb %al, 0xff00(%rsi)
testb $0x10, %al
jne 0x5ab4
cmpl $0x0, 0x1c(%rdi)
je 0x5a8a
andb $-0x12, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0x18(%rdi)
je 0x5a98
andb $-0x13, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0x10(%rdi)
je 0x5aa6
andb $-0x5, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0x14(%rdi)
je 0x5ab4
andb $-0x9, %al
movb %al, 0xff00(%rsi)
notb %al
testb $0xf, %al
je 0x5ac1
orb $0x10, 0xff0f(%rsi)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/main.c
// Function: quit
int quit(CPU* cpu, GPU* gpu, Memory* mem, Audio* audio, Timer* timer, Joypad* joy, int returnCode) {
    // Dump external RAM to save
    if (mem->battery) {
        char* saveFileName = malloc(strlen(mem->romPath) + 5); // freed at the end of this block
        snprintf(saveFileName, strlen(mem->romPath) + 5, "%s.sav", mem->romPath);
        FILE* file = fopen(saveFileName, "wb+");
        for (int i = 0; i < (mem->extRamBanksNo * 0x2000); ++i) {
            fputc(mem->extRamBanks[i], file);
        }
        fclose(file);
        free(saveFileName);
    }

    // Destroy components
    CPU_destroy(cpu);
    GPU_destroy(gpu);
    MEM_destroy(mem);
    AUD_destroy(audio);
    TIMER_destroy(timer);
    JOY_destroy(joy);

    return returnCode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, 0x20(%rsp)
movq %rdi, %rbp
movl 0x60(%rsp), %r14d
cmpl $0x0, 0x10040(%rdx)
je 0x604d
movq %r13, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq 0x10048(%r12), %r14
movq %r14, %rdi
callq 0x20c0
leaq 0x5(%rax), %r15
movq %r15, %rdi
callq 0x2200
movq %rax, %rbx
leaq 0x1a21(%rip), %rdx      # 0x79fa
xorl %r13d, %r13d
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2250
leaq 0x1a0e(%rip), %rsi      # 0x7a01
movq %rbx, %rdi
callq 0x21a0
movq %rax, %r14
movslq 0x10030(%r12), %rax
shlq $0xd, %rax
cmpq %rax, %r13
jge 0x6029
movq 0x10028(%r12), %rax
movzbl (%rax,%r13), %edi
movq %r14, %rsi
callq 0x21e0
incq %r13
jmp 0x5ffe
movq %r14, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x21b0
movq 0x18(%rsp), %rbx
movl 0x60(%rsp), %r14d
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r13
movq %rbp, %rdi
callq 0x2936
movq 0x20(%rsp), %rdi
callq 0x5282
movq %r12, %rdi
callq 0x6113
movq %r13, %rdi
callq 0x24f9
movq %r15, %rdi
callq 0x665c
movq %rbx, %rdi
callq 0x5a27
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/memory.c
// Function: MEM_destroy
void MEM_destroy(Memory* mem) {
    free(mem->cartridge);
    mem->cartridge = NULL;
    free(mem->romBanks);
    mem->romBanks = NULL;
    free(mem->extRamBanks);
    mem->extRamBanks = NULL;
    free(mem->romPath);
    mem->romPath = NULL;
    free(mem);
    mem = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10038(%rdi), %rdi
callq 0x21b0
andq $0x0, 0x10038(%rbx)
movq 0x10018(%rbx), %rdi
callq 0x21b0
andq $0x0, 0x10018(%rbx)
movq 0x10028(%rbx), %rdi
callq 0x21b0
andq $0x0, 0x10028(%rbx)
movq 0x10048(%rbx), %rdi
callq 0x21b0
movq %rbx, %rdi
popq %rbx
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/memory.c
// Function: MEM_getByte
uint8_t MEM_getByte(Memory* mem, uint16_t address) {
    if (address < OFFSET_ROMBANKN) {
        // ROM bank 0
        return mem->romBank0[address - OFFSET_ROMBANK0];

    } else if (address < OFFSET_VIDEORAM) {
        // ROM bank N
        return mem->romBankN[address - OFFSET_ROMBANKN];

    } else if (address >= OFFSET_EXTRAM && address < OFFSET_WORKRAMBANK0) {
        // External RAM
        return mem->extRamBanksNo != 0 && mem->extRamEnabled
            ? mem->extRam[address - OFFSET_EXTRAM]
            : 0xFF;

    } else {
        return mem->logicalMemory[address];
    }
}

// Assembly:
cmpw $0x3fff, %si            # imm = 0x3FFF
ja 0x617b
movzwl %si, %eax
addq 0x10000(%rdi), %rax
jmp 0x61d4
testw %si, %si
js 0x6195
movq 0x10008(%rdi), %rax
movzwl %si, %ecx
addq %rcx, %rax
addq $-0x4000, %rax          # imm = 0xC000
jmp 0x61d4
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpw $0xa000, %ax            # imm = 0xA000
jne 0x61cb
movb $-0x1, %al
cmpl $0x0, 0x10030(%rdi)
je 0x61d6
cmpb $0x1, 0x10034(%rdi)
jne 0x61d6
movq 0x10010(%rdi), %rax
movzwl %si, %ecx
addq %rcx, %rax
addq $-0xa000, %rax          # imm = 0xFFFF6000
jmp 0x61d4
movzwl %si, %eax
addq %rax, %rdi
movq %rdi, %rax
movb (%rax), %al
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/memory.c
// Function: MEM_setByte
void MEM_setByte(Memory* mem, uint16_t address, uint8_t value) {
    if ((address > 0xDFFF && address < 0xFE00) || (address > 0xFE9F && address < 0xFF00)) {
        //fprintf(stdout, "[MEM] warning: attempt to write to restricted address %04x\n", address);
    } else if (address < OFFSET_VIDEORAM) {
        // Handle MBC operations
        CART_mbcDispatch(mem, address, value);

    } else if (address >= OFFSET_EXTRAM && address < OFFSET_WORKRAMBANK0 && mem->extRamBanksNo != 0 && mem->extRamEnabled) {
        //printf("extram write %d\n", mem->extRamBanksNo);
        //getchar();
        // Set external RAM
        mem->extRam[address - OFFSET_EXTRAM] = value;

    } else if (address == REG_DIV) {
        // Reset the DIV register
        mem->logicalMemory[REG_DIV] = 0;

    } else if (address == REG_DMA) {
        // Initiate a DMA transfer
        MEM_dmaBegin(mem, value);
        mem->logicalMemory[address] = value;

    } else if (address == REG_TAC) {
        // Preserve last 3 bits only (set rest to 1)
        mem->logicalMemory[address] = 0xF8 | (value & 0x7);

    } else {
        mem->logicalMemory[address] = value;
    }
}

// Assembly:
leal 0x2000(%rsi), %eax
cmpw $0x1e00, %ax            # imm = 0x1E00
setb %al
leal 0x160(%rsi), %ecx
cmpw $0x60, %cx
setb %cl
orb %al, %cl
je 0x61f6
retq
testw %si, %si
js 0x6206
movzwl %si, %esi
movzbl %dl, %edx
jmp 0x2833
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpw $0xa000, %ax            # imm = 0xA000
jne 0x6239
cmpl $0x0, 0x10030(%rdi)
je 0x6239
cmpb $0x1, 0x10034(%rdi)
jne 0x6239
movq 0x10010(%rdi), %rax
movzwl %si, %ecx
andl $0x1fff, %ecx           # imm = 0x1FFF
movb %dl, (%rax,%rcx)
retq
cmpw $0xff46, %si            # imm = 0xFF46
je 0x6263
movzwl %si, %eax
cmpl $0xff07, %eax           # imm = 0xFF07
je 0x6259
cmpl $0xff04, %eax           # imm = 0xFF04
jne 0x6281
movb $0x0, 0xff04(%rdi)
retq
orb $-0x8, %dl
movb %dl, 0xff07(%rdi)
retq
movb %dl, 0x10054(%rdi)
movb $0x0, 0x10055(%rdi)
movl $0x1, 0x10050(%rdi)
movb %dl, 0xff46(%rdi)
retq
movb %dl, (%rdi,%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/memory.c
// Function: MEM_popFromStack
uint16_t MEM_popFromStack(Memory* mem, uint16_t* SP) {
    *SP += 2;
    uint8_t byteUpper = MEM_getByte(mem, *SP - 1);
    uint8_t byteLower = MEM_getByte(mem, *SP - 2);
    return (byteUpper << 8) | byteLower;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movzwl (%rsi), %r14d
leal 0x2(%r14), %eax
movw %ax, (%rsi)
leal 0x1(%r14), %eax
movzwl %ax, %esi
callq 0x6168
movl %eax, %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6168
movzbl %bpl, %ecx
shll $0x8, %ecx
movzbl %al, %eax
orl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/memory.c
// Function: MEM_setRomBank
void MEM_setRomBank(Memory* mem, uint8_t bankNo) {
    // Mask the bank number to the required no. of bits
    if (bankNo >= mem->romBanksNo) {
        unsigned int requiredBits = intlog2(mem->romBanksNo);
        uint8_t _mask = (0xFF << requiredBits) & 0xFF;
        uint8_t mask = ~_mask;
        bankNo &= mask;
    }

    mem->romBankN = mem->romBanks + (0x4000 * bankNo);
}

// Assembly:
movl 0x10020(%rdi), %eax
cmpl %esi, %eax
jg 0x65c3
testl %eax, %eax
je 0x65b2
xorl %ecx, %ecx
cmpl $0x1, %eax
je 0x65b5
jmp 0x65ab
shrl %eax
incl %ecx
cmpl $0x2, %eax
jae 0x65a7
jmp 0x65b5
pushq $-0x1
popq %rcx
movl $0xff, %eax
shll %cl, %eax
notb %al
andb %sil, %al
movl %eax, %esi
movzbl %sil, %eax
shll $0xe, %eax
addq 0x10018(%rdi), %rax
movq %rax, 0x10008(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/memory.c
// Function: MEM_dmaUpdate
void MEM_dmaUpdate(Memory* mem) {
    if (!mem->dmaInProgress) return;
    uint16_t sourceAddress = (mem->dmaAddressUpper << 8) | mem->dmaPosition;
    uint16_t destAddress = 0xFE00 | mem->dmaPosition;
    MEM_setByte(mem, destAddress, MEM_getByte(mem, sourceAddress));

    if (mem->dmaPosition == 0x9F) {
        mem->dmaPosition = 0x00;
        mem->dmaInProgress = 0;
    } else {
        ++(mem->dmaPosition);
    }
}

// Assembly:
cmpl $0x0, 0x10050(%rdi)
je 0x6657
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10054(%rdi), %eax
shll $0x8, %eax
movzbl 0x10055(%rdi), %ebp
orl %ebp, %eax
movzwl %ax, %esi
callq 0x6168
movzbl %al, %edx
orl $0xfe00, %ebp           # imm = 0xFE00
movq %rbx, %rdi
movl %ebp, %esi
callq 0x61d7
movb 0x10055(%rbx), %al
cmpb $-0x61, %al
jne 0x6649
movb $0x0, 0x10055(%rbx)
andl $0x0, 0x10050(%rbx)
jmp 0x6651
incb %al
movb %al, 0x10055(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qad114[P]yobeboy/src/timer.c
// Function: TIMER_update
void TIMER_update(CPU* cpu, Memory* mem, Timer* timer) {
    uint8_t* TIMA = &(mem->logicalMemory[REG_TIMA]);
    uint8_t TAC = mem->logicalMemory[REG_TAC];

    // Update DIV every 256 machine cycles
    if (timer->divCounter == 64) {//256) {
        timer->divCounter = 0;
        updateDiv(mem, timer);
    } else {
        ++(timer->divCounter);
    }

    // Update TIMA
    if (!getBit(TAC, 2)) {
        timer->timaCounter = 0;
        *TIMA = 0;
        return;
    }

    int interval = 0;
    switch (TAC & 0x3) {
        case 0: interval = 256; break;
        case 1: interval = 4; break;
        case 2: interval = 16; break;
        case 3: interval = 64; break;
    }

    //++(timer->timaCounter);
    if (timer->timaCounter >= interval) {
        timer->timaCounter = (timer->timaCounter - interval + 1);
        updateTima(mem, timer);
    } else {
        ++(timer->timaCounter);
    }
}

// Assembly:
movzbl 0xff07(%rsi), %eax
movl (%rdx), %ecx
cmpl $0x40, %ecx
jne 0x668c
andl $0x0, (%rdx)
movb 0xff04(%rsi), %cl
testb %cl, %cl
jne 0x6682
movb 0xff04(%rsi), %cl
incb %cl
movb %cl, 0xff04(%rsi)
jmp 0x6690
incl %ecx
movl %ecx, (%rdx)
testb $0x4, %al
jne 0x66a0
andl $0x0, 0x4(%rdx)
movb $0x0, 0xff05(%rsi)
retq
andl $0x3, %eax
leaq 0x1466(%rip), %r8       # 0x7b10
movl 0x4(%rdx), %ecx
movl %ecx, %edi
subl (%r8,%rax,4), %edi
jge 0x66bb
incl %ecx
movl %ecx, 0x4(%rdx)
retq
incl %edi
movl %edi, 0x4(%rdx)
movb 0xff05(%rsi), %al
cmpb $-0x1, %al
je 0x66ce
incb %al
jmp 0x66db
movb 0xff06(%rsi), %al
orb $0x4, 0xff0f(%rsi)
movb %al, 0xff05(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/eric-lo[P]3150/9-File/fileno.c
// Function: main
int main(void)
{
	printf("fd of stdin  = %d\n", fileno(stdin));
	printf("fd of stdout = %d\n", fileno(stdout));
	printf("fd of stderr = %d\n", fileno(stderr));
	printf("%d\n", fileno(fopen("/tmp/a.txt", "w")));
    
    int input;
    int counter = 0;
    while(1) {
        scanf("%d", &input);
        counter++;
        printf("counter = %d\n", counter);
        printf("%d\n", input);
    }

    
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x2e59(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x1040
leaq 0xe76(%rip), %rdi       # 0x2004
movl %eax, %esi
xorl %eax, %eax
callq 0x1030
movq 0x2e32(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
callq 0x1040
leaq 0xe6a(%rip), %rdi       # 0x2017
movl %eax, %esi
xorl %eax, %eax
callq 0x1030
movq 0x2e3b(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
callq 0x1040
leaq 0xe5e(%rip), %rdi       # 0x202a
movl %eax, %esi
xorl %eax, %eax
callq 0x1030
leaq 0xe61(%rip), %rdi       # 0x203d
leaq 0xe65(%rip), %rsi       # 0x2048
callq 0x1050
movq %rax, %rdi
callq 0x1040
leaq 0xe1c(%rip), %rbx       # 0x2013
movq %rbx, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1030
pushq $0x1
popq %rbp
leaq 0xe3d(%rip), %r14       # 0x204a
leaq 0xc(%rsp), %r15
leaq 0xe34(%rip), %r12       # 0x204d
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
movq %r12, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1030
movl 0xc(%rsp), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1030
incl %ebp
jmp 0x1219
// File: /workspace/github_c_makefile_star2_O2/jwang11[P]intel_avx_perf/matrix_float.c
// Function: init
void init(void) {
  srand(time(0));
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      mat[i][j] = (float)(rand() % 1000) / 300.0f;
    }   
  }
  for (int j = 0; j < col; j++) {
    mutiplier[j] = (float)(rand() % 1000) / 300.0f;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1070
movl %eax, %edi
callq 0x1060
leaq 0x2ec6(%rip), %r14      # 0x4070
movl $0x3e8, %ebp            # imm = 0x3E8
cmpq $0x40, %rbx
je 0x11ec
xorl %r15d, %r15d
cmpq $0x400, %r15            # imm = 0x400
je 0x11e0
callq 0x1080
cltd
idivl %ebp
vcvtsi2ss %edx, %xmm1, %xmm0
vdivss 0xe2f(%rip), %xmm0, %xmm0 # 0x2004
vmovss %xmm0, (%r14,%r15,4)
incq %r15
jmp 0x11b8
incq %rbx
addq $0x1000, %r14           # imm = 0x1000
jmp 0x11af
xorl %ebx, %ebx
movl $0x3e8, %ebp            # imm = 0x3E8
leaq 0x42e76(%rip), %r14     # 0x44070
cmpq $0x1000, %rbx           # imm = 0x1000
je 0x1223
callq 0x1080
cltd
idivl %ebp
vcvtsi2ss %edx, %xmm1, %xmm0
vdivss 0xded(%rip), %xmm0, %xmm0 # 0x2004
vmovss %xmm0, (%rbx,%r14)
addq $0x4, %rbx
jmp 0x11fa
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jwang11[P]intel_avx_perf/matrix_float.c
// Function: calc_non
void calc_non(void) {
  for(int j = 0; j < row; j++) {
    float sum = 0;
    float *vec = mat[j];

    for(int i = 0; i < col; i++)
      sum += vec[i] * mutiplier[i];

    result[j] = sum;
  }
}

// Assembly:
leaq 0x2e3b(%rip), %rax      # 0x4070
xorl %ecx, %ecx
leaq 0x43e32(%rip), %rdx     # 0x45070
leaq 0x42e2b(%rip), %rsi     # 0x44070
cmpq $0x40, %rcx
je 0x127b
vxorps %xmm0, %xmm0, %xmm0
xorl %edi, %edi
cmpq $0x1000, %rdi           # imm = 0x1000
je 0x126b
vmovss (%rax,%rdi), %xmm1
vfmadd231ss (%rdi,%rsi), %xmm1, %xmm0 # xmm0 = (xmm1 * mem) + xmm0
addq $0x4, %rdi
jmp 0x1251
vmovss %xmm0, (%rdx,%rcx,4)
incq %rcx
addq $0x1000, %rax           # imm = 0x1000
jmp 0x1245
retq
// File: /workspace/github_c_makefile_star2_O2/jwang11[P]intel_avx_perf/matrix_float.c
// Function: calc_avx2
void calc_avx2(void) {
  #define VLEN (256/8/sizeof(float))

  const int col_aligned = col - col % VLEN;
  float *f_arr;

  __m256 op0, op1;
  volatile __m256 tgt;

  for (int i = 0; i < row; i++) {
    float sum = 0;

    tgt = _mm256_setzero_ps();
    for (int j = 0; j < col_aligned; j += VLEN) {
      op0 = _mm256_load_ps(&mutiplier[j]);
      op1 = _mm256_load_ps(&mat[i][j]);
      tgt = _mm256_fmadd_ps(op0, op1, tgt);
    }

    f_arr = (float *)&tgt;
    for (int k = 0; k < VLEN; k++)
      sum += f_arr[k];

    for (int l = col_aligned; l < col; l++)
      sum += mat[i][l] * mutiplier[l];

    result[i] = sum;
  }
  #undef VLEN
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x20, %rsp
subq $0x40, %rsp
leaq 0x2de1(%rip), %rax      # 0x4070
xorl %ecx, %ecx
vxorps %xmm0, %xmm0, %xmm0
leaq 0x42dd4(%rip), %rdx     # 0x44070
leaq 0x43dcd(%rip), %rsi     # 0x45070
cmpq $0x40, %rcx
je 0x1302
vmovaps %ymm0, (%rsp)
movq %rdx, %rdi
xorl %r8d, %r8d
cmpq $0x400, %r8             # imm = 0x400
jae 0x12dc
vmovaps (%rdi), %ymm1
vmovaps (%rax,%r8,4), %ymm2
vfmadd213ps (%rsp), %ymm1, %ymm2 # ymm2 = (ymm1 * ymm2) + mem
vmovaps %ymm2, (%rsp)
addq $0x8, %r8
addq $0x20, %rdi
jmp 0x12b4
vxorps %xmm1, %xmm1, %xmm1
xorl %edi, %edi
cmpq $0x8, %rdi
je 0x12f2
vaddss (%rsp,%rdi,4), %xmm1, %xmm1
incq %rdi
jmp 0x12e2
vmovss %xmm1, (%rsi,%rcx,4)
incq %rcx
addq $0x1000, %rax           # imm = 0x1000
jmp 0x12a3
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O2/jwang11[P]intel_avx_perf/matrix_float.c
// Function: calc_avx512
void calc_avx512(void) {
  #define VLEN (512/8/sizeof(float))

  const int col_aligned = col - col % VLEN;
  float *f_arr;
  __m512 op0, op1;
  volatile __m512 tgt;

  for (int i = 0; i < row; i++) {
    float sum = 0;

    tgt = _mm512_setzero_ps();
    for (int j = 0; j < col_aligned; j += VLEN) {
      op0 = _mm512_load_ps(&mutiplier[j]);
      op1 = _mm512_load_ps(&mat[i][j]);
      tgt = _mm512_fmadd_ps(op0, op1, tgt);
    }

    f_arr = (float *)&tgt;
    for (int k = 0; k < VLEN; k++)
      sum += f_arr[k];

    for (int l = col_aligned; l < col; l++)
      sum += mat[i][l] * mutiplier[l];

    result[i] = sum;
  }
  #undef VLEN
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x40, %rsp
subq $0x80, %rsp
leaq 0x2d50(%rip), %rax      # 0x4070
xorl %ecx, %ecx
vxorps %xmm0, %xmm0, %xmm0
leaq 0x42d43(%rip), %rdx     # 0x44070
leaq 0x43d3c(%rip), %rsi     # 0x45070
cmpq $0x40, %rcx
je 0x139b
vmovaps %zmm0, (%rsp)
movq %rdx, %rdi
xorl %r8d, %r8d
cmpq $0x400, %r8             # imm = 0x400
jae 0x1375
vmovaps (%rdi), %zmm1
vmovaps (%rax,%r8,4), %zmm2
vfmadd213ps (%rsp), %zmm1, %zmm2 # zmm2 = (zmm1 * zmm2) + mem
vmovaps %zmm2, (%rsp)
addq $0x10, %r8
addq $0x40, %rdi
jmp 0x1347
vxorps %xmm1, %xmm1, %xmm1
xorl %edi, %edi
cmpq $0x10, %rdi
je 0x138b
vaddss (%rsp,%rdi,4), %xmm1, %xmm1
incq %rdi
jmp 0x137b
vmovss %xmm1, (%rsi,%rcx,4)
incq %rcx
addq $0x1000, %rax           # imm = 0x1000
jmp 0x1334
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/main.c
// Function: prompt
void		prompt(void)
{
  char		*dir;
  static int	i = 0;

  dir = getcwd((char *)NULL, 0);
  my_printf("(%s %d)> ", dir, i);
  i += 1;
  free(dir);
}

// Assembly:
pushq %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x20c0
movq %rax, %rbx
movl 0x8ef5(%rip), %edx      # 0xb1f4
leaq 0x4cfe(%rip), %rdi      # 0x7004
movq %rax, %rsi
xorl %eax, %eax
callq 0x5648
incl 0x8ede(%rip)            # 0xb1f4
movq %rbx, %rdi
popq %rbx
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias.c
// Function: get_my_alias
char		**get_my_alias()
{
  int		i;
  int		j;
  char		*txt;
  char		**alias;
  char		**valid_tab;

  i = 0;
  j = 0;
  txt = my_strdup(MY_ALIAS);
  if ((alias = my_str_to_wordtab(txt, '\n')) == NULL)
    return (NULL);
  if ((valid_tab = malloc(sizeof(char *) * ((my_tablen(alias)) + 1))) == NULL)
    return (NULL);
  while (alias[i] != NULL)
    {
      if ((my_find_str(alias[i], "alias ") == 1))
	valid_tab[j++] = my_strdup(alias[i]);
      i += 1;
    }
  valid_tab[j] = NULL;
  free_all(txt, alias);
  return (valid_tab);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4be0(%rip), %rdi      # 0x700e
callq 0x4960
movq %rax, %rbx
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x4889
testq %rax, %rax
je 0x24a7
movq %rax, %r14
movq %rax, %rdi
callq 0x43d0
cltq
leaq 0x8(,%rax,8), %rdi
callq 0x2130
xorl %ebp, %ebp
testq %rax, %rax
je 0x24a7
movq %rax, %r15
movq %rbx, (%rsp)
leaq 0x4b9e(%rip), %r12      # 0x7013
movq %r14, %r13
movq (%r13), %rdi
movslq %ebp, %rbx
testq %rdi, %rdi
je 0x24ac
movq %r12, %rsi
callq 0x4330
cmpl $0x1, %eax
jne 0x24a1
movq (%r13), %rdi
callq 0x4960
leal 0x1(%rbx), %ebp
movq %rax, (%r15,%rbx,8)
addq $0x8, %r13
jmp 0x2478
xorl %r15d, %r15d
jmp 0x24bd
andq $0x0, (%r15,%rbx,8)
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x436b
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias.c
// Function: cut_alias
char		**cut_alias(char **tab)
{
  int		i;
  int		j;
  char		**alias;
  char		buffer[2];

  if ((alias = malloc(sizeof(char *) * ((my_tablen(tab)) + 1))) == NULL)
    return (NULL);
  i = 0;
  buffer[1] = '\0';
  while (tab[i] != NULL)
    {
      j = 0;
      alias[i] = NULL;
      while (tab[i][j] != ' ')
	j += 1;
      while (tab[i][++j] != '=')
	{
	  buffer[0] = tab[i][j];
	  alias[i] = my_strcat(alias[i], buffer, 1);
	}
      i += 1;
    }
  alias[i] = NULL;
  return (alias);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x43d0
cltq
leaq 0x8(,%rax,8), %rdi
callq 0x2130
movq %rax, %r14
testq %rax, %rax
je 0x255d
leaq 0x6(%rsp), %r15
movb $0x0, 0x1(%r15)
xorl %r12d, %r12d
pushq $0x1
popq %rbp
movq (%rbx,%r12,8), %rcx
andq $0x0, (%r14,%r12,8)
testq %rcx, %rcx
je 0x255d
pushq $0x1
popq %rax
pushq $-0x1
popq %rdx
cmpb $0x20, 0x1(%rcx,%rdx)
movq %rax, %r13
leaq 0x1(%rdx), %rdx
leaq 0x1(%rax), %rax
jne 0x251d
xorl %eax, %eax
movb (%rcx,%r13), %cl
cmpb $0x3d, %cl
je 0x2558
movb %cl, 0x6(%rsp)
movq %rax, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x4abc
movq %rax, (%r14,%r12,8)
movq (%rbx,%r12,8), %rcx
incq %r13
jmp 0x2531
incq %r12
jmp 0x2509
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias.c
// Function: cut_commands
char		**cut_commands(char **tab)
{
  int		i;
  int		j;
  char		**commands;
  char		buffer[2];

  if ((commands = malloc(sizeof(char *) * ((my_tablen(tab)) + 1))) == NULL)
    return (NULL);
  i = 0;
  buffer[1] = '\0';
  while (tab[i] != NULL)
    {
      j = 0;
      commands[i] = NULL;
      while (tab[i][j] != '\'')
	j += 1;
      while (tab[i][++j] != '\'')
	{
	  buffer[0] = tab[i][j];
	  commands[i] = my_strcat(commands[i], buffer, 1);
	}
      i += 1;
    }
  commands[i] = NULL;
  return (commands);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x43d0
cltq
leaq 0x8(,%rax,8), %rdi
callq 0x2130
movq %rax, %r14
testq %rax, %rax
je 0x25fd
leaq 0x6(%rsp), %r15
movb $0x0, 0x1(%r15)
xorl %r12d, %r12d
pushq $0x1
popq %rbp
movq (%rbx,%r12,8), %rcx
andq $0x0, (%r14,%r12,8)
testq %rcx, %rcx
je 0x25fd
pushq $0x1
popq %rax
pushq $-0x1
popq %rdx
cmpb $0x27, 0x1(%rcx,%rdx)
movq %rax, %r13
leaq 0x1(%rdx), %rdx
leaq 0x1(%rax), %rax
jne 0x25bd
xorl %eax, %eax
movb (%rcx,%r13), %cl
cmpb $0x27, %cl
je 0x25f8
movb %cl, 0x6(%rsp)
movq %rax, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x4abc
movq %rax, (%r14,%r12,8)
movq (%rbx,%r12,8), %rcx
incq %r13
jmp 0x25d1
incq %r12
jmp 0x25a9
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias.c
// Function: create_new_command
char		**create_new_command(char **commands, char **alias,
				     t_info_shell *shell, int size)
{
  t_count	ct;
  char		**new_tab;
  char		**tmp;

  (1 == 1) ? (ct.i = 0, ct.j = 0, ct.k = 0) : 1;
  if ((new_tab= malloc(sizeof(char *) * size)) == NULL)
    return (NULL);
  while (shell->tab[ct.i] != NULL)
    {
      ct.l = -1;
      while (alias[++ct.l] != NULL)
	{
	  if (((my_strcmp(shell->tab[ct.i], alias[ct.l])) == 0) && ++ct.i)
	    {
	      tmp = my_str_to_wordtab(commands[ct.l], ' ');
	      while (tmp[ct.k] != NULL)
		new_tab[ct.j++] = my_strdup(tmp[ct.k++]);
	    }
	}
      new_tab[ct.j++] = my_strdup(shell->tab[ct.i++]);
      if (new_tab[ct.j - 1] == NULL)
	break ;
    }
  (1 == 1) ? (new_tab[ct.j] = NULL, free_all(NULL, tmp)) : 1;
  return (new_tab);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movslq %ecx, %rdi
shlq $0x3, %rdi
callq 0x2130
movq %rax, %rbx
testq %rax, %rax
je 0x2751
movq %r12, 0x28(%rsp)
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %rbx, 0x18(%rsp)
movq 0x18(%r14), %rax
movslq %ebp, %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x273d
pushq $-0x1
popq %r12
movl %ebp, %eax
movl %eax, 0x8(%rsp)
movslq %eax, %rbp
movq 0x8(%r15,%r12,8), %rsi
movq 0x18(%r14), %rax
movslq %r13d, %rbx
testq %rsi, %rsi
je 0x2710
movq (%rax,%rbp,8), %rdi
callq 0x43a1
incq %r12
testl %eax, %eax
jne 0x2675
movl 0x8(%rsp), %ebp
movl $0x0, %eax
incl %ebp
je 0x266e
movq 0x28(%rsp), %rax
movq (%rax,%r12,8), %rdi
pushq $0x20
popq %rsi
callq 0x4889
movslq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
leaq (%rcx,%rbx,8), %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x20(%rsp)
leaq (%rax,%rdx,8), %rax
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x26fc
callq 0x4960
movq 0x30(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
jmp 0x26db
addl %ebx, %r13d
movq 0x10(%rsp), %rax
addl %ebx, %eax
movq %rax, 0x10(%rsp)
jmp 0x266c
movl 0x8(%rsp), %r12d
incl %r12d
movq (%rax,%rbp,8), %rdi
callq 0x4960
leal 0x1(%rbx), %r13d
movq 0x18(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
movq %rcx, %rbx
movl %r12d, %ebp
testq %rax, %rax
jne 0x2656
movslq %r13d, %rax
andq $0x0, (%rbx,%rax,8)
xorl %edi, %edi
movq 0x20(%rsp), %rsi
callq 0x436b
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias.c
// Function: recognize_my_alias
int		recognize_my_alias(char **commands,
				   char **alias, t_info_shell *shell)
{
  int		i;
  int		j;
  int		size;

  i = -1;
  size = (my_tablen(shell->tab) + my_tablen(commands)) + 1;
  while (shell->tab[++i] != NULL)
    {
      j = -1;
      while (alias[++j] != NULL)
	{
	  if ((my_strcmp(shell->tab[i], alias[j])) == 0)
	    {
	      if (my_tablen(shell->tab) != 1)
		shell->tab = create_new_command(commands, alias, shell, size);
	      else
		{
		  free_all(NULL, shell->tab);
		  shell->tab = my_str_to_wordtab(commands[j], ' ');
		}
	      return (0);
	    }
	}
    }
  return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdx), %rdi
callq 0x43d0
movl %eax, %r12d
movq %r14, %rdi
callq 0x43d0
addl %r12d, %eax
incl %eax
movl %eax, 0x4(%rsp)
pushq $-0x1
popq %rbp
pushq $0x1
popq %r12
movq 0x18(%rbx), %rax
cmpq $0x0, 0x8(%rax,%rbp,8)
je 0x280c
incq %rbp
xorl %r13d, %r13d
movq (%r15,%r13), %rsi
testq %rsi, %rsi
je 0x279b
movq 0x18(%rbx), %rax
movq (%rax,%rbp,8), %rdi
callq 0x43a1
addq $0x8, %r13
testl %eax, %eax
jne 0x27ad
movq 0x18(%rbx), %rdi
callq 0x43d0
cmpl $0x1, %eax
jne 0x27f3
movq 0x18(%rbx), %rsi
xorl %edi, %edi
callq 0x436b
movq -0x8(%r14,%r13), %rdi
pushq $0x20
popq %rsi
callq 0x4889
jmp 0x2805
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl 0x4(%rsp), %ecx
callq 0x260f
movq %rax, 0x18(%rbx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias_detection.c
// Function: create_my_alias
int		create_my_alias(t_info_shell *shell)
{
  char		*new_alias;

  if (alias_check(shell) == 0)
    {
      new_alias = create_valid_alias(shell->tab);
      if (shell->alias_value == 0)
	shell->alias_tab = add_new_alias(shell->alias_tab, new_alias);
      shell->alias_value = 0;
    }
  return (0);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2960
testl %eax, %eax
jne 0x2850
movq 0x18(%rbx), %rdi
callq 0x29f0
cmpl $0x0, 0x44(%rbx)
jne 0x284c
movq 0x30(%rbx), %rdi
movq %rax, %rsi
callq 0x2a82
movq %rax, 0x30(%rbx)
andl $0x0, 0x44(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias_detection.c
// Function: replace_existing_alias
int		replace_existing_alias(char *new_alias, t_info_shell *shell)
{
  char		**alias;
  int		i;

  i = 0;
  alias = cut_alias(shell->alias_tab);
  while (alias[i] != NULL)
    {
      if (my_strcmp(alias[i], new_alias) == 0)
	{
	  shell->alias_tab[i] = my_strdup(create_valid_alias(shell->tab));
	  shell->alias_value = 1;
	}
      i += 1;
    }
  free_all(NULL, alias);
  return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rsi), %rdi
callq 0x24cf
movq %rax, %r15
xorl %r12d, %r12d
movq (%r15,%r12), %rdi
testq %rdi, %rdi
je 0x28ac
movq %r14, %rsi
callq 0x43a1
testl %eax, %eax
jne 0x28a6
movq 0x18(%rbx), %rdi
callq 0x29f0
movq %rax, %rdi
callq 0x4960
movq 0x30(%rbx), %rcx
movq %rax, (%rcx,%r12)
movl $0x1, 0x44(%rbx)
addq $0x8, %r12
jmp 0x2871
xorl %edi, %edi
movq %r15, %rsi
callq 0x436b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/alias_detection.c
// Function: my_alias
int		my_alias(t_info_shell *shell)
{
  char		**alias;
  char		**commands;

  if (((alias = cut_alias(shell->alias_tab)) == NULL)
      || ((commands = cut_commands(shell->alias_tab)) == NULL))
    return (84);
  if ((my_strcmp(shell->tab[0], "alias") == 0)
      && (shell->tab[1] != NULL)
      && (shell->tab[2] != NULL))
    replace_existing_alias(shell->tab[1], shell);
  recognize_my_alias(commands, alias, shell);
  free_all(NULL, alias);
  free_all(NULL, commands);
  return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x30(%rdi), %rdi
callq 0x24cf
pushq $0x54
popq %r12
testq %rax, %rax
je 0x2931
movq %rax, %rbx
movq 0x30(%r14), %rdi
callq 0x256f
testq %rax, %rax
je 0x2931
movq %rax, %r15
movq 0x18(%r14), %rax
movq (%rax), %rdi
leaq 0x4717(%rip), %rsi      # 0x701a
callq 0x43a1
testl %eax, %eax
je 0x2940
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2763
xorl %r12d, %r12d
xorl %edi, %edi
movq %rbx, %rsi
callq 0x436b
xorl %edi, %edi
movq %r15, %rsi
callq 0x436b
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x18(%r14), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x290c
cmpq $0x0, 0x10(%rax)
je 0x290c
movq %r14, %rsi
callq 0x2854
jmp 0x290c
nop
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/create_alias.c
// Function: alias_check
int		alias_check(t_info_shell *shell)
{
  if (my_tablen(shell->tab) == 1)
    {
      my_printf("%t", shell->alias_tab);
      return (1);
    }
  if (my_tablen(shell->tab) == 2)
    return (1);
  if ((my_strcmp(shell->tab[0], shell->tab[1]) == 0) && (shell->tab[2] != NULL))
    {
      my_printf("%s", ALIAS_ERROR);
      return (1);
    }
  if ((my_strcmp(shell->tab[0], shell->tab[1]) == 0))
    return (1);
  return (0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
callq 0x43d0
cmpl $0x1, %eax
jne 0x298c
movq 0x30(%r14), %rsi
leaq 0x46a0(%rip), %rdi      # 0x7020
xorl %eax, %eax
callq 0x5648
pushq $0x1
popq %rbx
jmp 0x29e6
movq 0x18(%r14), %rdi
callq 0x43d0
pushq $0x1
popq %rbx
cmpl $0x2, %eax
je 0x29e6
movq 0x18(%r14), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x43a1
movq 0x18(%r14), %rcx
testl %eax, %eax
je 0x29ca
movq (%rcx), %rdi
movq 0x8(%rcx), %rsi
callq 0x43a1
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
jmp 0x29e6
cmpq $0x0, 0x10(%rcx)
je 0x29b5
leaq 0x4810(%rip), %rdi      # 0x71e8
leaq 0x4644(%rip), %rsi      # 0x7023
xorl %eax, %eax
callq 0x5648
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/create_alias.c
// Function: create_valid_alias
char		*create_valid_alias(char **tab)
{
  int		i;
  char		*command;

  i = 2;
  command = NULL;
  command = my_strcat(my_strcat(my_strcat(tab[0], " ", 2), tab[1], 2), "='", 1);
  while (tab[i] != NULL)
    {
      if (i != 2)
	command = my_strcat(command, " ", 1);
      command = my_strcat(command, tab[i], 1);
      i += 1;
    }
  command = my_strcat(command, "'\0", 2);
  return (command);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x4608(%rip), %r14      # 0x700c
pushq $0x2
popq %rbp
movq %r14, %rsi
movl %ebp, %edx
callq 0x4abc
movq 0x8(%rbx), %rsi
movq %rax, %rdi
movl %ebp, %edx
callq 0x4abc
leaq 0x4622(%rip), %rsi      # 0x7048
pushq $0x1
popq %rbp
movq %rax, %rdi
movl %ebp, %edx
callq 0x4abc
xorl %r15d, %r15d
movq 0x10(%rbx,%r15,8), %rsi
testq %rsi, %rsi
je 0x2a66
testq %r15, %r15
je 0x2a57
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x4abc
movq 0x10(%rbx,%r15,8), %rsi
movq %rax, %rdi
movl %ebp, %edx
callq 0x4abc
incq %r15
jmp 0x2a36
leaq 0x45de(%rip), %rsi      # 0x704b
pushq $0x2
popq %rdx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4abc
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/my_alias/create_alias.c
// Function: add_new_alias
char		**add_new_alias(char **tab, char *command)
{
  int		i;
  char		**new_tab;

  i = 0;
  if ((new_tab = malloc(sizeof(char *) * ((my_tablen(tab) + 1) + 1))) == NULL)
    return (NULL);
  while (tab[i] != NULL)
    {
      new_tab[i] = my_strdup(tab[i]);
      i += 1;
    }
  new_tab[i] = my_strdup(command);
  new_tab[i + 1] = NULL;
  free_all(command, tab);
  return (new_tab);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x43d0
cltq
leaq 0x10(,%rax,8), %rdi
callq 0x2130
movq %rax, %r15
testq %rax, %rax
je 0x2ae4
xorl %r12d, %r12d
movq (%rbx,%r12), %rdi
testq %rdi, %rdi
je 0x2ac7
callq 0x4960
movq %rax, (%r15,%r12)
addq $0x8, %r12
jmp 0x2aaf
movq %r14, %rdi
callq 0x4960
movq %rax, (%r15,%r12)
andq $0x0, 0x8(%r15,%r12)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x436b
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/MaxenceEpitech[P]42sh/builtin/my_cd.c
// Function: cd_minus
int		cd_minus(char *path, char **dir, char **save)
{
  if ((my_strcmp(path, "-") == 0))
    {
      if (*dir != NULL)
	{
	  *save = getcwd((char *)NULL, 0);
	  chdir(*dir);
	}
      else
	my_printf("%s", CD_DIR);
      *dir = *save;
      return (0);
    }
  return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
leaq 0x4516(%rip), %rsi      # 0x706a
callq 0x43a1
testl %eax, %eax
je 0x2b62
pushq $0x1
popq %rax
jmp 0x2b9b
cmpq $0x0, (%rbx)
je 0x2b7e
xorl %edi, %edi
xorl %esi, %esi
callq 0x20c0
movq %rax, (%r14)
movq (%rbx), %rdi
callq 0x2090
jmp 0x2b93
leaq 0x4663(%rip), %rdi      # 0x71e8
leaq 0x44e0(%rip), %rsi      # 0x706c
xorl %eax, %eax
callq 0x5648
movq (%r14), %rax
movq %rax, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq