LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
shll $0x4, %eax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
andl $0xf0, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32e0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movw -0x12(%rbp), %ax
movw %ax, -0x26(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movzbl %al, %eax
shll $0x4, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movq -0x30(%rbp), %rdi
movw -0x26(%rbp), %cx
movb %al, %dl
movl -0x24(%rbp), %eax
movzbl %dl, %edx
andl $0xf0, %edx
sarl $0x4, %edx
orl %edx, %eax
movzwl %cx, %esi
movzbl %al, %edx
callq 0xce30
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movq -0x20(%rbp), %rdi
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32e0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
sarl %eax
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl (%rax), %esi
andl $0x1, %esi
callq 0x32e0
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movzbl %al, %eax
sarl %eax
movb %al, -0x13(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x13(%rbp), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movq -0x20(%rbp), %rdi
movzbl %al, %esi
andl $0x1, %esi
callq 0x32e0
movq -0x10(%rbp), %rdi
movw -0x12(%rbp), %ax
movzwl %ax, %esi
movzbl -0x13(%rbp), %edx
callq 0xce30
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl -0xc(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
movl -0xc(%rbp), %ecx
sarl %cl, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x32a0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %cx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movw %ax, -0x16(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x16(%rbp), %esi
callq 0xcd50
movq -0x20(%rbp), %rdi
movzbl %al, %eax
movl -0x14(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
movl -0x14(%rbp), %ecx
sarl %cl, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x32a0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x16a00, %edi          # imm = 0x16A00
callq 0x2210
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2210
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2210
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movb $-0x65, 0x28(%rax)
movq -0x8(%rbp), %rax
movb $-0x44, 0x29(%rax)
movq -0x8(%rbp), %rax
movb $0xf, 0x2a(%rax)
movq -0x8(%rbp), %rax
movb $-0x75, 0x2c(%rax)
movq -0x8(%rbp), %rax
movb $-0x54, 0x2d(%rax)
movq -0x8(%rbp), %rax
movb $0xf, 0x2e(%rax)
movq -0x8(%rbp), %rax
movb $0x30, 0x30(%rax)
movq -0x8(%rbp), %rax
movb $0x62, 0x31(%rax)
movq -0x8(%rbp), %rax
movb $0x30, 0x32(%rax)
movq -0x8(%rbp), %rax
movb $0xf, 0x34(%rax)
movq -0x8(%rbp), %rax
movb $0x38, 0x35(%rax)
movq -0x8(%rbp), %rax
movb $0xf, 0x36(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x21c0
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21c0
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x21c0
movq $0x0, -0x8(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/gpu.c
// Function: updateBackgroundMap
static void updateBackgroundMap(GPU* gpu, Memory* mem) {
    uint8_t LCDC = mem->logicalMemory[REG_LCDC];
    uint8_t SCY = mem->logicalMemory[REG_SCY];
    uint8_t LY = mem->logicalMemory[REG_LY];
    int mapY = (SCY + LY) / 8;
    if (mapY >= 32) mapY -= 32;

    for (int mapX = 0; mapX < 32; ++mapX) {
        uint16_t address = (getBit(LCDC, 3) ? 0x9C00 : 0x9800) + (mapY * 0x20) + mapX;
        uint16_t tileAddress = getBit(LCDC, 4)
            ? 0x8000 + (mem->logicalMemory[address] * 0x10)
            : 0x9000 + (((int8_t) (mem->logicalMemory[address])) * 0x10);

        uint8_t* srcAddress = mem->videoRam + tileAddress - OFFSET_VIDEORAM;
        uint8_t* targetAddress = gpu->backgroundMap + (mapY * 16 * 32) + (mapX * 16);
        memcpy(targetAddress, srcAddress, 16);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb 0xff40(%rax), %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movb 0xff42(%rax), %al
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
movb 0xff44(%rax), %al
movb %al, -0x13(%rbp)
movzbl -0x12(%rbp), %eax
movzbl -0x13(%rbp), %ecx
addl %ecx, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x18(%rbp)
cmpl $0x20, -0x18(%rbp)
jl 0xb46b
movl -0x18(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x20, -0x1c(%rbp)
jge 0xb562
movl $0x3, %esi
movzbl -0x11(%rbp), %edi
callq 0xb9f0
movzbl %al, %edx
movl $0x9800, %eax           # imm = 0x9800
movl $0x9c00, %ecx           # imm = 0x9C00
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl -0x18(%rbp), %ecx
shll $0x5, %ecx
addl %ecx, %eax
addl -0x1c(%rbp), %eax
movw %ax, -0x1e(%rbp)
movl $0x4, %esi
movzbl -0x11(%rbp), %edi
callq 0xb9f0
movzbl %al, %eax
cmpl $0x0, %eax
je 0xb4db
movq -0x10(%rbp), %rax
movzwl -0x1e(%rbp), %ecx
movzbl (%rax,%rcx), %eax
shll $0x4, %eax
addl $0x8000, %eax           # imm = 0x8000
movl %eax, -0x34(%rbp)
jmp 0xb4f2
movq -0x10(%rbp), %rax
movzwl -0x1e(%rbp), %ecx
movsbl (%rax,%rcx), %eax
shll $0x4, %eax
addl $0x9000, %eax           # imm = 0x9000
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movw %ax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movzwl -0x20(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
addq $-0x8000, %rax          # imm = 0x8000
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x18(%rbp), %ecx
shll $0x4, %ecx
shll $0x5, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl -0x1c(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb472
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/gpu.c
// Function: GPU_renderToFrameBuffer
void GPU_renderToFrameBuffer(GPU* gpu, Memory* mem) {
    uint8_t LCDC = mem->logicalMemory[REG_LCDC];
    if (!getBit(LCDC, 7)) {
        // LCD disabled, return a blank screen
        for (int i = 0; i < (160 * 144 * 4); i += 4) {
            memcpy(gpu->framebuffer + i, &(gpu->colorPalette[0]), 3);
            gpu->framebuffer[i + 3] = 0xFF;
        }
        gpu->fbUpdated = true;
        return;
    }

    if (getBit(LCDC, 0)) {
        //renderBackground(gpu, mem);
        if (getBit(LCDC, 5)) renderWindow(gpu, mem);
    };
    if (getBit(LCDC, 1)) renderObjects(gpu, mem);
    gpu->fbUpdated = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb 0xff40(%rax), %al
movb %al, -0x11(%rbp)
movl $0x7, %esi
movzbl -0x11(%rbp), %edi
callq 0xb9f0
cmpb $0x0, %al
jne 0xb938
movl $0x0, -0x18(%rbp)
cmpl $0x16800, -0x18(%rbp)   # imm = 0x16800
jge 0xb92e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rdx
movw 0x28(%rdx), %si
movw %si, (%rax,%rcx)
movb 0x2a(%rdx), %dl
movb %dl, 0x2(%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x18(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movb $-0x1, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x18(%rbp)
jmp 0xb8e6
movq -0x8(%rbp), %rax
movb $0x1, 0x10(%rax)
jmp 0xb98f
xorl %esi, %esi
movzbl -0x11(%rbp), %edi
callq 0xb9f0
cmpb $0x0, %al
je 0xb968
movl $0x5, %esi
movzbl -0x11(%rbp), %edi
callq 0xb9f0
cmpb $0x0, %al
je 0xb966
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xba10
jmp 0xb968
movl $0x1, %esi
movzbl -0x11(%rbp), %edi
callq 0xb9f0
cmpb $0x0, %al
je 0xb987
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xbd00
movq -0x8(%rbp), %rax
movb $0x1, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/joypad.c
// Function: JOY_init
void JOY_init(Joypad* joy) {
    joy->a = 0;
    joy->b = 0;
    joy->start = 0;
    joy->select = 0;
    joy->up = 0;
    joy->down = 0;
    joy->left = 0;
    joy->right = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1c(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0xff00, %rax           # imm = 0xFF00
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %ecx
orl $0xcf, %ecx
movb %cl, (%rax)
movq -0x18(%rbp), %rax
movl $0x5, %esi
movzbl (%rax), %edi
callq 0xc2d0
cmpb $0x0, %al
jne 0xc1f8
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
je 0xc187
movq -0x18(%rbp), %rax
xorl %edx, %edx
movzbl (%rax), %edi
movl %edx, %esi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0xc1ac
movq -0x18(%rbp), %rax
movl $0x1, %esi
xorl %edx, %edx
movzbl (%rax), %edi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0xc1d1
movq -0x18(%rbp), %rax
movl $0x2, %esi
xorl %edx, %edx
movzbl (%rax), %edi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0xc1f6
movq -0x18(%rbp), %rax
movl $0x3, %esi
xorl %edx, %edx
movzbl (%rax), %edi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
jmp 0xc1f8
movq -0x18(%rbp), %rax
movl $0x4, %esi
movzbl (%rax), %edi
callq 0xc2d0
cmpb $0x0, %al
jne 0xc2a4
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0xc233
movq -0x18(%rbp), %rax
xorl %edx, %edx
movzbl (%rax), %edi
movl %edx, %esi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0xc258
movq -0x18(%rbp), %rax
movl $0x1, %esi
xorl %edx, %edx
movzbl (%rax), %edi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0xc27d
movq -0x18(%rbp), %rax
movl $0x2, %esi
xorl %edx, %edx
movzbl (%rax), %edi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0xc2a2
movq -0x18(%rbp), %rax
movl $0x3, %esi
xorl %edx, %edx
movzbl (%rax), %edi
callq 0xc2f0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
jmp 0xc2a4
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
andl $0xf, %eax
cmpl $0xf, %eax
je 0xc2c7
movq -0x10(%rbp), %rax
movzbl 0xff0f(%rax), %ecx
orl $0x10, %ecx
movb %cl, 0xff0f(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10040(%rax)
je 0xcb38
movq -0x18(%rbp), %rax
movq 0x10048(%rax), %rdi
callq 0x20c0
movq %rax, %rdi
addq $0x5, %rdi
callq 0x2210
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x10048(%rax), %rdi
callq 0x20c0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
addq $0x5, %rsi
movq -0x18(%rbp), %rax
movq 0x10048(%rax), %rcx
leaq 0x1f24(%rip), %rdx      # 0xe9ed
movb $0x0, %al
callq 0x2250
movq -0x38(%rbp), %rdi
leaq 0x1f19(%rip), %rsi      # 0xe9f4
callq 0x21b0
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
movl 0x10030(%rcx), %ecx
shll $0xd, %ecx
cmpl %ecx, %eax
jge 0xcb26
movq -0x18(%rbp), %rax
movq 0x10028(%rax), %rax
movslq -0x44(%rbp), %rcx
movzbl (%rax,%rcx), %edi
movq -0x40(%rbp), %rsi
callq 0x21f0
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xcaeb
movq -0x40(%rbp), %rdi
callq 0x2180
movq -0x38(%rbp), %rdi
callq 0x21c0
movq -0x8(%rbp), %rdi
callq 0x3390
movq -0x10(%rbp), %rdi
callq 0xb160
movq -0x18(%rbp), %rdi
callq 0xccb0
movq -0x20(%rbp), %rdi
callq 0x25f0
movq -0x28(%rbp), %rdi
callq 0xd6c0
movq -0x30(%rbp), %rdi
callq 0xc0f0
movl 0x10(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/memory.c
// Function: MEM_init
void MEM_init(Memory* mem) {
    // Zero out memory
    /*for (int i = 0; i < 0x10000; ++i) {
        mem->logicalMemory[i] = 0;
    }*/
    memset(mem->logicalMemory, 0, 0x10000);

    // Set special registers
    mem->ioRegisters[REG_NR10 - OFFSET_IOREGISTERS] = 0x80;
    mem->ioRegisters[REG_NR11 - OFFSET_IOREGISTERS] = 0xBF;
    mem->ioRegisters[REG_NR12 - OFFSET_IOREGISTERS] = 0xF3;
    mem->ioRegisters[REG_NR14 - OFFSET_IOREGISTERS] = 0xBF;
    mem->ioRegisters[REG_NR21 - OFFSET_IOREGISTERS] = 0x3F;
    mem->ioRegisters[REG_NR24 - OFFSET_IOREGISTERS] = 0xBF;
    mem->ioRegisters[REG_NR30 - OFFSET_IOREGISTERS] = 0x7F;
    mem->ioRegisters[REG_NR31 - OFFSET_IOREGISTERS] = 0xFF;
    mem->ioRegisters[REG_NR32 - OFFSET_IOREGISTERS] = 0x9F;
    mem->ioRegisters[REG_NR34 - OFFSET_IOREGISTERS] = 0xBF;
    mem->ioRegisters[REG_NR41 - OFFSET_IOREGISTERS] = 0xFF;
    mem->ioRegisters[REG_NR44 - OFFSET_IOREGISTERS] = 0xBF;
    mem->ioRegisters[REG_NR50 - OFFSET_IOREGISTERS] = 0x77;
    mem->ioRegisters[REG_NR51 - OFFSET_IOREGISTERS] = 0xF3;
    mem->ioRegisters[REG_NR52 - OFFSET_IOREGISTERS] = 0xF1;
    mem->ioRegisters[REG_LCDC - OFFSET_IOREGISTERS] = 0x91;
    mem->ioRegisters[REG_BGP  - OFFSET_IOREGISTERS] = 0xFC;
    mem->ioRegisters[REG_OBP0 - OFFSET_IOREGISTERS] = 0xFF;
    mem->ioRegisters[REG_OBP1 - OFFSET_IOREGISTERS] = 0xFF;

    // Initialize other variables
    mem->battery = 0;
    mem->dmaAddressUpper = 0;
    mem->dmaInProgress = 0;
    mem->dmaPosition = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x20d0
movq -0x8(%rbp), %rax
movb $-0x80, 0xff10(%rax)
movq -0x8(%rbp), %rax
movb $-0x41, 0xff11(%rax)
movq -0x8(%rbp), %rax
movb $-0xd, 0xff12(%rax)
movq -0x8(%rbp), %rax
movb $-0x41, 0xff14(%rax)
movq -0x8(%rbp), %rax
movb $0x3f, 0xff16(%rax)
movq -0x8(%rbp), %rax
movb $-0x41, 0xff19(%rax)
movq -0x8(%rbp), %rax
movb $0x7f, 0xff1a(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0xff1b(%rax)
movq -0x8(%rbp), %rax
movb $-0x61, 0xff1c(%rax)
movq -0x8(%rbp), %rax
movb $-0x41, 0xff1e(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0xff20(%rax)
movq -0x8(%rbp), %rax
movb $-0x41, 0xff23(%rax)
movq -0x8(%rbp), %rax
movb $0x77, 0xff24(%rax)
movq -0x8(%rbp), %rax
movb $-0xd, 0xff25(%rax)
movq -0x8(%rbp), %rax
movb $-0xf, 0xff26(%rax)
movq -0x8(%rbp), %rax
movb $-0x6f, 0xff40(%rax)
movq -0x8(%rbp), %rax
movb $-0x4, 0xff47(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0xff48(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0xff49(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10040(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x10054(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10050(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x10055(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10038(%rax), %rdi
callq 0x21c0
movq -0x8(%rbp), %rax
movq $0x0, 0x10038(%rax)
movq -0x8(%rbp), %rax
movq 0x10018(%rax), %rdi
callq 0x21c0
movq -0x8(%rbp), %rax
movq $0x0, 0x10018(%rax)
movq -0x8(%rbp), %rax
movq 0x10028(%rax), %rdi
callq 0x21c0
movq -0x8(%rbp), %rax
movq $0x0, 0x10028(%rax)
movq -0x8(%rbp), %rax
movq 0x10048(%rax), %rdi
callq 0x21c0
movq -0x8(%rbp), %rax
movq $0x0, 0x10048(%rax)
movq -0x8(%rbp), %rdi
callq 0x21c0
movq $0x0, -0x8(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jge 0xcd8a
movq -0x10(%rbp), %rax
movq 0x10000(%rax), %rax
movzwl -0x12(%rbp), %ecx
subl $0x0, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x1(%rbp)
jmp 0xce26
movzwl -0x12(%rbp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jge 0xcdb5
movq -0x10(%rbp), %rax
movq 0x10008(%rax), %rax
movzwl -0x12(%rbp), %ecx
subl $0x4000, %ecx           # imm = 0x4000
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x1(%rbp)
jmp 0xce26
movzwl -0x12(%rbp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xce18
movzwl -0x12(%rbp), %eax
cmpl $0xc000, %eax           # imm = 0xC000
jge 0xce18
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10030(%rax)
je 0xce06
movq -0x10(%rbp), %rax
testb $0x1, 0x10034(%rax)
je 0xce06
movq -0x10(%rbp), %rax
movq 0x10010(%rax), %rax
movzwl -0x12(%rbp), %ecx
subl $0xa000, %ecx           # imm = 0xA000
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x18(%rbp)
jmp 0xce10
movl $0xff, %eax
movl %eax, -0x18(%rbp)
jmp 0xce10
movl -0x18(%rbp), %eax
movb %al, -0x1(%rbp)
jmp 0xce26
movq -0x10(%rbp), %rax
movzwl -0x12(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0xdfff, %eax           # imm = 0xDFFF
jle 0xce5e
movzwl -0xa(%rbp), %eax
cmpl $0xfe00, %eax           # imm = 0xFE00
jl 0xce74
movzwl -0xa(%rbp), %eax
cmpl $0xfe9f, %eax           # imm = 0xFE9F
jle 0xce79
movzwl -0xa(%rbp), %eax
cmpl $0xff00, %eax           # imm = 0xFF00
jge 0xce79
jmp 0xcf6b
movzwl -0xa(%rbp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jge 0xce9d
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %ax
movzwl %ax, %esi
movzbl -0xb(%rbp), %edx
callq 0x3030
jmp 0xcf69
movzwl -0xa(%rbp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xceed
movzwl -0xa(%rbp), %eax
cmpl $0xc000, %eax           # imm = 0xC000
jge 0xceed
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10030(%rax)
je 0xceed
movq -0x8(%rbp), %rax
testb $0x1, 0x10034(%rax)
je 0xceed
movb -0xb(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x10010(%rax), %rax
movzwl -0xa(%rbp), %ecx
subl $0xa000, %ecx           # imm = 0xA000
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0xcf67
movzwl -0xa(%rbp), %eax
cmpl $0xff04, %eax           # imm = 0xFF04
jne 0xcf05
movq -0x8(%rbp), %rax
movb $0x0, 0xff04(%rax)
jmp 0xcf65
movzwl -0xa(%rbp), %eax
cmpl $0xff46, %eax           # imm = 0xFF46
jne 0xcf2d
movq -0x8(%rbp), %rdi
movzbl -0xb(%rbp), %esi
callq 0xcf80
movb -0xb(%rbp), %dl
movq -0x8(%rbp), %rax
movzwl -0xa(%rbp), %ecx
movb %dl, (%rax,%rcx)
jmp 0xcf63
movzwl -0xa(%rbp), %eax
cmpl $0xff07, %eax           # imm = 0xFF07
jne 0xcf53
movzbl -0xb(%rbp), %eax
andl $0x7, %eax
orl $0xf8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movzwl -0xa(%rbp), %ecx
movb %dl, (%rax,%rcx)
jmp 0xcf61
movb -0xb(%rbp), %dl
movq -0x8(%rbp), %rax
movzwl -0xa(%rbp), %ecx
movb %dl, (%rax,%rcx)
jmp 0xcf63
jmp 0xcf65
jmp 0xcf67
jmp 0xcf69
jmp 0xcf6b
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzwl (%rax), %ecx
addl $0x2, %ecx
movw %cx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
subl $0x1, %eax
movzwl %ax, %esi
callq 0xcd50
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
subl $0x2, %eax
movzwl %ax, %esi
callq 0xcd50
movb %al, -0x12(%rbp)
movzbl -0x11(%rbp), %eax
shll $0x8, %eax
movzbl -0x12(%rbp), %ecx
orl %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10020(%rcx), %eax
jl 0xd4fd
movq -0x8(%rbp), %rax
movl 0x10020(%rax), %edi
callq 0xd530
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %ecx
movl $0xff, %eax
shll %cl, %eax
andl $0xff, %eax
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
xorl $-0x1, %eax
movb %al, -0x12(%rbp)
movzbl -0x12(%rbp), %ecx
movzbl -0x9(%rbp), %eax
andl %ecx, %eax
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq 0x10018(%rax), %rcx
movzbl -0x9(%rbp), %eax
shll $0xe, %eax
cltq
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10008(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/memory.c
// Function: intlog2
static unsigned int intlog2(unsigned int val) {
    if (val == 0) return UINT_MAX;
    if (val == 1) return 0;
    unsigned int ret = 0;
    while (val > 1) {
        val >>= 1;
        ret++;
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0xd546
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd57b
cmpl $0x1, -0x8(%rbp)
jne 0xd555
movl $0x0, -0x4(%rbp)
jmp 0xd57b
movl $0x0, -0xc(%rbp)
cmpl $0x1, -0x8(%rbp)
jbe 0xd575
movl -0x8(%rbp), %eax
shrl %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xd55c
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10050(%rax)
jne 0xd5ee
jmp 0xd691
movq -0x8(%rbp), %rax
movzbl 0x10054(%rax), %eax
shll $0x8, %eax
movq -0x8(%rbp), %rcx
movzbl 0x10055(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x10055(%rax), %eax
orl $0xfe00, %eax           # imm = 0xFE00
movw %ax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movw -0xc(%rbp), %ax
movw %ax, -0xe(%rbp)
movq -0x8(%rbp), %rdi
movzwl -0xa(%rbp), %esi
callq 0xcd50
movq -0x18(%rbp), %rdi
movw -0xe(%rbp), %cx
movzwl %cx, %esi
movzbl %al, %edx
callq 0xce30
movq -0x8(%rbp), %rax
movzbl 0x10055(%rax), %eax
cmpl $0x9f, %eax
jne 0xd67e
movq -0x8(%rbp), %rax
movb $0x0, 0x10055(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10050(%rax)
jmp 0xd691
movq -0x8(%rbp), %rax
movb 0x10055(%rax), %cl
addb $0x1, %cl
movb %cl, 0x10055(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0xff05, %rax           # imm = 0xFF05
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movb 0xff07(%rax), %al
movb %al, -0x21(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x40, (%rax)
jne 0xd741
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xd810
jmp 0xd74c
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl $0x2, %esi
movzbl -0x21(%rbp), %edi
callq 0xd850
cmpb $0x0, %al
jne 0xd775
movq -0x18(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
jmp 0xd800
movl $0x0, -0x28(%rbp)
movzbl -0x21(%rbp), %eax
andl $0x3, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3, %eax
ja 0xd7c4
movq -0x30(%rbp), %rax
leaq 0x135f(%rip), %rcx      # 0xeaf8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x100, -0x28(%rbp)     # imm = 0x100
jmp 0xd7c4
movl $0x4, -0x28(%rbp)
jmp 0xd7c4
movl $0x10, -0x28(%rbp)
jmp 0xd7c4
movl $0x40, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x28(%rbp), %eax
jl 0xd7f3
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
subl -0x28(%rbp), %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xd870
jmp 0xd800
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/timer.c
// Function: updateDiv
static void updateDiv(Memory* mem, Timer* timer) {
    uint8_t* DIV = &(mem->logicalMemory[REG_DIV]);
    if (*DIV == 0) {
        timer->divCounter = 0;
    }
    ++*DIV;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0xff04, %rax           # imm = 0xFF04
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xd840
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/timer.c
// Function: updateTima
static void updateTima(Memory* mem, Timer* timer) {
    uint8_t* TIMA = &(mem->logicalMemory[REG_TIMA]);
    if (*TIMA == 0xFF) {
        *TIMA = mem->logicalMemory[REG_TMA];
        mem->logicalMemory[REG_IF] |= 0x4;
    } else {
        ++*TIMA;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0xff05, %rax           # imm = 0xFF05
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0xd8be
movq -0x8(%rbp), %rax
movb 0xff06(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movzbl 0xff0f(%rax), %ecx
orl $0x4, %ecx
movb %cl, 0xff0f(%rax)
jmp 0xd8c9
movq -0x18(%rbp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movq 0x2e52(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x1040
movl %eax, %esi
leaq 0xe6d(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
movq 0x2e2b(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
callq 0x1040
movl %eax, %esi
leaq 0xe61(%rip), %rdi       # 0x2017
movb $0x0, %al
callq 0x1030
movq 0x2e34(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
callq 0x1040
movl %eax, %esi
leaq 0xe55(%rip), %rdi       # 0x202a
movb $0x0, %al
callq 0x1030
leaq 0xe5a(%rip), %rdi       # 0x203d
leaq 0xe5e(%rip), %rsi       # 0x2048
callq 0x1050
movq %rax, %rdi
callq 0x1040
movl %eax, %esi
leaq 0xe13(%rip), %rdi       # 0x2013
movb $0x0, %al
callq 0x1030
movl $0x0, -0xc(%rbp)
leaq 0xe35(%rip), %rdi       # 0x204a
leaq -0x8(%rbp), %rsi
movb $0x0, %al
callq 0x1060
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
leaq 0xe1a(%rip), %rdi       # 0x204d
movb $0x0, %al
callq 0x1030
movl -0x8(%rbp), %esi
leaq 0xdcf(%rip), %rdi       # 0x2013
movb $0x0, %al
callq 0x1030
jmp 0x120e
// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x18, %rsp
xorl %eax, %eax
movl %eax, %edi
callq 0x1060
movl %eax, %edi
callq 0x1050
movl $0x0, 0x14(%rsp)
cmpl $0x40, 0x14(%rsp)
jge 0x120b
movl $0x0, 0x10(%rsp)
cmpl $0x400, 0x10(%rsp)      # imm = 0x400
jge 0x11fc
callq 0x1070
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
vcvtsi2ss %edx, %xmm0, %xmm0
vmovss 0xe36(%rip), %xmm1      # 0x2004
vdivss %xmm1, %xmm0, %xmm0
movslq 0x14(%rsp), %rcx
leaq 0x2e82(%rip), %rax      # 0x4060
shlq $0xc, %rcx
addq %rcx, %rax
movslq 0x10(%rsp), %rcx
vmovss %xmm0, (%rax,%rcx,4)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x11ab
jmp 0x11fe
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x119c
movl $0x0, 0xc(%rsp)
cmpl $0x400, 0xc(%rsp)       # imm = 0x400
jge 0x1258
callq 0x1070
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
vcvtsi2ss %edx, %xmm0, %xmm0
vmovss 0xdce(%rip), %xmm1      # 0x2004
vdivss %xmm1, %xmm0, %xmm0
movslq 0xc(%rsp), %rcx
leaq 0x42e1a(%rip), %rax     # 0x44060
vmovss %xmm0, (%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1213
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
movl $0x0, -0x4(%rsp)
cmpl $0x40, -0x4(%rsp)
jge 0x130c
vxorps %xmm0, %xmm0, %xmm0
vmovss %xmm0, -0x8(%rsp)
movslq -0x4(%rsp), %rcx
leaq 0x2dd7(%rip), %rax      # 0x4060
shlq $0xc, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
cmpl $0x400, -0x14(%rsp)     # imm = 0x400
jge 0x12e5
movq -0x10(%rsp), %rax
movslq -0x14(%rsp), %rcx
vmovss (%rax,%rcx,4), %xmm1
movslq -0x14(%rsp), %rcx
leaq 0x42d9e(%rip), %rax     # 0x44060
vmovss (%rax,%rcx,4), %xmm0
vmovss -0x8(%rsp), %xmm2
vfmadd213ss %xmm2, %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + xmm2
vmovss %xmm0, -0x8(%rsp)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x129d
vmovss -0x8(%rsp), %xmm0
movslq -0x4(%rsp), %rcx
leaq 0x43d69(%rip), %rax     # 0x45060
vmovss %xmm0, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rsp)
jmp 0x1268
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 $0x160, %rsp            # imm = 0x160
movl $0x400, 0x9c(%rsp) # imm = 0x400
movl $0x0, 0x1c(%rsp)
cmpl $0x40, 0x1c(%rsp)
jge 0x1512
movl $0x0, 0x18(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %ymm0, 0xa0(%rsp)
vmovaps 0xa0(%rsp), %ymm0
vmovaps %ymm0, 0x20(%rsp)
movl $0x0, 0x14(%rsp)
cmpl $0x400, 0x14(%rsp)      # imm = 0x400
jge 0x1442
movslq 0x14(%rsp), %rcx
leaq 0x42cdd(%rip), %rax     # 0x44060
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rax
vmovaps (%rax), %ymm0
vmovaps %ymm0, 0x60(%rsp)
movslq 0x1c(%rsp), %rcx
leaq 0x2cb0(%rip), %rax      # 0x4060
shlq $0xc, %rcx
addq %rcx, %rax
movslq 0x14(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
vmovaps (%rax), %ymm0
vmovaps %ymm0, 0x40(%rsp)
vmovaps 0x60(%rsp), %ymm2
vmovaps 0x40(%rsp), %ymm1
vmovaps 0x20(%rsp), %ymm0
vmovaps %ymm2, 0x120(%rsp)
vmovaps %ymm1, 0x100(%rsp)
vmovaps %ymm0, 0xe0(%rsp)
vmovaps 0x120(%rsp), %ymm1
vmovaps 0x100(%rsp), %ymm0
vmovaps 0xe0(%rsp), %ymm2
vfmadd213ps %ymm2, %ymm1, %ymm0 # ymm0 = (ymm1 * ymm0) + ymm2
vmovaps %ymm0, 0x20(%rsp)
movslq 0x14(%rsp), %rax
addq $0x8, %rax
movl %eax, 0x14(%rsp)
jmp 0x1369
leaq 0x20(%rsp), %rax
movq %rax, 0x90(%rsp)
movl $0x0, 0x10(%rsp)
movslq 0x10(%rsp), %rax
cmpq $0x8, %rax
jae 0x148d
movq 0x90(%rsp), %rax
movslq 0x10(%rsp), %rcx
vmovss (%rax,%rcx,4), %xmm0
vaddss 0x18(%rsp), %xmm0, %xmm0
vmovss %xmm0, 0x18(%rsp)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x1457
movl $0x400, 0xc(%rsp)       # imm = 0x400
cmpl $0x400, 0xc(%rsp)       # imm = 0x400
jge 0x14eb
movslq 0x1c(%rsp), %rcx
leaq 0x2bb5(%rip), %rax      # 0x4060
shlq $0xc, %rcx
addq %rcx, %rax
movslq 0xc(%rsp), %rcx
vmovss (%rax,%rcx,4), %xmm1
movslq 0xc(%rsp), %rcx
leaq 0x42b98(%rip), %rax     # 0x44060
vmovss (%rax,%rcx,4), %xmm0
vmovss 0x18(%rsp), %xmm2
vfmadd213ss %xmm2, %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + xmm2
vmovss %xmm0, 0x18(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1495
vmovss 0x18(%rsp), %xmm0
movslq 0x1c(%rsp), %rcx
leaq 0x43b63(%rip), %rax     # 0x45060
vmovss %xmm0, (%rax,%rcx,4)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1332
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 $0x2c0, %rsp            # imm = 0x2C0
movl $0x400, 0x13c(%rsp) # imm = 0x400
movl $0x0, 0x3c(%rsp)
cmpl $0x40, 0x3c(%rsp)
jge 0x172d
movl $0x0, 0x38(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %zmm0, 0x140(%rsp)
vmovaps 0x140(%rsp), %zmm0
vmovaps %zmm0, 0x40(%rsp)
movl $0x0, 0x34(%rsp)
cmpl $0x400, 0x34(%rsp)      # imm = 0x400
jge 0x165d
movslq 0x34(%rsp), %rcx
leaq 0x42acd(%rip), %rax     # 0x44060
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rax
vmovaps (%rax), %zmm0
vmovaps %zmm0, 0xc0(%rsp)
movslq 0x3c(%rsp), %rcx
leaq 0x2a9c(%rip), %rax      # 0x4060
shlq $0xc, %rcx
addq %rcx, %rax
movslq 0x34(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rax
vmovaps (%rax), %zmm0
vmovaps %zmm0, 0x80(%rsp)
vmovaps 0xc0(%rsp), %zmm2
vmovaps 0x80(%rsp), %zmm1
vmovaps 0x40(%rsp), %zmm0
vmovaps %zmm2, 0x240(%rsp)
vmovaps %zmm1, 0x200(%rsp)
vmovaps %zmm0, 0x1c0(%rsp)
vmovaps 0x240(%rsp), %zmm1
vmovaps 0x200(%rsp), %zmm0
vmovaps 0x1c0(%rsp), %zmm2
vfmadd213ps %zmm2, %zmm1, %zmm0 # zmm0 = (zmm1 * zmm0) + zmm2
vmovaps %zmm0, 0x40(%rsp)
movslq 0x34(%rsp), %rax
addq $0x10, %rax
movl %eax, 0x34(%rsp)
jmp 0x1579
leaq 0x40(%rsp), %rax
movq %rax, 0x130(%rsp)
movl $0x0, 0x30(%rsp)
movslq 0x30(%rsp), %rax
cmpq $0x10, %rax
jae 0x16a8
movq 0x130(%rsp), %rax
movslq 0x30(%rsp), %rcx
vmovss (%rax,%rcx,4), %xmm0
vaddss 0x38(%rsp), %xmm0, %xmm0
vmovss %xmm0, 0x38(%rsp)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x1672
movl $0x400, 0x2c(%rsp)      # imm = 0x400
cmpl $0x400, 0x2c(%rsp)      # imm = 0x400
jge 0x1706
movslq 0x3c(%rsp), %rcx
leaq 0x299a(%rip), %rax      # 0x4060
shlq $0xc, %rcx
addq %rcx, %rax
movslq 0x2c(%rsp), %rcx
vmovss (%rax,%rcx,4), %xmm1
movslq 0x2c(%rsp), %rcx
leaq 0x4297d(%rip), %rax     # 0x44060
vmovss (%rax,%rcx,4), %xmm0
vmovss 0x38(%rsp), %xmm2
vfmadd213ss %xmm2, %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + xmm2
vmovss %xmm0, 0x38(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x16b0
vmovss 0x38(%rsp), %xmm0
movslq 0x3c(%rsp), %rcx
leaq 0x43948(%rip), %rax     # 0x45060
vmovss %xmm0, (%rax,%rcx,4)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x1542
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
nopw %cs:(%rax,%rax)