LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::integrate(Physics::Body*, float)
void integrate(Body *body, f32 delta) {
    body->acceleration += body->force * body->inverse_mass;
    body->velocity += body->acceleration * delta;
    body->position += body->velocity * delta;

#if 1
    f32 damping = CLAMP(0.0f, 1.0f, 1 - body->damping);
    if (damping != 0.0f)
        body->velocity = body->velocity * pow(damping, delta);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movaps %xmm0, %xmm1
movss 0x3c(%rdi), %xmm0
movss 0x34(%rdi), %xmm2
mulss %xmm0, %xmm2
mulss 0x38(%rdi), %xmm0
addss 0x2c(%rdi), %xmm2
movss %xmm2, 0x2c(%rdi)
addss 0x30(%rdi), %xmm0
movss %xmm0, 0x30(%rdi)
mulss %xmm1, %xmm2
mulss %xmm1, %xmm0
addss 0x24(%rdi), %xmm2
movss %xmm2, 0x24(%rdi)
addss 0x28(%rdi), %xmm0
movss %xmm0, 0x28(%rdi)
mulss %xmm1, %xmm2
mulss %xmm1, %xmm0
addss 0x14(%rdi), %xmm2
movss %xmm2, 0x14(%rdi)
addss 0x18(%rdi), %xmm0
movss %xmm0, 0x18(%rdi)
movss 0x821f(%rip), %xmm0     # 0x2b004
movaps %xmm0, %xmm2
subss 0x40(%rdi), %xmm2
xorps %xmm3, %xmm3
ucomiss %xmm2, %xmm3
ja 0x22e24
movq %rdi, %rbx
ucomiss %xmm0, %xmm2
ja 0x22e0a
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm2
movaps %xmm2, %xmm0
jne 0x22e0a
jnp 0x22e24
callq 0x23f0
movss 0x24(%rbx), %xmm1
mulss %xmm0, %xmm1
mulss 0x28(%rbx), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movlps %xmm1, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::reversed(Physics::Overlap)
Overlap reversed(Overlap overlap)
{
    return {
        overlap.b,
        overlap.a,
        overlap.depth,
        -overlap.normal,
        overlap.is_valid
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq 0x18(%rbp), %rcx
movq %rcx, (%rdi)
movq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rdi)
movss 0x20(%rbp), %xmm0
movss %xmm0, 0x10(%rdi)
movsd 0x24(%rbp), %xmm0
xorps 0x7a0d(%rip), %xmm0     # 0x2b040
movlps %xmm0, 0x14(%rdi)
movb 0x2c(%rbp), %cl
movb %cl, 0x1c(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::add(float*, float, float)
void add(f32 *value, f32 target, f32 delta) {
    if (delta > 0 && *value < target) {
        *value = MIN(*value + delta, target);
    } else if (delta < 0 && *value > target) {
        *value = MAX(*value + delta, target);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm1
jbe 0x2365e
movss (%rdi), %xmm2
ucomiss %xmm2, %xmm0
jbe 0x2365e
addss %xmm1, %xmm2
minss %xmm0, %xmm2
jmp 0x23674
ucomiss %xmm1, %xmm3
jbe 0x23678
movss (%rdi), %xmm2
ucomiss %xmm0, %xmm2
jbe 0x23678
addss %xmm1, %xmm2
maxss %xmm0, %xmm2
movss %xmm2, (%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::Channel::set_delay(float, float, float)
void Channel::set_delay(f32 feedback, f32 len_seconds, f32 in_seconds) {
    if (feedback >= 0) delay.feedback_target = feedback;
    if (len_seconds >= 0) delay.len_seconds_target = len_seconds;
    delay.feedback_delta = (delay.feedback_target - delay.feedback) / (in_seconds * AUDIO_SAMPLE_RATE / (AUDIO_SAMPLES_WANT * 2));
    delay.len_seconds_delta = (delay.len_seconds_target - delay.len_seconds) / (in_seconds * AUDIO_SAMPLE_RATE / (AUDIO_SAMPLES_WANT * 2));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm0
jb 0x239b5
movss %xmm0, 0xc(%rdi)
ucomiss %xmm3, %xmm1
jae 0x239c1
movss 0x1c(%rdi), %xmm1
jmp 0x239c6
movss %xmm1, 0x1c(%rdi)
movss 0xc(%rdi), %xmm0
subss 0x8(%rdi), %xmm0
mulss 0x7884(%rip), %xmm2     # 0x2b25c
mulss 0x7880(%rip), %xmm2     # 0x2b260
divss %xmm2, %xmm0
movss %xmm0, 0x10(%rdi)
subss 0x18(%rdi), %xmm1
divss %xmm2, %xmm1
movss %xmm1, 0x20(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::push_sound(Mixer::SoundSource)
AudioID push_sound(SoundSource source) {
    lock_audio();
    if (audio_struct.num_free_sources) {
        u16 source_id =
            audio_struct.free_sources[--audio_struct.num_free_sources];
        source.gen = audio_struct.sources[source_id].gen + 1;
        audio_struct.sources[source_id] = source;
        unlock_audio();
        return {source.gen, source_id};
    } else {
        ERR("Not enough free sources, skipping playing of sound");
    }
    unlock_audio();
    return {0, NUM_SOURCES};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x23ceb
leaq 0x26729(%rip), %rax     # 0x4a378
movzwl 0x600(%rax), %ecx
testw %cx, %cx
je 0x23cac
leaq 0x10(%rbp), %rdx
decl %ecx
movw %cx, 0x600(%rax)
movzwl %cx, %ecx
movzwl 0x602(%rax,%rcx,2), %ebx
imulq $0x30, %rbx, %rcx
movb 0x26(%rax,%rcx), %r14b
incb %r14b
movb %r14b, 0x26(%rdx)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
movups 0x20(%rdx), %xmm0
movups %xmm0, 0x20(%rax,%rcx)
callq 0x23d02
shll $0x10, %ebx
movzbl %r14b, %eax
orl %ebx, %eax
jmp 0x23ce6
movq 0x2631d(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
leaq 0x7fba(%rip), %rdi      # 0x2bc77
leaq 0x8e9e(%rip), %rdx      # 0x2cb62
leaq 0x8f20(%rip), %r8       # 0x2cbeb
leaq 0x8f24(%rip), %r9       # 0x2cbf6
pushq $0x7e
popq %rcx
xorl %eax, %eax
callq 0x683a
callq 0x23d02
movl $0x200000, %eax         # imm = 0x200000
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::play_sound_at(unsigned int, unsigned long long, Vec2, float, float, float, float, unsigned char)
AudioID play_sound_at(u32 channel_id, AssetID asset_id, Vec2 position, f32 pitch, f32 gain,
                      f32 pitch_variance, f32 gain_variance, b8 loop) {
    ASSERT(channel_id < NUM_CHANNELS, "Invalid channel");
    return push_sound({0, asset_id, channel_id, pitch + random_real(-1, 1) * pitch_variance,
                       gain + random_real(-1, 1) * gain_variance, loop, true,
                       position});
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebx
movss %xmm4, -0x24(%rbp)
movss %xmm3, -0x1c(%rbp)
movss %xmm2, -0x28(%rbp)
movss %xmm1, -0x20(%rbp)
movaps %xmm0, -0x70(%rbp)
movq %rsi, %r14
movl %edi, %r15d
xorl %ecx, %ecx
cmpl $0xa, %edi
setb %cl
leaq 0x8ceb(%rip), %rdi      # 0x2cb62
leaq 0x8d42(%rip), %rdx      # 0x2cbc0
movl $0x93, %esi
callq 0x6903
andl $0x0, -0x58(%rbp)
movq %r14, -0x50(%rbp)
movl %r15d, -0x48(%rbp)
movss 0x738c(%rip), %xmm0     # 0x2b228
movss 0x7160(%rip), %xmm1     # 0x2b004
callq 0x8344
mulss -0x1c(%rbp), %xmm0
addss -0x20(%rbp), %xmm0
movss %xmm0, -0x44(%rbp)
movss 0x7368(%rip), %xmm0     # 0x2b228
movss 0x713c(%rip), %xmm1     # 0x2b004
callq 0x8344
mulss -0x24(%rbp), %xmm0
addss -0x28(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movb %bl, -0x3c(%rbp)
movb $0x1, -0x3b(%rbp)
movaps -0x70(%rbp), %xmm0
movlps %xmm0, -0x3a(%rbp)
movb $0x0, -0x32(%rbp)
andq $0x0, -0x30(%rbp)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups -0x38(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x23c3c
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::stop_sound(Mixer::AudioID)
void stop_sound(AudioID id) {
    ASSERT(id.slot < NUM_SOURCES, "Invalid index in ID");
    lock_audio();
    SoundSource *source = fetch_source(id);
    if (source->gen == id.gen) {
        audio_struct.free_sources[audio_struct.num_free_sources++] = id.slot;
        source->gain = 0.0;
    } else {
        ERR("Invalid removal of AudioID that does not exist");
    }
    unlock_audio();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x200000, %edi         # imm = 0x200000
setb %cl
leaq 0x8c27(%rip), %rdi      # 0x2cb62
leaq 0x8d28(%rip), %rdx      # 0x2cc6a
movl $0x9a, %esi
callq 0x6903
callq 0x23ceb
movl %ebx, %edi
callq 0x23d19
cmpb %bl, 0x26(%rax)
jne 0x23f86
shrl $0x10, %ebx
leaq 0x26411(%rip), %rcx     # 0x4a378
movzwl 0x600(%rcx), %edx
leal 0x1(%rdx), %esi
movw %si, 0x600(%rcx)
movw %bx, 0x602(%rcx,%rdx,2)
andl $0x0, 0x18(%rax)
jmp 0x23fb8
movq 0x26043(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
leaq 0x7ce0(%rip), %rdi      # 0x2bc77
leaq 0x8bc4(%rip), %rdx      # 0x2cb62
leaq 0x8cf0(%rip), %r8       # 0x2cc95
leaq 0x8cf4(%rip), %r9       # 0x2cca0
movl $0xa1, %ecx
xorl %eax, %eax
callq 0x683a
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x23d02
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::post_sound_hook(Mixer::AudioID, void (*)())
void post_sound_hook(AudioID id, FogCallback post_hook) {
    ASSERT(id.slot < NUM_SOURCES, "Invalid index in ID");
    lock_audio();
    SoundSource *source = fetch_source(id);
    if (source->gen == id.gen) {
        source->post_hook = post_hook;
    } else {
        ERR("Tried to attach a post hook to an AudioID that does not exist");
    }
    unlock_audio();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
xorl %ecx, %ecx
cmpl $0x200000, %edi         # imm = 0x200000
setb %cl
leaq 0x8b80(%rip), %rdi      # 0x2cb62
leaq 0x8c81(%rip), %rdx      # 0x2cc6a
movl $0xa7, %esi
callq 0x6903
callq 0x23ceb
movl %r14d, %edi
callq 0x23d19
cmpb %r14b, 0x26(%rax)
jne 0x2400c
movq %rbx, 0x28(%rax)
jmp 0x2403e
movq 0x25fbd(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
leaq 0x7c5a(%rip), %rdi      # 0x2bc77
leaq 0x8b3e(%rip), %rdx      # 0x2cb62
leaq 0x8ca4(%rip), %r8       # 0x2cccf
leaq 0x8cad(%rip), %r9       # 0x2ccdf
movl $0xad, %ecx
xorl %eax, %eax
callq 0x683a
popq %rbx
popq %r14
popq %rbp
jmp 0x23d02
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::init()
b8 init() {
    OTHER_THREAD(AUDIO);
    OTHER_THREAD(AUDIO_SOURCES);
    OTHER_THREAD(AUDIO_EFFECTS);

    audio_mixer.arena = Util::request_arena();

    audio_struct.num_free_sources = NUM_SOURCES;
    for (u32 i = 0; i < NUM_SOURCES; i++)
        audio_struct.free_sources[i] = i;

    for (u32 i = 0; i < NUM_CHANNELS; i++)
        audio_struct.channels[i].buffer = audio_mixer.arena->push<f32>(CHANNEL_BUFFER_LENGTH);

    SDL_AudioSpec want = {};
    want.freq = AUDIO_SAMPLE_RATE;
    want.format = AUDIO_F32;
    want.samples = AUDIO_SAMPLES_WANT;
    want.channels = 2;
    want.callback = audio_callback;
    audio_struct.time_step = 1.0 / (f32) AUDIO_SAMPLE_RATE;
    want.userdata = (void *) &audio_struct;

    // Let SDL handle the translation for us.
    SDL_AudioSpec have;
    audio_struct.dev = SDL_OpenAudioDevice(NULL, 0, &want, &have, 0);
    if (audio_struct.dev <= 0) {
        ERR("%s", SDL_GetError());
        return false;
    }

    SDL_PauseAudioDevice(audio_struct.dev, 0);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
pushq $0x7
popq %rdi
callq 0x21947
pushq $0x8
popq %rdi
callq 0x21947
pushq $0x9
popq %rdi
callq 0x21947
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x9a17
leaq 0x41d86(%rip), %r14     # 0x662e8
movq %rax, 0x10(%r14)
leaq 0x25e0b(%rip), %rbx     # 0x4a378
movw $0x20, 0x600(%rbx)
cmpq $0x20, %r15
je 0x2458a
movw %r15w, 0x602(%rbx,%r15,2)
incq %r15
jmp 0x24576
xorl %r15d, %r15d
cmpq $0x370, %r15            # imm = 0x370
je 0x245b2
movq 0x10(%r14), %rdi
movl $0x46500, %esi          # imm = 0x46500
callq 0x2a870
movq %rax, 0x648(%rbx,%r15)
addq $0x58, %r15
jmp 0x2458d
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movaps %xmm0, (%rdx)
movl $0xbb80, (%rdx)         # imm = 0xBB80
movw $0x8120, 0x4(%rdx)      # imm = 0x8120
movw $0x800, 0x8(%rdx)       # imm = 0x800
movb $0x2, 0x6(%rdx)
leaq -0x592(%rip), %rax      # 0x24047
movq %rax, 0x10(%rdx)
movl $0x37aec33e, 0x9c8(%rbx) # imm = 0x37AEC33E
movq %rbx, 0x18(%rdx)
leaq -0x60(%rbp), %rcx
xorl %edi, %edi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x2420
movl %eax, 0x9cc(%rbx)
testl %eax, %eax
je 0x24612
movl %eax, %edi
xorl %esi, %esi
callq 0x21a0
movb $0x1, %bl
jmp 0x24652
movq 0x259b7(%rip), %rax     # 0x49fd0
movq (%rax), %r14
callq 0x24a0
movq %rax, (%rsp)
leaq 0x764b(%rip), %rdi      # 0x2bc77
leaq 0x852f(%rip), %rdx      # 0x2cb62
leaq 0x7585(%rip), %r8       # 0x2bbbf
leaq 0x7c42(%rip), %r9       # 0x2c283
xorl %ebx, %ebx
movq %r14, %rsi
movl $0x147, %ecx            # imm = 0x147
xorl %eax, %eax
callq 0x683a
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/unix_main.cpp
// Function: Fog::register_debug_keybinds()
void register_debug_keybinds() {
    using namespace Input;

    QUIT = request_name();
    TWEAK_SMOOTH = request_name();
    TWEAK_STEP = request_name();
    DEBUG_PERF = request_name();
    DEBUG_VIEW = request_name();
    DEBUG_VALUES = request_name();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0xa71c
leaq 0x3b239(%rip), %rcx     # 0x5f978
movl %eax, (%rcx)
movl %ebx, %edi
callq 0xa71c
leaq 0x3b22d(%rip), %rcx     # 0x5f97c
movl %eax, (%rcx)
movl %ebx, %edi
callq 0xa71c
leaq 0x3b221(%rip), %rcx     # 0x5f980
movl %eax, (%rcx)
movl %ebx, %edi
callq 0xa71c
leaq 0x3b215(%rip), %rcx     # 0x5f984
movl %eax, (%rcx)
movl %ebx, %edi
callq 0xa71c
leaq 0x3b209(%rip), %rcx     # 0x5f988
movl %eax, (%rcx)
movl %ebx, %edi
callq 0xa71c
leaq 0x3b1fd(%rip), %rcx     # 0x5f98c
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/unix_main.cpp
// Function: Fog::setup_debug_keybinds()
void setup_debug_keybinds() {
    using namespace Input;
    CHECK(add(K(F10), QUIT),
          "Failed to create mapping");

    CHECK(add(K(LSHIFT), TWEAK_SMOOTH),
          "Failed to create mapping");

    CHECK(add(K(LCTRL), TWEAK_STEP),
          "Failed to create mapping");

    CHECK(add(K(F1), DEBUG_PERF),
          "Failed to create mapping");

    CHECK(add(K(F2), DEBUG_VIEW),
          "Failed to create mapping");

    CHECK(add(K(F3), DEBUG_VALUES),
          "Failed to create mapping");

    const auto debug_callback = [](f32, f32, f32, void*) {
        if (pressed(DEBUG_PERF))
            show_perf = !show_perf;
        if (pressed(DEBUG_VIEW))
            debug_view = !debug_view;
        if (pressed(DEBUG_VALUES))
            show_debug_values = !show_debug_values;
    };
    Logic::add_callback(Logic::At::PRE_UPDATE, debug_callback, Logic::now(),
                        Logic::FOREVER);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x3b1d2(%rip), %rax     # 0x5f978
movl (%rax), %esi
pushq $0x1
popq %rbx
movl $0x861, %edi            # imm = 0x861
movl %ebx, %edx
callq 0x8e0c
movzbl %al, %ecx
leaq 0x85d1(%rip), %r14      # 0x2cd92
leaq 0x85e3(%rip), %rdx      # 0x2cdab
movq %r14, %rdi
movl $0x81, %esi
callq 0x693a
leaq 0x3b1a0(%rip), %rax     # 0x5f97c
movl (%rax), %esi
movl $0x1c21, %edi           # imm = 0x1C21
movl %ebx, %edx
callq 0x8e0c
movzbl %al, %ecx
leaq 0x85e5(%rip), %rdx      # 0x2cdd9
movq %r14, %rdi
movl $0x84, %esi
callq 0x693a
leaq 0x3b178(%rip), %rax     # 0x5f980
movl (%rax), %esi
movl $0x1c01, %edi           # imm = 0x1C01
movl %ebx, %edx
callq 0x8e0c
movzbl %al, %ecx
leaq 0x85f2(%rip), %rdx      # 0x2ce12
movq %r14, %rdi
movl $0x87, %esi
callq 0x693a
leaq 0x3b150(%rip), %rax     # 0x5f984
movl (%rax), %esi
movl $0x741, %edi            # imm = 0x741
movl %ebx, %edx
callq 0x8e0c
movzbl %al, %ecx
leaq 0x85fc(%rip), %rdx      # 0x2ce48
movq %r14, %rdi
movl $0x8a, %esi
callq 0x693a
leaq 0x3b128(%rip), %rax     # 0x5f988
movl (%rax), %esi
movl $0x761, %edi            # imm = 0x761
movl %ebx, %edx
callq 0x8e0c
movzbl %al, %ecx
leaq 0x8603(%rip), %rdx      # 0x2ce7b
movq %r14, %rdi
movl $0x8d, %esi
callq 0x693a
leaq 0x3b100(%rip), %rax     # 0x5f98c
movl (%rax), %esi
movl $0x781, %edi            # imm = 0x781
movl %ebx, %edx
callq 0x8e0c
movzbl %al, %ecx
leaq 0x860a(%rip), %rdx      # 0x2ceae
movq %r14, %rdi
movl $0x90, %esi
callq 0x693a
leaq 0x27068(%rip), %rax     # 0x4b920
movss 0x14028(%rax), %xmm0
leaq 0x47db(%rip), %rsi      # 0x290a2
movss 0x6959(%rip), %xmm1     # 0x2b228
xorps %xmm2, %xmm2
xorl %edi, %edi
xorl %edx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x22246
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/unix_main.cpp
// Function: Fog::update()
void update() {
    Logic::frame(SDL_GetTicks() / 1000.0f);

    if (show_perf)
        Perf::report();
    Util::clear_tweak_values();
    Perf::clear();
    START_PERF(MAIN);
    START_PERF(INPUT);
    Input::clear_input_for_frame();
    STOP_PERF(INPUT);
    SDL::poll_events();

    Logic::call(Logic::At::PRE_UPDATE);
    Logic::call(Logic::At::POST_UPDATE);

    Mixer::audio_struct.position = Renderer::fetch_camera()->position;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x24f0
movl %eax, %eax
cvtsi2ss %rax, %xmm0
divss 0x671a(%rip), %xmm0     # 0x2b020
leaq 0x27013(%rip), %rax     # 0x4b920
movss 0x14028(%rax), %xmm1
movaps %xmm0, %xmm2
subss %xmm1, %xmm2
xorps %xmm3, %xmm3
cmpneqss %xmm1, %xmm3
andps %xmm2, %xmm3
movss %xmm3, 0x1402c(%rax)
movss %xmm0, 0x14028(%rax)
cmpb $0x0, 0x419c3(%rip)     # 0x66301
je 0x24945
callq 0x21987
callq 0x21b95
callq 0x2183b
leaq 0x858d(%rip), %rsi      # 0x2cee3
xorl %edi, %edi
callq 0x202dd
leaq 0x8584(%rip), %rsi      # 0x2cee8
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x202dd
callq 0x9ca7
movl %ebx, %edi
callq 0x20365
callq 0x249ac
xorl %edi, %edi
callq 0x22403
movl %ebx, %edi
callq 0x22403
xorl %edi, %edi
callq 0x9156
movq (%rax), %rax
leaq 0x259da(%rip), %rcx     # 0x4a378
movq %rax, 0x9bc(%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/unix_main.cpp
// Function: Fog::draw()
void draw() {
    START_PERF(RENDER);
    Renderer::clear();

    Logic::call(Logic::At::PRE_DRAW);
    // User defined
    Logic::call(Logic::At::POST_DRAW);

    Renderer::blit();
    STOP_PERF(RENDER);

    STOP_PERF(MAIN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x8088(%rip), %rsi      # 0x2ceee
pushq $0x2
popq %rbx
movl %ebx, %edi
callq 0x202dd
leaq 0x3acb1(%rip), %rax     # 0x5fb28
movl $0x4100, %edi           # imm = 0x4100
callq *(%rax)
movl %ebx, %edi
callq 0x22403
pushq $0x3
popq %rdi
callq 0x22403
callq 0x1fb1a
movl %ebx, %edi
callq 0x20365
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20365
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/unix_main.cpp
// Function: Fog::post_init()
void post_init() {
#ifdef DEBUG
    setup_debug_keybinds();
#endif
    Util::strict_allocation_check();
    Logic::frame(SDL_GetTicks() / 1000.0f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x24798
movl $0x1, 0x253a0(%rip)     # 0x4a374
callq 0x24f0
movl %eax, %eax
cvtsi2ss %rax, %xmm0
divss 0x6038(%rip), %xmm0     # 0x2b020
leaq 0x26931(%rip), %rax     # 0x4b920
movss 0x14028(%rax), %xmm1
movaps %xmm0, %xmm2
subss %xmm1, %xmm2
xorps %xmm3, %xmm3
cmpneqss %xmm1, %xmm3
andps %xmm2, %xmm3
movss %xmm3, 0x1402c(%rax)
movss %xmm0, 0x14028(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/unix_main.cpp
// Function: Fog::run(void (*)(), void (*)())
void run(FogCallback user_update, FogCallback user_draw) {
    post_init();
    while (SDL::running) {
        Logic::frame(SDL_GetTicks() / 1000.0f);

        if (show_perf)
            Perf::report();
        Util::clear_tweak_values();
        Perf::clear();
        START_PERF(MAIN);
        START_PERF(INPUT);
        Input::clear_input_for_frame();
        STOP_PERF(INPUT);
        SDL::poll_events();

#if DEBUG
        if (value(QUIT, Input::ANY))
            SDL::running = false;
#endif

        Logic::call(Logic::At::PRE_UPDATE);
        // User defined
        user_update();
        Logic::call(Logic::At::POST_UPDATE);

        Mixer::audio_struct.position = Renderer::fetch_camera()->position;

        Renderer::clear();
        START_PERF(RENDER);

        Logic::call(Logic::At::PRE_DRAW);
        // User defined
        user_draw();
        Logic::call(Logic::At::POST_DRAW);

        STOP_PERF(RENDER);
        Renderer::blit();

        STOP_PERF(MAIN);
    }

    _fog_close_app_responsibly();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x24fc1
leaq 0x268e5(%rip), %r12     # 0x4b920
pushq $0x1
popq %r13
pushq $0x2
popq %r15
cmpb $0x0, 0x412b6(%rip)     # 0x66300
jne 0x25171
callq 0x24f0
movl %eax, %eax
cvtsi2ss %rax, %xmm0
divss 0x5fbc(%rip), %xmm0     # 0x2b020
movss 0x14028(%r12), %xmm1
movaps %xmm0, %xmm2
subss %xmm1, %xmm2
cmpneqss 0x61ae(%rip), %xmm1     # 0x2b22c
andps %xmm2, %xmm1
movss %xmm1, 0x1402c(%r12)
movss %xmm0, 0x14028(%r12)
cmpb $0x0, 0x41265(%rip)     # 0x66301
je 0x250a3
callq 0x21987
callq 0x21b95
callq 0x2183b
xorl %edi, %edi
leaq 0x7e2d(%rip), %rsi      # 0x2cee3
callq 0x202dd
movl %r13d, %edi
leaq 0x7e23(%rip), %rsi      # 0x2cee8
callq 0x202dd
callq 0x9ca7
movl %r13d, %edi
callq 0x20365
callq 0x249ac
leaq 0x3a895(%rip), %rax     # 0x5f978
movl (%rax), %edi
pushq $0xf
popq %rsi
callq 0xa3b5
ucomiss 0x6138(%rip), %xmm0     # 0x2b22c
jne 0x250f8
jnp 0x250ff
movb $0x1, 0x41201(%rip)     # 0x66300
xorl %edi, %edi
callq 0x22403
callq *%r14
movl %r13d, %edi
callq 0x22403
xorl %edi, %edi
callq 0x9156
movq (%rax), %rax
leaq 0x25256(%rip), %rcx     # 0x4a378
movq %rax, 0x9bc(%rcx)
movl $0x4100, %edi           # imm = 0x4100
leaq 0x3a9f3(%rip), %rax     # 0x5fb28
callq *(%rax)
movl %r15d, %edi
leaq 0x7dad(%rip), %rsi      # 0x2ceee
callq 0x202dd
movl %r15d, %edi
callq 0x22403
callq *%rbx
pushq $0x3
popq %rdi
callq 0x22403
movl %r15d, %edi
callq 0x20365
callq 0x1fb1a
xorl %edi, %edi
callq 0x20365
jmp 0x25043
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x68ed
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/printf.c
// Function: out_rev(void (*)(char, void*, unsigned long, unsigned long), char*, unsigned long, unsigned long, char const*, unsigned long, unsigned int, unsigned int)
static size_t _out_rev(out_fct_type out, char* buffer, size_t idx, size_t maxlen, const char* buf, size_t len, unsigned int width, unsigned int flags)
{
  const size_t start_idx = idx;

  // pad spaces up to given width
  if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) {
    for (size_t i = len; i < width; i++) {
      out(' ', buffer, idx++, maxlen);
    }
  }

  // reverse string
  while (len) {
    out(buf[--len], buffer, idx++, maxlen);
  }

  // append pad spaces up to given width
  if (flags & FLAGS_LEFT) {
    while (idx - start_idx < width) {
      out(' ', buffer, idx++, maxlen);
    }
  }

  return idx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %r8, -0x40(%rbp)
movq %rcx, -0x30(%rbp)
movq %rsi, %r15
movq %rdi, %r12
movl 0x18(%rbp), %eax
movq %rdx, -0x38(%rbp)
testb $0x3, %al
je 0x28fa9
movq %r13, %r14
subq $0x1, %r14
jb 0x28f63
movq -0x40(%rbp), %rax
movsbl -0x1(%rax,%r13), %edi
leaq 0x1(%rdx), %rbx
movq %r15, %rsi
movq -0x30(%rbp), %rcx
callq *%r12
movq %r14, %r13
movq %rbx, %rdx
jmp 0x28f3d
movl 0x18(%rbp), %eax
testb $0x2, %al
jne 0x28f7c
movq %rdx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x38(%rbp), %r13
negq %r13
pushq $0x20
popq %r14
leaq (%rdx,%r13), %rax
movl 0x10(%rbp), %ecx
cmpq %rcx, %rax
jae 0x28f6a
leaq 0x1(%rdx), %rbx
movl %r14d, %edi
movq %r15, %rsi
movq -0x30(%rbp), %rcx
callq *%r12
movq %rbx, %rdx
jmp 0x28f87
movq -0x38(%rbp), %rdx
movq %r13, %r14
movl 0x10(%rbp), %eax
cmpq %rax, %r14
jae 0x28f3a
leaq 0x1(%rdx), %rbx
pushq $0x20
popq %rdi
movq %r15, %rsi
movq -0x30(%rbp), %rcx
callq *%r12
incq %r14
movq %rbx, %rdx
jmp 0x28fb0
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/inc/glad/glad.c
// Function: has_ext(char const*)
static int has_ext(const char *ext) {
#ifdef _GLAD_IS_SOME_NEW_VERSION
    if(max_loaded_major < 3) {
#endif
        const char *extensions;
        const char *loc;
        const char *terminator;
        extensions = exts;
        if(extensions == NULL || ext == NULL) {
            return 0;
        }

        while(1) {
            loc = strstr(extensions, ext);
            if(loc == NULL) {
                return 0;
            }

            terminator = loc + strlen(ext);
            if((loc == extensions || *(loc - 1) == ' ') &&
                (*terminator == ' ' || *terminator == '\0')) {
                return 1;
            }
            extensions = terminator;
        }
#ifdef _GLAD_IS_SOME_NEW_VERSION
    } else {
        int index;
        if(exts_i == NULL) return 0;
        for(index = 0; index < num_exts_i; index++) {
            const char *e = exts_i[index];

            if(exts_i[index] != NULL && strcmp(e, ext) == 0) {
                return 1;
            }
        }
    }
#endif

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpl $0x2, 0x3d32f(%rip)     # 0x66318
jg 0x2904a
movq 0x3d32e(%rip), %r15     # 0x66320
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
xorl %ebx, %ebx
orb %al, %cl
jne 0x29091
pushq $0x1
popq %r13
movq %r15, %rdi
movq %r14, %rsi
callq 0x2290
testq %rax, %rax
je 0x29091
movq %rax, %r12
movq %r14, %rdi
callq 0x2250
addq %r12, %rax
cmpq %r15, %r12
je 0x2903a
cmpb $0x20, -0x1(%r12)
movq %rax, %r15
jne 0x2900c
movzbl (%rax), %ecx
movq %rax, %r15
testb $-0x21, %cl
jne 0x2900c
movl %r13d, %ebx
jmp 0x29091
movq 0x3d2df(%rip), %r15     # 0x66330
testq %r15, %r15
je 0x29088
movl 0x3d2cb(%rip), %r12d    # 0x66328
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x29091
movq (%r15,%r13,8), %rdi
testq %rdi, %rdi
je 0x29083
movq %r14, %rsi
callq 0x23d0
testl %eax, %eax
je 0x2908c
incq %r13
jmp 0x29069
xorl %ebx, %ebx
jmp 0x29091
pushq $0x1
popq %rax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input_sdl.cpp
// Function: (anonymous namespace)::get_contoller_id(int)
s32 get_contoller_id(s32 slot) {
    for (u32 i = 0; i < NUM_PLAYERS; i++) {
        if (_fog_global_controller_mapping[i].slot == slot)
            return i;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x3d224(%rip), %rdx     # 0x66340
xorl %ecx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x4, %rcx
je 0x29138
cmpl %edi, (%rdx)
je 0x29136
incq %rcx
addq $0x10, %rdx
jmp 0x29123
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Input::Mapping::VirtualButton* Util::MemoryArena::push<Input::Mapping::VirtualButton>(unsigned long long)
T *MemoryArena::push(u64 count) {
    CHECK_ILLEGAL_ALLOC;
    u64 allocation_size = sizeof(T) * count;
    ASSERT(allocation_size <= ARENA_SIZE_IN_BYTES, "Too large allocation");
    if (watermark + allocation_size > ARENA_SIZE_IN_BYTES) {
        if (!next) {
            if (only_one) HALT_AND_CATCH_FIRE;
            // Only complain once.
            allow_allocation();
            next = request_arena();
        }
        return next->push<T>(count);
    }
    void *region = (void *) (((u8 *) memory) + watermark);
    watermark += allocation_size;
    return (T *) region;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rax
shlq $0x4, %rbx
xorl %r14d, %r14d
cmpq $0x200001, %rbx         # imm = 0x200001
setb %r14b
leaq 0x17373(%rip), %r12     # 0x407cc
pushq $0x7c
popq %r13
movq %rax, %r15
movl 0x20f0e(%rip), %eax     # 0x4a374
cmpl $0x2, %eax
je 0x2947f
cmpl $0x1, %eax
jne 0x29475
callq 0x9919
movl $0x1, 0x20ef5(%rip)     # 0x4a374
leaq 0x2821(%rip), %rdi      # 0x2bca7
movl %r13d, %esi
movq %r12, %rdx
movl %r14d, %ecx
callq 0x6903
movq 0x8(%r15), %rax
leaq (%rax,%rbx), %rcx
cmpq $0x200001, %rcx         # imm = 0x200001
jb 0x294d1
movq 0x10(%r15), %rax
testq %rax, %rax
jne 0x2945d
cmpb $0x0, (%r15)
jne 0x294e8
cmpl $0x1, 0x20eb9(%rip)     # 0x4a374
jne 0x294c4
andl $0x0, 0x20eb0(%rip)     # 0x4a374
xorl %edi, %edi
callq 0x9a17
movq %rax, 0x10(%r15)
jmp 0x2945d
addq 0x18(%r15), %rax
movq %rcx, 0x8(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x68ed
pushq $-0x1
popq %rdi
callq 0x2330
nop
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::RenderQueue<Renderer::Impl::Vertex>::create(unsigned int)
void RenderQueue<T>::create(u32 triangles_per_buffer) {
    ASSERT(gl_draw_hint == 0,
           "Cannot create same RenderQueue twice without deleting.");
    buffer_size = triangles_per_buffer * 3;
    arena = Util::request_arena(true);
    vertex_buffers = arena->push<GLBuffer>(num_buffers);

    gl_draw_hint = GL_TRIANGLES;

    next_free = 0;
    num_buffers = 0;
    expand();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
xorl %ecx, %ecx
cmpl $0x0, 0x4(%rdi)
sete %cl
leaq 0x2a70(%rip), %rdi      # 0x2c04d
leaq 0x17225(%rip), %rdx     # 0x40809
pushq $0x5e
popq %rsi
callq 0x6903
leal (%r14,%r14,2), %eax
movl %eax, (%rbx)
pushq $0x1
popq %rdi
callq 0x9a17
movq %rax, 0x18(%rbx)
movl 0xc(%rbx), %esi
movq %rax, %rdi
callq 0x2a93a
movq %rax, 0x10(%rbx)
movq $0x4, 0x4(%rbx)
andl $0x0, 0xc(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2a9fe
nop
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::RenderQueue<Renderer::Impl::Vertex>::push(unsigned int, Renderer::Impl::Vertex*)
void RenderQueue<T>::push(u32 num_new_verticies, T *new_verticies) {
    ASSERT(gl_draw_hint, "Trying to use uninitalized render queue.");
    ASSERT(gl_draw_hint == GL_TRIANGLES, "Push code assumes triangles.");

    while (num_new_verticies) {
        for (u32 i = next_free; num_new_verticies; i++) {
            next_free = i;
            if (next_free == num_buffers) expand();
            GLBuffer *buffer = vertex_buffers + next_free;
            u32 free = buffer_size - buffer->draw_length;
            if (free == 0) continue;
            u32 to_push = MIN(num_new_verticies, (u32) free);

            buffer->bind();
            glBufferSubData(GL_ARRAY_BUFFER,
                            buffer->draw_length * sizeof(T),
                            to_push * sizeof(T), new_verticies);

            buffer->draw_length += to_push;
            num_new_verticies -= to_push;
            new_verticies += to_push;
        }
    }
    glBindVertexArray(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, -0x30(%rbp)
movl %esi, %r13d
movq %rdi, %r14
xorl %ecx, %ecx
cmpl $0x0, 0x4(%rdi)
setne %cl
leaq 0x2996(%rip), %r12      # 0x2c04d
leaq 0x171cb(%rip), %rdx     # 0x40889
pushq $0x6c
popq %rsi
movq %r12, %rdi
callq 0x6903
xorl %ecx, %ecx
cmpl $0x4, 0x4(%r14)
sete %cl
leaq 0x171e6(%rip), %rdx     # 0x408c0
pushq $0x6d
popq %rsi
movq %r12, %rdi
callq 0x6903
movq %r14, -0x38(%rbp)
testl %r13d, %r13d
je 0x2977c
movl 0x8(%r14), %ebx
testl %r13d, %r13d
je 0x29774
movl %ebx, 0x8(%r14)
movl %ebx, %eax
cmpl 0xc(%r14), %ebx
jne 0x29713
movq %r14, %rdi
callq 0x2a9fe
movl 0x8(%r14), %eax
movq 0x10(%r14), %r12
movl %eax, %eax
imulq $0xc, %rax, %rax
movl (%r14), %r15d
subl (%r12,%rax), %r15d
je 0x29770
addq %rax, %r12
cmpl %r15d, %r13d
cmovbl %r13d, %r15d
movq %r12, %rdi
callq 0x2ab14
movl (%r12), %eax
imulq $0x24, %rax, %rsi
imulq $0x24, %r15, %rdx
movq %rdx, -0x40(%rbp)
movl $0x8892, %edi           # imm = 0x8892
movq -0x30(%rbp), %r14
movq %r14, %rcx
leaq 0x363a5(%rip), %rax     # 0x5fb00
callq *(%rax)
addl %r15d, (%r12)
subl %r15d, %r13d
addq -0x40(%rbp), %r14
movq %r14, -0x30(%rbp)
movq -0x38(%rbp), %r14
incl %ebx
jmp 0x296f6
xorl %r13d, %r13d
jmp 0x296e9
leaq 0x36335(%rip), %rax     # 0x5fab8
xorl %edi, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *(%rax)
nop
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::RenderQueue<Renderer::Impl::Vertex>::draw() const
void RenderQueue<T>::draw() const {
    ASSERT(gl_draw_hint, "Trying to use uninitalized render queue");
    for (u32 i = 0; i < num_buffers; i++) {
        GLBuffer buffer = vertex_buffers[i];
        if (buffer.draw_length == 0) break;
        buffer.bind();
        glBindBuffer(GL_ARRAY_BUFFER, buffer.gl_buffer);
        glDrawArrays(gl_draw_hint, 0, buffer.draw_length);
    }
    glBindVertexArray(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ecx, %ecx
cmpl $0x0, 0x4(%rdi)
setne %cl
leaq 0x278c(%rip), %rdi      # 0x2c04d
leaq 0x16f8b(%rip), %rdx     # 0x40853
movl $0xcf, %esi
callq 0x6903
pushq $0x8
popq %r12
xorl %ecx, %ecx
movl 0xc(%rbx), %eax
cmpq %rax, %rcx
jae 0x29941
movq 0x10(%rbx), %rax
movl -0x8(%rax,%r12), %r14d
testl %r14d, %r14d
je 0x29941
movl -0x4(%rax,%r12), %r15d
movl (%rax,%r12), %edi
leaq 0x361ba(%rip), %rax     # 0x5fab8
movq %rcx, -0x30(%rbp)
callq *(%rax)
movl $0x8892, %edi           # imm = 0x8892
movl %r15d, %esi
leaq 0x3616d(%rip), %r13     # 0x5fa80
callq *(%r13)
movl $0x8892, %edi           # imm = 0x8892
movl %r15d, %esi
callq *(%r13)
movl 0x4(%rbx), %edi
xorl %esi, %esi
movl %r14d, %edx
leaq 0x36496(%rip), %rax     # 0x5fdc8
callq *(%rax)
movq -0x30(%rbp), %rcx
incq %rcx
addq $0xc, %r12
jmp 0x298d8
xorl %edi, %edi
leaq 0x3616e(%rip), %rax     # 0x5fab8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *(%rax)
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/asset/asset.h
// Function: Asset::Font::find_kerning(char, char)
f32 find_kerning(char a, char b) {
        u16 key = (a << 8) | b;
        s64 low = 0;
        s64 high = num_kernings;
        s64 last_guess = -1;
        while (low <= high) {
            s64 cur = (low + high) / 2;
            if (cur < 0 || num_kernings < cur || cur == last_guess)
                break;
            last_guess = cur;
            u16 cur_key = kernings[cur].key;
            if (cur_key > key)
                high = cur + 1;
            else if (cur_key < key)
                low = cur + 1;
            else
                return kernings[cur].ammount;
        }
        return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl %sil, %esi
shll $0x8, %esi
movq 0x18(%rdi), %rcx
movq 0x28(%rdi), %rax
movzwl %dx, %edx
orl %esi, %edx
movabsq $-0x1, %r8
xorl %edi, %edi
movq %rcx, %rsi
xorps %xmm0, %xmm0
movq %r8, %r9
cmpq %rsi, %rdi
jg 0x29abe
leaq (%rdi,%rsi), %r8
shrq %r8
cmpq %r8, %rcx
jl 0x29abe
cmpq %r9, %r8
je 0x29abe
movzwl (%rax,%r8,8), %r9d
cmpl %r9d, %edx
jb 0x29ab1
jbe 0x29ab7
leaq 0x1(%r8), %rdi
jmp 0x29a86
leaq 0x1(%r8), %rsi
jmp 0x29a86
movss 0x4(%rax,%r8,8), %xmm0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/asset/asset.cpp
// Function: unsigned long Asset::read_from_file<Asset::FileHeader>(_IO_FILE*, void*, unsigned long)
size_t read_from_file(FILE *stream, void *ptr, size_t num = 1) {
    if (!num) {
        ERR("Has to read something from file, invalid read");
        return 0;
    }
    size_t read = 0;
    do {
        size_t last_read = fread(ptr, sizeof(T), num - read, stream);
        ASSERT(last_read, "Failed to read anything from asset file.");
        read += last_read;
        ptr = (void *) ((u8 *) ptr + last_read * sizeof(T));
    } while (read < num);
    return read;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x29bfe
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
movq %r14, %rdx
subq %rbx, %rdx
movq %r15, %rdi
pushq $0x20
popq %rsi
movq %r12, %rcx
callq 0x22c0
movq %rax, %r13
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leaq 0x29d0(%rip), %rdi      # 0x2c5ae
pushq $0x4d
popq %rsi
leaq 0x16d4a(%rip), %rdx     # 0x40932
callq 0x6903
addq %r13, %rbx
shlq $0x5, %r13
addq %r13, %r15
cmpq %r14, %rbx
jb 0x29bb8
jmp 0x29c30
movq 0x203cb(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
leaq 0x2068(%rip), %rdi      # 0x2bc77
leaq 0x2998(%rip), %rdx      # 0x2c5ae
leaq 0x16cd8(%rip), %r8      # 0x408f5
leaq 0x16ce0(%rip), %r9      # 0x40904
xorl %ebx, %ebx
pushq $0x47
popq %rcx
xorl %eax, %eax
callq 0x683a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/logic/logic.h
// Function: Logic::Timer::call(float, float)
void call(f32 time, f32 delta) {
        if (next <= time && next != -1) {
            if (end == FOREVER) {
                callback(delta, time, 0, aux);
            } else if (end == ONCE) {
                callback(delta, time, 1, aux);
            } else {
                f32 percent = CLAMP(0, 1, (time - start) / (end - start));
                callback(delta, time, percent, aux);
            }
            next += spacing;
        }
    }

// Assembly:
movaps %xmm0, %xmm3
movss 0x8(%rdi), %xmm0
ucomiss %xmm0, %xmm3
jb 0x2a698
ucomiss 0xc0c(%rip), %xmm0      # 0x2b228
jne 0x2a620
jnp 0x2a698
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0xc(%rdi), %xmm0
xorps %xmm2, %xmm2
ucomiss 0xbf0(%rip), %xmm0      # 0x2b228
jne 0x2a63c
jnp 0x2a676
ucomiss %xmm2, %xmm0
jne 0x2a64d
jp 0x2a64d
movss 0x9b9(%rip), %xmm2      # 0x2b004
jmp 0x2a676
movss 0x4(%rbx), %xmm5
movaps %xmm3, %xmm4
subss %xmm5, %xmm4
subss %xmm5, %xmm0
divss %xmm0, %xmm4
ucomiss %xmm4, %xmm2
ja 0x2a676
movss 0x996(%rip), %xmm2      # 0x2b004
ucomiss %xmm2, %xmm4
ja 0x2a676
movaps %xmm4, %xmm2
movq 0x20(%rbx), %rdi
movaps %xmm1, %xmm0
movaps %xmm3, %xmm1
callq *0x18(%rbx)
movss 0x10(%rbx), %xmm0
addss 0x8(%rbx), %xmm0
movss %xmm0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/block_list.h
// Function: Util::List<Vec2>::append(Vec2)
void append(T element)
    {
        ASSERT(initalized, "Trying to use uninitalized list");
        length++;
        if (length >= capacity)
            resize(capacity * 2);

        data[length - 1] = element;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movaps %xmm0, -0x20(%rbp)
movq %rdi, %rbx
xorl %ecx, %ecx
cmpb $0x0, 0x10(%rdi)
setne %cl
leaq 0x16264(%rip), %rdi     # 0x40966
leaq 0x1627a(%rip), %rdx     # 0x40983
pushq $0x38
popq %rsi
callq 0x6903
movl (%rbx), %esi
movl 0x4(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%rbx)
cmpl %esi, %ecx
jb 0x2a72f
addl %esi, %esi
movq %rbx, %rdi
callq 0x2adbe
movl 0x4(%rbx), %eax
decl %eax
movq 0x8(%rbx), %rcx
movl %eax, %eax
movaps -0x20(%rbp), %xmm0
movlps %xmm0, (%rcx,%rax,8)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::RenderQueue<Renderer::Impl::Vertex>::expand()
void RenderQueue<T>::expand() {
    ASSERT(gl_draw_hint, "Trying to use uninitalized render queue");
    arena->clear();
    u32 to_copy = num_buffers;
    num_buffers += GROW_BY;
    GLBuffer *new_buffers = arena->push<GLBuffer>(num_buffers);
    if (new_buffers != vertex_buffers) {
        for (u32 i = 0; i < to_copy; i++) {
            new_buffers[i] = vertex_buffers[i];
        }
        vertex_buffers = new_buffers;
    }

    u32 vaos[GROW_BY];
    glGenVertexArrays(GROW_BY, vaos);
    u32 buffers[GROW_BY];
    glGenBuffers(GROW_BY, buffers);
    for (u32 i = 0; i < GROW_BY; i++) {
        vertex_buffers[to_copy + i] = {0, buffers[i], vaos[i]};
        vertex_buffers[to_copy + i].bind();
        glBufferData(GL_ARRAY_BUFFER, buffer_size * sizeof(T), NULL,
                     GL_STREAM_DRAW);
        enable_attrib_pointer();
    }
    glBindVertexArray(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorl %ecx, %ecx
cmpl $0x0, 0x4(%rdi)
setne %cl
leaq 0x162d(%rip), %rdi      # 0x2c04d
leaq 0x15e2c(%rip), %rdx     # 0x40853
movl $0x88, %esi
callq 0x6903
movq 0x18(%rbx), %rdi
callq 0x9ad0
movl 0xc(%rbx), %r15d
leal 0x3(%r15), %esi
movl %esi, 0xc(%rbx)
movq 0x18(%rbx), %rdi
callq 0x2a93a
cmpq 0x10(%rbx), %rax
je 0x2aa7d
imulq $0xc, %r15, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2aa79
movq 0x10(%rbx), %rsi
movl 0x8(%rsi,%rdx), %edi
movl %edi, 0x8(%rax,%rdx)
movq (%rsi,%rdx), %rsi
movq %rsi, (%rax,%rdx)
addq $0xc, %rdx
jmp 0x2aa5a
movq %rax, 0x10(%rbx)
leaq 0x3553c(%rip), %rax     # 0x5ffc0
pushq $0x3
popq %r14
leaq -0x38(%rbp), %rsi
movl %r14d, %edi
callq *(%rax)
leaq 0x354f8(%rip), %rax     # 0x5ff90
leaq -0x2c(%rbp), %rsi
movl %r14d, %edi
callq *(%rax)
xorl %r14d, %r14d
leaq 0x3504d(%rip), %r12     # 0x5faf8
cmpq $0x3, %r14
je 0x2aafc
movl -0x2c(%rbp,%r14,4), %eax
movl -0x38(%rbp,%r14,4), %ecx
movq 0x10(%rbx), %rdx
leal (%r15,%r14), %esi
imulq $0xc, %rsi, %rsi
andl $0x0, (%rdx,%rsi)
leaq (%rdx,%rsi), %rdi
movl %eax, 0x4(%rdx,%rsi)
movl %ecx, 0x8(%rdx,%rsi)
callq 0x2ab14
movl (%rbx), %eax
imulq $0x24, %rax, %rsi
movl $0x8892, %edi           # imm = 0x8892
xorl %edx, %edx
movl $0x88e0, %ecx           # imm = 0x88E0
callq *(%r12)
callq 0x1e60a
incq %r14
jmp 0x2aaab
leaq 0x34fb5(%rip), %rax     # 0x5fab8
xorl %edi, %edi
callq *(%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/block_list.h
// Function: Util::List<Vec2>::resize(unsigned int)
void resize(u32 new_size)
    {
        ASSERT(initalized, "Trying to use uninitalized list");
        // Only expand it. No need to free memory.
        if (capacity < new_size)
        {
            data = resize_memory<T>(data, sizeof(T) * new_size);
            capacity = new_size;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
cmpb $0x0, 0x10(%rdi)
setne %cl
leaq 0x15b8c(%rip), %rdi     # 0x40966
leaq 0x15ba2(%rip), %rdx     # 0x40983
pushq $0x2d
popq %rsi
callq 0x6903
cmpl %ebx, (%r14)
jae 0x2ae05
movq 0x8(%r14), %rdi
leal (,%rbx,8), %esi
callq 0x2ae0a
movq %rax, 0x8(%r14)
movl %ebx, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/examples/basic.c
// Function: main
int main() {
  libforks_ServerConn conn;
  assert(libforks_start(&conn) == libforks_OK);

  assert(libforks_fork(
    conn,
    NULL, // pid_ptr
    NULL, // socket_fd_ptr
    NULL, // exit_fd_ptr
    child_main
  ) == libforks_OK);

  // `libforks_stop` waits until the child process exits
  assert(libforks_stop(conn) == libforks_OK);

  puts("main process exited");

  return 0;
}

// Assembly:
pushq %rax
movq %rsp, %rdi
callq 0x174e
testl %eax, %eax
jne 0x1340
movq (%rsp), %rdi
leaq 0x7b(%rip), %r8         # 0x138f
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x204a
testl %eax, %eax
jne 0x1359
movq (%rsp), %rdi
callq 0x21ee
testl %eax, %eax
jne 0x1372
leaq 0x1d74(%rip), %rdi      # 0x30ab
callq 0x1070
xorl %eax, %eax
popq %rcx
retq
leaq 0x1cbd(%rip), %rdi      # 0x3004
leaq 0x1cdb(%rip), %rsi      # 0x3029
leaq 0x1ce5(%rip), %rcx      # 0x303a
pushq $0x15
jmp 0x1389
leaq 0x1ce5(%rip), %rdi      # 0x3045
leaq 0x1cc2(%rip), %rsi      # 0x3029
leaq 0x1ccc(%rip), %rcx      # 0x303a
pushq $0x1d
jmp 0x1389
leaq 0x1d0f(%rip), %rdi      # 0x3088
leaq 0x1ca9(%rip), %rsi      # 0x3029
leaq 0x1cb3(%rip), %rcx      # 0x303a
pushq $0x20
popq %rdx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/examples/basic.c
// Function: child_main
static void child_main(libforks_ServerConn conn, int socket_fd) {
  // not strictly required but recommended
  assert(libforks_free_conn(conn) == libforks_OK);

  assert(socket_fd == -1);
  puts("child process started");
  sleep(1);
  puts("child process exited");
}

// Assembly:
pushq %rbx
movl %esi, %ebx
callq 0x2217
testl %eax, %eax
jne 0x13c1
cmpl $-0x1, %ebx
jne 0x13da
leaq 0x1d7a(%rip), %rdi      # 0x3121
callq 0x1070
pushq $0x1
popq %rdi
callq 0x11e0
leaq 0x1d7c(%rip), %rdi      # 0x3137
popq %rbx
jmp 0x1070
leaq 0x1cf7(%rip), %rdi      # 0x30bf
leaq 0x1c5a(%rip), %rsi      # 0x3029
leaq 0x1d11(%rip), %rcx      # 0x30e7
pushq $0xb
jmp 0x13f1
leaq 0x1d30(%rip), %rdi      # 0x3111
leaq 0x1c41(%rip), %rsi      # 0x3029
leaq 0x1cf8(%rip), %rcx      # 0x30e7
pushq $0xd
popq %rdx
callq 0x10c0
nop
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/pwd.c
// Function: main
int main(int argc, char **argv){
    char pwd[PATH_MAX];

    if(!getcwd(pwd, sizeof(pwd))){
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        return 1;
    }
    puts(pwd);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %rbx
leaq -0x1010(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x1050
testq %rax, %rax
je 0x11bd
leaq -0x1010(%rbp), %rdi
callq 0x1040
xorl %eax, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %rbp
retq
movq 0x2e34(%rip), %rax      # 0x3ff8
movq (%rax), %r14
movq (%rbx), %rbx
callq 0x1030
movl (%rax), %edi
callq 0x1070
leaq 0xe27(%rip), %rsi       # 0x2004
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1060
pushq $0x1
popq %rax
jmp 0x11b1
// File: /workspace/github_c_makefile_star2_O2/sushant8421[P]create_your_own_shell/break.c
// Function: main
int main(int argc , char *argv[]) {
	FILE *read;
	FILE *write;
	char line [128]; 
	int split_no=1, nof_lines=1,total_lines ;
	sscanf(argv[1], "%d", &total_lines); 
   
	read = fopen(argv[2],"r");
	if (!read)
		return 1;

	write= write_in(split_no);

	while (fgets(line, sizeof(line), read)!=NULL) {
		if (nof_lines == (total_lines+1)) 
		{
			fclose(write);
			nof_lines = 1;
			split_no++;
			write= write_in(split_no);	
			if (!write)
			return 1;
		}
		fprintf(write,"%s", line);
		nof_lines++;
	}
	fclose(read);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
leaq 0xe29(%rip), %rsi       # 0x2016
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x1060
movq 0x10(%rbx), %rdi
leaq 0xe16(%rip), %rsi       # 0x2019
callq 0x1070
testq %rax, %rax
je 0x1272
movq %rax, %r14
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x118c
movq %rax, %r13
leaq -0xb0(%rbp), %r15
movl %ebx, %r12d
movq %r15, %rdi
movl $0x80, %esi
movq %r14, %rdx
callq 0x1050
testq %rax, %rax
je 0x1277
movl -0x2c(%rbp), %eax
incl %eax
cmpl %eax, %ebx
jne 0x1263
movq %r13, %rdi
callq 0x1030
incl %r12d
movl %r12d, %edi
callq 0x118c
movq %rax, %r13
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x1272
movq %r15, %rdi
movq %r13, %rsi
callq 0x1040
incl %ebx
jmp 0x1227
pushq $0x1
popq %rax
jmp 0x1281
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq