// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/audio.c
// Function: main
int main(int arcg, char *argv[]) {
    scg_config_t config = scg_config_new_default();
    config.video.title = "SCG Example: Audio";
    config.audio.enabled = true;

    scg_app_t app;
    scg_app_init(&app, config);

    scg_sound_t *music =
        scg_sound_new_from_wav(app.audio, "assets/arcade-music-loop.wav", true);
    if (music == NULL) {
        return -1;
    }
    scg_sound_play(music);

    while (scg_app_process_events(&app)) {
        float32_t play_position = scg_sound_get_position(music);
        draw(app.draw_target, play_position);

        scg_app_present(&app);
    }

    scg_app_free(&app);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x38(%rsp)
movl $0x1, 0x48(%rsp)
movb $0x0, 0x4c(%rsp)
movl $0x1010101, 0x4d(%rsp)  # imm = 0x1010101
movl $0x40, 0x58(%rsp)
leaq 0x1083(%rip), %rax      # 0x659c
movq %rax, 0x40(%rsp)
movb $0x1, 0x54(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x38(%rsp), %xmm0
movups 0x48(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x3e81
movq 0x50(%rbx), %rdi
leaq 0x1057(%rip), %rsi      # 0x65af
movl $0x1, %edx
callq 0x3cc7
testq %rax, %rax
je 0x56da
movq %rax, %rbx
cmpb $0x0, 0x48(%rax)
jne 0x5578
movb $0x1, 0x48(%rbx)
leaq 0x60(%rsp), %rdi
callq 0x49dc
testb %al, %al
je 0x56cc
movq %rbx, 0x30(%rsp)
xorps %xmm1, %xmm1
cmpb $0x1, 0x48(%rbx)
jne 0x55b2
movl 0x28(%rbx), %eax
movl 0x38(%rbx), %ecx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
divss %xmm0, %xmm1
movss %xmm1, 0x28(%rsp)
movq 0x98(%rsp), %r12
movl (%r12), %ebp
movl 0x4(%r12), %ebx
movl %ebx, %eax
imull %ebp, %eax
testl %eax, %eax
jle 0x55e7
movq 0x10(%r12), %rdi
movl %eax, %edx
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x2100
movl %ebp, %edx
shrl $0x1f, %edx
addl %ebp, %edx
sarl %edx
movl %ebx, %r14d
shrl $0x1f, %r14d
addl %ebx, %r14d
sarl %r14d
leal -0x14(%r14), %ecx
movq %r12, %rdi
leaq 0x1bb4(%rip), %rsi      # 0x71bf
movl $0x1, %r8d
movl $0xff000000, %r9d       # imm = 0xFF000000
callq 0x3977
addl $-0x14, %ebp
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movss 0x28(%rsp), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %r15d
addl $0x14, %r14d
movq %r12, %rdi
movl $0xa, %esi
movq %r14, 0x28(%rsp)
movl %r14d, %edx
movl %ebp, %ecx
movl $0xa, %r8d
movl $0xff000000, %r9d       # imm = 0xFF000000
callq 0x347f
movl %r15d, %ebx
negl %ebx
xorl %r13d, %r13d
testl %r15d, %r15d
js 0x569d
movq 0x28(%rsp), %rax
leal (%rax,%r13), %ebp
movl $0xa, %r14d
movq %r12, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl $0xff000000, %ecx       # imm = 0xFF000000
callq 0x2b68
leal (%rbx,%r14), %eax
incl %eax
movl %r14d, %ecx
incl %ecx
movl %ecx, %r14d
cmpl $0xb, %eax
jne 0x5678
leal 0x1(%r13), %eax
cmpl $0xa, %r13d
movl %eax, %r13d
jne 0x5664
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b28
movq %rbx, %rdi
callq 0x49dc
testb %al, %al
movq 0x30(%rsp), %rbx
jne 0x558f
leaq 0x60(%rsp), %rdi
callq 0x4ff7
xorl %eax, %eax
jmp 0x56df
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq