LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/extracters/dbtap/dos11.c
// Function: AscR50
static uint16 AscR50(
  char *inbuf
)
{
  uint16 value;
  char *ptr;

  if ((ptr = strchr(rad50, toupper(*inbuf++))) == NULL)
    ptr = strchr(rad50, '%');

  value = (ptr - rad50) * 03100;

  if ((ptr = strchr(rad50, toupper(*inbuf++))) == NULL)
    ptr = strchr(rad50, '%');

  value += (ptr - rad50) * 050;

  if ((ptr = strchr(rad50, toupper(*inbuf))) == NULL)
    ptr = strchr(rad50, '%');

  value += ptr - rad50;

  return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1030
movq (%rax), %r12
movsbq (%r14), %rax
movl (%r12,%rax,4), %esi
leaq 0x2cc1(%rip), %rdi      # 0x5130
callq 0x10d0
movq %rax, %rbx
testq %rax, %rax
jne 0x2490
leaq 0x2cad(%rip), %rdi      # 0x5130
movl $0x25, %esi
callq 0x10d0
movq %rax, %rbx
movsbq 0x1(%r14), %rax
movl (%r12,%rax,4), %esi
leaq 0x2c90(%rip), %rdi      # 0x5130
callq 0x10d0
movq %rax, %r15
testq %rax, %rax
jne 0x24c1
leaq 0x2c7c(%rip), %rdi      # 0x5130
movl $0x25, %esi
callq 0x10d0
movq %rax, %r15
movsbq 0x2(%r14), %rax
movl (%r12,%rax,4), %esi
leaq 0x2c5f(%rip), %rdi      # 0x5130
callq 0x10d0
testq %rax, %rax
jne 0x24ec
leaq 0x2c4e(%rip), %rdi      # 0x5130
movl $0x25, %esi
callq 0x10d0
leaq 0x2c3d(%rip), %rcx      # 0x5130
subl %ecx, %ebx
imull $0x640, %ebx, %edx      # imm = 0x640
subl %ecx, %r15d
shll $0x3, %r15d
leal (%r15,%r15,4), %esi
subl %ecx, %edx
addl %esi, %eax
addl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/extracters/dbtap/dos11.c
// Function: r50AscNoSpace
static int r50AscNoSpace(
  uint16 value,
  char *outbuf
)
{
  int count = 0;
  int value2 = value / 050;

  /*
   * The rad50 representation of ' ' is zero.
   */
  if ((value2 / 050) != 0)
    outbuf[count++] = rad50[value2 / 050];
  if ((value2 % 050) != 0)
    outbuf[count++] = rad50[value2 % 050];
  if ((value % 050) != 0)
    outbuf[count++] = rad50[value % 050];

  return count;
}

// Assembly:
movl %edi, %r8d
imulq $0x6666667, %r8, %rcx   # imm = 0x6666667
shrq $0x20, %rcx
leal (,%rcx,8), %eax
leal (%rax,%rax,4), %edx
xorl %eax, %eax
cmpl $0x640, %edi            # imm = 0x640
jb 0x2847
imulq $0x28f5c3, %r8, %rax    # imm = 0x28F5C3
shrq $0x20, %rax
leaq 0x28f4(%rip), %r8       # 0x5130
movb (%rax,%r8), %al
movb %al, (%rsi)
movl $0x1, %eax
subl %edx, %edi
movl %ecx, %edx
imulq $0x6666667, %rdx, %rdx  # imm = 0x6666667
shrq $0x20, %rdx
shll $0x3, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
je 0x2873
movl %ecx, %ecx
leaq 0x28c7(%rip), %rdx      # 0x5130
movb (%rcx,%rdx), %cl
movl %eax, %edx
incl %eax
movb %cl, (%rsi,%rdx)
testl %edi, %edi
je 0x288a
movl %edi, %ecx
leaq 0x28b0(%rip), %rdx      # 0x5130
movb (%rcx,%rdx), %cl
movl %eax, %edx
incl %eax
movb %cl, (%rsi,%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/pyk[P]simple-nn/deps/pcg/src/pcg-advance-8.c
// Function: pcg_advance_lcg_8
uint8_t pcg_advance_lcg_8(uint8_t state, uint8_t delta, uint8_t cur_mult,
                          uint8_t cur_plus)
{
    uint8_t acc_mult = 1u;
    uint8_t acc_plus = 0u;
    while (delta > 0) {
        if (delta & 1) {
            acc_mult *= cur_mult;
            acc_plus = acc_plus * cur_mult + cur_plus;
        }
        cur_plus = (cur_mult + 1) * cur_plus;
        cur_mult *= cur_mult;
        delta /= 2;
    }
    return acc_mult * state + acc_plus;
}

// Assembly:
testl %esi, %esi
je 0x16f1
pushq %rbx
movl %ecx, %r8d
movl %edx, %r9d
movb $0x1, %dl
xorl %ecx, %ecx
movl $0x1, %r11d
movl %esi, %ebx
movl %ecx, %eax
mulb %r9b
addb %r8b, %al
testb $0x1, %sil
movzbl %r9b, %r9d
movl %r9d, %r10d
cmovel %r11d, %r10d
movzbl %al, %eax
movzbl %cl, %ecx
cmovnel %eax, %ecx
movl %edx, %eax
mulb %r10b
leal 0x1(%r9), %r10d
movl %eax, %edx
movl %r10d, %eax
mulb %r8b
movl %eax, %r8d
movl %r9d, %eax
mulb %r9b
shrb %bl
movl %eax, %r9d
cmpb $0x1, %sil
movl %ebx, %esi
ja 0x16a7
popq %rbx
jmp 0x16f5
movb $0x1, %dl
xorl %ecx, %ecx
movl %edx, %eax
mulb %dil
addb %cl, %al
retq
// File: /workspace/github_c_makefile_star2_O1/mflatt[P]gc-demo/common/tree.c
// Function: make_tree
static struct node *make_tree(int depth)
{
  if (depth == 0)
    return NULL;
  else {
    if (create_garbage) {
      /* create and destroy a junk branch */
      struct node *n = NULL;
      PUSH_STACK_POINTER(n);
      SET_NODE(n, make_tree(depth-1));
      destroy_tree(n);
      UNSET_NODE(n);
      POP_STACK_POINTER(n);
    }
    
    /* Left subtree */
    struct node *l = NULL;
    PUSH_STACK_POINTER(l);
    SET_NODE(l, make_tree(depth-1));
    
    /* Right subtree */
    struct node *r = NULL;
    PUSH_STACK_POINTER(r);
    SET_NODE(r, make_tree(depth-1));
    
    /* New node */
    struct node *t = NULL;
    PUSH_STACK_POINTER(t);
    SET_NODE(t, allocate());
    SET_NODE(t->left, l);
    UNSET_NODE(l);
    SET_NODE(t->right, r);
    UNSET_NODE(r);

    UNSET_RETURN_NODE(t);

    POP_STACK_POINTER(t);
    POP_STACK_POINTER(r);
    POP_STACK_POINTER(l);

    return t;
  }
}

// Assembly:
testl %edi, %edi
je 0x12f0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
cmpb $0x1, 0x2e2d(%rip)      # 0x4054
jne 0x1259
movq %rsp, %rax
movq $0x0, (%rax)
leaq 0x2e46(%rip), %r14      # 0x4080
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
leaq 0x2e46(%rip), %rdx      # 0x4090
movq %rax, (%rdx,%rcx,8)
leal -0x1(%rbx), %edi
callq 0x1208
decl (%r14)
xorl %r12d, %r12d
movq %rsp, %r15
movq %r12, (%r15)
leaq 0x2e17(%rip), %r14      # 0x4080
movslq (%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
leaq 0x2e17(%rip), %r13      # 0x4090
movq %r15, (%r13,%rax,8)
decl %ebx
movl %ebx, %edi
callq 0x1208
movq %rax, (%r15)
leaq 0x10(%rsp), %rbp
movq %r12, (%rbp)
movslq (%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq %rbp, (%r13,%rax,8)
movl %ebx, %edi
callq 0x1208
movq %rax, (%rbp)
leaq 0x8(%rsp), %rbx
movq %r12, (%rbx)
movslq (%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq %rbx, (%r13,%rax,8)
xorl %eax, %eax
callq 0x1404
movq %rax, (%rbx)
movq (%r15), %rcx
movq %rcx, (%rax)
movq (%rbp), %rcx
movq (%rbx), %rax
movq %rcx, 0x8(%rax)
addl $-0x3, (%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/mflatt[P]gc-demo/2space/2space.c
// Function: collect_garbage
void collect_garbage()
{
  /* Set up new space */
  size_t new_size = (space_end - space_start + sizeof(struct gc_node));
  if (new_size < (prev_size * 2))
    new_size = prev_size * 2;
  
  void *new_space = raw_malloc(new_size);
  struct gc_node *alloc_pos = new_space;

  /* Copy into new space */
  copy_from_roots(&alloc_pos);

  /* Clean up old space */
  if (space_start != 0)
    raw_free((void *)space_start, space_end - space_start);

  /* Continue allocating into new space */
  space_start = (uintptr_t)new_space;
  space_end = space_start + new_size;
  space_next = (uintptr_t)alloc_pos;

  /* Remember size after collection to be used as a guide for the next
     space's size: */
  prev_size = space_next - space_start;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2d11(%rip), %r15      # 0x4078
movq (%r15), %rax
leaq 0x311f(%rip), %r12      # 0x4490
subq (%r12), %rax
addq $0x18, %rax
movq 0x2cc0(%rip), %rbx      # 0x4040
addq %rbx, %rbx
cmpq %rbx, %rax
cmovaq %rax, %rbx
movq %rbx, %rdi
callq 0x1320
movq %rax, %r14
movq %rsp, %rdi
movq %rax, (%rdi)
callq 0x143e
movq (%r12), %rdi
testq %rdi, %rdi
je 0x13b4
movq (%r15), %rsi
subq %rdi, %rsi
callq 0x134a
movq %r14, (%r12)
addq %r14, %rbx
movq %rbx, (%r15)
movq (%rsp), %rax
leaq 0x2ca7(%rip), %rcx      # 0x4070
movq %rax, (%rcx)
subq %r14, %rax
movq %rax, 0x2c6a(%rip)      # 0x4040
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mflatt[P]gc-demo/2space/copy.c
// Function: allocate
struct node *allocate()
{
  if (space_next + sizeof(struct gc_node) > space_end)
    collect_garbage();

  struct gc_node *p = (struct gc_node *)space_next;
  space_next += sizeof(struct gc_node);

  p->forwarded = 0;

  return &p->n;
}

// Assembly:
pushq %rax
movq 0x2c64(%rip), %rax      # 0x4070
addq $0x18, %rax
cmpq 0x2c61(%rip), %rax      # 0x4078
jbe 0x1420
xorl %eax, %eax
callq 0x1358
movq 0x2c49(%rip), %rax      # 0x4070
leaq 0x18(%rax), %rcx
movq %rcx, 0x2c3e(%rip)      # 0x4070
movl $0x0, (%rax)
addq $0x8, %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/mflatt[P]gc-demo/2space/copy.c
// Function: copy_from_roots
void copy_from_roots(struct gc_node **alloc_pos_ptr)
{
  struct gc_node *init_ptr = *alloc_pos_ptr;
  
  for (int i = 0; i < num_roots; i++) {
    copy_or_forward(root_addrs[i], alloc_pos_ptr);
  }

  traverse_copied(init_ptr, alloc_pos_ptr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
cmpl $0x0, 0x2c2d(%rip)      # 0x4080
jle 0x147d
leaq 0x2c34(%rip), %r15      # 0x4090
xorl %r12d, %r12d
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x14af
incq %r12
movslq 0x2c0c(%rip), %rax      # 0x4080
addq $0x8, %r15
cmpq %rax, %r12
jl 0x145f
cmpq %r14, (%rbx)
jbe 0x14a3
leaq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0x14af
leaq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x14af
addq $0x18, %r14
cmpq (%rbx), %r14
jb 0x1482
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mflatt[P]gc-demo/2space/copy.c
// Function: copy_or_forward
static void copy_or_forward(struct node **addr,
                            struct gc_node **alloc_pos_ptr)
{
  if (is_allocated(*addr)) {
    struct gc_node *nh;
    nh = NODE_TO_GC(*addr);
    
    if (nh->forwarded) {
      /* Object already copied */
      *addr = nh->forward_to;
    } else {
      /* Allocate a copy: */
      struct gc_node *nh2;
      nh2 = *alloc_pos_ptr;
      (*alloc_pos_ptr)++;
      memcpy(nh2, nh, sizeof(struct gc_node));

      /* Mark old location as copied and set forwarding pointer */
      nh->forwarded = 1;
      nh->forward_to = &nh2->n;
      *addr = &nh2->n;
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x13e2
testl %eax, %eax
je 0x1500
movq (%rbx), %rax
cmpl $0x0, -0x8(%rax)
je 0x14d3
movq (%rax), %rcx
jmp 0x14fd
leaq -0x8(%rax), %rdx
movq (%r14), %rcx
leaq 0x18(%rcx), %rsi
movq %rsi, (%r14)
movq 0x10(%rdx), %rsi
movq %rsi, 0x10(%rcx)
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
movl $0x1, -0x8(%rax)
addq $0x8, %rcx
movq %rcx, (%rax)
movq %rcx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/accre[P]Cprogramming/functions.c
// Function: main
int main()
{

   int i = 22;
   float x = 234.23;

   // i and x are both passed by value,
   // meaning a copy of each of these variables
   // is passed to mySimpleFunc
   float y = mySimpleFuncByValue(i,x);
   printf("i: %d x: %10.5f y: %10.5f\n",i,x,y);
   // Now i and x are both being passed by reference
   // (Notice the & symbol)
   // This means that the actual memory location of 
   // i and x are being passed, so any modifications
   // to the values i and x within the function will
   // propogate to main() 
   y = mySimpleFuncByReference(&i,&x);
   printf("i: %d x: %10.5f y: %10.5f\n",i,x,y);

   int myArray[2] = { 0, 0 };
   printf("Before function call, myArray[0]: %d myArray[1]: %d\n",myArray[0],myArray[1]);
   modifyArray(myArray);
   printf("After function call, myArray[0]: %d myArray[1]: %d\n",myArray[0],myArray[1]);

   return 0;

}

// Assembly:
pushq %rbx
leaq 0xe90(%rip), %rbx       # 0x2028
movsd 0xe70(%rip), %xmm0      # 0x2010
movsd 0xe70(%rip), %xmm1      # 0x2018
movq %rbx, %rdi
movl $0x16, %esi
movb $0x2, %al
callq 0x1030
movsd 0xe61(%rip), %xmm0      # 0x2020
movq %rbx, %rdi
movl $0x7b, %esi
movsd 0xe49(%rip), %xmm1      # 0x2018
movb $0x2, %al
callq 0x1030
leaq 0xe66(%rip), %rdi       # 0x2043
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1030
leaq 0xe89(%rip), %rdi       # 0x2078
movl $0x5, %esi
movl $0xc, %edx
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_sprintf
int scg_sprintf(char *buf, const char *fmt, ...) {
    va_list args;
    va_start(args, fmt);

    int size = scg__vsprintf(buf, fmt, args);

    va_end(args);

    return size;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x2658
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x20(%rsp), %rcx
movq %rsi, 0x10(%rcx)
movq (%rsp), %rax
movq %rax, (%rcx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rcx)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2140
testl %eax, %eax
js 0x26b6
incl %eax
movq %rsp, %rcx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x2140
jmp 0x26bb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xf8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_asprintf
int scg_asprintf(char **buf, const char *fmt, ...) {
    va_list args;
    va_start(args, fmt);

    int size = scg__vasprintf(buf, fmt, args);

    va_end(args);

    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x272f
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x20(%rsp), %rcx
movq %rsi, 0x10(%rcx)
movq (%rsp), %rax
movq %rax, (%rcx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rcx)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2140
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x27a6
movl %eax, %r15d
incl %r15d
movq %r15, %rdi
callq 0x22f0
movq %rax, (%r14)
testq %rax, %rax
je 0x27a6
movq %rsp, %rcx
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2140
movl %eax, %ebp
movl %ebp, %eax
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_pixel_lerp_rgb
scg_pixel_t scg_pixel_lerp_rgb(scg_pixel_t start, scg_pixel_t end,
                               float32_t t) {
    t = scg_clamp_float32(t, 0.0f, 1.0f);

    float32_t r = (1.0f - t) * start.data.r + t * end.data.r;
    float32_t g = (1.0f - t) * start.data.g + t * end.data.g;
    float32_t b = (1.0f - t) * start.data.b + t * end.data.b;

    return scg_pixel_new_rgb((uint8_t)r, (uint8_t)g, (uint8_t)b);
}

// Assembly:
movl %edi, %eax
shrl $0x8, %eax
movl %edi, %r8d
shrl $0x10, %r8d
movl %esi, %edx
shrl $0x8, %edx
movl %esi, %r9d
shrl $0x10, %r9d
xorps %xmm2, %xmm2
maxss %xmm0, %xmm2
movss 0x382b(%rip), %xmm0     # 0x6008
movaps %xmm0, %xmm1
minss %xmm2, %xmm1
movl $0xff, %ecx
andl %ecx, %r8d
xorps %xmm2, %xmm2
cvtsi2ss %r8d, %xmm2
andl %ecx, %r9d
cvtsi2ss %r9d, %xmm3
subss %xmm1, %xmm0
mulss %xmm1, %xmm3
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
andl %ecx, %eax
xorps %xmm3, %xmm3
cvtsi2ss %eax, %xmm3
andl %ecx, %edx
cvtsi2ss %edx, %xmm4
mulss %xmm1, %xmm4
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
andl %ecx, %edi
xorps %xmm4, %xmm4
cvtsi2ss %edi, %xmm4
andl %ecx, %esi
cvtsi2ss %esi, %xmm5
mulss %xmm1, %xmm5
mulss %xmm0, %xmm4
addss %xmm5, %xmm4
cvttss2si %xmm4, %eax
cvttss2si %xmm3, %edx
cvttss2si %xmm2, %esi
shll $0x10, %esi
andl %ecx, %edx
shll $0x8, %edx
orl %esi, %edx
andl %ecx, %eax
orl %edx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_new
scg_image_t *scg_image_new(int width, int height) {
    uint32_t *pixels = calloc(width * height, sizeof(*pixels));
    if (pixels == NULL) {
        scg_log_error("Failed to allocate memory for pixels");

        return NULL;
    }

    scg_image_t *image = malloc(sizeof(*image));
    if (image == NULL) {
        scg_log_error("Failed to allocate memory for image");

        free(pixels);
        return NULL;
    }

    image->width = width;
    image->height = height;
    image->pitch = width * sizeof(*pixels);
    image->pixels = pixels;
    image->blend_mode = SCG_BLEND_MODE_NONE;

    return image;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movl %edi, %ebp
movl %esi, %eax
imull %edi, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x2150
testq %rax, %rax
je 0x28b3
movq %rax, %r14
movl $0x20, %edi
callq 0x22f0
testq %rax, %rax
je 0x28e2
movq %rax, %rbx
movl %ebp, (%rax)
movl %r15d, 0x4(%rax)
shll $0x2, %ebp
movl %ebp, 0x8(%rax)
movq %r14, 0x10(%rax)
movl $0x0, 0x18(%rax)
jmp 0x2917
leaq 0x37e6(%rip), %rsi      # 0x60a0
leaq 0x37f7(%rip), %rdx      # 0x60b8
leaq 0x37fe(%rip), %rcx      # 0x60c6
leaq 0x3809(%rip), %r9       # 0x60d8
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x262, %r8d            # imm = 0x262
xorl %eax, %eax
callq 0x22e0
jmp 0x2917
leaq 0x37b7(%rip), %rsi      # 0x60a0
leaq 0x37c8(%rip), %rdx      # 0x60b8
leaq 0x37cf(%rip), %rcx      # 0x60c6
leaq 0x37ff(%rip), %r9       # 0x60fd
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x269, %r8d            # imm = 0x269
xorl %eax, %eax
callq 0x22e0
movq %r14, %rdi
callq 0x2290
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_get_pixel
scg_pixel_t scg_image_get_pixel(scg_image_t *image, int x, int y) {
    int w = image->width;
    int h = image->height;

    if (x < 0 || x >= w || y < 0 || y >= h) {
        return SCG_COLOR_MAGENTA;
    }

    int i = scg_pixel_index_from_xy(x, y, w);
    return scg_pixel_new_uint32(image->pixels[i]);
}

// Assembly:
movl $0xffff00ff, %eax       # imm = 0xFFFF00FF
testl %esi, %esi
js 0x2b67
testl %edx, %edx
js 0x2b67
movl (%rdi), %ecx
cmpl %esi, %ecx
jle 0x2b67
cmpl %edx, 0x4(%rdi)
jle 0x2b67
imull %edx, %ecx
addl %esi, %ecx
movq 0x10(%rdi), %rax
movl (%rax,%rcx,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_set_pixel
void scg_image_set_pixel(scg_image_t *image, int x, int y, scg_pixel_t color) {
    int w = image->width;
    int h = image->height;

    if (x < 0 || x >= w || y < 0 || y >= h) {
        return;
    }

    scg_blend_mode_t blend_mode = image->blend_mode;
    int i = scg_pixel_index_from_xy(x, y, w);

    if (blend_mode == SCG_BLEND_MODE_NONE) {
        image->pixels[i] = color.packed;
    }

    if (blend_mode == SCG_BLEND_MODE_MASK) {
        if (color.data.a == 255) {
            image->pixels[i] = color.packed;
        }
    }

    if (blend_mode == SCG_BLEND_MODE_ALPHA) {
        scg_pixel_t d = scg_pixel_new_uint32(image->pixels[i]);
        float32_t a = (float32_t)(color.data.a / 255.0f);
        float32_t c = 1.0f - a;
        float32_t r = a * (float32_t)color.data.r + c * (float32_t)d.data.r;
        float32_t g = a * (float32_t)color.data.g + c * (float32_t)d.data.g;
        float32_t b = a * (float32_t)color.data.b + c * (float32_t)d.data.b;

        scg_pixel_t blended_color =
            scg_pixel_new_rgb((uint8_t)r, (uint8_t)g, (uint8_t)b);
        image->pixels[i] = blended_color.packed;
    }
}

// Assembly:
testl %esi, %esi
js 0x2c91
testl %edx, %edx
js 0x2c91
movl (%rdi), %r8d
cmpl %esi, %r8d
jle 0x2c91
cmpl %edx, 0x4(%rdi)
jle 0x2c91
movl %ecx, %r9d
shrl $0x18, %r9d
movl 0x18(%rdi), %eax
imull %edx, %r8d
addl %esi, %r8d
testl %eax, %eax
jne 0x2bac
movq 0x10(%rdi), %rdx
movl %r8d, %esi
movl %ecx, (%rdx,%rsi,4)
movl %eax, %edx
xorl $0x1, %edx
movl %r9d, %esi
xorl $0xff, %esi
orl %edx, %esi
jne 0x2bc8
movq 0x10(%rdi), %rdx
movl %r8d, %esi
movl %ecx, (%rdx,%rsi,4)
cmpl $0x2, %eax
jne 0x2c91
movl %ecx, %r10d
shrl $0x8, %r10d
movl %ecx, %esi
shrl $0x10, %esi
movq 0x10(%rdi), %rax
movl %r8d, %edx
movl (%rax,%rdx,4), %edi
movl %edi, %r8d
shrl $0x8, %r8d
movl %edi, %r11d
shrl $0x10, %r11d
cvtsi2ss %r9d, %xmm0
divss 0x340a(%rip), %xmm0     # 0x600c
movss 0x33fe(%rip), %xmm2     # 0x6008
movzbl %sil, %esi
cvtsi2ss %esi, %xmm1
movl $0xff, %esi
andl %esi, %r11d
cvtsi2ss %r11d, %xmm3
subss %xmm0, %xmm2
mulss %xmm2, %xmm3
mulss %xmm0, %xmm1
addss %xmm3, %xmm1
movzbl %r10b, %r9d
xorps %xmm3, %xmm3
cvtsi2ss %r9d, %xmm3
andl %esi, %r8d
cvtsi2ss %r8d, %xmm4
mulss %xmm2, %xmm4
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
movzbl %cl, %ecx
xorps %xmm4, %xmm4
cvtsi2ss %ecx, %xmm4
andl %esi, %edi
cvtsi2ss %edi, %xmm5
mulss %xmm2, %xmm5
mulss %xmm0, %xmm4
addss %xmm5, %xmm4
cvttss2si %xmm4, %ecx
cvttss2si %xmm3, %edi
cvttss2si %xmm1, %r8d
shll $0x10, %r8d
andl %esi, %edi
shll $0x8, %edi
orl %r8d, %edi
andl %esi, %ecx
orl %edi, %ecx
orl $0xff000000, %ecx       # imm = 0xFF000000
movl %ecx, (%rax,%rdx,4)
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_clear
void scg_image_clear(scg_image_t *image, scg_pixel_t color) {
    int num_pixels = image->width * image->height;
    uint32_t pixel = color.packed;

    for (int i = 0; i < num_pixels; i++) {
        image->pixels[i] = pixel;
    }
}

// Assembly:
movl 0x4(%rdi), %ecx
imull (%rdi), %ecx
testl %ecx, %ecx
jle 0x2caf
movq 0x10(%rdi), %rax
movl %ecx, %ecx
xorl %edx, %edx
movl %esi, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x2ca4
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_image
void scg_image_draw_image(scg_image_t *dest, scg_image_t *src, int x, int y) {
    int src_w = src->width;
    int src_h = src->height;

    for (int i = 0; i < src_h; i++) {
        for (int j = 0; j < src_w; j++) {
            scg_pixel_t color = scg_image_get_pixel(src, j, i);
            scg_image_set_pixel(dest, x + j, y + i, color);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rsp)
testl %eax, %eax
jle 0x2d34
movq %rsi, %r15
movq %rdi, %r12
movl (%rsi), %ebx
xorl %r13d, %r13d
testl %ebx, %ebx
jle 0x2d2a
movq 0x8(%rsp), %rax
leal (%rax,%r13), %ebp
xorl %r14d, %r14d
movl (%r15), %eax
movl $0xffff00ff, %ecx       # imm = 0xFFFF00FF
cmpl %r14d, %eax
jle 0x2d0f
cmpl %r13d, 0x4(%r15)
jle 0x2d0f
imull %r13d, %eax
addl %r14d, %eax
movq 0x10(%r15), %rcx
movl (%rcx,%rax,4), %ecx
movq 0x10(%rsp), %rax
leal (%rax,%r14), %esi
movq %r12, %rdi
movl %ebp, %edx
callq 0x2b68
incl %r14d
cmpl %r14d, %ebx
jne 0x2cee
incl %r13d
cmpl 0x4(%rsp), %r13d
jne 0x2cde
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_line
void scg_image_draw_line(scg_image_t *image, int x0, int y0, int x1, int y1,
                         scg_pixel_t color) {
    // Line is vertical
    if (x0 == x1) {
        if (y1 < y0) {
            int tmp = y1;
            y1 = y0;
            y0 = tmp;
        }

        for (int y = y0; y <= y1; y++) {
            scg_image_set_pixel(image, x0, y, color);
        }

        return;
    }

    // Line is horizontal
    if (y0 == y1) {
        if (x1 < x0) {
            int tmp = x1;
            x1 = x0;
            x0 = tmp;
        }

        for (int x = x0; x <= x1; x++) {
            scg_image_set_pixel(image, x, y0, color);
        }

        return;
    }

    int dx = abs(x1 - x0);
    int dy = abs(y1 - y0);

    int step_x = x0 < x1 ? 1 : -1;
    int step_y = y0 < y1 ? 1 : -1;
    int err = (dx > dy ? dx : -dy) / 2;
    int e2 = 0;

    for (;;) {
        scg_image_set_pixel(image, x0, y0, color);

        if (x0 == x1 && y0 == y1) {
            break;
        }

        e2 = err;
        if (e2 > -dx) {
            err -= dy;
            x0 += step_x;
        }
        if (e2 < dy) {
            err += dx;
            y0 += step_y;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
movl %ecx, (%rsp)
cmpl %esi, %ecx
jne 0x3381
cmpl %ebp, %r8d
movl %ebp, %r12d
cmovgl %r8d, %r12d
cmovll %r8d, %ebp
incl %r12d
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b68
incl %ebp
cmpl %ebp, %r12d
jne 0x3366
jmp 0x3470
movl %r8d, %eax
subl %ebp, %eax
jne 0x33b8
movl (%rsp), %eax
cmpl %r14d, %eax
movl %r14d, %r12d
cmovgl %eax, %r12d
cmovll %eax, %r14d
incl %r12d
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b68
incl %r14d
cmpl %r14d, %r12d
jne 0x339c
jmp 0x3470
movl %r8d, 0x14(%rsp)
setg %cl
xorl %edx, %edx
movl (%rsp), %esi
subl %r14d, %esi
setg %dl
movl %esi, %edi
negl %edi
cmovsl %esi, %edi
movl %eax, %r12d
negl %r12d
cmovsl %eax, %r12d
leal -0x1(%rdx,%rdx), %eax
movl %eax, 0x10(%rsp)
movzbl %cl, %eax
leal -0x1(,%rax,2), %eax
movl %eax, 0xc(%rsp)
movl %r12d, %eax
negl %eax
movl %edi, 0x4(%rsp)
cmpl %r12d, %edi
cmoval %edi, %eax
movl %eax, %r13d
shrl $0x1f, %r13d
addl %eax, %r13d
sarl %r13d
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b68
movl 0x4(%rsp), %eax
negl %eax
movl %eax, 0x8(%rsp)
movl 0x10(%rsp), %eax
movl %r12d, %ecx
cmpl 0x8(%rsp), %r13d
jg 0x3439
xorl %eax, %eax
xorl %ecx, %ecx
movl 0xc(%rsp), %esi
movl 0x4(%rsp), %edx
cmpl %r12d, %r13d
jl 0x344a
xorl %esi, %esi
xorl %edx, %edx
addl %esi, %ebp
addl %eax, %r14d
subl %ecx, %r13d
addl %edx, %r13d
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b68
cmpl 0x14(%rsp), %ebp
jne 0x3427
cmpl (%rsp), %r14d
jne 0x3427
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_rect
void scg_image_draw_rect(scg_image_t *image, int x, int y, int w, int h,
                         scg_pixel_t color) {
    int minx = x;
    int miny = y;
    int maxx = minx + w;
    int maxy = miny + h;

    scg_image_draw_line(image, minx, miny, maxx, miny, color);
    scg_image_draw_line(image, maxx, miny, maxx, maxy, color);
    scg_image_draw_line(image, maxx, maxy, minx, maxy, color);
    scg_image_draw_line(image, minx, maxy, minx, miny, color);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
leal (%rcx,%r15), %ebp
leal (%r8,%r14), %r13d
movl %ebp, %ecx
movl %edx, %r8d
callq 0x3335
movq %r12, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %ebp, %ecx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0x3335
movq %r12, %rdi
movl %ebp, %esi
movl %r13d, %edx
movl %r15d, %ecx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0x3335
movq %r12, %rdi
movl %r15d, %esi
movl %r13d, %edx
movl %r15d, %ecx
movl %r14d, %r8d
movl %ebx, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3335
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_fill_circle
void scg_image_fill_circle(scg_image_t *image, int x, int y, int r,
                           scg_pixel_t color) {
    int f = 1 - r;
    int ddf_x = 0;
    int ddf_y = -2 * r;
    int xi = 0;
    int yi = r;

    scg_image_draw_line(image, x, y - r, x, y + r, color);
    scg_image_draw_line(image, x - r, y, x + r, y, color);

    while (xi < yi) {
        if (f >= 0) {
            yi--;
            ddf_y += 2;
            f += ddf_y;
        }

        xi++;
        ddf_x += 2;
        f += ddf_x + 1;

        scg_image_draw_line(image, x - xi, y + yi, x + xi, y + yi, color);
        scg_image_draw_line(image, x - xi, y - yi, x + xi, y - yi, color);
        scg_image_draw_line(image, x - yi, y + xi, x + yi, y + xi, color);
        scg_image_draw_line(image, x - yi, y - xi, x + yi, y - xi, color);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %r15
subl %ecx, %edx
leal (%r14,%r13), %r8d
movl %esi, %ecx
movl %ebx, %r9d
callq 0x3335
movl %r12d, %esi
subl %r14d, %esi
leal (%r14,%r12), %ecx
movq %r15, 0x28(%rsp)
movq %r15, %rdi
movl %r13d, %edx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0x3335
testl %r14d, %r14d
jle 0x38d7
leal (%r14,%r14), %esi
negl %esi
movl $0x1, %r8d
movl $0x1, %r15d
subl %r14d, %r15d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x3, %r9d
movq %r12, (%rsp)
movq %r8, 0x18(%rsp)
movl %r9d, 0x14(%rsp)
movq %rdi, 0x20(%rsp)
leal 0x2(%rsi), %eax
xorl %ecx, %ecx
testl %r15d, %r15d
setns %cl
movl $0x0, %edx
cmovnsl %eax, %edx
cmovnsl %eax, %esi
movq %rsi, 0x30(%rsp)
subl %ecx, %r14d
movq %r14, 0x8(%rsp)
addl %r9d, %r15d
addl %edx, %r15d
leal (%r12,%rdi), %ebp
leal (%r14,%r13), %edx
movq %r13, %r12
movl %ebx, %r13d
movq (%rsp), %rax
leal (%rax,%r8), %ebx
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %ecx
movl %edx, %r8d
movl %r13d, %r9d
callq 0x3335
movl %r12d, %edx
subl 0x8(%rsp), %edx
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %ecx
movl %edx, %r8d
movl %r13d, %r9d
callq 0x3335
movq (%rsp), %rax
movl %eax, %ebx
subl 0x8(%rsp), %ebx
movq 0x18(%rsp), %rax
leal (%r12,%rax), %edx
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
leal (%rax,%rcx), %ebp
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %ecx
movl %edx, %r8d
movl %r13d, %r9d
callq 0x3335
movq 0x20(%rsp), %rax
leal (%r12,%rax), %edx
movq %r14, %rdi
movl %ebx, %esi
movl %r13d, %ebx
movq %r12, %r13
movq (%rsp), %r12
movq 0x8(%rsp), %r14
movl %ebp, %ecx
movl %edx, %r8d
movl %ebx, %r9d
callq 0x3335
movl 0x14(%rsp), %r9d
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rcx
leal 0x1(%rcx), %eax
decl %edi
addl $0x2, %r9d
cmpl %r14d, %ecx
movl %eax, %r8d
jl 0x37d5
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_char
void scg_image_draw_char(scg_image_t *image, char ch, int x, int y,
                         scg_pixel_t color) {
    uint8_t char_code = (uint8_t)ch;
    if (char_code > SCG__FONT_CHAR_CODE_END) {
        char_code = SCG__FONT_CHAR_CODE_QUESTION_MARK;
    }

    char bitmap[SCG_FONT_SIZE];
    int index = char_code * SCG_FONT_SIZE;
    memcpy(bitmap, scg__font8x8 + index, SCG_FONT_SIZE);

    scg__draw_char_bitmap(image, bitmap, x, y, color);
}

// Assembly:
pushq %rax
testb %sil, %sil
movl $0x3f, %eax
cmovnsl %esi, %eax
movzbl %al, %eax
leaq 0x6924(%rip), %rsi      # 0xa220
movq (%rsi,%rax,8), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
callq 0x390d
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg__draw_char_bitmap
static void scg__draw_char_bitmap(scg_image_t *image, const char *bitmap, int x,
                                  int y, scg_pixel_t color) {
    for (int i = 0; i < SCG_FONT_SIZE; i++) {
        for (int j = 0; j < SCG_FONT_SIZE; j++) {
            int set = bitmap[i] & 1 << j;

            if (set) {
                scg_image_set_pixel(image, x + j, y + i, color);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r13
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
leal (%r14,%rax), %ebp
xorl %ebx, %ebx
movsbl (%r12,%r14), %eax
btl %ebx, %eax
jae 0x3958
leal (%r15,%rbx), %esi
movq %r13, %rdi
movl %ebp, %edx
movl 0xc(%rsp), %ecx
callq 0x2b68
incl %ebx
cmpl $0x8, %ebx
jne 0x393c
incq %r14
cmpq $0x8, %r14
jne 0x3931
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_string
void scg_image_draw_string(scg_image_t *image, const char *str, int x, int y,
                           bool anchor_to_center, scg_pixel_t color) {
    int current_x = x;
    int current_y = y;

    if (anchor_to_center) {
        int width = strlen(str) * SCG_FONT_SIZE;
        current_x = x - width / 2;
        current_y -= SCG_FONT_SIZE / 2;
    }

    for (int i = 0; str[i] != '\0'; i++) {
        if (str[i] != SCG__FONT_CHAR_CODE_SPACE) {
            scg_image_draw_char(image, str[i], current_x, current_y, color);
        }

        current_x += SCG_FONT_SIZE;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
testl %r8d, %r8d
je 0x39a8
movq %r15, %rdi
callq 0x20f0
shll $0x3, %eax
sarl %eax
subl %eax, %r14d
addl $-0x4, %ebp
movq %rsp, %r13
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x39ea
testl %eax, %eax
je 0x39f3
testb %al, %al
movzbl %al, %eax
movl $0x3f, %ecx
cmovsl %ecx, %eax
movzbl %al, %eax
leaq 0x6851(%rip), %rcx      # 0xa220
movq (%rcx,%rax,8), %rax
movq %rax, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movl %r14d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x390d
addl $0x8, %r14d
incq %r15
jmp 0x39ab
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_wchar
void scg_image_draw_wchar(scg_image_t *image, wchar_t ch, int x, int y,
                          scg_pixel_t color) {
    char bitmap[SCG_FONT_SIZE];

    if (ch <= SCG__FONT_CHAR_CODE_END) {
        int index = ch * SCG_FONT_SIZE;
        memcpy(bitmap, scg__font8x8 + index, SCG_FONT_SIZE);
    } else if (ch >= SCG__FONT_HIRAGANA_CHAR_CODE_START &&
               ch <= SCG__FONT_HIRAGANA_CHAR_CODE_END) {
        int mapped_code = SCG__FONT_HIRAGANA_NUM_CHARS -
                          (SCG__FONT_HIRAGANA_CHAR_CODE_END - ch);

        int index = mapped_code * SCG_FONT_SIZE;
        memcpy(bitmap, scg__font8x8_hiragana + index, SCG_FONT_SIZE);
    } else {
        int index = SCG__FONT_CHAR_CODE_QUESTION_MARK * SCG_FONT_SIZE;
        memcpy(bitmap, scg__font8x8 + index, SCG_FONT_SIZE);
    }

    scg__draw_char_bitmap(image, bitmap, x, y, color);
}

// Assembly:
pushq %rax
cmpl $0x7f, %esi
jg 0x3a18
movslq %esi, %rax
leaq 0x680e(%rip), %rsi      # 0xa220
movq (%rsi,%rax,8), %rax
jmp 0x3a3d
leal -0x3040(%rsi), %eax
cmpl $0x5f, %eax
ja 0x3a36
movl %esi, %eax
leaq 0x6bf4(%rip), %rsi      # 0xa620
movq -0x181f8(%rsi,%rax,8), %rax
jmp 0x3a3d
movq 0x69db(%rip), %rax      # 0xa418
movq %rax, (%rsp)
movq %rsp, %rsi
callq 0x390d
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_wstring
void scg_image_draw_wstring(scg_image_t *image, const wchar_t *str, int x,
                            int y, bool anchor_to_center, scg_pixel_t color) {
    int current_x = x;
    int current_y = y;

    if (anchor_to_center) {
        int width = wcslen(str) * SCG_FONT_SIZE;
        current_x = x - width / 2;
        current_y -= SCG_FONT_SIZE / 2;
    }

    for (int i = 0; str[i] != '\0'; i++) {
        if (str[i] != SCG__FONT_CHAR_CODE_SPACE) {
            scg_image_draw_wchar(image, str[i], current_x, current_y, color);
        }

        current_x += SCG_FONT_SIZE;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
testl %r8d, %r8d
je 0x3a93
movq %r15, %rdi
callq 0x21e0
shll $0x3, %eax
sarl %eax
subl %eax, %r14d
addl $-0x4, %ebp
jmp 0x3a93
movq %r12, %rdi
movl %r14d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x3a02
addl $0x8, %r14d
addq $0x4, %r15
movl (%r15), %esi
cmpl $0x20, %esi
je 0x3a8b
testl %esi, %esi
jne 0x3a7b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_frame_metrics
void scg_image_draw_frame_metrics(scg_image_t *image,
                                  scg_frame_metrics_t frame_metrics) {
    int fps = frame_metrics.fps;
    float32_t frame_time_ms = frame_metrics.frame_time_millisecs;
    const char *fmt = "fps:%d ms/f:%.4f";

    ssize_t bsize = snprintf(NULL, 0, fmt, fps, frame_time_ms);
    char buffer[bsize];
    snprintf(buffer, bsize + 1, fmt, fps, frame_time_ms);

    scg_pixel_t color = SCG_COLOR_GREEN;
    float32_t target_fps = (float32_t)frame_metrics.target_fps;
    if (fps < target_fps * 0.95) {
        color = SCG_COLOR_YELLOW;
    }
    if (fps < target_fps * 0.5) {
        color = SCG_COLOR_RED;
    }

    // Draw the metrics with no alpha blending.
    scg_blend_mode_t blend_mode = image->blend_mode;
    scg_image_set_blend_mode(image, SCG_BLEND_MODE_NONE);
    scg_image_draw_string(image, buffer, 10, 10, 0, color);
    scg_image_set_blend_mode(image, blend_mode);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x28(%rbp), %r15d
cvtsd2ss 0x20(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x277c(%rip), %r12      # 0x624e
xorl %r13d, %r13d
xorl %edi, %edi
xorl %esi, %esi
movq %r12, %rdx
movl %r15d, %ecx
movb $0x1, %al
callq 0x2340
movslq %eax, %rsi
leaq 0xf(%rsi), %rax
andq $-0x10, %rax
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
incq %rsi
movq %r14, %rdi
movq %r12, %rdx
movl %r15d, %ecx
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x2340
xorps %xmm0, %xmm0
cvtsi2ssl 0x10(%rbp), %xmm0
cvtsi2sd %r15d, %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0x2545(%rip), %xmm2     # 0x6070
mulsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
movl $0xff0000, %eax         # imm = 0xFF0000
movl $0x0, %ecx
cmoval %eax, %ecx
mulsd 0x2530(%rip), %xmm0     # 0x6078
ucomisd %xmm1, %xmm0
cmoval %eax, %ecx
movl 0x18(%rbx), %r15d
movl %r13d, 0x18(%rbx)
movl $0xff000000, %eax       # imm = 0xFF000000
movl $0xff00ff00, %r9d       # imm = 0xFF00FF00
cmoval %eax, %r9d
orl %ecx, %r9d
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
movl $0xa, %ecx
xorl %r8d, %r8d
callq 0x3977
movl %r15d, 0x18(%rbx)
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_save_to_bmp
bool scg_image_save_to_bmp(scg_image_t *image, const char *filepath) {
    SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
        (void *)image->pixels, image->width, image->height, 32, image->pitch,
        SCG__IMAGE_PIXEL_FORMAT);
    if (surface == NULL) {
        scg_log_errorf("Failed to create SDL surface from image. %s",
                       SDL_GetError());

        return false;
    }

    if (SDL_SaveBMP(surface, filepath) != 0) {
        scg_log_errorf("Failed to save image to %s. %s", filepath,
                       SDL_GetError());

        SDL_FreeSurface(surface);
        return false;
    }

    SDL_FreeSurface(surface);

    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq 0x10(%rdi), %rax
movl (%rdi), %esi
movl 0x4(%rdi), %edx
movl 0x8(%rdi), %r8d
movq %rax, %rdi
movl $0x20, %ecx
movl $0x16362004, %r9d       # imm = 0x16362004
callq 0x22c0
testq %rax, %rax
je 0x3c26
movq %rax, %r14
leaq 0x26e8(%rip), %rsi      # 0x62b6
movq %rbx, %rdi
callq 0x20e0
movq %r14, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x2110
testl %eax, %eax
je 0x3c56
callq 0x2190
movq %rax, (%rsp)
leaq 0x26bf(%rip), %rsi      # 0x62b9
leaq 0x269f(%rip), %rdx      # 0x62a0
leaq 0x24be(%rip), %rcx      # 0x60c6
xorl %ebp, %ebp
xorl %edi, %edi
movl $0x4d5, %r8d            # imm = 0x4D5
movq %rbx, %r9
xorl %eax, %eax
callq 0x22e0
movq %r14, %rdi
callq 0x2230
jmp 0x3c61
callq 0x2190
leaq 0x262d(%rip), %rsi      # 0x625f
leaq 0x2667(%rip), %rdx      # 0x62a0
leaq 0x2486(%rip), %rcx      # 0x60c6
xorl %ebp, %ebp
xorl %edi, %edi
movl $0x4ce, %r8d            # imm = 0x4CE
movq %rax, %r9
xorl %eax, %eax
callq 0x22e0
jmp 0x3c61
movq %r14, %rdi
callq 0x2230
movb $0x1, %bpl
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_sound_new_from_wav
scg_sound_t *scg_sound_new_from_wav(scg_audio_t *audio, const char *filepath,
                                    bool loop) {
    if (audio->num_sounds == SCG__MAX_SOUNDS) {
        scg_log_error("Maximum sounds reached");

        return NULL;
    }

    SDL_AudioSpec spec;
    uint32_t length;
    uint8_t *buffer;

    if (SDL_LoadWAV(filepath, &spec, &buffer, &length) == NULL) {
        scg_log_errorf("Failed to load WAV file at %s. %s", filepath,
                       SDL_GetError());

        return NULL;
    }

    scg_sound_t *sound = malloc(sizeof(*sound));
    if (sound == NULL) {
        scg_log_error("Failed to allocate memory for sound");

        SDL_FreeWAV(buffer);
        return NULL;
    }

    sound->sdl_spec = spec;
    sound->length = length;
    sound->buffer = buffer;
    sound->play_offset = 0;
    sound->end_position = buffer + length;
    sound->is_playing = false;
    sound->loop = loop;

    audio->sounds[audio->num_sounds++] = sound;

    return sound;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
cmpl $0x10, 0xa0(%rdi)
jne 0x3d05
leaq 0x23bf(%rip), %rsi      # 0x60a0
leaq 0x2605(%rip), %rdx      # 0x62ed
leaq 0x23d7(%rip), %rcx      # 0x60c6
leaq 0x260e(%rip), %r9       # 0x6304
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x51a, %r8d            # imm = 0x51A
jmp 0x3dce
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x240d(%rip), %rsi      # 0x6121
movq %r15, %rdi
callq 0x20e0
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
movq %rax, %rdi
movl $0x1, %esi
callq 0x2090
testq %rax, %rax
je 0x3da3
movl $0x50, %edi
callq 0x22f0
testq %rax, %rax
je 0x3de3
movq %rax, %rbx
movups 0x18(%rsp), %xmm0
movups 0x28(%rsp), %xmm1
movups %xmm1, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movl 0xc(%rsp), %eax
movl %eax, 0x28(%rbx)
movq 0x10(%rsp), %rcx
movq %rcx, 0x30(%rbx)
movl $0x0, 0x38(%rbx)
addq %rax, %rcx
movq %rcx, 0x40(%rbx)
movb $0x0, 0x48(%rbx)
movb %bpl, 0x49(%rbx)
movslq 0xa0(%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0xa0(%r14)
movq %rbx, 0x20(%r14,%rax,8)
jmp 0x3dd5
callq 0x2190
movq %rax, (%rsp)
leaq 0x2568(%rip), %rsi      # 0x631b
leaq 0x2533(%rip), %rdx      # 0x62ed
leaq 0x2305(%rip), %rcx      # 0x60c6
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x525, %r8d            # imm = 0x525
movq %r15, %r9
xorl %eax, %eax
callq 0x22e0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22b6(%rip), %rsi      # 0x60a0
leaq 0x24fc(%rip), %rdx      # 0x62ed
leaq 0x22ce(%rip), %rcx      # 0x60c6
leaq 0x2553(%rip), %r9       # 0x6352
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x52c, %r8d            # imm = 0x52C
xorl %eax, %eax
callq 0x22e0
movq 0x10(%rsp), %rdi
callq 0x2310
jmp 0x3dd5
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_config_new_default
scg_config_t scg_config_new_default(void) {
    return (scg_config_t){
        .video = {.width = 640,
                  .height = 480,
                  .title = "SCG Application",
                  .scale = 1,
                  .fullscreen = false,
                  .vsync = true,
                  .lock_fps = true,
                  .show_frame_metrics = true},
        .input = {.hide_mouse_cursor = true},
        .audio = {.enabled = false, .volume = SCG__MAX_VOLUME / 2}};
}

// Assembly:
movq %rdi, %rax
movabsq $0x1e000000280, %rcx    # imm = 0x1E000000280
movq %rcx, (%rdi)
leaq 0x2517(%rip), %rcx      # 0x6376
movq %rcx, 0x8(%rdi)
movl $0x1, 0x10(%rdi)
xorl %ecx, %ecx
movb %cl, 0x14(%rdi)
movl $0x1010101, 0x15(%rdi)  # imm = 0x1010101
movb %cl, 0x1c(%rdi)
movl $0x40, 0x20(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg__screen_free
static void scg__screen_free(scg__screen_t *screen) {
    SDL_DestroyTexture(screen->sdl_texture);
    SDL_DestroyRenderer(screen->sdl_renderer);
    SDL_DestroyWindow(screen->sdl_window);

    free(screen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x2160
movq 0x58(%rbx), %rdi
callq 0x20c0
movq 0x50(%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
popq %rbx
jmp 0x2290
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg__mouse_update
static void scg__mouse_update(scg_mouse_t *mouse, int w, int h, int win_w,
                              int win_h) {
    int x, y;
    uint32_t button_state = SDL_GetMouseState(&x, &y);

    mouse->window_x = x;
    mouse->window_y = y;
    mouse->x = (int)(((float32_t)x / (float32_t)win_w) * (float32_t)w);
    mouse->y = (int)(((float32_t)y / (float32_t)win_h) * (float32_t)h);
    mouse->button_state = button_state;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, 0xc(%rsp)
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x14(%rsp), %r13
leaq 0x10(%rsp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x2350
movl (%r13), %ecx
movl %ecx, 0x8(%rbx)
cvtsi2ss %ecx, %xmm0
movl (%r15), %ecx
cvtsi2ss %r14d, %xmm1
divss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r12d, %xmm1
movl %ecx, 0xc(%rbx)
mulss %xmm0, %xmm1
cvttss2si %xmm1, %edx
movl %edx, (%rbx)
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ebp, %xmm1
divss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl 0xc(%rsp), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movl %ecx, 0x4(%rbx)
movl %eax, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg__decode_font_data
static void scg__decode_font_data(char *out, size_t out_len, const char *data) {
    const int len = strlen(data);

    uint8_t indices[4];
    uint8_t buf[3];
    size_t size = 0;

    for (int i = 0; i < len; i += 4) {
        indices[0] = scg__base64_index_from_char(data[i]);
        indices[1] = scg__base64_index_from_char(data[i + 1]);
        indices[2] = scg__base64_index_from_char(data[i + 2]);
        indices[3] = scg__base64_index_from_char(data[i + 3]);

        buf[0] = (indices[0] << 2) + ((indices[1] & 0x30) >> 4);
        buf[1] = ((indices[1] & 0xF) << 4) + ((indices[2] & 0x3C) >> 2);
        buf[2] = ((indices[2] & 0x3) << 6) + indices[3];

        for (int j = 0; j < 3; j++) {
            if (size == out_len) {
                return;
            }

            out[size++] = buf[j];
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x20f0
testl %eax, %eax
jle 0x49d2
xorl %ecx, %ecx
leaq 0x2926(%rip), %rdx      # 0x7220
xorl %esi, %esi
movb (%rbx,%rcx), %r8b
movq %rdx, %r9
xorl %edi, %edi
cmpb %r8b, (%r9)
je 0x491c
addq $0x4, %rdi
incq %r9
cmpq $0x100, %rdi            # imm = 0x100
jne 0x4905
xorl %edi, %edi
movb 0x1(%rbx,%rcx), %r9b
xorl %r8d, %r8d
cmpb %r9b, (%r8,%rdx)
je 0x4936
incq %r8
cmpq $0x40, %r8
jne 0x4924
xorl %r8d, %r8d
movb 0x2(%rbx,%rcx), %r10b
xorl %r9d, %r9d
cmpb %r10b, (%r9,%rdx)
je 0x4950
incq %r9
cmpq $0x40, %r9
jne 0x493e
xorl %r9d, %r9d
movb 0x3(%rbx,%rcx), %r11b
xorl %r10d, %r10d
cmpb %r11b, (%r10,%rdx)
je 0x496a
incq %r10
cmpq $0x40, %r10
jne 0x4958
xorl %r10d, %r10d
movl %r8d, %r11d
shrb $0x4, %r11b
andb $0x3, %r11b
orb %dil, %r11b
movb %r11b, 0xd(%rsp)
shlb $0x4, %r8b
movl %r9d, %edi
shrb $0x2, %dil
andb $0xf, %dil
orb %r8b, %dil
movb %dil, 0xe(%rsp)
shlb $0x6, %r9b
addb %r10b, %r9b
movb %r9b, 0xf(%rsp)
movq %r14, %r8
subq %rsi, %r8
leaq (%r15,%rsi), %r9
xorl %edi, %edi
cmpq %rdi, %r8
je 0x49d2
movb 0xd(%rsp,%rdi), %r10b
movb %r10b, (%r9,%rdi)
incq %rdi
cmpq $0x3, %rdi
jne 0x49ac
addq $0x4, %rcx
addq %rdi, %rsi
cmpl %eax, %ecx
jl 0x48fc
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq