LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/clint.c
// Function: CLINT_init
int CLINT_init(struct region *r) {
  uint32_t *data;

  if(r->data != NULL) {
    display_log("CLINT already initialized");
    return 0;
  }
 
  data = malloc(r->size);
  if(data == NULL){
    return 0;
  }
  r->data = (void *)data;
  memset(r->data, 0, r->size);
  display_log("Set up CLINT region");
  return 1;
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x38(%rdi)
je 0x599f
xorl %ebx, %ebx
leaq 0x2dc8(%rip), %rdi      # 0x8765
jmp 0x59c4
movq %rdi, %rbx
movl 0xc(%rdi), %esi
movl $0x1, %edi
callq 0x2140
testq %rax, %rax
je 0x59cd
movq %rax, 0x38(%rbx)
movl $0x1, %ebx
leaq 0x2dbb(%rip), %rdi      # 0x877f
callq 0x4d36
movl %ebx, %eax
popq %rbx
retq
xorl %ebx, %ebx
jmp 0x59c9
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/clint.c
// Function: CLINT_get
int CLINT_get(struct region *r, uint32_t address, uint32_t *value) {
   uint32_t v = 0;
   char buffer[100];
   if((address & 3) != 0) {
     fprintf(stderr,"Unaligned memory read 0x%08x\n", r->base+address);
     return 0;
   }

   if(address+4 > r->size) {
     fprintf(stderr,"Memory region boundary crossed at 0x%08x\n", r->base+address);
     return 0;
   }

   v = ((unsigned char *)r->data)[address]; 
   v = v + (((unsigned char *)r->data)[address+1] << 8); 
   v = v + (((unsigned char *)r->data)[address+2] << 16); 
   v = v + (((unsigned char *)r->data)[address+3] << 24); 

   switch(address) {
     case 0x0000: // MSIP regs
        *value = v;
	break;
     case 0x4000: // Timer Compare Reg
        *value = v;
	break;
     case 0x4004:
        *value = v;
	break;
     case 0xBFF8:   // Cycle count
        *value = riscv_cycle_count_l();
	break;
     case 0xBFFC:
        *value = riscv_cycle_count_h();
	break;
     default:
        sprintf(buffer,"CLINT Rd of non-register address 0x%08x", address);
        display_log(buffer);
	*value = 0;
	return 1;
   }
     
   sprintf(buffer,"CLINT Rd address 0x%08x: 0x%08x", address, v);
   display_log(buffer);

   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebx
testb $0x3, %bl
jne 0x5b8e
leal 0x4(%rbx), %eax
cmpl 0xc(%rdi), %eax
ja 0x5ba4
movq %rdx, %r14
movq 0x38(%rdi), %rax
movl %ebx, %ecx
movl (%rax,%rcx), %ebp
movl %ebp, %eax
cmpl $0x4003, %ebx           # imm = 0x4003
jle 0x5b1f
cmpl $0x4004, %ebx           # imm = 0x4004
je 0x5b59
cmpl $0xbffc, %ebx           # imm = 0xBFFC
je 0x5b54
cmpl $0xbff8, %ebx           # imm = 0xBFF8
jne 0x5b2d
callq 0x2f93
jmp 0x5b59
testl %ebx, %ebx
je 0x5b59
movl %ebp, %eax
cmpl $0x4000, %ebx           # imm = 0x4000
je 0x5b59
leaq 0x2c7f(%rip), %rsi      # 0x87b3
movq %rsp, %r15
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2210
movq %r15, %rdi
callq 0x4d36
movl $0x0, (%r14)
jmp 0x5b7c
callq 0x2f9a
movl %eax, (%r14)
leaq 0x2c78(%rip), %rsi      # 0x87db
movq %rsp, %r14
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2210
movq %r14, %rdi
callq 0x4d36
movl $0x1, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x6463(%rip), %rax      # 0xbff8
movq (%rax), %rax
addl 0x8(%rdi), %ebx
leaq 0x2446(%rip), %rsi      # 0x7fe8
jmp 0x5bb8
movq 0x644d(%rip), %rax      # 0xbff8
movq (%rax), %rax
addl 0x8(%rdi), %ebx
leaq 0x23e7(%rip), %rsi      # 0x7f9f
xorl %ebp, %ebp
movq %rax, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2150
jmp 0x5b81
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/clint.c
// Function: CLINT_free
void CLINT_free(struct region *r) {
   char buffer[100];
   sprintf(buffer, "Releasing CLINT at 0x%08x", r->base);
   display_log(buffer);
   if(r->data != NULL) 
     free(r->data);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl 0x8(%rdi), %edx
leaq 0x2b93(%rip), %rsi      # 0x8817
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2210
movq %r14, %rdi
callq 0x4d36
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x5ca7
callq 0x2040
addq $0x68, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/gpio.c
// Function: GPIO_init
int GPIO_init(struct region *r) {
  uint32_t *data;

  if(r->data != NULL) {
    display_log("GPIO already initialized");
    return 0;
  }
 
  data = malloc(r->size);
  if(data == NULL){
    return 0;
  }
  r->data = (void *)data;
  memset(r->data, 0, r->size);
  display_log("Set up GPIO region");
  return 1;
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x38(%rdi)
je 0x5cc3
xorl %ebx, %ebx
leaq 0x2b70(%rip), %rdi      # 0x8831
jmp 0x5ce8
movq %rdi, %rbx
movl 0xc(%rdi), %esi
movl $0x1, %edi
callq 0x2140
testq %rax, %rax
je 0x5cf1
movq %rax, 0x38(%rbx)
movl $0x1, %ebx
leaq 0x2b62(%rip), %rdi      # 0x884a
callq 0x4d36
movl %ebx, %eax
popq %rbx
retq
xorl %ebx, %ebx
jmp 0x5ced
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/gpio.c
// Function: GPIO_free
void GPIO_free(struct region *r) {
   char buffer[100];
   sprintf(buffer, "Releasing GPIO at 0x%08x", r->base);
   display_log(buffer);
   if(r->data != NULL) 
     free(r->data);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl 0x8(%rdi), %edx
leaq 0x298a(%rip), %rsi      # 0x88b6
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2210
movq %r14, %rdi
callq 0x4d36
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x5f4f
callq 0x2040
addq $0x68, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/memory.c
// Function: memory_read_request
uint32_t memory_read_request(uint32_t address) {
  if(read_request_fifo.count == FIFO_SIZE)
    return 0;
  read_request_fifo.address[read_request_fifo.write_ptr] = address;
  read_request_fifo.count++;
  read_request_fifo.write_ptr = (read_request_fifo.write_ptr == FIFO_SIZE-1) ? 0 : read_request_fifo.write_ptr+1;
  return 1;
}

// Assembly:
movl 0xad5f(%rip), %ecx      # 0x10d48
xorl %eax, %eax
cmpl $0x8, %ecx
je 0x6023
movl 0xad4e(%rip), %eax      # 0x10d44
leaq 0xad43(%rip), %rdx      # 0x10d40
incl %ecx
leal 0x1(%rax), %esi
xorl %r8d, %r8d
cmpq $0x7, %rax
movl %edi, 0xc(%rdx,%rax,4)
movl %ecx, 0xad35(%rip)      # 0x10d48
cmovnel %esi, %r8d
movl %r8d, 0xad26(%rip)      # 0x10d44
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/memory.c
// Function: memory_fetch_request
uint32_t memory_fetch_request(uint32_t address) {
  if(fetch_request_fifo.count == FIFO_SIZE)
    return 0;

  fetch_request_fifo.address[fetch_request_fifo.write_ptr] = address;
  fetch_request_fifo.count++;
  fetch_request_fifo.write_ptr = (fetch_request_fifo.write_ptr == FIFO_SIZE-1) ? 0 : fetch_request_fifo.write_ptr+1;

  return 1;
}

// Assembly:
movl 0xad4a(%rip), %ecx      # 0x10d74
xorl %eax, %eax
cmpl $0x8, %ecx
je 0x6064
movl 0xad39(%rip), %eax      # 0x10d70
leaq 0xad2e(%rip), %rdx      # 0x10d6c
incl %ecx
leal 0x1(%rax), %esi
xorl %r8d, %r8d
cmpq $0x7, %rax
movl %edi, 0xc(%rdx,%rax,4)
movl %ecx, 0xad20(%rip)      # 0x10d74
cmovnel %esi, %r8d
movl %r8d, 0xad11(%rip)      # 0x10d70
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/memory.c
// Function: memory_read_data
uint32_t memory_read_data(void) {
  uint32_t rtn;
  if(read_data_fifo.count == 0) {
    display_log("Attempt to read empty FIFO read_data");
    return 0;
  }

  rtn = read_data_fifo.data[read_data_fifo.read_ptr];
  read_data_fifo.count--;
  read_data_fifo.read_ptr = (read_data_fifo.read_ptr == FIFO_SIZE-1) ? 0 : read_data_fifo.read_ptr+1; 
  return rtn;
}

// Assembly:
movl 0xabff(%rip), %ecx      # 0x10c84
testl %ecx, %ecx
je 0x60b5
movl 0xabed(%rip), %eax      # 0x10c7c
leaq 0xabe6(%rip), %rdx      # 0x10c7c
decl %ecx
leal 0x1(%rax), %esi
xorl %edi, %edi
cmpq $0x7, %rax
movl 0xc(%rdx,%rax,4), %eax
movl %ecx, 0xabd9(%rip)      # 0x10c84
cmovnel %esi, %edi
movl %edi, 0xabc8(%rip)      # 0x10c7c
retq
pushq %rax
leaq 0x281f(%rip), %rdi      # 0x88dc
callq 0x4d36
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/memory.c
// Function: memory_fetch_data
uint32_t memory_fetch_data(void) {
  uint32_t rtn;
  if(fetch_data_fifo.count == 0) {
    display_log("Attempt to read empty FIFO fetch_data");
    return 0;
  }

  rtn = fetch_data_fifo.data[fetch_data_fifo.read_ptr];
  fetch_data_fifo.count--;
  fetch_data_fifo.read_ptr = (fetch_data_fifo.read_ptr == FIFO_SIZE-1) ? 0 : fetch_data_fifo.read_ptr+1;
  return rtn;
}

// Assembly:
movl 0xabe1(%rip), %ecx      # 0x10cb0
testl %ecx, %ecx
je 0x60ff
movl 0xabcf(%rip), %eax      # 0x10ca8
leaq 0xabc8(%rip), %rdx      # 0x10ca8
decl %ecx
leal 0x1(%rax), %esi
xorl %edi, %edi
cmpq $0x7, %rax
movl 0xc(%rdx,%rax,4), %eax
movl %ecx, 0xabbb(%rip)      # 0x10cb0
cmovnel %esi, %edi
movl %edi, 0xabaa(%rip)      # 0x10ca8
retq
pushq %rax
leaq 0x27fa(%rip), %rdi      # 0x8901
callq 0x4d36
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/hamsternz[P]emulate-risc-v/memory.c
// Function: memory_write_request
int      memory_write_request(uint32_t address, uint32_t mask, uint32_t value) {
  if(write_request_fifo.count == FIFO_SIZE) {
    return 0;
  }
  write_request_fifo.address[write_request_fifo.write_ptr] = address;
  write_request_fifo.mask[write_request_fifo.write_ptr]    = mask;
  write_request_fifo.data[write_request_fifo.write_ptr]    = value;
  write_request_fifo.count++;
  write_request_fifo.write_ptr = (write_request_fifo.write_ptr == FIFO_SIZE-1) ? 0 : write_request_fifo.write_ptr+1;
  return 1; 
}

// Assembly:
movl 0xabb6(%rip), %ecx      # 0x10cdc
xorl %eax, %eax
cmpl $0x8, %ecx
je 0x616c
movl 0xaba5(%rip), %eax      # 0x10cd8
leaq 0xab9a(%rip), %r8       # 0x10cd4
incl %ecx
leal 0x1(%rax), %r9d
xorl %r10d, %r10d
cmpq $0x7, %rax
movl %edi, 0xc(%r8,%rax,4)
movl %esi, 0x2c(%r8,%rax,4)
movl %edx, 0x4c(%r8,%rax,4)
movl %ecx, 0xab80(%rip)      # 0x10cdc
cmovnel %r9d, %r10d
movl %r10d, 0xab71(%rip)     # 0x10cd8
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/rain/editor_main.cpp
// Function: read_with_default(char const*, char const*, char*, unsigned int)
void read_with_default(const char *prompt, const char *def, char *val, u32 length) {
    s32 input_length;
    do {
        printf("%s", prompt);
        if (def)
            printf(" [%s]", def);
        printf(": ");

        fgets(val, length, stdin);
        input_length = strlen(val);
        if (val[MAX(input_length - 1, 0)] == '\n') {
            break;
        }

        printf("You passed in a too long string, max length is %d.\n", length);
        do {
            fgets(val, length, stdin);
            input_length = strlen(val);
        } while (val[MAX(input_length - 1, 0)] != '\n');
    } while (true);

    if (input_length == 2)
        memcpy((void *) def, (void *) val, strlen(def));
    else
        val[input_length - 1] = '\0';

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
movq 0x4c81b(%rip), %r13     # 0x4efe8
movl $0x1, %r12d
leaq 0x2ead1(%rip), %rdi     # 0x312ab
movq -0x30(%rbp), %rsi
xorl %eax, %eax
callq 0x2080
testq %r14, %r14
je 0x27fb
leaq 0x2d8bf(%rip), %rdi     # 0x300b0
movq %r14, %rsi
xorl %eax, %eax
callq 0x2080
leaq 0x2e736(%rip), %rdi     # 0x30f38
xorl %eax, %eax
callq 0x2080
movq (%r13), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x22f0
movq %rbx, %rdi
callq 0x2250
movslq %eax, %rcx
decq %rcx
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
cmpb $0xa, (%rbx,%rdx)
je 0x2871
leaq 0x2d879(%rip), %rdi     # 0x300b6
movl %r15d, %esi
xorl %eax, %eax
callq 0x2080
movq (%r13), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x22f0
movq %rbx, %rdi
callq 0x2250
cmpl $0x2, %eax
cmovll %r12d, %eax
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x2847
jmp 0x27d3
cmpl $0x2, %eax
jne 0x289a
movq %r14, %rdi
callq 0x2250
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2090
movb $0x0, (%rbx,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/rain/editor_main.cpp
// Function: write_sprite_to_file(EditableSprite, _IO_FILE*)
void write_sprite_to_file(EditableSprite sprite, FILE *file) {
    fprintf(file, "%s:#%llu:%d:", sprite.name,
            fog_asset_hash(sprite.sheet), sprite.points.size());

    Vec2 center = fog_V2(0, 0);
    for (u32 i = 0; i < sprite.points.size(); i++) {
        center += sprite.points[i];
    }
    center /= sprite.points.size();
    for (u32 i = 0; i < sprite.points.size(); i++) {
        Vec2 p = sprite.points[i];
        fprintf(file, "(%f %f %f %f)",
            p.x - center.x, p.y - center.y,
            p.x, p.y);
    }
    fprintf(file, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r15
movq 0x18(%rdi), %rdi
callq 0x2821d
movq 0x8(%r14), %r8
subq (%r14), %r8
sarq $0x3, %r8
leaq 0x2d809(%rip), %rsi     # 0x300ea
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2170
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x28631
movq (%r14), %rax
movq 0x8(%r14), %rdx
movq %rdx, %rcx
subq %rax, %rcx
je 0x29c2
sarq $0x3, %rcx
xorl %esi, %esi
movsd (%rax,%rsi,8), %xmm1
addps %xmm1, %xmm0
incq %rsi
movl %esi, %edi
cmpq %rdi, %rcx
ja 0x2915
cmpq %rax, %rdx
je 0x29c2
movaps %xmm0, %xmm2
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
movss 0x2d6bd(%rip), %xmm3    # 0x30004
divss %xmm1, %xmm3
mulss %xmm3, %xmm0
mulss %xmm2, %xmm3
movss %xmm3, -0x24(%rbp)
movl $0x1, %r12d
xorl %ecx, %ecx
leaq 0x2d790(%rip), %r15     # 0x300f7
movaps %xmm0, -0x40(%rbp)
movss (%rax,%rcx,8), %xmm3
movss 0x4(%rax,%rcx,8), %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm3, %xmm2
subss %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
xorps %xmm3, %xmm3
cvtss2sd %xmm1, %xmm3
subss -0x24(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movq %rbx, %rdi
movq %r15, %rsi
movb $0x4, %al
callq 0x2170
movaps -0x40(%rbp), %xmm0
movl %r12d, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x296b
movl $0xa, %edi
movq %rbx, %rsi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2400
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/rain/editor_main.cpp
// Function: find_next_sheet(unsigned long long, int)
AssetID find_next_sheet(AssetID start=0, int dir=1) {
    for (s32 i = 1; i < (s32) fog_asset_num(); i++) {
        AssetID curr = (start + i * dir + fog_asset_num()) % fog_asset_num();
        if (fog_asset_is(curr, Type::TEXTURE))
            return curr;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %r14
callq 0x2820c
movq $-0x1, %rbx
cmpl $0x2, %eax
jl 0x2a52
movslq %r15d, %r12
addq %r12, %r14
movl $0x1, %r13d
callq 0x2820c
movq %rax, %r15
addq %r14, %r15
callq 0x2820c
movq %rax, %rcx
movq %r15, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
movq %rdx, %rdi
movl $0x1, %esi
callq 0x281e0
testb %al, %al
jne 0x2a4f
incq %r13
callq 0x2820c
cltq
addq %r12, %r14
cmpq %rax, %r13
jl 0x2a0c
jmp 0x2a52
movq %r15, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/rain/editor_main.cpp
// Function: create_new_sprite()
void create_new_sprite() {
    EditableSprite new_sprite = {
        std::vector<Vec2>(0),
        find_next_sheet(0, 1),
    };
    read_with_default("sprite name",
            nullptr,
            new_sprite.name,
            MAX_TEXT_LENGTH);

    global_editor.current_sprite = global_editor.sprites.size();
    global_editor.sprites.push_back(new_sprite);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
leaq -0x20(%rbp), %rbx
movaps %xmm0, -0x20(%rbx)
movq $0x0, -0x10(%rbx)
xorl %edi, %edi
movl $0x1, %esi
callq 0x29db
movq %rax, -0x8(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
leaq 0x2d60c(%rip), %rdi     # 0x30105
xorl %esi, %esi
movq %rbx, %rdx
movl $0x10, %ecx
callq 0x27ab
movq 0x4d279(%rip), %rax     # 0x4fd88
subq 0x4d26a(%rip), %rax     # 0x4fd80
leaq 0x4d263(%rip), %rdi     # 0x4fd80
shrq $0x4, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
movl %eax, 0x4d24b(%rip)     # 0x4fd78
leaq -0x40(%rbp), %rsi
callq 0x43ae
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x2b4b
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x20e0
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x2b6a
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/rain/editor_main.cpp
// Function: main
int main(int argc, char *argv[]) {
    fog_input_request_name((u32) In::EDIT_NUM_BINDINGS);
    fog_init(argc, argv);
    setup(argc, argv);

    fog_run(sprite_editor_update, sprite_editor_draw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
movl $0x12, %edi
callq 0x28d9d
movl %r14d, %edi
movq %rbx, %rsi
callq 0x28270
movl %r14d, %edi
movq %rbx, %rsi
callq 0x2b72
leaq -0xf39(%rip), %rdi      # 0x33b0
leaq -0x458(%rip), %rsi      # 0x3e98
callq 0x28287
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/printf.c
// Function: fctprintf
int fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...)
{
  va_list va;
  va_start(va, format);
  const out_fct_wrap_type out_fct_wrap = { out, arg };
  const int ret = _vsnprintf(_out_fct, (char*)(uintptr_t)&out_fct_wrap, (size_t)-1, format, va);
  va_end(va);
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdx, %r10
leaq -0xe0(%rbp), %rdx
movq %rcx, 0x18(%rdx)
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0x7129
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq -0x30(%rbp), %r8
movq %rdx, 0x10(%r8)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%r8)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%r8)
leaq -0x10(%rbp), %rax
movq %rdi, (%rax)
movq %rsi, 0x8(%rax)
leaq 0x1b(%rip), %rdi        # 0x7173
movq %rax, %rsi
movq $-0x1, %rdx
movq %r10, %rcx
callq 0x6606
addq $0xe0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, unsigned char*)
b8 tweak(const char *name, b8 *value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %s", name, *value ? "true" : "false");
    debug_value_logic(name, buffer);

    if (name == global_tweak.active && Input::mouse_pressed(0)) {
        *value = !*value;
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x45fba(%rip)     # 0x4f370
je 0x9417
movq %rsi, %rbx
movq %rdi, %r15
cmpb $0x0, (%rsi)
leaq 0x284df(%rip), %rax     # 0x318a7
leaq 0x284d3(%rip), %rdx     # 0x318a2
cmoveq %rax, %rdx
leaq 0x284c0(%rip), %rdi     # 0x3189a
xorl %r14d, %r14d
movq %r15, %rsi
xorl %eax, %eax
callq 0xa899
movq %r15, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x469ef(%rip), %rax     # 0x4fde8
cmpq %r15, 0x18(%rax)
jne 0x941a
leaq 0x45ed2(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
jne 0x941a
cmpb $0x0, (%rbx)
sete (%rbx)
movb $0x1, %r14b
jmp 0x941a
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, int*)
b8 tweak(const char *name, s32 *value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %d", name, *value);
    debug_value_logic(name, buffer);

    if (name == global_tweak.hot) {
        s32 delta = moved_over_boundry().x;
        *value += delta;
        return delta != 0;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x45f2d(%rip)     # 0x4f370
je 0x9488
movq %rsi, %rbx
movq %rdi, %r15
movl (%rsi), %edx
leaq 0x28463(%rip), %rdi     # 0x318b7
xorl %r14d, %r14d
movq %r15, %rsi
xorl %eax, %eax
callq 0xa899
movq %r15, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x46975(%rip), %rax     # 0x4fde8
cmpq %r15, 0x20(%rax)
jne 0x948b
callq 0x23e6c
addl %eax, (%rbx)
testl %eax, %eax
setne %r14b
jmp 0x948b
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, unsigned int*)
b8 tweak(const char *name, u32 *value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %u", name, *value);
    debug_value_logic(name, buffer);

    if (name == global_tweak.hot) {
        s32 delta = moved_over_boundry().x;
        if ((s32) *value < -delta) {
            *value = 0;
        } else {
            *value += delta;
        }
        return delta != 0;
    }
    return true;
}

// Assembly:
cmpb $0x0, 0x45ec6(%rip)     # 0x4f370
je 0x9512
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %edx
leaq 0x283fa(%rip), %rdi     # 0x318bf
xorl %r15d, %r15d
movq %r14, %rsi
xorl %eax, %eax
callq 0xa899
movq %r14, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x46904(%rip), %rcx     # 0x4fde8
movb $0x1, %al
cmpq %r14, 0x20(%rcx)
jne 0x9507
callq 0x23e6c
movq %rax, %rcx
movl (%rbx), %edx
movl %ecx, %esi
negl %esi
setb %al
addl %edx, %ecx
cmpl %esi, %edx
cmovll %r15d, %ecx
movl %ecx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, float*, float)
b8 tweak(const char *name, f32 *value, f32 modifier) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f", name, *value);
    debug_value_logic(name, buffer);

    if (name == global_tweak.hot) {
        f32 delta;
        if (Input::down(TWEAK_STEP)) {
            delta = moved_over_boundry().x;

            if (Input::down(TWEAK_SMOOTH))
                delta *= 0.1;

            if (delta) {
                *value += delta;
                precise_snap(value);
            }
        } else {
            delta = scaled_mouse_movements().x;
            *value += delta * modifier;
        }
        return delta != 0;
    }
    return false;
}

// Assembly:
cmpb $0x0, 0x45e4a(%rip)     # 0x4f370
je 0x9574
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movss %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
cvtss2sd (%rsi), %xmm0
leaq 0x28362(%rip), %rdi     # 0x318ad
movq %r14, %rsi
movb $0x1, %al
callq 0xa899
movq %r14, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x46881(%rip), %r15     # 0x4fde8
cmpq %r14, 0x20(%r15)
je 0x9577
xorl %eax, %eax
jmp 0x969f
xorl %eax, %eax
retq
leaq 0x5b3f2(%rip), %rax     # 0x64970
movl (%rax), %edi
movl $0xf, %esi
callq 0xb743
testb %al, %al
je 0x95cd
callq 0x23e6c
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x1c(%rbp)
leaq 0x5b3c6(%rip), %r14     # 0x6496c
movl (%r14), %edi
movl $0xf, %esi
callq 0xb743
testb %al, %al
je 0x9616
xorps %xmm0, %xmm0
cvtss2sd -0x1c(%rbp), %xmm0
mulsd 0x26aa1(%rip), %xmm0    # 0x30068
cvtsd2ss %xmm0, %xmm1
jmp 0x961b
leaq 0x45d04(%rip), %rax     # 0x4f2d8
xorps %xmm0, %xmm0
cvtsi2ssl 0x7c(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
leaq 0x5b384(%rip), %rax     # 0x6496c
movl (%rax), %edi
movl $0xf, %esi
callq 0xb743
movss -0x1c(%rbp), %xmm1
leaq 0x4(%r15), %rcx
testb %al, %al
cmoveq %r15, %rcx
mulss (%rcx), %xmm1
movss -0x20(%rbp), %xmm0
mulss %xmm1, %xmm0
addss (%rbx), %xmm0
jmp 0x968c
movss -0x1c(%rbp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x9625
jnp 0x9690
movss (%rbx), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rbx)
movl (%r14), %edi
movl $0xf, %esi
movss %xmm1, -0x1c(%rbp)
callq 0xb743
xorl %ecx, %ecx
testb %al, %al
sete %cl
leaq 0x273ff(%rip), %rax     # 0x30a50
movss (%rax,%rcx,4), %xmm1
movss %xmm1, -0x20(%rbp)
movss (%rbx), %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x273e9(%rip), %xmm0    # 0x30a58
callq 0x2100
xorps %xmm1, %xmm1
cvtss2sd -0x20(%rbp), %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss -0x1c(%rbp), %xmm1
movss %xmm0, (%rbx)
xorps %xmm0, %xmm0
cmpneqss %xmm1, %xmm0
movd %xmm0, %eax
andl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, unsigned char)
b8 show(const char *name, b8 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %s", name, value ? "true" : "false");
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x457c4(%rip)     # 0x4f370
je 0x9c03
movq %rdi, %rbx
testb %sil, %sil
leaq 0x27cec(%rip), %rax     # 0x318a7
leaq 0x27ce0(%rip), %rdx     # 0x318a2
cmoveq %rax, %rdx
leaq 0x27ccd(%rip), %rdi     # 0x3189a
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa899
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x461fc(%rip), %rax     # 0x4fde8
cmpq %rbx, 0x18(%rax)
jne 0x9c06
leaq 0x456df(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %r14b
jmp 0x9c06
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, int)
b8 show(const char *name, s32 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %d", name, value);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x4574a(%rip)     # 0x4f370
je 0x9c68
movl %esi, %edx
movq %rdi, %r14
leaq 0x27c83(%rip), %rdi     # 0x318b7
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0xa899
movq %r14, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x46196(%rip), %rax     # 0x4fde8
cmpq %r14, 0x18(%rax)
jne 0x9c6a
leaq 0x45679(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %bl
jmp 0x9c6a
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, unsigned int)
b8 show(const char *name, u32 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %u", name, value);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x456e7(%rip)     # 0x4f370
je 0x9ccb
movl %esi, %edx
movq %rdi, %r14
leaq 0x27c28(%rip), %rdi     # 0x318bf
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0xa899
movq %r14, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x46133(%rip), %rax     # 0x4fde8
cmpq %r14, 0x18(%rax)
jne 0x9ccd
leaq 0x45616(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %bl
jmp 0x9ccd
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, float)
b8 show(const char *name, f32 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f", name, value);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
cmpb $0x0, 0x4568b(%rip)     # 0x4f370
je 0x9d21
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm0
leaq 0x27bb2(%rip), %rdi     # 0x318ad
movq %rbx, %rsi
movb $0x1, %al
callq 0xa899
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x460d1(%rip), %rax     # 0x4fde8
cmpq %rbx, 0x18(%rax)
je 0x9d24
xorl %eax, %eax
jmp 0x9d32
xorl %eax, %eax
retq
leaq 0x455ad(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, Vec2)
b8 show(const char *name, Vec2 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f, %.4f", name, value.x, value.y);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
cmpb $0x0, 0x45626(%rip)     # 0x4f370
je 0x9d91
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvtss2sd %xmm0, %xmm1
leaq 0x27b5f(%rip), %rdi     # 0x318c7
movq %rbx, %rsi
movaps %xmm2, %xmm0
movb $0x2, %al
callq 0xa899
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x46061(%rip), %rax     # 0x4fde8
cmpq %rbx, 0x18(%rax)
je 0x9d94
xorl %eax, %eax
jmp 0x9da2
xorl %eax, %eax
retq
leaq 0x4553d(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, Span)
b8 show(const char *name, Span value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f, %.4f", name, value.min, value.max);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
cmpb $0x0, 0x455b6(%rip)     # 0x4f370
je 0x9e01
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvtss2sd %xmm0, %xmm1
leaq 0x27aef(%rip), %rdi     # 0x318c7
movq %rbx, %rsi
movaps %xmm2, %xmm0
movb $0x2, %al
callq 0xa899
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x45ff1(%rip), %rax     # 0x4fde8
cmpq %rbx, 0x18(%rax)
je 0x9e04
xorl %eax, %eax
jmp 0x9e12
xorl %eax, %eax
retq
leaq 0x454cd(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::add_mod(unsigned int, unsigned int, Input::Player, float)
b8 add_mod(InputCode code, Name name, Player player, f32 modifier) {
    Binding binding = {code, player, name, 0};

    // Check if there is a free binding.
    ASSERT(is_valid_player(player), "");
    auto buttons = global_mapping.buttons[toID(player)];
    u32 index = binding.index();
    b8 valid = false;
    for (u32 i = 0; i < NUM_ALTERNATIVE_BINDINGS; i++) {
        if (buttons[index + i].is_used()) continue;
        binding.binding_id = i;
        buttons[index + i].reset(name, modifier);
        valid = true;
        break;
    }

    CHECK(valid, "Cannot add new mapping");
    if (!valid) return false;

    insert(binding);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movss %xmm0, -0x24(%rbp)
movl %edx, %r12d
movl %esi, %ebx
movl %edi, %eax
movq %r12, %r14
shlq $0x20, %r14
movl %esi, %r15d
cmpl $0x4, %edx
ja 0x9f8b
movb $0x1, %cl
movl $0x16, %edx
btl %r12d, %edx
jb 0x9f92
cmpl $0x8, %r12d
sete %cl
orq %rax, %r14
movzbl %cl, %ecx
leaq 0x26f10(%rip), %rdi     # 0x30eaf
leaq 0x26f7b(%rip), %rdx     # 0x30f21
movl $0x27, %esi
callq 0x729c
movl %r12d, %edi
callq 0x9ec0
movl %eax, %eax
leaq 0x45317(%rip), %rdx     # 0x4f2d8
xorl %ecx, %ecx
testl %ebx, %ebx
setne %cl
leal (,%rbx,4), %r12d
shlq $0x4, %r12
addq 0x20(%rdx,%rax,8), %r12
leaq 0x26b9d(%rip), %rdi     # 0x30b7d
leaq 0x28608(%rip), %rdx     # 0x325ef
movl $0x76, %esi
callq 0x729c
xorl %eax, %eax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpl $0x0, (%r12,%rax)
je 0xa047
addq %rcx, %r15
addq $0x10, %rax
cmpq $0x40, %rax
jne 0x9ffd
movq 0x44fb8(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0x26b41(%rip), %rdi     # 0x30b63
leaq 0x26e86(%rip), %rdx     # 0x30eaf
leaq 0x26b3b(%rip), %r8      # 0x30b6b
leaq 0x26f04(%rip), %r9      # 0x30f3b
xorl %ebx, %ebx
movl $0x33, %ecx
xorl %eax, %eax
callq 0x718c
jmp 0xa06d
movl %ebx, (%r12,%rax)
movss -0x24(%rbp), %xmm0
movss %xmm0, 0x4(%r12,%rax)
movq $0x0, 0x8(%r12,%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0xaf71
movb $0x1, %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/font_settings.h
// Function: Util::init()
b8 init() {
        DEBUG_FONT = Asset::fetch_id("MONACO_FONT");
        if (DEBUG_FONT != Asset::ASSET_ID_NO_ASSET)
            return true;
        LOG("Failed to load the default font.");
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x26b16(%rip), %rdi     # 0x30bb7
callq 0xa0f9
leaq 0x5a8d3(%rip), %rcx     # 0x64980
movq %rax, (%rcx)
movb $0x1, %bl
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jne 0xa0f0
movq 0x44f05(%rip), %rax     # 0x4efc8
movq (%rax), %rsi
leaq 0x26af6(%rip), %rdi     # 0x30bc3
leaq 0x26af3(%rip), %rdx     # 0x30bc7
leaq 0x26b0c(%rip), %r8      # 0x30be7
leaq 0x26b0a(%rip), %r9      # 0x30bec
xorl %ebx, %ebx
movl $0xe, %ecx
xorl %eax, %eax
callq 0x718c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/asset/asset.cpp
// Function: Asset::fetch_id(char const*)
AssetID fetch_id(const char *str) {
    u64 hash = asset_hash(str);
    for (u64 i = 0; i < system.num_assets; i++) {
        Header *headers = system.headers;
        if (headers[i].hash == hash) return i;
    }
    LOG("Failed to load asset: '%s', check that the correct .fog file is loaded.", str);
    return ASSET_ID_NO_ASSET;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb (%rdi), %dl
testb %dl, %dl
je 0xa153
leaq 0x1(%rdi), %rax
movl $0x14e7, %ecx           # imm = 0x14E7
movsbq %dl, %rdx
incq %rcx
imulq %rdx, %rcx
movb (%rax), %dl
incq %rax
testb %dl, %dl
jne 0xa110
movabsq $0x1000000101, %rdx     # imm = 0x1000000101
movq %rcx, %rax
mulq %rdx
movq %rcx, %rsi
subq %rdx, %rsi
shrq %rsi
addq %rdx, %rsi
shrq $0x1b, %rsi
movq %rsi, %rax
shlq $0x1c, %rax
subq %rax, %rsi
addq %rcx, %rsi
jmp 0xa158
movl $0x14e7, %esi           # imm = 0x14E7
leaq 0x61139(%rip), %rax     # 0x6b298
movq 0x38(%rax), %rcx
testq %rcx, %rcx
je 0xa183
movq 0x28(%rax), %rdx
addq $0x28, %rdx
xorl %eax, %eax
cmpq %rsi, (%rdx)
je 0xa1be
incq %rax
addq $0x38, %rdx
cmpq %rax, %rcx
jne 0xa172
movq 0x44e3e(%rip), %rax     # 0x4efc8
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0x26a2b(%rip), %rdi     # 0x30bc3
leaq 0x27437(%rip), %rdx     # 0x315d6
leaq 0x274af(%rip), %r8      # 0x31655
leaq 0x274b1(%rip), %r9      # 0x3165e
movl $0x40, %ecx
xorl %eax, %eax
callq 0x718c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/renderer/text.cpp
// Function: Renderer::messure_text(char const*, float, unsigned long long)
Vec2 messure_text(const char *string, f32 size, AssetID font_id) {
    Asset::Font *font = Asset::fetch_font(font_id);
    ASSERT(font, "Cannot find font");
    f32 length = 0;
    if (!font->num_kernings) {
        while (*(string++)) length += font->glyphs[(u8) 'A'].advance;
    } else {
        u8 prev = '\0';
        while (*string) {
            u8 curr = *(string++);
            length += font->find_kerning(prev, curr);
            length += font->glyphs[curr].advance + font->glyphs[curr].x_offset;
        }
    }
    return V2(length * size, size * font->height);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movaps %xmm0, -0x30(%rbp)
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2, %esi
callq 0x23225
movq %rax, %rbx
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leaq 0x2714e(%rip), %rdi     # 0x31399
leaq 0x27164(%rip), %rdx     # 0x313b6
movl $0x5, %esi
callq 0x729c
cmpq $0x0, 0x18(%rbx)
movb (%r14), %al
je 0xa2b1
testb %al, %al
je 0xa2d7
incq %r14
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movsbl %al, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x2dcc6
addss -0x40(%rbp), %xmm0
movq 0x20(%rbx), %rax
movzbl %r15b, %ecx
shll $0x5, %ecx
movss 0x1c(%rax,%rcx), %xmm1
addss 0x14(%rax,%rcx), %xmm1
addss %xmm0, %xmm1
movb (%r14), %al
incq %r14
testb %al, %al
jne 0xa270
jmp 0xa2da
testb %al, %al
je 0xa2d7
movq 0x20(%rbx), %rax
movss 0x83c(%rax), %xmm0
incq %r14
xorps %xmm1, %xmm1
addss %xmm0, %xmm1
cmpb $0x0, (%r14)
leaq 0x1(%r14), %r14
jne 0xa2c7
jmp 0xa2da
xorps %xmm1, %xmm1
movaps -0x30(%rbp), %xmm0
mulss %xmm0, %xmm1
mulss 0x8(%rbx), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps %xmm1, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::format(char const*, __va_list_tag*)
char *format(const char *fmt, va_list args) {
    // TODO(ed): Test this function.
    char c;
    int size = vsnprintf(&c, 1, fmt, args);
    ASSERT(size > 0, "Failed to print format string");
    char *buffer = request_temporary_memory<char>(++size);
    vsnprintf(buffer, size, fmt, args);
    va_end(args);
    return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x21(%rbp), %rdi
movl $0x1, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2340
movl %eax, %r15d
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
leaq 0x2642e(%rip), %rdi     # 0x30c60
leaq 0x2643e(%rip), %rdx     # 0x30c77
movl $0x3c, %esi
callq 0x729c
cmpl $0x1, 0x44b2a(%rip)     # 0x4f374
jne 0xa856
movl $0x0, 0x44b1e(%rip)     # 0x4f374
incl %r15d
movslq %r15d, %r15
movl 0x5a17e(%rip), %eax     # 0x649e0
leaq 0x5a167(%rip), %rcx     # 0x649d0
movq (%rcx,%rax,8), %rdi
movq %r15, %rsi
callq 0x2e0b4
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2340
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::format_int(char const*, ...)
char *format_int(const char *fmt, ...) {
    va_list args;
    va_start(args, fmt);
    char c;
    int size = vsnprintf_(&c, 1, fmt, args);
    ASSERT(size > 0, "Failed to print format string");
    va_end(args);
    char *buffer = request_temporary_memory<char>(++size);
    va_start(args, fmt);
    vsnprintf_(buffer, size, fmt, args);
    va_end(args);
    return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq -0x100(%rbp), %r12
movq %rsi, 0x8(%r12)
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0xa903
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
leaq -0x50(%rbp), %r8
movq %r12, 0x10(%r8)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%r8)
movabsq $0x3000000008, %r13     # imm = 0x3000000008
movq %r13, (%r8)
leaq -0x3929(%rip), %rdi     # 0x6ffe
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x6606
movl %eax, %r14d
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
leaq 0x26317(%rip), %rdi     # 0x30c60
leaq 0x26327(%rip), %rdx     # 0x30c77
movl $0x4a, %esi
callq 0x729c
cmpl $0x1, 0x44a13(%rip)     # 0x4f374
jne 0xa96d
movl $0x0, 0x44a07(%rip)     # 0x4f374
incl %r14d
movslq %r14d, %r14
movl 0x5a067(%rip), %eax     # 0x649e0
leaq 0x5a050(%rip), %rcx     # 0x649d0
movq (%rcx,%rax,8), %rdi
movq %r14, %rsi
callq 0x2e0b4
movq %rax, %r15
leaq -0x50(%rbp), %r8
movq %r13, (%r8)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%r8)
movq %r12, 0x10(%r8)
leaq -0x39ab(%rip), %rdi     # 0x6ffe
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x6606
movq %r15, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::utf8_size(char const*)
u8 utf8_size(const char *c) {
    if ((*c & 0b10000000) == 0) return 1;
    if ((*c & 0b11100000) == 0b11000000) return 2;
    if ((*c & 0b11110000) == 0b11100000) return 3;
    if ((*c & 0b11111000) == 0b11110000) return 4;
    ERR("Invalid codepoint");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movzbl (%rdi), %eax
movb $0x1, %bl
testb %al, %al
jns 0xaabb
movl %eax, %ecx
andl $-0x20, %ecx
movb $0x2, %bl
cmpl $0xc0, %ecx
je 0xaabb
movl %eax, %ecx
andl $-0x10, %ecx
movb $0x3, %bl
cmpl $0xe0, %ecx
je 0xaabb
andl $-0x8, %eax
movb $0x4, %bl
cmpl $0xf0, %eax
je 0xaabb
movq 0x44542(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0x26207(%rip), %rdi     # 0x30c9f
leaq 0x261c1(%rip), %rdx     # 0x30c60
leaq 0x261fd(%rip), %r8      # 0x30ca3
leaq 0x26200(%rip), %r9      # 0x30cad
xorl %ebx, %ebx
movl $0x6e, %ecx
xorl %eax, %eax
callq 0x718c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::utf8_insert_glyph(char*, char const*, unsigned int)
b8 utf8_insert_glyph(char *to, const char *from, u32 length) {
    const u32 glyph_size = utf8_size(from);
    if (glyph_size > length) return false;
    for (u32 i = 0; i < glyph_size; i++)
        to[i] = from[i];
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0xaa4e
movzbl %al, %edx
cmpl %r15d, %edx
jbe 0xaafa
xorl %eax, %eax
jmp 0xab14
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0xab14
xorl %ecx, %ecx
movb (%rbx,%rcx), %sil
movb %sil, (%r14,%rcx)
incq %rcx
cmpq %rcx, %rdx
jne 0xab04
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::contains_substr(char const*, char const*)
b8 contains_substr(const char *str, const char *substr) {
    for (; *str; str++) {
        for (u32 i = 0; str[i] == substr[i]; i++) {
            if (substr[i+1] == '\0')
                return true;
        }
    }
    return false;
}

// Assembly:
cmpb $0x0, (%rdi)
je 0xab75
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
movl $0x1, %ecx
movl %eax, %edx
leal -0x1(%rcx), %r8d
cmpb %dl, (%rdi,%r8)
jne 0xab63
movl %ecx, %edx
movb (%rsi,%rdx), %dl
incl %ecx
testb %dl, %dl
jne 0xab4c
jmp 0xab71
cmpb $0x0, 0x1(%rdi)
leaq 0x1(%rdi), %rdi
jne 0xab45
xorl %eax, %eax
jmp 0xab73
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::do_all_allocations()
void do_all_allocations() {
    static_assert(TOTAL_MEMORY_BUDGET % ARENA_SIZE_IN_BYTES == 0);

    // Setup regions.
    global_memory.free_regions = global_memory.all_regions + 0;
    global_memory.num_free_regions = NUM_ARENAS;
    for (u64 i = 0; i < NUM_ARENAS - 1; i++) {
        global_memory.all_regions[i].next = global_memory.all_regions + i + 1;
        global_memory.all_regions[i].memory = malloc(ARENA_SIZE_IN_BYTES);
    }
    global_memory.all_regions[NUM_ARENAS - 1].next = 0;

    // Frame memory
    for (u32 i = 0; i < FRAME_LAG_FOR_MEMORY; i++)
        FRAME_MEMORY[i] = request_arena();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x451ad(%rip), %rbx     # 0x4fe18
leaq 0x10(%rbx), %rax
movq %rax, 0x8(%rbx)
movq $0x40, (%rbx)
leaq 0x30(%rbx), %r14
movl $0x3f, %r15d
movq %r14, -0x10(%r14)
movl $0x200000, %edi         # imm = 0x200000
callq 0x2450
movq %rax, -0x8(%r14)
addq $0x20, %r14
decq %r15
jne 0xac84
movq $0x0, 0x800(%rbx)
xorl %edi, %edi
callq 0xacd1
movq %rax, 0x59d18(%rip)     # 0x649d0
xorl %edi, %edi
callq 0xacd1
movq %rax, 0x59d12(%rip)     # 0x649d8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::request_arena(unsigned char)
MemoryArena *request_arena(b8 only_one) {
    CHECK_ILLEGAL_ALLOC;
    ASSERT(global_memory.free_regions, "No more memory");
    ASSERT(global_memory.num_free_regions, "No more memory");
    MemoryArena *next = global_memory.free_regions;
    global_memory.free_regions = next->next;
    --global_memory.num_free_regions;
    next->only_one = only_one;
    next->next = 0;
    next->watermark = 0;
    return next;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl 0x44691(%rip), %eax     # 0x4f374
cmpl $0x2, %eax
je 0xad3a
cmpl $0x1, %eax
jne 0xad30
movl 0x59ccd(%rip), %eax     # 0x649c0
incl %eax
movl %eax, 0x59cc5(%rip)     # 0x649c0
movq 0x442ce(%rip), %rcx     # 0x4efd0
movq (%rcx), %rsi
movl %eax, (%rsp)
leaq 0x25f90(%rip), %rdi     # 0x30c9f
leaq 0x25fb9(%rip), %rdx     # 0x30ccf
leaq 0x25fcd(%rip), %r8      # 0x30cea
leaq 0x25fde(%rip), %r9      # 0x30d02
movl $0x2a, %ecx
xorl %eax, %eax
callq 0x718c
movl $0x1, 0x4463a(%rip)     # 0x4f374
leaq 0x450d7(%rip), %r15     # 0x4fe18
xorl %ecx, %ecx
cmpq $0x0, 0x8(%r15)
setne %cl
leaq 0x25f7d(%rip), %r14     # 0x30ccf
leaq 0x260d4(%rip), %rdx     # 0x30e2d
movq %r14, %rdi
movl $0x65, %esi
callq 0x729c
xorl %ecx, %ecx
cmpq $0x0, (%r15)
setne %cl
leaq 0x260e2(%rip), %rdx     # 0x30e58
movq %r14, %rdi
movl $0x66, %esi
callq 0x729c
movq 0x8(%r15), %rax
movq 0x10(%rax), %rcx
movq %rcx, 0x8(%r15)
decq (%r15)
movb %bl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::swap_frame_memory()
void swap_frame_memory() {
    CURRENT_MEMORY = (CURRENT_MEMORY + 1) % FRAME_LAG_FOR_MEMORY;
    // Clear when it is swapped to so the old ones
    // still can be used.
    FRAME_MEMORY[CURRENT_MEMORY]->clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x59c2e(%rip), %eax     # 0x649e0
notl %eax
andl $0x1, %eax
movl %eax, 0x59c23(%rip)     # 0x649e0
leaq 0x59c0c(%rip), %rcx     # 0x649d0
movq (%rcx,%rax,8), %rbx
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xade0
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
callq 0xae55
jmp 0xadc8
movq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::MemoryArena::clear()
void MemoryArena::clear() {
    while (next) {
        MemoryArena *old = next;
        next = next->next;
        return_arean(old);
    }
    watermark = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0xae15
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
callq 0xae55
movq 0x10(%rbx), %rdi
jmp 0xadfd
movq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq