// File: /workspace/github_c_makefile_star2_O1/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, %ebp
movq %rdi, %rbx
testl %esi, %esi
je 0x31d1
movl 0x4(%rbx), %edi
leaq 0x14(%rsp), %rsi
movl $0x404f921, (%rsi)      # imm = 0x404F921
movl $0x4, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x19(%rsp), %rsi
movw %bp, (%rsi)
movl $0x2, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x283e(%rip), %rsi      # 0x5a05
movl $0x2, %edx
callq 0x1080
cmpb $0x0, 0x2c(%rbx)
movzwl (%rbx), %r12d
je 0x31ef
movzwl 0x2(%rbx), %r14d
movb $0x0, 0x2c(%rbx)
xorl %r15d, %r15d
xorl %r13d, %r13d
jmp 0x32a1
movzwl %r12w, %edx
movzwl 0x2(%rbx), %ecx
testl %ecx, %ecx
je 0x3259
xorl %esi, %esi
xorl %r14d, %r14d
movl %ecx, %r13d
xorl %eax, %eax
movl %edx, %r15d
xorl %edi, %edi
testw %r12w, %r12w
je 0x324f
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 0x3247
cmpl %r15d, %r10d
cmovll %r10d, %r15d
cmpl %eax, %r10d
cmovgl %r10d, %eax
cmpl %r13d, %edi
cmovll %edi, %r13d
cmpl %r14d, %edi
cmovgl %edi, %r14d
incq %r10
cmpl %r10d, %edx
jne 0x3221
incl %edi
addl %edx, %esi
cmpl %ecx, %edi
jne 0x320a
jmp 0x3264
xorl %eax, %eax
movl %edx, %r15d
movl %ecx, %r13d
xorl %r14d, %r14d
cmpl %edx, %r15d
sete %dl
cmpl %ecx, %r13d
sete %cl
orb %dl, %cl
jne 0x3282
subl %r15d, %eax
incl %eax
subl %r13d, %r14d
incl %r14d
movl %eax, %r12d
testb %cl, %cl
je 0x32a1
testw %bp, %bp
je 0x35bf
movw $0x1, %r12w
xorl %r15d, %r15d
movw $0x1, %r14w
jmp 0x31e7
leaq 0x5(%rsp), %rcx
movb $0x0, (%rcx)
movq %rbx, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl %r12d, %ebx
movq 0x20(%rax), %r12
xorl %eax, %eax
testq %r12, %r12
movl $0x83, %ebp
cmovel %eax, %ebp
movb %bpl, (%rcx)
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x2724(%rip), %rsi      # 0x59fd
movl $0x1, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x19(%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
movw %bx, 0x6(%rsp)
movw %bx, (%rsi)
movl $0x2, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x2a(%rsp), %rsi
movw %r14w, (%rsi)
movl $0x2, %edx
callq 0x1080
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
movl $0x1, %edx
leaq 0x5(%rsp), %rsi
callq 0x1080
movzwl %r14w, %ebx
testq %r12, %r12
movq 0x8(%rsp), %r12
je 0x3397
movl 0x4(%r12), %edi
movq 0x20(%r12), %rsi
andb $0x3, %bpl
incb %bpl
movl $0x3, %edx
movl %ebp, %ecx
shll %cl, %edx
callq 0x1080
movl 0x4(%r12), %edi
leaq 0x265c(%rip), %rsi      # 0x59ff
movl $0x1, %edx
callq 0x1080
leaq 0x14(%rsp), %rdi
callq 0x35f7
movq %rax, %rbp
movq %r12, %rdi
movl $0x10, %esi
movl $0x5, %edx
callq 0x3654
testl %ebx, %ebx
je 0x350b
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 0x34f4
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 0x34e3
movzwl (%r14), %esi
movq %r12, %rdi
movl %r13d, %edx
callq 0x3654
movl %r13d, %ecx
movl 0x14(%rsp), %r13d
cmpl $0xfff, %r13d           # imm = 0xFFF
jg 0x34ab
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 0x348f
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 0x34d5
movq %r12, %rdi
movl $0x10, %esi
movl %ecx, %edx
callq 0x3654
movq %rbp, %rdi
callq 0x370a
leaq 0x14(%rsp), %rdi
callq 0x35f7
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 0x3415
jmp 0x34f7
movq %r14, %rax
incq %rcx
movq %rax, %r14
movl 0x20(%rsp), %ebx
cmpl %ebx, %ecx
jb 0x33ff
jmp 0x3514
movq %rbp, %rax
movl $0x5, %r13d
movzwl (%rax), %esi
movq %r12, %rdi
movl %r13d, %edx
callq 0x3654
movq %r12, %rdi
movl $0x11, %esi
movl %r13d, %edx
callq 0x3654
movl 0x8(%r12), %eax
leal 0x7(%rax), %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
sarl $0x3, %ebx
testb $0x7, %al
je 0x3555
movb 0x28(%r12), %al
movslq %ebx, %rcx
incl %ebx
movb %al, 0x2d(%r12,%rcx)
testl %ebx, %ebx
je 0x3581
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 0x2476(%rip), %rsi      # 0x5a03
movl $0x1, %edx
callq 0x1080
xorl %eax, %eax
movl %eax, 0x28(%r12)
movl %eax, 0x8(%r12)
movq %rbp, %rdi
callq 0x370a
movq 0x10(%r12), %rax
movq 0x18(%r12), %rcx
movq %rax, 0x18(%r12)
movq %rcx, 0x10(%r12)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq