// File: /workspace/github_c_makefile_star2_O2/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, %r12d
movq %rdi, %rbx
testl %esi, %esi
movq %rdi, 0x10(%rsp)
je 0x2f91
movl 0x4(%rbx), %edi
leaq 0x1c(%rsp), %rsi
movl $0x404f921, (%rsi)      # imm = 0x404F921
pushq $0x4
popq %rdx
callq 0x1080
movq 0x10(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x21(%rsp), %rsi
movw %r12w, (%rsi)
pushq $0x2
popq %r14
movq %r14, %rdx
callq 0x1080
movq 0x10(%rsp), %rax
movl 0x4(%rax), %edi
leaq 0x1a81(%rip), %rsi      # 0x4a05
movq %r14, %rdx
callq 0x1080
movq 0x10(%rsp), %rbx
cmpb $0x0, 0x2c(%rbx)
movzwl (%rbx), %r13d
je 0x2fab
movzwl 0x2(%rbx), %r14d
movb $0x0, 0x2c(%rbx)
xorl %ebp, %ebp
xorl %r15d, %r15d
jmp 0x3029
movzwl %r13w, %ecx
movzwl 0x2(%rbx), %eax
xorl %edx, %edx
xorl %esi, %esi
movl %ecx, %ebp
xorl %r13d, %r13d
movl %eax, %r15d
xorl %r14d, %r14d
cmpl %eax, %edx
je 0x300c
movslq %esi, %rsi
xorl %edi, %edi
movq %rsi, %r8
cmpl %edi, %ecx
je 0x3005
movq 0x10(%rbx), %r9
movq 0x18(%rbx), %r10
movb (%r9,%r8), %r9b
cmpb (%r10,%r8), %r9b
je 0x2ffe
cmpl %ebp, %edi
cmovll %edi, %ebp
cmpl %r13d, %edi
cmovgl %edi, %r13d
cmpl %r15d, %edx
cmovll %edx, %r15d
cmpl %r14d, %edx
cmovgl %edx, %r14d
incl %edi
incq %r8
jmp 0x2fce
addq %rcx, %rsi
incl %edx
jmp 0x2fc2
cmpl %ecx, %ebp
je 0x32c0
cmpl %eax, %r15d
je 0x32c0
subl %ebp, %r13d
incl %r13d
subl %r15d, %r14d
incl %r14d
movq 0x20(%rbx), %rcx
movq %rcx, 0x28(%rsp)
xorl %eax, %eax
testq %rcx, %rcx
movl $0x83, %ecx
cmovel %eax, %ecx
leaq 0xf(%rsp), %rax
movb %cl, (%rax)
movl 0x4(%rbx), %edi
leaq 0x19ad(%rip), %rsi      # 0x49fd
pushq $0x1
popq %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x21(%rsp), %rsi
movw %bp, (%rsi)
pushq $0x2
popq %r12
movq %r12, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x3e(%rsp), %rsi
movw %r15w, (%rsi)
movq %r12, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x3c(%rsp), %rsi
movw %r13w, (%rsi)
movq %r12, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x3a(%rsp), %rsi
movw %r14w, (%rsi)
movq %r12, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x1080
movzwl %bp, %ebp
movzwl %r15w, %r15d
movzwl %r13w, %r12d
movzwl %r14w, %eax
movl %eax, 0x24(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x30e5
movl 0x4(%rbx), %edi
movq 0x20(%rbx), %rsi
pushq $0x30
popq %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x1910(%rip), %rsi      # 0x49ff
pushq $0x1
popq %rdx
callq 0x1080
leaq 0x1c(%rsp), %rdi
callq 0x32fe
movq %rax, %r14
pushq $0x10
popq %rsi
pushq $0x5
popq %r13
movq %rbx, %rdi
movl %r13d, %edx
callq 0x333a
addl %r15d, 0x24(%rsp)
addl %ebp, %r12d
movl %r15d, %edx
movl %ebp, %eax
movq %rax, 0x40(%rsp)
movq %r14, %rax
movq %rbx, %rdi
movl %r12d, 0x34(%rsp)
cmpl 0x24(%rsp), %edx
jae 0x3201
movq 0x40(%rsp), %r15
movq %rdx, 0x28(%rsp)
cmpl %r12d, %r15d
jae 0x31f9
movzwl (%rdi), %ecx
imulq %rdx, %rcx
addq 0x10(%rdi), %rcx
movzbl (%r15,%rcx), %ebp
movq 0x8(%r14,%rbp,8), %rcx
testq %rcx, %rcx
jne 0x31ee
movq %rax, %rbx
movzwl (%r14), %esi
movl %r13d, %edx
movq %rdi, %r12
callq 0x333a
movl 0x1c(%rsp), %eax
cmpl $0xfff, %eax            # imm = 0xFFF
jg 0x31b6
pushq $0x1
popq %rdx
movl %r13d, %ecx
shll %cl, %edx
xorl %ecx, %ecx
cmpl %edx, %eax
sete %cl
addl %ecx, %r13d
leal 0x1(%rax), %ecx
movl %ecx, 0x1c(%rsp)
movzwl %ax, %edi
callq 0x33d7
movq %rax, 0x8(%r14,%rbp,8)
movq %rbx, %rax
jmp 0x31da
movq %r12, %rdi
pushq $0x10
popq %rsi
movl %r13d, %edx
callq 0x333a
movq %rbx, %rdi
callq 0x33f1
leaq 0x1c(%rsp), %rdi
callq 0x32fe
pushq $0x5
popq %r13
movq 0x8(%rax,%rbp,8), %rcx
movq 0x10(%rsp), %rdi
movl 0x34(%rsp), %r12d
movq 0x28(%rsp), %rdx
incq %r15
movq %rcx, %r14
jmp 0x3147
incq %rdx
jmp 0x3133
movq %rax, %r15
movzwl (%r14), %esi
movl %r13d, %edx
callq 0x333a
pushq $0x11
popq %rsi
movq 0x10(%rsp), %rdi
movl %r13d, %edx
callq 0x333a
movq 0x10(%rsp), %r8
movl 0x8(%r8), %ecx
pushq $0x8
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movl %eax, %ebp
testb $0x7, %cl
je 0x3246
movb 0x28(%r8), %al
movslq %ebp, %rcx
incl %ebp
movb %al, 0x2d(%r8,%rcx)
testl %ebp, %ebp
je 0x327c
movl 0x4(%r8), %edi
leaq 0x23(%rsp), %rsi
movb %bpl, (%rsi)
pushq $0x1
popq %rdx
callq 0x1080
movq 0x10(%rsp), %rax
movl 0x4(%rax), %edi
movq 0x10(%rsp), %rax
leaq 0x2d(%rax), %rsi
movslq %ebp, %rdx
callq 0x1080
movq 0x10(%rsp), %r8
movl 0x4(%r8), %edi
leaq 0x177c(%rip), %rsi      # 0x4a03
pushq $0x1
popq %rdx
movq %r8, %rbx
callq 0x1080
andl $0x0, 0x28(%rbx)
andl $0x0, 0x8(%rbx)
movq %r15, %rdi
callq 0x33f1
movdqu 0x10(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testw %r12w, %r12w
je 0x32b1
movw $0x1, %r13w
xorl %ebp, %ebp
movw $0x1, %r14w
jmp 0x2fa6