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

    scg_app_t app;
    scg_app_init(&app, config);

    srand(scg_get_performance_counter());

    int num_columns = app.draw_target->width / CODE_STRING_CHAR_SIZE;
    int num_rows = app.draw_target->height / CODE_STRING_CHAR_SIZE;
    matrix_t matrix;
    matrix_init(&matrix, num_columns, num_rows);

    while (scg_app_process_events(&app)) {
        update(&matrix, &app);

        draw(app.draw_target, &matrix);

        scg_app_present(&app);
    }

    free(matrix.code_strings);
    scg_app_free(&app);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x88(%rsp)
movl $0x1, 0x98(%rsp)
xorl %eax, %eax
movb %al, 0x9c(%rsp)
movl $0x1010101, 0x9d(%rsp) # imm = 0x1010101
movb %al, 0xa4(%rsp)
movl $0x40, 0xa8(%rsp)
leaq 0x105c(%rip), %rax      # 0x65ac
movq %rax, 0x90(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x88(%rsp), %xmm0
movups 0x98(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x3ea1
callq 0x2320
movl %eax, %edi
callq 0x2260
movq 0x38(%rbx), %rax
movl (%rax), %r14d
leal 0x7(%r14), %r12d
testl %r14d, %r14d
cmovnsl %r14d, %r12d
sarl $0x3, %r12d
leal (%r12,%r12), %ebx
movslq %ebx, %rax
imulq $0x178, %rax, %rdi      # imm = 0x178
callq 0x2310
movq %rax, 0x38(%rsp)
movq %r14, 0x58(%rsp)
cmpl $0x8, %r14d
jl 0x55fc
cmpl $0x2, %ebx
movl $0x1, %r14d
cmovgel %ebx, %r14d
movq 0x38(%rsp), %r15
movq %r15, %rdi
movl %r12d, %esi
callq 0x5985
addq $0x178, %r15            # imm = 0x178
decq %r14
jne 0x55e5
movq %r12, 0x78(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x49fc
testb %al, %al
je 0x595a
movl %ebx, %eax
movq %rax, 0x60(%rsp)
movq 0x38(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x70(%rsp)
movl $0xff, %r13d
cmpl $0x8, 0x58(%rsp)
movq 0x78(%rsp), %r14
jl 0x56c4
movq 0xe8(%rsp), %rax
xorps %xmm2, %xmm2
cvtsi2ssl 0x4(%rax), %xmm2
movss 0xb4(%rsp), %xmm3
movq 0x38(%rsp), %r12
movq 0x60(%rsp), %rbx
movss %xmm2, 0x34(%rsp)
movss %xmm3, 0x40(%rsp)
movss 0x8(%r12), %xmm0
mulss %xmm3, %xmm0
addss 0x4(%r12), %xmm0
movss %xmm0, 0x4(%r12)
movl 0xc(%r12), %eax
shll $0x3, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
ucomiss %xmm2, %xmm0
jb 0x56b8
movq %r12, %rdi
movl %r14d, %esi
callq 0x5985
movss 0x40(%rsp), %xmm3
movss 0x34(%rsp), %xmm2
addq $0x178, %r12            # imm = 0x178
decq %rbx
jne 0x5670
movq 0xe8(%rsp), %rbp
movl 0x4(%rbp), %ecx
imull (%rbp), %ecx
testl %ecx, %ecx
jle 0x56ee
movq 0x10(%rbp), %rax
movl %ecx, %ecx
xorl %edx, %edx
movl $0xff000000, (%rax,%rdx,4) # imm = 0xFF000000
incq %rdx
cmpq %rdx, %rcx
jne 0x56df
cmpl $0x8, 0x58(%rsp)
jl 0x593a
movq 0x70(%rsp), %rax
movq %rax, 0x68(%rsp)
xorl %eax, %eax
movq %rax, 0x80(%rsp)
imulq $0x178, %rax, %rbx      # imm = 0x178
movq 0x38(%rsp), %rax
movslq 0xc(%rax,%rbx), %r15
testq %r15, %r15
jle 0x591b
addq 0x38(%rsp), %rbx
movss 0x4(%rbx), %xmm1
movss 0x8(%rbx), %xmm0
xorps %xmm2, %xmm2
cvtsi2ss %r15d, %xmm2
movss %xmm2, 0x4c(%rsp)
divss 0x8ec(%rip), %xmm0      # 0x6038
movss %xmm1, 0x34(%rsp)
mulss 0x8e6(%rip), %xmm1      # 0x6040
cvttss2si %xmm1, %eax
movss 0x8d6(%rip), %xmm1      # 0x603c
cvttss2si (%rbx), %ecx
movl %ecx, 0x50(%rsp)
maxss %xmm0, %xmm1
movss %xmm1, 0x54(%rsp)
negl %eax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
testq %r14, %r14
je 0x57a4
cmpq $0x4, %r14
jae 0x57b8
movl $0xff800000, %ecx       # imm = 0xFF800000
movl $0x8000, %eax           # imm = 0x8000
movss 0x8a2(%rip), %xmm0      # 0x6044
jmp 0x5800
movl $0xffff0000, %ecx       # imm = 0xFFFF0000
movl $0xff00, %eax           # imm = 0xFF00
movss 0x856(%rip), %xmm0      # 0x600c
jmp 0x5800
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
divss 0x4c(%rsp), %xmm0
movss 0x83a(%rip), %xmm1      # 0x6008
subss %xmm0, %xmm1
movaps %xmm1, %xmm0
mulss 0x86b(%rip), %xmm0      # 0x6048
cvttss2si %xmm0, %ecx
mulss 0x823(%rip), %xmm1      # 0x600c
cvttss2si %xmm1, %eax
andl %r13d, %ecx
andl %r13d, %eax
shll $0x8, %eax
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
shll $0x10, %ecx
shrl $0x10, %ecx
andl %r13d, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movss 0x54(%rsp), %xmm2
mulss %xmm2, %xmm1
cvttss2si %xmm1, %ecx
shrl $0x8, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss %xmm2, %xmm1
cvttss2si %xmm1, %eax
mulss %xmm2, %xmm0
cvttss2si %xmm0, %r8d
shll $0x10, %ecx
andl %r13d, %eax
shll $0x8, %eax
orl %ecx, %eax
andl %r13d, %r8d
orl %eax, %r8d
orl $0xff000000, %r8d       # imm = 0xFF000000
movq 0x40(%rsp), %rax
leal (%rax,%r14), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cltd
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
idivl 0xc(%rbx)
movss 0x34(%rsp), %xmm1
subss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movl 0x10(%rbx,%rdx,4), %esi
movq %rbp, %rdi
movl 0x50(%rsp), %edx
callq 0x3a22
callq 0x2080
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
cmpl $0x4, %eax
jg 0x590b
callq 0x2080
movq %r15, %r13
movq %rbp, %r15
imull $0xcccccccd, %eax, %ebp # imm = 0xCCCCCCCD
addl $0x19999998, %ebp       # imm = 0x19999998
rorl %ebp
callq 0x2080
cmpl $0x19999999, %ebp       # imm = 0x19999999
movl $0x53, %ecx
movl $0x5d, %edx
cmovbl %edx, %ecx
cltd
idivl %ecx
leal 0x21(%rdx), %eax
addl $0x3041, %edx           # imm = 0x3041
cmpl $0x19999999, %ebp       # imm = 0x19999999
movq %r15, %rbp
movq %r13, %r15
movl $0xff, %r13d
cmovbl %eax, %edx
movq 0x68(%rsp), %rax
movl %edx, (%rax,%r14,4)
incq %r14
addl $0x8, %r12d
cmpq %r14, %r15
jne 0x5785
movq 0x80(%rsp), %rax
incq %rax
addq $0x178, 0x68(%rsp)      # imm = 0x178
cmpq 0x60(%rsp), %rax
jne 0x5705
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b48
movq %rbx, %rdi
callq 0x49fc
testb %al, %al
jne 0x5631
movq 0x38(%rsp), %rdi
callq 0x22b0
leaq 0xb0(%rsp), %rdi
callq 0x5017
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq