LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xe96(%rip), %rbx       # 0x2028
pushq $0x16
popq %rsi
movsd 0xe73(%rip), %xmm0      # 0x2010
movsd 0xe73(%rip), %xmm1      # 0x2018
movq %rbx, %rdi
movb $0x2, %al
callq 0x1030
pushq $0x7b
popq %rsi
movsd 0xe66(%rip), %xmm0      # 0x2020
movq %rbx, %rdi
movsd 0xe53(%rip), %xmm1      # 0x2018
movb $0x2, %al
callq 0x1030
leaq 0xe70(%rip), %rdi       # 0x2043
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1030
leaq 0xe93(%rip), %rdi       # 0x2078
pushq $0x5
popq %rsi
pushq $0xc
popq %rdx
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x272d
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
pushq $-0x1
popq %rbp
testl %eax, %eax
js 0x27a2
movl %eax, %r15d
incl %r15d
movq %r15, %rdi
callq 0x22f0
movq %rax, (%r14)
testq %rax, %rax
je 0x27a2
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_O2/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 0x382f(%rip), %xmm0     # 0x6008
movaps %xmm0, %xmm1
minss %xmm2, %xmm1
movl $0xff, %ecx
andl %ecx, %r8d
cvtsi2ss %r8d, %xmm2
andl %ecx, %r9d
cvtsi2ss %r9d, %xmm3
subss %xmm1, %xmm0
mulss %xmm1, %xmm3
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
andl %ecx, %eax
cvtsi2ss %eax, %xmm3
andl %ecx, %edx
cvtsi2ss %edx, %xmm4
mulss %xmm1, %xmm4
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
andl %ecx, %edi
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_O2/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
pushq $0x4
popq %rsi
callq 0x2150
testq %rax, %rax
je 0x289f
movq %rax, %r14
pushq $0x20
popq %rdi
callq 0x22f0
testq %rax, %rax
je 0x28ce
movq %rax, %rbx
movl %ebp, (%rax)
movl %r15d, 0x4(%rax)
shll $0x2, %ebp
movl %ebp, 0x8(%rax)
movq %r14, 0x10(%rax)
andl $0x0, 0x18(%rax)
jmp 0x2903
leaq 0x380a(%rip), %rsi      # 0x60b0
leaq 0x381b(%rip), %rdx      # 0x60c8
leaq 0x3822(%rip), %rcx      # 0x60d6
leaq 0x382d(%rip), %r9       # 0x60e8
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x262, %r8d            # imm = 0x262
xorl %eax, %eax
callq 0x22e0
jmp 0x2903
leaq 0x37db(%rip), %rsi      # 0x60b0
leaq 0x37ec(%rip), %rdx      # 0x60c8
leaq 0x37f3(%rip), %rcx      # 0x60d6
leaq 0x3823(%rip), %r9       # 0x610d
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_O2/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 0x2b4c
testl %edx, %edx
js 0x2b4c
movl (%rdi), %ecx
cmpl %esi, %ecx
jle 0x2b4c
cmpl %edx, 0x4(%rdi)
jle 0x2b4c
imull %edx, %ecx
addl %esi, %ecx
movq 0x10(%rdi), %rax
movl (%rax,%rcx,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2b93
testl %edx, %edx
js 0x2b93
movl (%rdi), %r8d
cmpl %esi, %r8d
jle 0x2b93
cmpl %edx, 0x4(%rdi)
jle 0x2b93
movl 0x18(%rdi), %eax
imull %edx, %r8d
addl %esi, %r8d
testl %eax, %eax
je 0x2b89
movl %ecx, %esi
shrl $0x18, %esi
movl %eax, %edx
xorl $0x1, %edx
movl %esi, %r9d
xorl $0xff, %r9d
orl %edx, %r9d
jne 0x2b94
movq 0x10(%rdi), %rax
movl %r8d, %edx
movl %ecx, (%rax,%rdx,4)
retq
cmpl $0x2, %eax
jne 0x2b93
movl %ecx, %r9d
shrl $0x8, %r9d
movl %ecx, %r10d
shrl $0x10, %r10d
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 %esi, %xmm0
divss 0x3441(%rip), %xmm0     # 0x600c
movss 0x3435(%rip), %xmm2     # 0x6008
movzbl %r10b, %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 %r9b, %r9d
cvtsi2ss %r9d, %xmm3
andl %esi, %r8d
cvtsi2ss %r8d, %xmm4
mulss %xmm2, %xmm4
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
movzbl %cl, %ecx
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
jmp 0x2b90
// File: /workspace/github_c_makefile_star2_O2/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), %eax
imull (%rdi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x2c74
movq 0x10(%rdi), %rdx
movl %esi, (%rdx,%rcx,4)
incq %rcx
jmp 0x2c63
retq
// File: /workspace/github_c_makefile_star2_O2/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)
movq %rsi, %r15
movq %rdi, %r12
movl (%rsi), %r14d
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
movl 0x4(%rsi), %eax
testl %eax, %eax
cmovlel %r13d, %eax
movl %eax, 0x4(%rsp)
cmpl 0x4(%rsp), %r13d
je 0x2cee
movq 0x8(%rsp), %rax
leal (%rax,%r13), %ebp
xorl %ebx, %ebx
cmpl %ebx, %r14d
je 0x2ce9
movq %r15, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0x2b28
movq 0x10(%rsp), %rcx
leal (%rcx,%rbx), %esi
movq %r12, %rdi
movl %ebp, %edx
movl %eax, %ecx
callq 0x2b4d
incl %ebx
jmp 0x2cbf
incl %r13d
jmp 0x2cad
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3300
cmpl %ebp, %r8d
movl %ebp, %r12d
cmovgl %r8d, %r12d
cmovll %r8d, %ebp
cmpl %r12d, %ebp
jg 0x33eb
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b4d
incl %ebp
jmp 0x32e4
movl %r8d, %eax
subl %ebp, %eax
jne 0x3335
movl (%rsp), %eax
cmpl %r14d, %eax
movl %r14d, %r12d
cmovgl %eax, %r12d
cmovll %eax, %r14d
cmpl %r12d, %r14d
jg 0x33eb
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b4d
incl %r14d
jmp 0x3318
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,2), %eax
movl %eax, 0xc(%rsp)
movzbl %cl, %ecx
movl %r12d, %eax
negl %eax
cmpl %r12d, %edi
cmoval %edi, %eax
leal -0x1(,%rcx,2), %ecx
movl %ecx, 0x8(%rsp)
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %r13d
movl %edi, 0x10(%rsp)
negl %edi
movl %edi, 0x4(%rsp)
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2b4d
cmpl 0x14(%rsp), %ebp
jne 0x33ab
cmpl (%rsp), %r14d
je 0x33eb
cmpl 0x4(%rsp), %r13d
movl $0x0, %eax
cmovgl 0xc(%rsp), %eax
movl $0x0, %ecx
cmovgl %r12d, %ecx
addl %eax, %r14d
movl %r13d, %eax
subl %ecx, %eax
cmpl %r12d, %r13d
movl $0x0, %ecx
cmovll 0x8(%rsp), %ecx
movl $0x0, %r13d
cmovll 0x10(%rsp), %r13d
addl %ecx, %ebp
addl %eax, %r13d
jmp 0x3390
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x32b6
movq %r12, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %ebp, %ecx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0x32b6
movq %r12, %rdi
movl %ebp, %esi
movl %r13d, %edx
movl %r15d, %ecx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0x32b6
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 0x32b6
// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r13d
movq %rdi, %r12
pushq $0x1
popq %rax
subl %ecx, %eax
movq %rax, 0x28(%rsp)
leal (%r14,%r14), %eax
negl %eax
movq %rax, 0x20(%rsp)
subl %ecx, %edx
leal (%r14,%r15), %r8d
movl %esi, %ecx
movl %ebx, %r9d
callq 0x32b6
movl %r13d, %esi
subl %r14d, %esi
leal (%r14,%r13), %ecx
movq %r12, 0x30(%rsp)
movq %r12, %rdi
movl %r15d, %edx
movl %r15d, %r8d
movl %ebx, 0x14(%rsp)
movl %ebx, %r9d
callq 0x32b6
leal -0x1(%r15), %r12d
movq %r15, 0x40(%rsp)
leal 0x1(%r15), %ebx
leal 0x1(%r13), %ecx
movq %r13, 0x38(%rsp)
leal -0x1(%r13), %esi
movl $0x0, 0x8(%rsp)
xorl %r10d, %r10d
movl 0x14(%rsp), %r15d
cmpl %r14d, %r10d
jge 0x385b
movq 0x20(%rsp), %rdi
leal 0x2(%rdi), %eax
xorl %r8d, %r8d
movq 0x28(%rsp), %r9
testl %r9d, %r9d
setns %r8b
movl $0x0, %edx
cmovnsl %eax, %edx
cmovnsl %eax, %edi
movq %rdi, 0x20(%rsp)
subl %r8d, %r14d
incl %r10d
movl %r10d, 0x18(%rsp)
movl 0x8(%rsp), %eax
addl %eax, %r9d
addl $0x2, %eax
movl %eax, 0x8(%rsp)
addl %edx, %r9d
addl $0x3, %r9d
movq %r9, 0x28(%rsp)
movq 0x40(%rsp), %r13
leal (%r14,%r13), %edx
movl %r12d, 0x1c(%rsp)
movq 0x30(%rsp), %r12
movq %r12, %rdi
movl %ecx, 0x10(%rsp)
movl %edx, %r8d
movl %esi, 0xc(%rsp)
movl %r15d, %r9d
callq 0x32b6
movl %r13d, %edx
subl %r14d, %edx
movq %r12, %rdi
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %ecx
movl %edx, %r8d
movl %r15d, %r9d
callq 0x32b6
movq 0x38(%rsp), %rax
movl %eax, %r13d
subl %r14d, %r13d
leal (%r14,%rax), %ebp
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl %ebp, %ecx
movl %ebx, %r8d
movl %r15d, %r9d
callq 0x32b6
movq %r12, %rdi
movl 0x1c(%rsp), %r12d
movl %r13d, %esi
movl %r12d, %edx
movl %ebp, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
callq 0x32b6
movl 0x18(%rsp), %r10d
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %ecx
decl %r12d
incl %ebx
incl %ecx
decl %esi
jmp 0x3767
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x3f
popq %rax
cmovnsl %esi, %eax
movzbl %al, %eax
leaq 0x69a2(%rip), %rsi      # 0xa220
movq (%rsi,%rax,8), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
callq 0x388f
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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
cmpq $0x8, %r14
je 0x38ee
movq 0x10(%rsp), %rax
leal (%r14,%rax), %ebp
xorl %ebx, %ebx
cmpl $0x8, %ebx
je 0x38e9
movsbl (%r12,%r14), %eax
btl %ebx, %eax
jae 0x38e5
leal (%r15,%rbx), %esi
movq %r13, %rdi
movl %ebp, %edx
movl 0xc(%rsp), %ecx
callq 0x2b4d
incl %ebx
jmp 0x38c4
incq %r14
jmp 0x38b3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movl %r9d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
testl %r8d, %r8d
je 0x3947
movq %r15, %rdi
callq 0x20f0
shll $0x3, %eax
sarl %eax
subl %eax, %r14d
addl $-0x4, %ebp
jmp 0x3947
movsbl %al, %esi
movq %r12, %rdi
movl %r14d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x386a
addl $0x8, %r14d
incq %r15
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x3940
testl %eax, %eax
jne 0x392d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3973
movslq %esi, %rax
leaq 0x68b3(%rip), %rsi      # 0xa220
movq (%rsi,%rax,8), %rax
jmp 0x3998
leal -0x3040(%rsi), %eax
cmpl $0x5f, %eax
ja 0x3991
movl %esi, %eax
leaq 0x6c99(%rip), %rsi      # 0xa620
movq -0x181f8(%rsi,%rax,8), %rax
jmp 0x3998
movq 0x6a80(%rip), %rax      # 0xa418
movq %rax, (%rsp)
movq %rsp, %rsi
callq 0x388f
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x39ee
movq %r15, %rdi
callq 0x21e0
shll $0x3, %eax
sarl %eax
subl %eax, %r14d
addl $-0x4, %ebp
jmp 0x39ee
movq %r12, %rdi
movl %r14d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x395d
addl $0x8, %r14d
addq $0x4, %r15
movl (%r15), %esi
cmpl $0x20, %esi
je 0x39e6
testl %esi, %esi
jne 0x39d6
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2831(%rip), %r12      # 0x625e
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
cvtsi2ssl 0x10(%rbp), %xmm0
cvtsi2sd %r15d, %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0x25fd(%rip), %xmm2     # 0x6080
mulsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
movl $0xff0000, %eax         # imm = 0xFF0000
cmoval %eax, %r13d
movl 0x18(%rbx), %r15d
andl $0x0, 0x18(%rbx)
mulsd 0x25e4(%rip), %xmm0     # 0x6088
ucomisd %xmm1, %xmm0
cmoval %eax, %r13d
movl $0xff000000, %eax       # imm = 0xFF000000
movl $0xff00ff00, %r9d       # imm = 0xFF00FF00
cmoval %eax, %r9d
orl %r13d, %r9d
pushq $0xa
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movl %ecx, %edx
xorl %r8d, %r8d
callq 0x38fd
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_O2/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
pushq $0x20
popq %rcx
movq %rax, %rdi
movl $0x16362004, %r9d       # imm = 0x16362004
callq 0x22c0
testq %rax, %rax
je 0x3b72
movq %rax, %r14
leaq 0x27aa(%rip), %rsi      # 0x62c6
movq %rbx, %rdi
callq 0x20e0
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x2110
testl %eax, %eax
je 0x3ba2
callq 0x2190
movq %rax, (%rsp)
leaq 0x2783(%rip), %rsi      # 0x62c9
leaq 0x2763(%rip), %rdx      # 0x62b0
leaq 0x2582(%rip), %rcx      # 0x60d6
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 0x3bad
callq 0x2190
leaq 0x26f1(%rip), %rsi      # 0x626f
leaq 0x272b(%rip), %rdx      # 0x62b0
leaq 0x254a(%rip), %rcx      # 0x60d6
xorl %ebp, %ebp
xorl %edi, %edi
movl $0x4ce, %r8d            # imm = 0x4CE
movq %rax, %r9
xorl %eax, %eax
callq 0x22e0
jmp 0x3bad
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_O2/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 0x3c51
leaq 0x2483(%rip), %rsi      # 0x60b0
leaq 0x26c9(%rip), %rdx      # 0x62fd
leaq 0x249b(%rip), %rcx      # 0x60d6
leaq 0x26d2(%rip), %r9       # 0x6314
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x51a, %r8d            # imm = 0x51A
jmp 0x3d13
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x24d1(%rip), %rsi      # 0x6131
movq %r15, %rdi
callq 0x20e0
pushq $0x1
popq %rsi
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
movq %rax, %rdi
callq 0x2090
testq %rax, %rax
je 0x3ce8
pushq $0x50
popq %rdi
callq 0x22f0
testq %rax, %rax
je 0x3d28
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)
andl $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 0x3d1a
callq 0x2190
movq %rax, (%rsp)
leaq 0x2633(%rip), %rsi      # 0x632b
leaq 0x25fe(%rip), %rdx      # 0x62fd
leaq 0x23d0(%rip), %rcx      # 0x60d6
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 0x2381(%rip), %rsi      # 0x60b0
leaq 0x25c7(%rip), %rdx      # 0x62fd
leaq 0x2399(%rip), %rcx      # 0x60d6
leaq 0x261e(%rip), %r9       # 0x6362
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x52c, %r8d            # imm = 0x52C
xorl %eax, %eax
callq 0x22e0
movq 0x10(%rsp), %rdi
callq 0x2310
jmp 0x3d1a
// File: /workspace/github_c_makefile_star2_O2/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 0x25e5(%rip), %rcx      # 0x6386
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_O2/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)
movl (%r15), %edx
movl %edx, 0xc(%rbx)
movd %ebp, %xmm0
movd %r14d, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2ps %xmm1, %xmm0
movd 0xc(%rsp), %xmm1
movd %r12d, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2ps %xmm2, %xmm1
movd %ecx, %xmm2
movd %edx, %xmm3
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
cvtdq2ps %xmm2, %xmm2
divps %xmm0, %xmm2
mulps %xmm1, %xmm2
cvttps2dq %xmm2, %xmm0
movlps %xmm0, (%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_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
movq %rdx, %rdi
callq 0x20f0
cltq
negq %r14
movq %r14, 0x20(%rsp)
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %rax, 0x10(%rsp)
cmpq %rax, %r15
jge 0x4849
movsbl (%rbx,%r15), %edi
callq 0x529b
movl %eax, %ebp
movsbl 0x1(%rbx,%r15), %edi
callq 0x529b
movl %eax, %r12d
movsbl 0x2(%rbx,%r15), %edi
callq 0x529b
movl %eax, %r13d
movsbl 0x3(%rbx,%r15), %edi
callq 0x529b
shlb $0x2, %bpl
movl %r12d, %ecx
shrb $0x4, %cl
andb $0x3, %cl
orb %bpl, %cl
movb %cl, 0xd(%rsp)
shlb $0x4, %r12b
movl %r13d, %ecx
shrb $0x2, %cl
andb $0xf, %cl
orb %r12b, %cl
movb %cl, 0xe(%rsp)
shlb $0x6, %r13b
addb %al, %r13b
movb %r13b, 0xf(%rsp)
movq 0x18(%rsp), %rax
leaq (%rax,%r14), %rcx
movq 0x20(%rsp), %rax
leaq (%rax,%r14), %rdx
xorl %eax, %eax
cmpq $0x3, %rax
je 0x4838
movq %rdx, %rsi
addq %rax, %rsi
je 0x4849
movb 0xd(%rsp,%rax), %sil
movb %sil, (%rcx,%rax)
incq %rax
jmp 0x481c
addq $0x4, %r15
addq %rax, %r14
movq 0x10(%rsp), %rax
jmp 0x4798
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_app_process_events
bool scg_app_process_events(scg_app_t *app) {
    // Handle events that need to be polled. This may include
    // text input, mouse events, and game controller events.
    {
        SDL_Event event;
        while (SDL_PollEvent(&event)) {
            switch (event.type) {
            case SDL_QUIT:
                app->running = false;
                return false;
            case SDL_KEYDOWN:
                app->keyboard->current_key_states[event.key.keysym.scancode] =
                    true;
                break;
            case SDL_KEYUP:
                app->keyboard->current_key_states[event.key.keysym.scancode] =
                    false;
                break;
            case SDL_MOUSEBUTTONUP:
            case SDL_MOUSEBUTTONDOWN:
            case SDL_MOUSEMOTION:
                scg__mouse_update(app->mouse, app->draw_target->width,
                                  app->draw_target->height,
                                  app->screen->window_width,
                                  app->screen->window_height);
                break;
            }
        }
    }

    if (scg_keyboard_is_key_triggered(app->keyboard, SCG_KEY_ESCAPE)) {
        app->running = false;
        return false;
    }

    // Calculate the delta time and elapsed time in seconds.
    // This is useful for apps that want some quick consistent animation
    // and don't care about fixed updates.
    {
        uint64_t now = scg_get_performance_counter();
        app->delta_time =
            scg_get_elapsed_time_secs(now, app->delta_time_counter);
        app->delta_time_counter = now;

        app->elapsed_time += app->delta_time;
    }

    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x2120
testl %eax, %eax
je 0x48d0
movl (%rsp), %eax
leal -0x400(%rax), %ecx
cmpl $0x3, %ecx
jb 0x4896
cmpl $0x300, %eax            # imm = 0x300
je 0x48c2
cmpl $0x301, %eax            # imm = 0x301
je 0x48b4
cmpl $0x100, %eax            # imm = 0x100
jne 0x4865
jmp 0x48e3
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rdi
movl (%rax), %esi
movl 0x4(%rax), %edx
movq 0x60(%rbx), %rax
movl (%rax), %ecx
movl 0x4(%rax), %r8d
callq 0x46d2
jmp 0x4865
movq 0x40(%rbx), %rax
movl 0x10(%rsp), %ecx
movb $0x0, (%rax,%rcx)
jmp 0x4865
movq 0x40(%rbx), %rax
movl 0x10(%rsp), %ecx
movb $0x1, (%rax,%rcx)
jmp 0x4865
movq 0x40(%rbx), %rax
cmpb $0x0, 0x229(%rax)
jne 0x48ea
cmpb $0x1, 0x29(%rax)
jne 0x48ea
movb $0x0, (%rbx)
xorl %eax, %eax
jmp 0x4917
callq 0x2300
movq %rax, %r14
movq 0x58(%rbx), %rsi
movq %rax, %rdi
callq 0x2529
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rbx)
movq %r14, 0x58(%rbx)
addss 0x8(%rbx), %xmm0
movss %xmm0, 0x8(%rbx)
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_app_free
void scg_app_free(scg_app_t *app) {
    if (app->audio != NULL) {
        scg__audio_free(app->audio);
    }

    free(app->mouse);
    free(app->keyboard);
    scg__screen_free(app->screen);
    scg_image_free(app->draw_target);

    SDL_Quit();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x50(%rdi), %r14
testq %r14, %r14
je 0x4c56
movl (%r14), %edi
pushq $0x1
popq %rsi
callq 0x22d0
movl (%r14), %edi
callq 0x2330
xorl %r15d, %r15d
movslq 0xa0(%r14), %rax
cmpq %rax, %r15
jge 0x4c3d
movq 0x20(%r14,%r15,8), %rax
movq 0x30(%rax), %rdi
callq 0x2310
incq %r15
jmp 0x4c1e
movq 0x18(%r14), %rdi
callq 0x2290
movl (%r14), %edi
callq 0x20d0
movq %r14, %rdi
callq 0x2290
movq 0x48(%rbx), %rdi
callq 0x2290
movq 0x40(%rbx), %rdi
callq 0x2290
movq 0x60(%rbx), %rdi
callq 0x46aa
movq 0x38(%rbx), %rdi
callq 0x3bb8
popq %rbx
popq %r14
popq %r15
jmp 0x2060
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_tween_exponential_ease_in_out
float32_t scg_tween_exponential_ease_in_out(float32_t t) {
    if (t == 0.0f || t == 1.0f) {
        return t;
    }

    if (t < 0.5f) {
        return 0.5f * powf(2.0f, (20.0f * t) - 10.0f);
    }

    return -0.5f * powf(2.0f, (-20.0f * t) + 10.0f) + 1.0f;
}

// Assembly:
pushq %rax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4ce8
jnp 0x4d44
ucomiss 0x1319(%rip), %xmm0     # 0x6008
jne 0x4cf3
jnp 0x4d44
movss 0x1309(%rip), %xmm1     # 0x6004
ucomiss %xmm0, %xmm1
jbe 0x4d1f
mulss 0x131c(%rip), %xmm0     # 0x6024
addss 0x1308(%rip), %xmm0     # 0x6018
callq 0x23e0
mulss 0x12e7(%rip), %xmm0     # 0x6004
jmp 0x4d44
mulss 0x12f5(%rip), %xmm0     # 0x601c
addss 0x12e5(%rip), %xmm0     # 0x6014
callq 0x23e0
mulss 0x12e4(%rip), %xmm0     # 0x6020
addss 0x12c4(%rip), %xmm0     # 0x6008
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_tween_elastic_ease_in
float32_t scg_tween_elastic_ease_in(float32_t t) {
    if (t == 0.0f) {
        return 0.0f;
    }

    if (t == 1.0f) {
        return 1.0f;
    }

    return -powf(2.0f, 10.0f * (t - 1.0f)) * sinf((t - 1.1f) * 5.0f * SCG_PI);
}

// Assembly:
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x4d54
jp 0x4d54
retq
movss 0x12ac(%rip), %xmm0     # 0x6008
ucomiss %xmm0, %xmm1
jne 0x4d63
jnp 0x4d53
subq $0x28, %rsp
movss 0x12a1(%rip), %xmm0     # 0x6010
addss %xmm1, %xmm0
mulss 0x1299(%rip), %xmm0     # 0x6014
movss %xmm1, 0xc(%rsp)
callq 0x23e0
xorps 0x12e3(%rip), %xmm0     # 0x6070
movaps %xmm0, 0x10(%rsp)
movss 0xc(%rsp), %xmm0
addss 0x1288(%rip), %xmm0     # 0x6028
mulss 0x1284(%rip), %xmm0     # 0x602c
mulss 0x1280(%rip), %xmm0     # 0x6030
callq 0x21d0
mulss 0x10(%rsp), %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_tween_elastic_ease_out
float32_t scg_tween_elastic_ease_out(float32_t t) {
    if (t == 0.0f) {
        return 0.0f;
    }

    if (t == 1.0f) {
        return 1.0f;
    }

    return powf(2.0f, -10.0f * t) * sinf((t - 0.1f) * 5.0f * SCG_PI) + 1.0f;
}

// Assembly:
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x4dce
jp 0x4dce
retq
movss 0x1232(%rip), %xmm0     # 0x6008
ucomiss %xmm0, %xmm1
jne 0x4ddd
jnp 0x4dcd
pushq %rax
movss 0x1232(%rip), %xmm0     # 0x6018
mulss %xmm1, %xmm0
movss %xmm1, (%rsp)
callq 0x23e0
movss %xmm0, 0x4(%rsp)
movss (%rsp), %xmm0
addss 0x122d(%rip), %xmm0     # 0x6034
mulss 0x121d(%rip), %xmm0     # 0x602c
mulss 0x1219(%rip), %xmm0     # 0x6030
callq 0x21d0
mulss 0x4(%rsp), %xmm0
addss 0x11de(%rip), %xmm0     # 0x6008
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_tween_elastic_ease_in_out
float32_t scg_tween_elastic_ease_in_out(float32_t t) {
    if (t == 0.0f) {
        return 0.0f;
    }

    if (t == 1.0f) {
        return 1.0f;
    }

    t *= 2.0f;

    if (t < 1.0f) {
        return -0.5f * powf(2.0f, 10.0f * (t - 1.0f)) *
               sinf((t - 1.1f) * 5.0f * SCG_PI);
    }

    return 0.5f * powf(2.0f, -10.0f * (t - 1.0f)) *
               sinf((t - 1.1f) * 5.0f * SCG_PI) +
           1.0f;
}

// Assembly:
pushq %rax
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x4e3e
jnp 0x4eea
movss 0x11c2(%rip), %xmm0     # 0x6008
ucomiss %xmm0, %xmm1
jne 0x4e51
jnp 0x4eea
addss %xmm1, %xmm1
movss 0x11ab(%rip), %xmm0     # 0x6008
ucomiss %xmm1, %xmm0
movss 0x11a8(%rip), %xmm0     # 0x6010
addss %xmm1, %xmm0
addss 0x11b4(%rip), %xmm1     # 0x6028
mulss 0x11b0(%rip), %xmm1     # 0x602c
mulss 0x11ac(%rip), %xmm1     # 0x6030
movss %xmm1, 0x4(%rsp)
jbe 0x4eb8
mulss 0x1180(%rip), %xmm0     # 0x6014
callq 0x23e0
mulss 0x117f(%rip), %xmm0     # 0x6020
movss %xmm0, (%rsp)
movss 0x4(%rsp), %xmm0
callq 0x21d0
mulss (%rsp), %xmm0
jmp 0x4eea
mulss 0x1158(%rip), %xmm0     # 0x6018
callq 0x23e0
mulss 0x1137(%rip), %xmm0     # 0x6004
movss %xmm0, (%rsp)
movss 0x4(%rsp), %xmm0
callq 0x21d0
mulss (%rsp), %xmm0
addss 0x111e(%rip), %xmm0     # 0x6008
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_tween_update
void scg_tween_update(scg_tween_t *tween, float32_t *out,
                      float32_t current_time) {
    if (!tween->playing) {
        return;
    }

    scg_tween_definition_t definition = tween->definition;
    float32_t time;
    if (tween->paused) {
        time = (tween->pause_time - tween->start_time) / definition.duration;
    } else {
        time = (current_time - tween->start_time) / definition.duration;
    }

    if (definition.duration == 0.0f || time > 1.0f) {
        time = 1.0f;
    }

    for (int i = 0; i < definition.num_values; i++) {
        float32_t start = definition.start_end_values[i].x;
        float32_t end = definition.start_end_values[i].y;

        out[i] = start + definition.func(time) * (end - start);
    }

    if (time == 1.0f) {
        if (definition.yoyo) {
            for (int i = 0; i < definition.num_values; i++) {
                float32_t start = definition.start_end_values[i].x;
                float32_t end = definition.start_end_values[i].y;
                tween->definition.start_end_values[i] =
                    scg_vec2f_new(end, start);
            }

            tween->yoyo_in_progress = !tween->yoyo_in_progress;
        }

        if (definition.loop || tween->yoyo_in_progress) {
            tween->start_time = current_time;
        } else {
            tween->playing = false;
        }
    }
}

// Assembly:
cmpb $0x1, 0x2c(%rdi)
jne 0x5062
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movss 0x10(%rdi), %xmm1
cmpb $0x1, 0x2d(%rdi)
movss %xmm0, 0x4(%rsp)
jne 0x4f60
movss 0x30(%rbx), %xmm0
movl 0x14(%rbx), %r15d
subss 0x28(%rbx), %xmm0
divss %xmm1, %xmm0
xorps %xmm2, %xmm2
cmpeqps %xmm1, %xmm2
movss 0x108c(%rip), %xmm1     # 0x6008
movaps %xmm1, 0x10(%rsp)
cmpltps %xmm0, %xmm1
orps %xmm2, %xmm1
movd %xmm1, %eax
testb $0x1, %al
jne 0x4f95
movaps %xmm0, 0x10(%rsp)
movq 0x8(%rbx), %r12
movb 0x18(%rbx), %al
movb %al, 0x3(%rsp)
movb 0x19(%rbx), %al
movb %al, 0x2(%rsp)
movq 0x20(%rbx), %rbp
xorl %r13d, %r13d
testl %r15d, %r15d
cmovlel %r13d, %r15d
cmpq %r13, %r15
je 0x4ffd
movss (%r12,%r13,8), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x4(%r12,%r13,8), %xmm0
movss %xmm0, 0x8(%rsp)
movaps 0x10(%rsp), %xmm0
callq *%rbp
movss 0xc(%rsp), %xmm1
movss 0x8(%rsp), %xmm2
subss %xmm1, %xmm2
mulss %xmm0, %xmm2
addss %xmm1, %xmm2
movss %xmm2, (%r14,%r13,4)
incq %r13
jmp 0x4fb5
movaps 0x10(%rsp), %xmm0
ucomiss 0xfff(%rip), %xmm0      # 0x6008
movss 0x4(%rsp), %xmm1
jne 0x5054
jp 0x5054
testb $0x1, 0x2(%rsp)
je 0x503c
xorl %eax, %eax
cmpq %rax, %r15
je 0x5038
movq 0x8(%rbx), %rcx
movsd (%r12,%rax,8), %xmm0
shufps $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movlps %xmm0, (%rcx,%rax,8)
incq %rax
jmp 0x501c
xorb $0x1, 0x2e(%rbx)
testb $0x1, 0x3(%rsp)
jne 0x5049
cmpb $0x1, 0x2e(%rbx)
jne 0x5050
movss %xmm1, 0x28(%rbx)
jmp 0x5054
movb $0x0, 0x2c(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg_tween_resume
void scg_tween_resume(scg_tween_t *tween, float32_t current_time) {
    if (!tween->playing || !tween->paused) {
        return;
    }

    tween->paused = false;
    tween->start_time += current_time - tween->pause_time;
    tween->pause_time = 0.0f;
}

// Assembly:
cmpb $0x1, 0x2c(%rdi)
jne 0x50c9
cmpb $0x1, 0x2d(%rdi)
jne 0x50c9
movb $0x0, 0x2d(%rdi)
subss 0x30(%rdi), %xmm0
addss 0x28(%rdi), %xmm0
movss %xmm0, 0x28(%rdi)
andl $0x0, 0x30(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/adelciotto[P]scg/examples/../scg.h
// Function: scg__base64_index_from_char
static uint8_t scg__base64_index_from_char(char c) {
    for (int i = 0; i < 64; i++) {
        if (c == scg__base64_table[i]) {
            return i;
        }
    }

    return 0;
}

// Assembly:
xorl %eax, %eax
leaq 0x1f8c(%rip), %rcx      # 0x7230
cmpq $0x40, %rax
je 0x52b5
cmpb %dil, (%rax,%rcx)
je 0x52b7
incq %rax
jmp 0x52a4
xorl %eax, %eax
retq