// File: /workspace/github_c_makefile_star2_O3/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 $0x108, %rsp            # imm = 0x108
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x78(%rsp)
movl $0x1, 0x88(%rsp)
xorl %eax, %eax
movb %al, 0x8c(%rsp)
movl $0x1010101, 0x8d(%rsp) # imm = 0x1010101
movb %al, 0x94(%rsp)
movl $0x40, 0x98(%rsp)
leaq 0x1048(%rip), %rax      # 0x65ec
movq %rax, 0x80(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x78(%rsp), %xmm0
movups 0x88(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x3f8d
callq 0x2320
movl %eax, %edi
callq 0x2260
movq 0x38(%rbx), %rax
movl (%rax), %r12d
leal 0x7(%r12), %r13d
testl %r12d, %r12d
cmovnsl %r12d, %r13d
sarl $0x3, %r13d
leal (,%r13,2), %ebx
movslq %ebx, %rax
imulq $0x178, %rax, %rdi      # imm = 0x178
callq 0x2310
movq %rax, 0x30(%rsp)
cmpl $0x8, %r12d
jl 0x5643
movl %ebx, %r14d
movq 0x30(%rsp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x5ac7
addq $0x178, %r15            # imm = 0x178
decq %r14
jne 0x562c
movq %r13, 0x58(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x4a66
testb %al, %al
je 0x5a9c
movl %ebx, %eax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x50(%rsp)
movdqa 0xa16(%rip), %xmm6      # 0x6090
pcmpeqd %xmm7, %xmm7
movdqa 0xa19(%rip), %xmm8      # 0x60a0
movl $0xff, %ebp
movq %r12, 0x60(%rsp)
movq 0xd8(%rsp), %r15
movl 0x4(%r15), %eax
cmpl $0x8, %r12d
jl 0x573b
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
movss 0xa4(%rsp), %xmm3
movq 0x30(%rsp), %r13
movq 0x40(%rsp), %rbx
movq 0x58(%rsp), %r14
movss %xmm2, 0x2c(%rsp)
movss %xmm3, 0x28(%rsp)
movss 0x8(%r13), %xmm0
mulss %xmm3, %xmm0
addss 0x4(%r13), %xmm0
movss %xmm0, 0x4(%r13)
movl 0xc(%r13), %eax
shll $0x3, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
ucomiss %xmm2, %xmm0
jb 0x572b
movq %r13, %rdi
movl %r14d, %esi
callq 0x5ac7
movss 0x28(%rsp), %xmm3
movss 0x2c(%rsp), %xmm2
movdqa 0x981(%rip), %xmm8      # 0x60a0
pcmpeqd %xmm7, %xmm7
movdqa 0x965(%rip), %xmm6      # 0x6090
addq $0x178, %r13            # imm = 0x178
decq %rbx
jne 0x56d2
movl 0x4(%r15), %eax
imull (%r15), %eax
testl %eax, %eax
jle 0x582d
movq 0x10(%r15), %rcx
movl %eax, %edx
addl $0x3, %eax
andl $-0x4, %eax
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm6, %xmm0
xorl %edx, %edx
movdqa 0x912(%rip), %xmm1      # 0x6080
movdqa 0x8fa(%rip), %xmm2      # 0x6070
movdqa %xmm1, %xmm3
pxor %xmm6, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
movd %xmm3, %esi
notl %esi
testb $0x1, %sil
je 0x57af
movl $0xff000000, (%rcx,%rdx,4) # imm = 0xFF000000
pxor %xmm7, %xmm3
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x57c6
movl $0xff000000, 0x4(%rcx,%rdx,4) # imm = 0xFF000000
movdqa %xmm2, %xmm3
pxor %xmm6, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
pxor %xmm7, %xmm3
pextrw $0x0, %xmm3, %esi
testb $0x1, %sil
je 0x5803
movl $0xff000000, 0x8(%rcx,%rdx,4) # imm = 0xFF000000
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x5816
movl $0xff000000, 0xc(%rcx,%rdx,4) # imm = 0xFF000000
addq $0x4, %rdx
paddq %xmm8, %xmm1
paddq %xmm8, %xmm2
cmpq %rdx, %rax
jne 0x5776
movq %r15, 0x70(%rsp)
cmpl $0x8, %r12d
jl 0x5a62
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
xorl %eax, %eax
movq %rax, 0x68(%rsp)
imulq $0x178, %rax, %r15      # imm = 0x178
movq 0x30(%rsp), %rax
movslq 0xc(%rax,%r15), %r14
testq %r14, %r14
jle 0x5a46
addq 0x30(%rsp), %r15
movss 0x4(%r15), %xmm1
movss 0x8(%r15), %xmm0
xorps %xmm2, %xmm2
cvtsi2ss %r14d, %xmm2
movss %xmm2, 0x38(%rsp)
divss 0x7aa(%rip), %xmm0      # 0x6038
movss %xmm1, 0x2c(%rsp)
mulss 0x7a4(%rip), %xmm1      # 0x6040
cvttss2si %xmm1, %r12d
movss 0x793(%rip), %xmm1      # 0x603c
cvttss2si (%r15), %eax
movl %eax, 0x3c(%rsp)
maxss %xmm0, %xmm1
movss %xmm1, 0x28(%rsp)
negl %r12d
xorl %r13d, %r13d
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x58e3
cmpq $0x4, %rbx
jae 0x58f7
movl $0xff800000, %ecx       # imm = 0xFF800000
movl $0x8000, %eax           # imm = 0x8000
movss 0x763(%rip), %xmm0      # 0x6044
jmp 0x593c
movl $0xffff0000, %ecx       # imm = 0xFFFF0000
movl $0xff00, %eax           # imm = 0xFF00
movss 0x717(%rip), %xmm0      # 0x600c
jmp 0x593c
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
divss 0x38(%rsp), %xmm0
movss 0x6fc(%rip), %xmm1      # 0x6008
subss %xmm0, %xmm1
movaps %xmm1, %xmm0
mulss 0x72d(%rip), %xmm0      # 0x6048
cvttss2si %xmm0, %ecx
mulss 0x6e5(%rip), %xmm1      # 0x600c
cvttss2si %xmm1, %eax
andl %ebp, %ecx
andl %ebp, %eax
shll $0x8, %eax
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
shll $0x10, %ecx
shrl $0x10, %ecx
andl %ebp, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movss 0x28(%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 %ebp, %eax
shll $0x8, %eax
orl %ecx, %eax
andl %ebp, %r8d
orl %eax, %r8d
orl $0xff000000, %r8d       # imm = 0xFF000000
leal (%r12,%rbx), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
xorl %edx, %edx
divl %r14d
movss 0x2c(%rsp), %xmm1
subss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movl 0x10(%r15,%rdx,4), %esi
movq 0x70(%rsp), %rdi
movl 0x3c(%rsp), %edx
callq 0x3b0e
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 0x5a36
callq 0x2080
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
movl $0xff, %ebp
cmovbl %eax, %edx
movq 0x48(%rsp), %rax
movl %edx, (%rax,%rbx,4)
incq %rbx
addl $0x8, %r13d
cmpq %rbx, %r14
jne 0x58c4
movq 0x68(%rsp), %rax
incq %rax
addq $0x178, 0x48(%rsp)      # imm = 0x178
cmpq 0x40(%rsp), %rax
jne 0x5848
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b8f
movq %rbx, %rdi
callq 0x4a66
testb %al, %al
movq 0x60(%rsp), %r12
movdqa 0x607(%rip), %xmm6      # 0x6090
pcmpeqd %xmm7, %xmm7
movdqa 0x60a(%rip), %xmm8      # 0x60a0
jne 0x5691
movq 0x30(%rsp), %rdi
callq 0x22b0
leaq 0xa0(%rsp), %rdi
callq 0x5062
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq