// File: /workspace/github_c_makefile_star2_O0/adelciotto[P]scg/examples/tween.c
// Function: main
int main(int arcg, char *argv[]) {
    scg_config_t config = scg_config_new_default();
    config.video.title = "SCG Example: Tween";
    config.video.show_frame_metrics = false;

    scg_app_t app;
    scg_app_init(&app, config);

    const float32_t start_x = 10.0f;
    const float32_t end_x = app.draw_target->width - 64.0f;
    const float32_t duration = 3.0f;
    const bool loop = true;
    const bool yoyo = true;

    tween_example_t tween_examples[NUM_TWEENS] = {
        (tween_example_t){scg_tween_new(scg_tween_definition_new(
                              (scg_vec2f_t[]){scg_vec2f_new(start_x, end_x)}, 1,
                              scg_tween_linear, duration, loop, yoyo)),
                          "Linear", SCG_COLOR_BLACK},
        (tween_example_t){
            scg_tween_new(scg_tween_definition_new(
                (scg_vec2f_t[]){scg_vec2f_new(start_x, end_x)}, 1,
                scg_tween_exponential_ease_in, duration, loop, yoyo)),
            "Exponential Ease-In", SCG_COLOR_RED},
        (tween_example_t){
            scg_tween_new(scg_tween_definition_new(
                (scg_vec2f_t[]){scg_vec2f_new(start_x, end_x)}, 1,
                scg_tween_exponential_ease_out, duration, loop, yoyo)),
            "Exponential Ease-Out", SCG_COLOR_GREEN},
        (tween_example_t){
            scg_tween_new(scg_tween_definition_new(
                (scg_vec2f_t[]){scg_vec2f_new(start_x, end_x)}, 1,
                scg_tween_exponential_ease_in_out, duration, loop, yoyo)),
            "Exponential Ease-In-Out", SCG_COLOR_BLUE},
        (tween_example_t){scg_tween_new(scg_tween_definition_new(
                              (scg_vec2f_t[]){scg_vec2f_new(start_x, end_x)}, 1,
                              scg_tween_elastic_ease_in, duration, loop, yoyo)),
                          "Elastic Ease-In", SCG_COLOR_BROWN},
        (tween_example_t){
            scg_tween_new(scg_tween_definition_new(
                (scg_vec2f_t[]){scg_vec2f_new(start_x, end_x)}, 1,
                scg_tween_elastic_ease_out, duration, loop, yoyo)),
            "Elastic Ease-Out", SCG_COLOR_MAGENTA},
        (tween_example_t){
            scg_tween_new(scg_tween_definition_new(
                (scg_vec2f_t[]){scg_vec2f_new(start_x, end_x)}, 1,
                scg_tween_elastic_ease_in_out, duration, loop, yoyo)),
            "Elastic Ease-In-Out", SCG_COLOR_95_GREEN}};

    for (int i = 0; i < NUM_TWEENS; i++) {
        scg_tween_start(&tween_examples[i].tween, app.elapsed_time);
    }
    bool paused = false;

    while (scg_app_process_events(&app)) {
        if (scg_keyboard_is_key_triggered(app.keyboard, SCG_KEY_P)) {
            for (int i = 0; i < NUM_TWEENS; i++) {
                if (paused) {
                    scg_tween_resume(&tween_examples[i].tween,
                                     app.elapsed_time);
                } else {
                    for (int i = 0; i < NUM_TWEENS; i++) {
                        scg_tween_pause(&tween_examples[i].tween,
                                        app.elapsed_time);
                    }
                }
            }
            paused = !paused;
        }

        scg_image_clear(app.draw_target, SCG_COLOR_WHITE);

        const int window_size = (app.draw_target->height - 16) / NUM_TWEENS;
        int current_y = 16;
        float32_t values[1];

        for (int i = 0; i < NUM_TWEENS; i++) {
            tween_example_t *example = &tween_examples[i];

            scg_tween_update(&example->tween, values, app.elapsed_time);

            scg_image_fill_rect(app.draw_target, values[0],
                                current_y - 14 + window_size / 2, 32, 32,
                                example->color);
            scg_image_draw_string(app.draw_target, example->name, 10, current_y,
                                  false, example->color);
            scg_image_draw_line(app.draw_target, 0, current_y + 12,
                                app.draw_target->width, current_y + 12,
                                example->color);
            current_y += window_size;
        }

        const char *str = paused ? "Press P to resume" : "Press P to pause";
        int w = strlen(str) * SCG_FONT_SIZE;
        scg_image_draw_string(app.draw_target, str,
                              app.draw_target->width - w - 10, 10, false,
                              SCG_COLOR_BLACK);

        scg_app_present(&app);
    }

    scg_app_free(&app);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x470, %rsp            # imm = 0x470
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x49e0
leaq 0x1e93(%rip), %rax      # 0x859c
movq %rax, -0x30(%rbp)
movb $0x0, -0x21(%rbp)
movq -0x18(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0xa0(%rbp), %rdi
callq 0x4a30
movss 0x18d5(%rip), %xmm0     # 0x8014
movss %xmm0, -0xa4(%rbp)
movq -0x68(%rbp), %rax
cvtsi2ssl (%rax), %xmm0
movss 0x18e5(%rip), %xmm1     # 0x803c
subss %xmm1, %xmm0
movss %xmm0, -0xa8(%rbp)
movss 0x18cd(%rip), %xmm0     # 0x8038
movss %xmm0, -0xac(%rbp)
movb $0x1, -0xad(%rbp)
movb $0x1, -0xae(%rbp)
leaq -0x2b0(%rbp), %rax
movq %rax, -0x440(%rbp)
movss 0x187d(%rip), %xmm0     # 0x8014
movss %xmm0, -0x2d8(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x2d4(%rbp)
leaq -0x2d8(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
movl $0x1, %r9d
leaq -0xa1a(%rip), %rcx      # 0x5db0
movss 0x1866(%rip), %xmm0     # 0x8038
movl %r9d, %edx
movl %r9d, %r8d
callq 0x62d0
movq -0x440(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6350
leaq 0x1d96(%rip), %rax      # 0x85af
movq %rax, -0x278(%rbp)
movb $0x0, -0x270(%rbp)
movb $0x0, -0x26f(%rbp)
movb $0x0, -0x26e(%rbp)
movb $-0x1, -0x26d(%rbp)
leaq -0x2b0(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x438(%rbp)
movss 0x17be(%rip), %xmm0     # 0x8014
movss %xmm0, -0x300(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x2fc(%rbp)
leaq -0x300(%rbp), %rsi
leaq -0x2f8(%rbp), %rdi
movl $0x1, %r9d
leaq -0xac9(%rip), %rcx      # 0x5dc0
movss 0x17a7(%rip), %xmm0     # 0x8038
movl %r9d, %edx
movl %r9d, %r8d
callq 0x62d0
movq -0x438(%rbp), %rdi
leaq -0x2f8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6350
leaq 0x1cde(%rip), %rax      # 0x85b6
movq %rax, -0x230(%rbp)
movb $0x0, -0x228(%rbp)
movb $0x0, -0x227(%rbp)
movb $-0x1, -0x226(%rbp)
movb $-0x1, -0x225(%rbp)
leaq -0x2b0(%rbp), %rax
addq $0x90, %rax
movq %rax, -0x430(%rbp)
movss 0x16fd(%rip), %xmm0     # 0x8014
movss %xmm0, -0x328(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x324(%rbp)
leaq -0x328(%rbp), %rsi
leaq -0x320(%rbp), %rdi
movl $0x1, %r9d
leaq -0xb1a(%rip), %rcx      # 0x5e30
movss 0x16e6(%rip), %xmm0     # 0x8038
movl %r9d, %edx
movl %r9d, %r8d
callq 0x62d0
movq -0x430(%rbp), %rdi
leaq -0x320(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6350
leaq 0x1c31(%rip), %rax      # 0x85ca
movq %rax, -0x1e8(%rbp)
movb $0x0, -0x1e0(%rbp)
movb $-0x1, -0x1df(%rbp)
movb $0x0, -0x1de(%rbp)
movb $-0x1, -0x1dd(%rbp)
leaq -0x2b0(%rbp), %rax
addq $0xd8, %rax
movq %rax, -0x428(%rbp)
movss 0x163c(%rip), %xmm0     # 0x8014
movss %xmm0, -0x350(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x34c(%rbp)
leaq -0x350(%rbp), %rsi
leaq -0x348(%rbp), %rdi
movl $0x1, %r9d
leaq -0xb6b(%rip), %rcx      # 0x5ea0
movss 0x1625(%rip), %xmm0     # 0x8038
movl %r9d, %edx
movl %r9d, %r8d
callq 0x62d0
movq -0x428(%rbp), %rdi
leaq -0x348(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6350
leaq 0x1b85(%rip), %rax      # 0x85df
movq %rax, -0x1a0(%rbp)
movb $-0x1, -0x198(%rbp)
movb $0x0, -0x197(%rbp)
movb $0x0, -0x196(%rbp)
movb $-0x1, -0x195(%rbp)
leaq -0x2b0(%rbp), %rax
addq $0x120, %rax            # imm = 0x120
movq %rax, -0x420(%rbp)
movss 0x157b(%rip), %xmm0     # 0x8014
movss %xmm0, -0x378(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x374(%rbp)
leaq -0x378(%rbp), %rsi
leaq -0x370(%rbp), %rdi
movl $0x1, %r9d
leaq -0xb3c(%rip), %rcx      # 0x5f90
movss 0x1564(%rip), %xmm0     # 0x8038
movl %r9d, %edx
movl %r9d, %r8d
callq 0x62d0
movq -0x420(%rbp), %rdi
leaq -0x370(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6350
leaq 0x1adc(%rip), %rax      # 0x85f7
movq %rax, -0x158(%rbp)
movb $0x0, -0x150(%rbp)
movb $0x4b, -0x14f(%rbp)
movb $-0x6a, -0x14e(%rbp)
movb $-0x1, -0x14d(%rbp)
leaq -0x2b0(%rbp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, -0x418(%rbp)
movss 0x14ba(%rip), %xmm0     # 0x8014
movss %xmm0, -0x3a0(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x39c(%rbp)
leaq -0x3a0(%rbp), %rsi
leaq -0x398(%rbp), %rdi
movl $0x1, %r9d
leaq -0xb1d(%rip), %rcx      # 0x6070
movss 0x14a3(%rip), %xmm0     # 0x8038
movl %r9d, %edx
movl %r9d, %r8d
callq 0x62d0
movq -0x418(%rbp), %rdi
leaq -0x398(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6350
leaq 0x1a2b(%rip), %rax      # 0x8607
movq %rax, -0x110(%rbp)
movb $-0x1, -0x108(%rbp)
movb $0x0, -0x107(%rbp)
movb $-0x1, -0x106(%rbp)
movb $-0x1, -0x105(%rbp)
leaq -0x2b0(%rbp), %rax
addq $0x1b0, %rax            # imm = 0x1B0
movq %rax, -0x410(%rbp)
movss 0x13f9(%rip), %xmm0     # 0x8014
movss %xmm0, -0x3c8(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x3c4(%rbp)
leaq -0x3c8(%rbp), %rsi
leaq -0x3c0(%rbp), %rdi
movl $0x1, %r9d
leaq -0xb0e(%rip), %rcx      # 0x6140
movss 0x13e2(%rip), %xmm0     # 0x8038
movl %r9d, %edx
movl %r9d, %r8d
callq 0x62d0
movq -0x410(%rbp), %rdi
leaq -0x3c0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x6350
leaq 0x197b(%rip), %rax      # 0x8618
movq %rax, -0xc8(%rbp)
movb $-0x80, -0xc0(%rbp)
movb $-0x80, -0xbf(%rbp)
movb $0x0, -0xbe(%rbp)
movb $-0x1, -0xbd(%rbp)
movl $0x0, -0x3cc(%rbp)
cmpl $0x7, -0x3cc(%rbp)
jge 0x6d06
movslq -0x3cc(%rbp), %rax
leaq -0x2b0(%rbp), %rdi
imulq $0x48, %rax, %rax
addq %rax, %rdi
movss -0x98(%rbp), %xmm0
callq 0x65a0
movl -0x3cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3cc(%rbp)
jmp 0x6cca
movb $0x0, -0x3cd(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x56b0
testb $0x1, %al
jne 0x6d22
jmp 0x6fe6
movq -0x60(%rbp), %rdi
movl $0x13, %esi
callq 0x4700
testb $0x1, %al
jne 0x6d39
jmp 0x6deb
movl $0x0, -0x3d4(%rbp)
cmpl $0x7, -0x3d4(%rbp)
jge 0x6ddb
testb $0x1, -0x3cd(%rbp)
je 0x6d7d
movslq -0x3d4(%rbp), %rax
leaq -0x2b0(%rbp), %rdi
imulq $0x48, %rax, %rax
addq %rax, %rdi
movss -0x98(%rbp), %xmm0
callq 0x6680
jmp 0x6dc5
movl $0x0, -0x3d8(%rbp)
cmpl $0x7, -0x3d8(%rbp)
jge 0x6dc3
movslq -0x3d8(%rbp), %rax
leaq -0x2b0(%rbp), %rdi
imulq $0x48, %rax, %rax
addq %rax, %rdi
movss -0x98(%rbp), %xmm0
callq 0x6640
movl -0x3d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3d8(%rbp)
jmp 0x6d87
jmp 0x6dc5
jmp 0x6dc7
movl -0x3d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3d4(%rbp)
jmp 0x6d43
movb -0x3cd(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x3cd(%rbp)
movq -0x68(%rbp), %rdi
movb $-0x1, -0x3dc(%rbp)
movb $-0x1, -0x3db(%rbp)
movb $-0x1, -0x3da(%rbp)
movb $-0x1, -0x3d9(%rbp)
movl -0x3dc(%rbp), %esi
callq 0x3100
movq -0x68(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x10, %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %eax, -0x3e0(%rbp)
movl $0x10, -0x3e4(%rbp)
movl $0x0, -0x3ec(%rbp)
cmpl $0x7, -0x3ec(%rbp)
jge 0x6f53
movslq -0x3ec(%rbp), %rcx
leaq -0x2b0(%rbp), %rax
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x3f8(%rbp)
movq -0x3f8(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
movss -0x98(%rbp), %xmm0
callq 0x63a0
movq -0x68(%rbp), %rdi
cvttss2si -0x3e8(%rbp), %esi
movl -0x3e4(%rbp), %eax
subl $0xe, %eax
movl %eax, -0x444(%rbp)
movl -0x3e0(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x444(%rbp), %edx
addl %eax, %edx
movq -0x3f8(%rbp), %rax
movl 0x40(%rax), %r9d
movl $0x20, %r8d
movl %r8d, %ecx
callq 0x3ce0
movq -0x68(%rbp), %rdi
movq -0x3f8(%rbp), %rax
movq 0x38(%rax), %rsi
movl -0x3e4(%rbp), %ecx
movq -0x3f8(%rbp), %rax
movl 0x40(%rax), %r9d
movl $0xa, %edx
xorl %r8d, %r8d
callq 0x4190
movq -0x68(%rbp), %rdi
movl -0x3e4(%rbp), %edx
addl $0xc, %edx
movq -0x68(%rbp), %rax
movl (%rax), %ecx
movl -0x3e4(%rbp), %r8d
addl $0xc, %r8d
movq -0x3f8(%rbp), %rax
movl 0x40(%rax), %r9d
xorl %esi, %esi
callq 0x3a80
movl -0x3e0(%rbp), %eax
addl -0x3e4(%rbp), %eax
movl %eax, -0x3e4(%rbp)
movl -0x3ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3ec(%rbp)
jmp 0x6e42
movb -0x3cd(%rbp), %dl
leaq 0x16de(%rip), %rax      # 0x863e
leaq 0x16c5(%rip), %rcx      # 0x862c
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0x400(%rbp)
movq -0x400(%rbp), %rdi
callq 0x20f0
shlq $0x3, %rax
movl %eax, -0x404(%rbp)
movq -0x68(%rbp), %rdi
movq -0x400(%rbp), %rsi
movq -0x68(%rbp), %rax
movl (%rax), %edx
subl -0x404(%rbp), %edx
subl $0xa, %edx
movb $0x0, -0x408(%rbp)
movb $0x0, -0x407(%rbp)
movb $0x0, -0x406(%rbp)
movb $-0x1, -0x405(%rbp)
movl -0x408(%rbp), %r9d
movl $0xa, %ecx
xorl %r8d, %r8d
callq 0x4190
leaq -0xa0(%rbp), %rdi
callq 0x5800
jmp 0x6d0d
leaq -0xa0(%rbp), %rdi
callq 0x5cb0
xorl %eax, %eax
addq $0x470, %rsp            # imm = 0x470
popq %rbp
retq
nopl (%rax)