// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/lundump.c
// Function: LoadFunction
static Proto* LoadFunction(LoadState* S, TString* p)
{
 Proto* f;
 if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
 f=luaF_newproto(S->L);
 setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
 f->source=LoadString(S); if (f->source==NULL) f->source=p;
 f->linedefined=LoadInt(S);
 f->lastlinedefined=LoadInt(S);
 f->nups=LoadByte(S);
 f->numparams=LoadByte(S);
 f->is_vararg=LoadByte(S);
 f->maxstacksize=LoadByte(S);
 LoadCode(S,f);
 LoadConstants(S,f);
 LoadDebug(S,f);
 IF (!luaG_checkcode(f), "bad code");
 S->L->top--;
 S->L->nCcalls--;
 return f;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %r12
movl 0x60(%r12), %eax
incl %eax
movw %ax, 0x60(%r12)
movzwl %ax, %eax
cmpl $0xc9, %eax
jae 0x60722
movq %rsi, %r15
movl $0x78, %ecx
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5d2f2
movq %rax, %r14
movq 0x20(%r12), %rax
movq 0x28(%rax), %rcx
movq %rcx, (%r14)
movq %r14, 0x28(%rax)
movb 0x20(%rax), %al
andb $0x3, %al
movb %al, 0x9(%r14)
movb $0x9, 0x8(%r14)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x50(%r14)
movdqu %xmm0, 0x40(%r14)
movdqu %xmm0, 0x30(%r14)
movdqu %xmm0, 0x20(%r14)
movdqu %xmm0, 0x10(%r14)
movq $0x0, 0x60(%r14)
movl $0x0, 0x70(%r14)
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq %r14, (%rax)
movl $0x9, 0x8(%rax)
movq (%rbx), %rdi
movq 0x38(%rdi), %rax
subq 0x10(%rdi), %rax
cmpq $0x10, %rax
jg 0x6019e
movl $0x1, %esi
callq 0x576ac
movq (%rbx), %rax
addq $0x10, 0x10(%rax)
movq %rbx, %rdi
callq 0x607f3
testq %rax, %rax
cmovneq %rax, %r15
movq %r15, 0x40(%r14)
movq %rbx, %rdi
callq 0x6085f
movl %eax, 0x60(%r14)
movq %rbx, %rdi
callq 0x6085f
movl %eax, 0x64(%r14)
leaq 0x4(%rsp), %r15
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6074d
movb (%r15), %al
movb %al, 0x70(%r14)
leaq 0x5(%rsp), %r15
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6074d
movb (%r15), %al
movb %al, 0x71(%r14)
leaq 0x6(%rsp), %r15
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6074d
movb (%r15), %al
movb %al, 0x72(%r14)
leaq 0x7(%rsp), %r15
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6074d
movb (%r15), %al
movb %al, 0x73(%r14)
movq %rbx, %rdi
callq 0x6085f
movq (%rbx), %rdi
cmpl $-0x2, %eax
jle 0x606eb
movl %eax, %ebp
movslq %eax, %r15
shlq $0x2, %r15
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
callq 0x5d2f2
movq %rax, 0x18(%r14)
movl %ebp, 0x50(%r14)
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x6074d
movq %rbx, %rdi
callq 0x6085f
movq (%rbx), %rdi
cmpl $-0x1, %eax
jl 0x606eb
movl %eax, %r15d
movslq %eax, %rcx
shlq $0x4, %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5d2f2
movq %rax, 0x10(%r14)
movl %r15d, 0x4c(%r14)
movl %r15d, %ecx
movq %rcx, 0x8(%rsp)
testl %r15d, %r15d
jle 0x603c3
leal 0x3(%r15), %ecx
movq 0x8(%rsp), %rdx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %ecx
shlq $0x6, %rcx
movdqa 0x8d62b(%rip), %xmm1    # 0xed910
movdqa 0x8d633(%rip), %xmm2    # 0xed920
xorl %edx, %edx
movdqa 0x8d639(%rip), %xmm3    # 0xed930
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x8d649(%rip), %xmm5    # 0xed950
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x60344
movl $0x0, 0x8(%rax,%rdx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x6035b
movl $0x0, 0x18(%rax,%rdx)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %esi
testb $0x1, %sil
je 0x6039b
movl $0x0, 0x28(%rax,%rdx)
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x603ae
movl $0x0, 0x38(%rax,%rdx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x40, %rdx
cmpq %rdx, %rcx
jne 0x60307
testl %r15d, %r15d
jle 0x60485
movq %r14, %r12
addq $0x10, %r12
shlq $0x4, 0x8(%rsp)
xorl %r13d, %r13d
leaq 0x8cf51(%rip), %r15     # 0xed334
movq (%r12), %rbp
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x3(%rsp), %rsi
callq 0x6074d
movzbl 0x3(%rsp), %eax
cmpq $0x4, %rax
ja 0x606f9
movslq (%r15,%rax,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x2(%rsp), %rsi
callq 0x6074d
xorl %eax, %eax
cmpb $0x0, 0x2(%rsp)
setne %al
movl %eax, (%rbp,%r13)
movl $0x1, %eax
jmp 0x60471
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x6074d
movq 0x10(%rsp), %xmm0
movq %xmm0, (%rbp,%r13)
movl $0x3, %eax
jmp 0x60471
movq %rbx, %rdi
callq 0x607f3
movq %rax, (%rbp,%r13)
movl $0x4, %eax
movl %eax, 0x8(%rbp,%r13)
addq $0x10, %r13
cmpq %r13, 0x8(%rsp)
jne 0x603e3
movq %rbx, %rdi
callq 0x6085f
movq (%rbx), %rdi
cmpl $-0x1, %eax
jl 0x606eb
movl %eax, %ebp
movslq %eax, %rcx
shlq $0x3, %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5d2f2
movq %rax, 0x20(%r14)
movl %ebp, 0x58(%r14)
movl %ebp, %r15d
testl %ebp, %ebp
jle 0x604d0
xorl %eax, %eax
movq 0x20(%r14), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r15
jne 0x604bc
testl %ebp, %ebp
jle 0x604f3
xorl %r12d, %r12d
movq 0x40(%r14), %rsi
movq %rbx, %rdi
callq 0x600dc
movq 0x20(%r14), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x604d7
movq %rbx, %rdi
callq 0x6085f
movq (%rbx), %rdi
cmpl $-0x1, %eax
jl 0x606eb
movl %eax, %ebp
movslq %eax, %r15
shlq $0x2, %r15
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
callq 0x5d2f2
movq %rax, 0x28(%r14)
movl %ebp, 0x54(%r14)
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x6074d
movq %rbx, %rdi
callq 0x6085f
movq (%rbx), %rdi
cmpl $-0x2, %eax
jle 0x606eb
movl %eax, %r15d
movslq %eax, %rcx
shlq $0x4, %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5d2f2
movq %rax, 0x30(%r14)
movl %r15d, 0x5c(%r14)
testl %r15d, %r15d
jle 0x6064e
movl %r15d, %r12d
leal 0x1(%r15), %ecx
leaq -0x1(%r12), %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %ecx
shlq $0x5, %rcx
movdqa 0x8d392(%rip), %xmm1    # 0xed920
xorl %edx, %edx
movdqa 0x8d398(%rip), %xmm2    # 0xed930
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x8d3b8(%rip), %xmm4    # 0xed960
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x605e2
movq $0x0, (%rax,%rdx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x605fa
movq $0x0, 0x10(%rax,%rdx)
paddq %xmm4, %xmm1
addq $0x20, %rdx
cmpq %rdx, %rcx
jne 0x605a8
testl %r15d, %r15d
jle 0x6064e
shlq $0x4, %r12
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x607f3
movq 0x30(%r14), %rcx
movq %rax, (%rcx,%r15)
movq %rbx, %rdi
callq 0x6085f
movq 0x30(%r14), %rcx
movl %eax, 0x8(%rcx,%r15)
movq %rbx, %rdi
callq 0x6085f
movq 0x30(%r14), %rcx
movl %eax, 0xc(%rcx,%r15)
addq $0x10, %r15
cmpq %r15, %r12
jne 0x60613
movq %rbx, %rdi
callq 0x6085f
movq (%rbx), %rdi
cmpl $-0x1, %eax
jl 0x606eb
movl %eax, %ebp
movslq %eax, %rcx
shlq $0x3, %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5d2f2
movq %rax, 0x38(%r14)
movl %ebp, 0x48(%r14)
testl %ebp, %ebp
jle 0x606b8
movl %ebp, %r15d
xorl %eax, %eax
movq 0x38(%r14), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r15
jne 0x60685
testl %ebp, %ebp
jle 0x606b8
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x607f3
movq 0x38(%r14), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x606a0
movl 0x50(%r14), %esi
movq %r14, %rdi
movl $0xff, %edx
callq 0x5cb67
movq (%rbx), %rdi
testl %eax, %eax
je 0x60739
addq $-0x10, 0x10(%rdi)
decw 0x60(%rdi)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8d6dc(%rip), %rsi     # 0xeddce
xorl %eax, %eax
callq 0x57b1c
movq (%rbx), %rdi
movq 0x18(%rbx), %rdx
leaq 0x8d84a(%rip), %rsi     # 0xedf51
leaq 0x8d882(%rip), %rcx     # 0xedf90
xorl %eax, %eax
callq 0x5d33c
movq (%rbx), %rdi
movl $0x3, %esi
callq 0x5d170
movq 0x18(%rbx), %rdx
leaq 0x8d824(%rip), %rsi     # 0xedf51
leaq 0x8d839(%rip), %rcx     # 0xedf6d
movq %r12, %rdi
jmp 0x6070e
movq 0x18(%rbx), %rdx
leaq 0x8d80d(%rip), %rsi     # 0xedf51
leaq 0x8d830(%rip), %rcx     # 0xedf7b
jmp 0x6070e