// File: /workspace/github_c_makefile_star2_O2/nkanaev[P]tipsy/src/tigr.c
// Function: tigrUpdate
void tigrUpdate(Tigr* bmp) {
    XWindowAttributes gwa;

    TigrInternal* win = tigrInternal(bmp);

    memcpy(win->prev, win->keys, 256);

    XGetWindowAttributes(win->dpy, win->win, &gwa);

    if (win->flags & TIGR_AUTO)
        tigrResize(bmp, gwa.width / win->scale, gwa.height / win->scale);
    else
        win->scale = tigrEnforceScale(tigrCalcScale(bmp->w, bmp->h, gwa.width, gwa.height), win->flags);

    tigrPosition(bmp, win->scale, gwa.width, gwa.height, win->pos);
    glXMakeCurrent(win->dpy, win->win, win->glc);
    tigrGAPIPresent(bmp, gwa.width, gwa.height);
    glXSwapBuffers(win->dpy, win->win);

    tigrProcessInput(win, gwa.width, gwa.height);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, %r14
callq 0x5e9d
movq %rax, %rbx
movq %rax, %r13
leaq 0x190(%rax), %rdi
leaq 0x90(%rax), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x32e0
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rsi
leaq 0x140(%rsp), %r15
movq %r15, %rdx
callq 0x3730
movq %rbx, 0x10(%rsp)
movl 0x74(%rbx), %r12d
movl 0xc(%r15), %ebp
testb $0x1, %r12b
jne 0x69fd
movl (%r14), %edi
movl 0x4(%r14), %esi
movl 0x148(%rsp), %r15d
movl %r15d, %edx
movl %ebp, %ecx
callq 0x3a17
movl %eax, %edi
movl %r12d, %esi
callq 0x3a3d
movl %eax, %esi
movl %eax, 0x78(%r13)
jmp 0x6a2f
movl 0x148(%rsp), %eax
movl 0x78(%r13), %ecx
cltd
idivl %ecx
movl %eax, %esi
movl %ebp, %eax
cltd
idivl %ecx
movq %r14, %rdi
movl %eax, %edx
callq 0x3949
movl 0x78(%r13), %esi
movl 0x148(%rsp), %r15d
movl 0x14c(%rsp), %ebp
movq 0x10(%rsp), %rax
leaq 0x7c(%rax), %r8
movq %r14, %rdi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x3a6e
movq 0x30(%r13), %rdi
movq 0x38(%r13), %rsi
movq 0x40(%r13), %rdx
callq 0x32d0
movl 0x148(%rsp), %esi
movl 0x14c(%rsp), %edx
movq %r14, %rdi
callq 0x6de0
movq 0x30(%r13), %rdi
movq 0x38(%r13), %rsi
callq 0x3760
movl 0x148(%rsp), %ebp
movl 0x14c(%rsp), %ebx
movq 0x30(%r13), %rdi
leaq 0x80(%rsp), %r14
leaq 0x50(%rsp), %rdx
movq %r14, %rsi
callq 0x3700
movq 0x38(%r13), %rsi
cmpq (%r14), %rsi
jne 0x6dce
movq 0x30(%r13), %rdi
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
leaq 0x28(%rsp), %r10
leaq 0x2c(%rsp), %r11
leaq 0x38(%rsp), %rdx
leaq 0x80(%rsp), %rcx
leaq 0x48(%rsp), %r8
leaq 0x44(%rsp), %r9
pushq %rax
pushq %r10
pushq %r11
callq 0x33d0
addq $0x20, %rsp
testl %eax, %eax
je 0x6b7d
movl 0x8(%rsp), %esi
movl %esi, %ecx
andl $0x700, %ecx            # imm = 0x700
movl 0x24(%rsp), %edi
movl 0x7c(%r13), %edx
movl %edi, %eax
subl %edx, %eax
movl 0x78(%r13), %r9d
cltd
idivl %r9d
movl %eax, 0x294(%r13)
movl 0x20(%rsp), %r8d
movl %r8d, %eax
subl 0x80(%r13), %eax
cltd
idivl %r9d
movl %eax, 0x298(%r13)
cmpl 0x899c(%rip), %ecx      # 0xf4d4
setne %al
testl %edi, %edi
setg %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x6b77
cmpl %ebp, %edi
jge 0x6b77
testl %r8d, %r8d
jle 0x6b77
cmpl %ebx, %r8d
jge 0x6b77
btl $0x8, %esi
jb 0x6b69
btl $0xa, %esi
jb 0x6b6d
shrl $0x7, %esi
andl $0x4, %esi
jmp 0x6b70
pushq $0x1
jmp 0x6b6f
pushq $0x2
popq %rsi
movl %esi, 0x290(%r13)
movl %ecx, 0x8957(%rip)      # 0xf4d4
movq 0x30(%r13), %rdi
leaq 0x50(%rsp), %rsi
callq 0x3450
addq $0x8c, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0x6d4d
movb 0x50(%rsp,%rcx), %r14b
leaq 0x892b(%rip), %rax      # 0xf4e0
movq %rcx, 0x28(%rsp)
movb (%rcx,%rax), %r12b
cmpb %r12b, %r14b
jne 0x6bda
movq 0x28(%rsp), %rcx
incq %rcx
movq 0x18(%rsp), %rax
addl $0x8, %eax
movq %rax, 0x18(%rsp)
jmp 0x6b9f
pushq $0x8
popq %r15
movq 0x18(%rsp), %rax
movl %eax, %ebx
subl $0x1, %r15d
jb 0x6bc3
movl %r14d, %ebp
andb $0x1, %bpl
movl %r12d, %eax
andb $0x1, %al
cmpb %al, %bpl
je 0x6d40
movq 0x30(%r13), %rdi
movzbl %bl, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3130
testq %rax, %rax
je 0x6d40
movq %rax, %rdi
callq 0x6799
movzbl %al, %eax
movb %bpl, 0x90(%r13,%rax)
movb $0x1, %al
cmpb $0x0, 0x144(%r13)
movb $0x1, %cl
jne 0x6c45
cmpb $0x0, 0x145(%r13)
setne %cl
movb %cl, 0x12f(%r13)
cmpb $0x0, 0x146(%r13)
jne 0x6c61
cmpb $0x0, 0x147(%r13)
setne %al
movb %al, 0x130(%r13)
movb $0x1, %al
cmpb $0x0, 0x148(%r13)
jne 0x6c7f
cmpb $0x0, 0x149(%r13)
setne %al
movb %al, 0x131(%r13)
testb %bpl, %bpl
je 0x6d40
movq 0x30(%rsp), %rax
movl 0x8(%rsp), %ecx
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movl $0x2, 0x80(%rsp)
movq 0x30(%r13), %rdx
movq %rdx, 0x98(%rsp)
movq %rax, 0xa8(%rsp)
movq 0x38(%r13), %rax
movq %rax, 0xa0(%rsp)
movl %ecx, 0xd0(%rsp)
movl %ebx, 0xd4(%rsp)
andl $0x0, 0xc(%rsp)
movq 0x48(%r13), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x46(%rsp), %rdx
pushq $0xa
popq %rcx
xorl %r8d, %r8d
leaq 0xc(%rsp), %r9
callq 0x3280
cmpl $0x2, 0xc(%rsp)
jne 0x6d40
leaq 0x46(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x5cf3
sarb %r14b
sarb %r12b
incl %ebx
jmp 0x6be5
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movaps %xmm1, 0x8792(%rip)     # 0xf4f0
movaps %xmm0, 0x877b(%rip)     # 0xf4e0
pushq $0x21
popq %rbx
leaq 0x80(%rsp), %r14
movq 0x30(%r13), %rdi
movq 0x38(%r13), %rsi
movl %ebx, %edx
movq %r14, %rcx
callq 0x3530
testl %eax, %eax
je 0x6dc5
movq 0xb8(%rsp), %rax
cmpq 0x871b(%rip), %rax      # 0xf4b0
jne 0x6d70
movq 0x30(%r13), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32d0
movq 0x30(%r13), %rdi
movq 0x40(%r13), %rsi
callq 0x3250
movq 0x30(%r13), %rdi
movq 0x38(%r13), %rsi
callq 0x3680
andq $0x0, 0x38(%r13)
jmp 0x6d70
movq 0x30(%r13), %rdi
callq 0x3630
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq