// File: /workspace/github_c_makefile_star2_O3/lecram[P]congif/gif.c
// Function: add_frame
void
add_frame(GIF *gif, uint16_t d)
{
    uint16_t w, h, x, y;
    uint8_t *tmp;

    if (d)
        set_delay(gif, d);
    if (gif->plt_dirty) {
        w = gif->w; h = gif->h; x = y = 0;
        gif->plt_dirty = 0;
    } else
    if (!get_bbox(gif, &w, &h, &x, &y)) {
        /* image's not changed; save one pixel just to add delay */
        if (!d) return;
        w = h = 1;
        x = y = 0;
    }
    put_image(gif, w, h, x, y);
    tmp = gif->old;
    gif->old = gif->cur;
    gif->cur = tmp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %r14d
movq %rdi, %rbx
testl %esi, %esi
je 0x31f7
movl 0x4(%rbx), %edi
leaq 0x14(%rsp), %rsi
movl $0x404f921, (%rsi)      # imm = 0x404F921
movl $0x4, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x18(%rsp), %rsi
movw %r14w, (%rsi)
movl $0x2, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x2828(%rip), %rsi      # 0x5a15
movl $0x2, %edx
callq 0x1080
cmpb $0x0, 0x2c(%rbx)
movzwl (%rbx), %eax
movw %ax, 0x6(%rsp)
je 0x3215
movzwl 0x2(%rbx), %ebp
movb $0x0, 0x2c(%rbx)
xorl %r15d, %r15d
jmp 0x32b0
movzwl 0x2(%rbx), %ecx
testl %ecx, %ecx
je 0x3298
movzwl 0x6(%rsp), %edx
xorl %esi, %esi
xorl %ebp, %ebp
movl %ecx, %r13d
xorl %eax, %eax
movl %edx, %r15d
xorl %edi, %edi
cmpw $0x0, 0x6(%rsp)
je 0x3275
movslq %esi, %r8
movq 0x18(%rbx), %r9
addq %r8, %r9
addq 0x10(%rbx), %r8
xorl %r10d, %r10d
movb (%r8,%r10), %r11b
cmpb (%r9,%r10), %r11b
je 0x326d
cmpl %r15d, %r10d
cmovll %r10d, %r15d
cmpl %eax, %r10d
cmovgl %r10d, %eax
cmpl %r13d, %edi
cmovll %edi, %r13d
cmpl %ebp, %edi
cmovgl %edi, %ebp
incq %r10
cmpl %r10d, %edx
jne 0x3249
incl %edi
addl %edx, %esi
cmpl %ecx, %edi
jne 0x3230
cmpl %edx, %r15d
je 0x3298
cmpl %ecx, %r13d
je 0x3298
subl %r15d, %eax
incl %eax
subl %r13d, %ebp
incl %ebp
movw %ax, 0x6(%rsp)
jmp 0x32b3
testw %r14w, %r14w
je 0x35bb
movw $0x1, 0x6(%rsp)
xorl %r15d, %r15d
movw $0x1, %bp
xorl %r13d, %r13d
movq %rbx, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %r12
xorl %eax, %eax
testq %r12, %r12
movl $0x83, %ecx
cmovel %eax, %ecx
leaq 0x1a(%rsp), %r14
movb %cl, (%r14)
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x2728(%rip), %rsi      # 0x5a0d
movl $0x1, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x18(%rsp), %rsi
movw %r15w, (%rsi)
movl $0x2, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x2e(%rsp), %rsi
movw %r13w, (%rsi)
movl $0x2, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x2c(%rsp), %rsi
movzwl 0x6(%rsp), %eax
movw %ax, (%rsi)
movl $0x2, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x2a(%rsp), %rsi
movw %bp, (%rsi)
movl $0x2, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
movl $0x1, %edx
movq %r14, %rsi
callq 0x1080
movzwl %bp, %ebx
testq %r12, %r12
movq 0x8(%rsp), %r12
je 0x3394
movl 0x4(%r12), %edi
movq 0x20(%r12), %rsi
movl $0x30, %edx
callq 0x1080
movl 0x4(%r12), %edi
leaq 0x266f(%rip), %rsi      # 0x5a0f
movl $0x1, %edx
callq 0x1080
leaq 0x14(%rsp), %rdi
callq 0x35f3
movq %rax, %rbp
movq %r12, %rdi
movl $0x10, %esi
movl $0x5, %edx
callq 0x3645
testl %ebx, %ebx
je 0x3508
movzwl %r13w, %eax
movzwl %r15w, %ecx
movzwl 0x6(%rsp), %edx
addl %eax, %ebx
addl %ecx, %edx
movl %ecx, %ecx
movq %rcx, 0x38(%rsp)
movl %eax, %ecx
movl $0x5, %r13d
movq %rbp, %r14
movl %ebx, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
cmpw $0x0, 0x6(%rsp)
je 0x34f1
movq 0x38(%rsp), %r15
movq %rcx, 0x30(%rsp)
movzwl (%r12), %eax
imulq %rcx, %rax
addq 0x10(%r12), %rax
movzbl (%r15,%rax), %ebx
movq 0x8(%r14,%rbx,8), %rax
testq %rax, %rax
jne 0x34e0
movzwl (%r14), %esi
movq %r12, %rdi
movl %r13d, %edx
callq 0x3645
movl %r13d, %ecx
movl 0x14(%rsp), %r13d
cmpl $0xfff, %r13d           # imm = 0xFFF
jg 0x34a8
movq %rbp, 0x40(%rsp)
movl $0x1, %eax
movl %ecx, 0x24(%rsp)
shll %cl, %eax
xorl %ebp, %ebp
cmpl %eax, %r13d
sete %r12b
leal 0x1(%r13), %eax
movl %eax, 0x14(%rsp)
movl $0x1, %edi
movl $0x88, %esi
callq 0x1110
testq %rax, %rax
je 0x348c
movw %r13w, (%rax)
movb %r12b, %bpl
movl 0x24(%rsp), %r13d
addl %ebp, %r13d
movq %rax, 0x8(%r14,%rbx,8)
movq 0x8(%rsp), %r12
movq 0x40(%rsp), %rbp
jmp 0x34d2
movq %r12, %rdi
movl $0x10, %esi
movl %ecx, %edx
callq 0x3645
movq %rbp, %rdi
callq 0x3707
leaq 0x14(%rsp), %rdi
callq 0x35f3
movq %rax, %rbp
movl $0x5, %r13d
movl 0x1c(%rsp), %edx
movq 0x30(%rsp), %rcx
movq 0x8(%rbp,%rbx,8), %rax
incq %r15
movq %rax, %r14
cmpl %edx, %r15d
jb 0x3412
jmp 0x34f4
movq %r14, %rax
incq %rcx
movq %rax, %r14
movl 0x20(%rsp), %ebx
cmpl %ebx, %ecx
jb 0x33fc
jmp 0x3511
movq %rbp, %rax
movl $0x5, %r13d
movzwl (%rax), %esi
movq %r12, %rdi
movl %r13d, %edx
callq 0x3645
movq %r12, %rdi
movl $0x11, %esi
movl %r13d, %edx
callq 0x3645
movl 0x8(%r12), %eax
leal 0x7(%rax), %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
sarl $0x3, %ebx
testb $0x7, %al
je 0x3552
movb 0x28(%r12), %al
movslq %ebx, %rcx
incl %ebx
movb %al, 0x2d(%r12,%rcx)
testl %ebx, %ebx
je 0x357e
movl 0x4(%r12), %edi
leaq 0x1b(%rsp), %rsi
movb %bl, (%rsi)
movl $0x1, %edx
callq 0x1080
movl 0x4(%r12), %edi
leaq 0x2d(%r12), %rsi
movslq %ebx, %rdx
callq 0x1080
movl 0x4(%r12), %edi
leaq 0x2489(%rip), %rsi      # 0x5a13
movl $0x1, %edx
callq 0x1080
xorl %eax, %eax
movl %eax, 0x28(%r12)
movl %eax, 0x8(%r12)
movq %rbp, %rdi
callq 0x3707
movdqu 0x10(%r12), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%r12)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq