LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x6a94
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_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_CP_m
static inline void ASM_CP_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, 1);
    CPU_setFlagH(cpu, (((cpu->A & 0xF) - (MEM_getByte(mem, address) & 0xF)) & 0x10) != 0);
    CPU_setFlagC(cpu, result > cpu->A);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movb 0x3(%rdi), %r15b
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
subb %al, %r15b
setne %al
movb 0x2(%rbx), %cl
movb 0x3(%rbx), %r12b
andb $0x3f, %cl
shlb $0x7, %al
orb %cl, %al
addb $-0x40, %al
movb %al, 0x2(%rbx)
andb $0xf, %r12b
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
andb $0xf, %al
subb %al, %r12b
movb 0x2(%rbx), %al
andb $-0x31, %al
addb %r12b, %r12b
andb $0x20, %r12b
orb %al, %r12b
cmpb 0x3(%rbx), %r15b
seta %al
shlb $0x4, %al
orb %r12b, %al
movb %al, 0x2(%rbx)
incw 0xc(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x36a4(%rip), %rcx      # 0x8898
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
xorl %ecx, %ecx
testb %al, %al
setns %cl
jmp 0x520d
xorl %ecx, %ecx
testb $0x10, %al
sete %cl
movl %ecx, %eax
jmp 0x521c
shrl $0x4, %eax
andl $0x1, %eax
jmp 0x521c
shrl $0x7, %eax
testl %eax, %eax
je 0x523a
leaq 0xa(%rbx), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x6c12
movw %ax, 0xc(%rbx)
movl $0x1, %eax
jmp 0x5240
incw 0xc(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x35fc(%rip), %rcx      # 0x88a8
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
xorl %ecx, %ecx
testb %al, %al
setns %cl
jmp 0x52c5
xorl %ecx, %ecx
testb $0x10, %al
sete %cl
movl %ecx, %eax
jmp 0x52d4
shrl $0x4, %eax
andl $0x1, %eax
jmp 0x52d4
shrl $0x7, %eax
movzwl 0xc(%rbx), %ebp
testl %eax, %eax
je 0x532c
addl $0x2, %ebp
movl $0xffff, %r15d          # imm = 0xFFFF
andl %r15d, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
movzbl %al, %r12d
shll $0x8, %r12d
movl 0xc(%rbx), %esi
incl %esi
andl %r15d, %esi
movq %r14, %rdi
callq 0x6a94
movzbl %al, %ebp
orl %r12d, %ebp
movl 0xc(%rbx), %edx
addl $0x3, %edx
leaq 0xa(%rbx), %rsi
andl %r15d, %edx
movq %r14, %rdi
callq 0x6bcb
movl $0x1, %eax
jmp 0x5331
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_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_CALL_nn
static inline void ASM_CALL_nn(CPU* cpu, Memory* mem) {
    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;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rdi), %esi
addl $0x2, %esi
movl $0xffff, %ebp           # imm = 0xFFFF
andl %ebp, %esi
movq %r14, %rdi
callq 0x6a94
movzbl %al, %r15d
shll $0x8, %r15d
movl 0xc(%rbx), %esi
incl %esi
andl %ebp, %esi
movq %r14, %rdi
callq 0x6a94
movzbl %al, %r12d
orl %r15d, %r12d
movl 0xc(%rbx), %edx
addl $0x3, %edx
leaq 0xa(%rbx), %rsi
andl %ebp, %edx
movq %r14, %rdi
callq 0x6bcb
movw %r12w, 0xc(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_ADD_SP_n
static inline void ASM_ADD_SP_n(CPU* cpu, Memory* mem) {
    uint8_t nextByte = MEM_getByte(mem, cpu->PC + 1);
    uint16_t result = cpu->SP + (int8_t) nextByte;
    uint8_t lowResult = (cpu->SP & 0xFF) + nextByte;
    CPU_setFlagZ(cpu, 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, ((((cpu->SP & 0xFF) & 0xF) + (nextByte & 0xF)) & 0x10) == 0x10);
    CPU_setFlagC(cpu, lowResult < nextByte);
    cpu->SP = result;
    cpu->PC += 2;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movl 0xc(%rdi), %ecx
incl %ecx
movzwl %cx, %esi
movq %rax, %rdi
callq 0x6a94
movzwl 0xa(%rbx), %ecx
movsbl %al, %eax
leal (%rcx,%rax), %edx
movb 0x2(%rbx), %sil
movl %ecx, %edi
andl $0xf, %edi
movl %eax, %r8d
andb $0xf, %r8b
movzbl %r8b, %r8d
addl %edi, %r8d
cmpl $0x10, %r8d
setae %dil
andb $0xf, %sil
shlb $0x5, %dil
addb %al, %cl
setb %al
shlb $0x4, %al
orb %sil, %al
orb %dil, %al
movb %al, 0x2(%rbx)
movw %dx, 0xa(%rbx)
addw $0x2, 0xc(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_LDHL_SP_n
static inline void ASM_LDHL_SP_n(CPU* cpu, Memory* mem) {
    // Add SP and next byte, and set flags
    uint8_t nextByte = MEM_getByte(mem, cpu->PC + 1);
    uint16_t result = cpu->SP + (int8_t) nextByte;
    uint8_t lowResult = (cpu->SP & 0xFF) + nextByte;
    CPU_setFlagZ(cpu, 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, ((((cpu->SP & 0xFF) & 0xF) + (nextByte & 0xF)) & 0x10) == 0x10);
    CPU_setFlagC(cpu, lowResult < nextByte);

    // Load into HL
    cpu->H = (result & 0xFF00) >> 8;
    cpu->L = result & 0xFF;
    cpu->PC += 2;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movl 0xc(%rdi), %ecx
incl %ecx
movzwl %cx, %esi
movq %rax, %rdi
callq 0x6a94
movzwl 0xa(%rbx), %ecx
movsbl %al, %edx
leal (%rcx,%rdx), %eax
movb 0x2(%rbx), %sil
movl %ecx, %edi
andl $0xf, %edi
movl %edx, %r8d
andb $0xf, %r8b
movzbl %r8b, %r8d
addl %edi, %r8d
cmpl $0x10, %r8d
setae %dil
andb $0xf, %sil
shlb $0x5, %dil
addb %dl, %cl
setb %cl
shlb $0x4, %cl
orb %sil, %cl
orb %dil, %cl
movb %cl, 0x2(%rbx)
movb %ah, 0x9(%rbx)
movb %al, 0x8(%rbx)
addw $0x2, 0xc(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_RLC_m
static inline void ASM_RLC_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t bit7 = getBit(MEM_getByte(mem, address), 7);
    MEM_setByte(mem, address, (MEM_getByte(mem, address) << 1) | bit7);
    CPU_setFlagZ(cpu, MEM_getByte(mem, address) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit7);
    cpu->PC += 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
movl %eax, %ebp
movq %r15, %rdi
movl %r14d, %esi
callq 0x6a94
movl %ebp, %ecx
shrb $0x7, %cl
addb %al, %al
orb %cl, %al
movzbl %al, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x6b05
movq %r15, %rdi
movl %r14d, %esi
callq 0x6a94
testb %al, %al
sete %al
movb 0x2(%rbx), %cl
andb $0xf, %cl
shlb $0x7, %al
shrb $0x3, %bpl
andb $0x10, %bpl
orb %al, %bpl
orb %cl, %bpl
movb %bpl, 0x2(%rbx)
addw $0x2, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_RL_m
static inline void ASM_RL_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t bit7 = getBit(MEM_getByte(mem, address), 7);
    MEM_setByte(mem, address, (MEM_getByte(mem, address) << 1) | (uint8_t) CPU_getFlagC(cpu));
    CPU_setFlagZ(cpu, MEM_getByte(mem, address) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit7);
    cpu->PC += 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
movl %eax, %ebp
movq %r15, %rdi
movl %r14d, %esi
callq 0x6a94
addb %al, %al
movb 0x2(%rbx), %cl
shrb $0x4, %cl
andb $0x1, %cl
orb %al, %cl
movzbl %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x6b05
movq %r15, %rdi
movl %r14d, %esi
callq 0x6a94
testb %al, %al
sete %al
movb 0x2(%rbx), %cl
andb $0xf, %cl
shlb $0x7, %al
shrb $0x3, %bpl
andb $0x10, %bpl
orb %al, %bpl
orb %cl, %bpl
movb %bpl, 0x2(%rbx)
addw $0x2, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_RR_n
static inline void ASM_RR_n(CPU* cpu, uint8_t* reg) {
    uint8_t bit0 = *reg & 1;
    *reg = (*reg >> 1) | (CPU_getFlagC(cpu) << 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
movb 0x2(%rdi), %cl
movl %eax, %edx
shrb %dl
shlb $0x3, %cl
andb $-0x80, %cl
orb %dl, %cl
movb %cl, (%rsi)
testb %cl, %cl
sete %cl
movb 0x2(%rdi), %dl
andb $0xf, %dl
shlb $0x7, %cl
shlb $0x4, %al
andb $0x10, %al
orb %dl, %al
orb %cl, %al
movb %al, 0x2(%rdi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_RR_m
static inline void ASM_RR_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t bit0 = MEM_getByte(mem, address) & 1;
    MEM_setByte(mem, address, (MEM_getByte(mem, address) >> 1) | (CPU_getFlagC(cpu) << 7));
    CPU_setFlagZ(cpu, MEM_getByte(mem, address) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit0);
    cpu->PC += 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
movl %eax, %ebp
movq %r15, %rdi
movl %r14d, %esi
callq 0x6a94
movb 0x2(%rbx), %cl
shrb %al
shlb $0x3, %cl
andb $-0x80, %cl
orb %al, %cl
movzbl %cl, %edx
movq %r15, %rdi
movl %r14d, %esi
callq 0x6b05
movq %r15, %rdi
movl %r14d, %esi
callq 0x6a94
testb %al, %al
sete %al
movb 0x2(%rbx), %cl
andb $0xf, %cl
shlb $0x7, %al
shlb $0x4, %bpl
andb $0x10, %bpl
orb %al, %bpl
orb %cl, %bpl
movb %bpl, 0x2(%rbx)
addw $0x2, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_SLA_n
static inline void ASM_SLA_n(CPU* cpu, uint8_t* reg) {
    uint8_t result = *reg << 1;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, getBit(*reg, 7));
    *reg = result;
    cpu->PC += 2;
}

// Assembly:
movb (%rsi), %al
addb %al, %al
sete %cl
movb 0x2(%rdi), %dl
andb $0x1f, %dl
shlb $0x7, %cl
orb %dl, %cl
movb %cl, 0x2(%rdi)
movb (%rsi), %dl
andb $-0x71, %cl
shrb $0x3, %dl
andb $0x10, %dl
orb %cl, %dl
movb %dl, 0x2(%rdi)
movb %al, (%rsi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_SLA_m
static inline void ASM_SLA_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t result = MEM_getByte(mem, address) << 1;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, getBit(MEM_getByte(mem, address), 7));
    MEM_setByte(mem, address, result);
    cpu->PC += 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
movl %eax, %r15d
addb %al, %r15b
sete %al
movb 0x2(%rbx), %cl
andb $0x1f, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
movb 0x2(%rbx), %cl
andb $-0x11, %cl
shrb $0x3, %al
andb $0x10, %al
orb %cl, %al
movb %al, 0x2(%rbx)
movzbl %r15b, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x6b05
addw $0x2, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_SRA_n
static inline void ASM_SRA_n(CPU* cpu, uint8_t* reg) {
    uint8_t bit7mask = *reg & (1U << 7);
    uint8_t result = (*reg >> 1) | bit7mask;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, *reg & 1);
    *reg = result;
    cpu->PC += 2;
}

// Assembly:
movb (%rsi), %al
movl %eax, %ecx
andb $-0x80, %cl
shrb %al
orb %cl, %al
sete %cl
movb 0x2(%rdi), %dl
andb $0x1f, %dl
shlb $0x7, %cl
orb %dl, %cl
movb %cl, 0x2(%rdi)
movb (%rsi), %dl
andb $-0x71, %cl
shlb $0x4, %dl
andb $0x10, %dl
orb %cl, %dl
movb %dl, 0x2(%rdi)
movb %al, (%rsi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_SRA_m
static inline void ASM_SRA_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t bit7mask = MEM_getByte(mem, address) & (1U << 7);
    uint8_t result = (MEM_getByte(mem, address) >> 1) | bit7mask;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, MEM_getByte(mem, address) & 1);
    MEM_setByte(mem, address, result);
    cpu->PC += 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
movl %eax, %r12d
andb $-0x80, %r12b
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
movl %eax, %r15d
shrb %r15b
orb %r12b, %r15b
testb %r15b, %r15b
sete %al
movb 0x2(%rbx), %cl
andb $0x1f, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
movb 0x2(%rbx), %cl
andb $-0x11, %cl
shlb $0x4, %al
andb $0x10, %al
orb %cl, %al
movb %al, 0x2(%rbx)
movzbl %r15b, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x6b05
addw $0x2, 0xc(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_SWAP_m
static inline void ASM_SWAP_m(CPU* cpu, Memory* mem, uint16_t address) {
    MEM_setByte(mem, address, (MEM_getByte(mem, address) << 4) | (MEM_getByte(mem, address) & 0xF0) >> 4);
    CPU_setFlagZ(cpu, MEM_getByte(mem, address) == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, 0);
    cpu->PC += 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
movl %eax, %r15d
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
shlb $0x4, %r15b
shrb $0x4, %al
orb %r15b, %al
movzbl %al, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x6b05
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
testb %al, %al
sete %al
movb 0x2(%rbx), %cl
andb $0xf, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rbx)
addw $0x2, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_SRL_n
static inline void ASM_SRL_n(CPU* cpu, uint8_t* reg) {
    uint8_t result = *reg >> 1;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, *reg & 1);
    *reg = result;
    cpu->PC += 2;
}

// Assembly:
movb (%rsi), %al
cmpb $0x2, %al
setb %cl
shrb %al
movb 0x2(%rdi), %dl
andb $0x1f, %dl
shlb $0x7, %cl
orb %dl, %cl
movb %cl, 0x2(%rdi)
movb (%rsi), %dl
andb $-0x71, %cl
shlb $0x4, %dl
andb $0x10, %dl
orb %cl, %dl
movb %dl, 0x2(%rdi)
movb %al, (%rsi)
addw $0x2, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_SRL_m
static inline void ASM_SRL_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t result = MEM_getByte(mem, address) >> 1;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, MEM_getByte(mem, address) & 1);
    MEM_setByte(mem, address, result);
    cpu->PC += 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x6a94
movl %eax, %r15d
cmpb $0x2, %al
setb %al
shrb %r15b
movb 0x2(%rbx), %cl
andb $0x1f, %cl
shlb $0x7, %al
orb %cl, %al
movb %al, 0x2(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a94
movb 0x2(%rbx), %cl
andb $-0x11, %cl
shlb $0x4, %al
andb $0x10, %al
orb %cl, %al
movb %al, 0x2(%rbx)
movzbl %r15b, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x6b05
addw $0x2, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/asm.h
// Function: ASM_BIT_b_m
static inline void ASM_BIT_b_m(CPU* cpu, Memory* mem, int bit, uint16_t address) {
    CPU_setFlagZ(cpu, !((MEM_getByte(mem, address) & (1 << bit)) >> bit));
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 1);
    cpu->PC += 2;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movq %rsi, %rdi
movl %ecx, %esi
callq 0x6a94
movzbl %al, %eax
movb 0x2(%r14), %cl
btl %ebx, %eax
setae %al
andb $0x1f, %cl
shlb $0x7, %al
orb %cl, %al
orb $0x20, %al
movb %al, 0x2(%r14)
addw $0x2, 0xc(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/qad114[P]yobeboy/src/gpu.c
// Function: GPU_init
void GPU_init(GPU* gpu) {
    gpu->framebuffer = malloc(sizeof(uint8_t) * GB_SCREEN_WIDTH * GB_SCREEN_HEIGHT * 4 + 512); // freed in main.c:quit
    gpu->fbUpdated = false;
    gpu->machineCycleCounter = 0;

    gpu->backgroundMap = malloc(32 * 32 * 16);
    gpu->windowMap = malloc(32 * 32 * 16);

    // White - #9BBC0F
    gpu->colorPalette[0][0] = 0x9B;
    gpu->colorPalette[0][1] = 0xBC;
    gpu->colorPalette[0][2] = 0x0F;
    // Light grey - #8BAC0F
    gpu->colorPalette[1][0] = 0x8B;
    gpu->colorPalette[1][1] = 0xAC;
    gpu->colorPalette[1][2] = 0x0F;
    // Dark grey - #306230
    gpu->colorPalette[2][0] = 0x30;
    gpu->colorPalette[2][1] = 0x62;
    gpu->colorPalette[2][2] = 0x30;
    // Black - #0F380F
    gpu->colorPalette[3][0] = 0x0F;
    gpu->colorPalette[3][1] = 0x38;
    gpu->colorPalette[3][2] = 0x0F;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x16a00, %edi          # imm = 0x16A00
callq 0x2200
movq %rax, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movl $0x0, (%rbx)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2200
movq %rax, 0x18(%rbx)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2200
movq %rax, 0x20(%rbx)
movw $0xbc9b, 0x28(%rbx)     # imm = 0xBC9B
movb $0xf, %al
movb %al, 0x2a(%rbx)
movw $0xac8b, 0x2c(%rbx)     # imm = 0xAC8B
movb %al, 0x2e(%rbx)
movw $0x6230, 0x30(%rbx)     # imm = 0x6230
movb $0x30, 0x32(%rbx)
movw $0x380f, 0x34(%rbx)     # imm = 0x380F
movb %al, 0x36(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x21b0
xorl %r14d, %r14d
movq %r14, 0x18(%rbx)
movq 0x8(%rbx), %rdi
callq 0x21b0
movq %r14, 0x8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O1/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 0x62a9
cmpl $0x0, (%rdi)
je 0x6282
andb $-0x22, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0x4(%rdi)
je 0x628f
andb $-0x3, 0xff00(%rsi)
cmpl $0x0, 0xc(%rdi)
je 0x629c
andb $-0x5, 0xff00(%rsi)
cmpl $0x0, 0x8(%rdi)
je 0x62a9
andb $-0x9, 0xff00(%rsi)
movb 0xff00(%rsi), %al
testb $0x10, %al
jne 0x62e8
cmpl $0x0, 0x1c(%rdi)
je 0x62c1
andb $-0x12, %al
movb %al, 0xff00(%rsi)
cmpl $0x0, 0x18(%rdi)
je 0x62ce
andb $-0x3, 0xff00(%rsi)
cmpl $0x0, 0x10(%rdi)
je 0x62db
andb $-0x5, 0xff00(%rsi)
cmpl $0x0, 0x14(%rdi)
je 0x62e8
andb $-0x9, 0xff00(%rsi)
movb 0xff00(%rsi), %al
notb %al
testb $0xf, %al
je 0x62fb
orb $0x10, 0xff0f(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movq %r9, %rbx
movq %r8, %r15
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movl 0x50(%rsp), %r14d
cmpl $0x0, 0x10040(%rdx)
je 0x6961
movq %r15, (%rsp)
movq %rbx, 0x8(%rsp)
movq 0x10048(%r12), %r14
movq %r14, %rdi
callq 0x20c0
leaq 0x5(%rax), %r15
movq %r15, %rdi
callq 0x2200
movq %rax, %rbx
leaq 0x20e8(%rip), %rdx      # 0x89d2
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2250
leaq 0x20d8(%rip), %rsi      # 0x89d9
movq %rbx, %rdi
callq 0x21a0
movq %rax, %r14
cmpl $0x0, 0x10030(%r12)
jle 0x6943
xorl %r15d, %r15d
movq 0x10028(%r12), %rax
movzbl (%rax,%r15), %edi
movq %r14, %rsi
callq 0x21e0
incq %r15
movslq 0x10030(%r12), %rax
shlq $0xd, %rax
cmpq %rax, %r15
jl 0x691a
movq %r14, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x21b0
movq 0x8(%rsp), %rbx
movl 0x50(%rsp), %r14d
movq (%rsp), %r15
movq %rbp, %rdi
callq 0x2b24
movq %r13, %rdi
callq 0x5ab1
movq %r12, %rdi
callq 0x6a2f
movq 0x10(%rsp), %rdi
callq 0x252e
movq %r15, %rdi
callq 0x6f93
movq %rbx, %rdi
callq 0x625b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10038(%rdi), %rdi
callq 0x21b0
xorl %r14d, %r14d
movq %r14, 0x10038(%rbx)
movq 0x10018(%rbx), %rdi
callq 0x21b0
movq %r14, 0x10018(%rbx)
movq 0x10028(%rbx), %rdi
callq 0x21b0
movq %r14, 0x10028(%rbx)
movq 0x10048(%rbx), %rdi
callq 0x21b0
movq %r14, 0x10048(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O1/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:
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x6aa8
movzwl %si, %eax
addq 0x10000(%rdi), %rax
jmp 0x6b02
testw %si, %si
js 0x6ac2
movq 0x10008(%rdi), %rax
movzwl %si, %ecx
addq %rcx, %rax
addq $-0x4000, %rax          # imm = 0xC000
jmp 0x6b02
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x6af9
movb $-0x1, %al
cmpl $0x0, 0x10030(%rdi)
je 0x6b04
cmpb $0x1, 0x10034(%rdi)
jne 0x6b04
movq 0x10010(%rdi), %rax
movzwl %si, %ecx
addq %rcx, %rax
addq $-0xa000, %rax          # imm = 0xFFFF6000
jmp 0x6b02
movzwl %si, %eax
addq %rax, %rdi
movq %rdi, %rax
movb (%rax), %al
retq
// File: /workspace/github_c_makefile_star2_O1/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
movzwl %ax, %eax
cmpl $0x1e00, %eax           # imm = 0x1E00
setb %al
leal 0x160(%rsi), %ecx
cmpw $0x60, %cx
setb %cl
orb %al, %cl
je 0x6b28
retq
testw %si, %si
js 0x6b38
movzwl %si, %esi
movzbl %dl, %edx
jmp 0x2a39
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x6b6c
cmpl $0x0, 0x10030(%rdi)
je 0x6b6c
cmpb $0x1, 0x10034(%rdi)
jne 0x6b6c
movq 0x10010(%rdi), %rax
movzwl %si, %ecx
andl $0x1fff, %ecx           # imm = 0x1FFF
movb %dl, (%rax,%rcx)
retq
movzwl %si, %eax
cmpl $0xff46, %eax           # imm = 0xFF46
je 0x6b91
cmpl $0xff07, %eax           # imm = 0xFF07
je 0x6b8c
cmpl $0xff04, %eax           # imm = 0xFF04
jne 0x6ba8
movb $0x0, 0xff04(%rdi)
retq
orb $-0x8, %dl
jmp 0x6ba8
movb %dl, 0x10054(%rdi)
movb $0x0, 0x10055(%rdi)
movl $0x1, 0x10050(%rdi)
movb %dl, (%rdi,%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6a94
movl %eax, %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6a94
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_O1/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 0x6ef3
testl %eax, %eax
je 0x6ee0
xorl %ecx, %ecx
cmpl $0x1, %eax
je 0x6ee5
cmpl $0x2, %eax
jb 0x6ee5
xorl %ecx, %ecx
movl %eax, %edx
shrl %edx
incl %ecx
cmpl $0x3, %eax
movl %edx, %eax
ja 0x6ed3
jmp 0x6ee5
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
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_O1/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 0x6f8a
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 0x6a94
movzbl %al, %edx
orl $0xfe00, %ebp           # imm = 0xFE00
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6b05
movb 0x10055(%rbx), %al
cmpb $-0x61, %al
jne 0x6f7c
movb $0x0, 0x10055(%rbx)
movl $0x0, 0x10050(%rbx)
jmp 0x6f84
incb %al
movb %al, 0x10055(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x6fb4
movl $0x0, (%rdx)
incb 0xff04(%rsi)
jmp 0x6fb8
incl %ecx
movl %ecx, (%rdx)
testb $0x4, %al
jne 0x6fcb
movl $0x0, 0x4(%rdx)
movb $0x0, 0xff05(%rsi)
retq
andl $0x3, %eax
leaq 0x1b13(%rip), %r8       # 0x8ae8
movl 0x4(%rdx), %ecx
movl %ecx, %edi
subl (%r8,%rax,4), %edi
jge 0x6fe6
incl %ecx
movl %ecx, 0x4(%rdx)
retq
incl %edi
movl %edi, 0x4(%rdx)
movb 0xff05(%rsi), %al
cmpb $-0x1, %al
je 0x6ffe
incb %al
movb %al, 0xff05(%rsi)
retq
movb 0xff06(%rsi), %al
movb %al, 0xff05(%rsi)
orb $0x4, 0xff0f(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %ebp
leaq 0xe3b(%rip), %r14       # 0x204a
leaq 0xc(%rsp), %r15
leaq 0xe32(%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 0x121b
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1070
movl %eax, %edi
callq 0x1060
leaq 0x2ec8(%rip), %r14      # 0x4070
xorl %r15d, %r15d
callq 0x1080
vmovss 0xe4c(%rip), %xmm1      # 0x2004
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
vcvtsi2ss %eax, %xmm2, %xmm0
vdivss %xmm1, %xmm0, %xmm0
vmovss %xmm0, (%r14,%r15,4)
incq %r15
cmpq $0x400, %r15            # imm = 0x400
jne 0x11ab
incq %rbx
addq $0x1000, %r14           # imm = 0x1000
cmpq $0x40, %rbx
jne 0x11a8
xorl %ebx, %ebx
leaq 0x42e67(%rip), %r14     # 0x44070
callq 0x1080
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
vcvtsi2ss %eax, %xmm2, %xmm0
vdivss 0xdcc(%rip), %xmm0, %xmm0 # 0x2004
vmovss %xmm0, (%rbx,%r14)
addq $0x4, %rbx
cmpq $0x1000, %rbx           # imm = 0x1000
jne 0x1209
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2e18(%rip), %rax      # 0x4070
xorl %ecx, %ecx
leaq 0x42e0f(%rip), %rdx     # 0x44070
leaq 0x43e08(%rip), %rsi     # 0x45070
vxorps %xmm0, %xmm0, %xmm0
xorl %edi, %edi
vmovss (%rax,%rdi), %xmm1
vfmadd231ss (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * mem) + xmm0
addq $0x4, %rdi
cmpq $0x1000, %rdi           # imm = 0x1000
jne 0x126e
vmovss %xmm0, (%rsi,%rcx,4)
incq %rcx
addq $0x1000, %rax           # imm = 0x1000
cmpq $0x40, %rcx
jne 0x1268
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2dc2(%rip), %rax      # 0x4070
xorl %ecx, %ecx
vxorps %xmm0, %xmm0, %xmm0
leaq 0x42db5(%rip), %rdx     # 0x44070
leaq 0x43dae(%rip), %rsi     # 0x45070
vmovaps %ymm0, (%rsp)
movq $-0x8, %rdi
movq %rdx, %r8
vmovaps (%r8), %ymm1
vmovaps 0x20(%rax,%rdi,4), %ymm2
vfmadd213ps (%rsp), %ymm1, %ymm2 # ymm2 = (ymm1 * ymm2) + mem
vmovaps %ymm2, (%rsp)
addq $0x8, %rdi
addq $0x20, %r8
cmpq $0x3f8, %rdi            # imm = 0x3F8
jb 0x12d1
vxorps %xmm1, %xmm1, %xmm1
xorl %edi, %edi
vaddss (%rsp,%rdi,4), %xmm1, %xmm1
incq %rdi
cmpq $0x8, %rdi
jne 0x12fe
vmovss %xmm1, (%rsi,%rcx,4)
incq %rcx
addq $0x1000, %rax           # imm = 0x1000
cmpq $0x40, %rcx
jne 0x12c2
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2d32(%rip), %rax      # 0x4070
xorl %ecx, %ecx
vxorps %xmm0, %xmm0, %xmm0
leaq 0x42d25(%rip), %rdx     # 0x44070
leaq 0x43d1e(%rip), %rsi     # 0x45070
vmovaps %zmm0, (%rsp)
movq $-0x10, %rdi
movq %rdx, %r8
vmovaps (%r8), %zmm1
vmovaps 0x40(%rax,%rdi,4), %zmm2
vfmadd213ps (%rsp), %zmm1, %zmm2 # zmm2 = (zmm1 * zmm2) + mem
vmovaps %zmm2, (%rsp)
addq $0x10, %rdi
addq $0x40, %r8
cmpq $0x3f0, %rdi            # imm = 0x3F0
jb 0x1363
vxorps %xmm1, %xmm1, %xmm1
xorl %edi, %edi
vaddss (%rsp,%rdi,4), %xmm1, %xmm1
incq %rdi
cmpq $0x10, %rdi
jne 0x1396
vmovss %xmm1, (%rsi,%rcx,4)
incq %rcx
addq $0x1000, %rax           # imm = 0x1000
cmpq $0x40, %rcx
jne 0x1352
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8ee5(%rip), %edx      # 0xb1f4
leaq 0x4cee(%rip), %rdi      # 0x7004
movq %rax, %rsi
xorl %eax, %eax
callq 0x5bde
incl 0x8ece(%rip)            # 0xb1f4
movq %rbx, %rdi
popq %rbx
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/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 0x4bc4(%rip), %rdi      # 0x700e
callq 0x4dec
movq %rax, %rbx
movq %rax, %rdi
movl $0xa, %esi
callq 0x4cfb
testq %rax, %rax
je 0x24e8
movq %rax, %r14
movq %rax, %rdi
callq 0x47c2
cltq
leaq 0x8(,%rax,8), %rdi
callq 0x2140
testq %rax, %rax
je 0x24e8
movq %rax, %r15
movq (%r14), %rdi
xorl %r13d, %r13d
testq %rdi, %rdi
je 0x24d3
movq %r14, %rbp
addq $0x8, %rbp
leaq 0x4b70(%rip), %r12      # 0x7013
movq %r12, %rsi
callq 0x470c
cmpl $0x1, %eax
jne 0x24c3
movq -0x8(%rbp), %rdi
callq 0x4dec
movslq %r13d, %rcx
incl %r13d
movq %rax, (%r15,%rcx,8)
movq (%rbp), %rdi
addq $0x8, %rbp
testq %rdi, %rdi
jne 0x24a3
movslq %r13d, %r13
movq $0x0, (%r15,%r13,8)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4751
jmp 0x24eb
xorl %r15d, %r15d
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_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0x47c2
cltq
leaq 0x8(,%rax,8), %rdi
callq 0x2140
testq %rax, %rax
je 0x25b3
movq %rax, %rbx
movb $0x0, 0xf(%rsp)
movq (%r14), %rax
xorl %r12d, %r12d
testq %rax, %rax
je 0x25a9
leaq 0xe(%rsp), %r15
movq $0x0, (%rbx,%r12,8)
movl $0x2, %edx
xorl %ecx, %ecx
movq %rdx, %r13
cmpb $0x20, (%rax,%rcx)
leaq 0x1(%rcx), %rcx
leaq 0x1(%rdx), %rdx
jne 0x2551
movq (%r14,%r12,8), %rax
movl %ecx, %ecx
movb (%rax,%rcx), %cl
cmpb $0x3d, %cl
je 0x259c
movq (%rbx,%r12,8), %rax
movb %cl, 0xe(%rsp)
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x4f64
movq (%r14,%r12,8), %rcx
movb (%rcx,%r13), %cl
incq %r13
cmpb $0x3d, %cl
jne 0x2574
movq %rax, (%rbx,%r12,8)
movq 0x8(%r14,%r12,8), %rax
incq %r12
testq %rax, %rax
jne 0x2542
movq $0x0, (%rbx,%r12,8)
jmp 0x25b5
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0x47c2
cltq
leaq 0x8(,%rax,8), %rdi
callq 0x2140
testq %rax, %rax
je 0x267c
movq %rax, %rbx
movb $0x0, 0xf(%rsp)
movq (%r14), %rax
xorl %r12d, %r12d
testq %rax, %rax
je 0x2672
leaq 0xe(%rsp), %r15
movq $0x0, (%rbx,%r12,8)
movl $0x2, %edx
xorl %ecx, %ecx
movq %rdx, %r13
cmpb $0x27, (%rax,%rcx)
leaq 0x1(%rcx), %rcx
leaq 0x1(%rdx), %rdx
jne 0x261a
movq (%r14,%r12,8), %rax
movl %ecx, %ecx
movb (%rax,%rcx), %cl
cmpb $0x27, %cl
je 0x2665
movq (%rbx,%r12,8), %rax
movb %cl, 0xe(%rsp)
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x4f64
movq (%r14,%r12,8), %rcx
movb (%rcx,%r13), %cl
incq %r13
cmpb $0x27, %cl
jne 0x263d
movq %rax, (%rbx,%r12,8)
movq 0x8(%r14,%r12,8), %rax
incq %r12
testq %rax, %rax
jne 0x260b
movq $0x0, (%rbx,%r12,8)
jmp 0x267e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rdi, 0x30(%rsp)
movslq %ecx, %rdi
shlq $0x3, %rdi
callq 0x2140
movq $0x0, 0x8(%rsp)
testq %rax, %rax
je 0x27db
movq %rax, %r15
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %rax, 0x28(%rsp)
movq %r13, 0x20(%rsp)
movq 0x18(%r14), %rax
movslq %r12d, %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x27c7
movq %rsi, 0x18(%rsp)
movq (%r13), %rsi
testq %rsi, %rsi
je 0x279d
xorl %ebx, %ebx
movq 0x18(%r14), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x478e
testl %eax, %eax
jne 0x278c
incl %r12d
jne 0x271c
xorl %r12d, %r12d
jmp 0x278c
movq 0x30(%rsp), %rax
movq (%rax,%rbx,8), %rdi
movl $0x20, %esi
callq 0x4cfb
movslq 0x8(%rsp), %rdx
movq (%rax,%rdx,8), %rdi
testq %rdi, %rdi
movq %rax, 0x18(%rsp)
je 0x278c
movl %ebp, 0x14(%rsp)
movslq %ebp, %rcx
leaq (%rax,%rdx,8), %rbp
addq $0x8, %rbp
leaq (%r15,%rcx,8), %r15
xorl %r13d, %r13d
callq 0x4dec
movq %rax, (%r15,%r13,8)
movq (%rbp,%r13,8), %rdi
incq %r13
testq %rdi, %rdi
jne 0x2758
movq 0x8(%rsp), %rax
addl %r13d, %eax
movq %rax, 0x8(%rsp)
movl 0x14(%rsp), %ebp
addl %r13d, %ebp
movq 0x28(%rsp), %r15
movq 0x20(%rsp), %r13
movq 0x8(%r13,%rbx,8), %rsi
incq %rbx
testq %rsi, %rsi
jne 0x26fe
movq 0x18(%r14), %rax
movslq %r12d, %rcx
incl %r12d
movq (%rax,%rcx,8), %rdi
callq 0x4dec
movslq %ebp, %rcx
incl %ebp
movq %rax, (%r15,%rcx,8)
testq %rax, %rax
movq 0x18(%rsp), %rsi
jne 0x26d8
movslq %ebp, %rax
movq $0x0, (%r15,%rax,8)
xorl %edi, %edi
callq 0x4751
jmp 0x27de
xorl %r15d, %r15d
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq