// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/lua/lstrlib.c
// Function: packint
static void packint (luaL_Buffer *b, lua_Unsigned n,
                     int islittle, int size, int neg) {
  char *buff = luaL_prepbuffsize(b, size);
  int i;
  buff[islittle ? 0 : size - 1] = (char)(n & MC);  /* first byte */
  for (i = 1; i < size; i++) {
    n >>= NB;
    buff[islittle ? i : size - 1 - i] = (char)(n & MC);
  }
  if (neg && size > SZINT) {  /* negative number need sign extension? */
    for (i = SZINT; i < size; i++)  /* correct extra bytes */
      buff[islittle ? i : size - 1 - i] = (char)MC;
  }
  luaL_addsize(b, size);  /* add result to buffer */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r12d
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %r14
movslq %ecx, %r15
movq %r15, %rsi
callq 0x151bd
leal -0x1(%r15), %ecx
xorl %edx, %edx
testl %ebp, %ebp
cmovel %ecx, %edx
movslq %edx, %rcx
movb %r13b, (%rax,%rcx)
cmpl $0x2, %r15d
jl 0x1f50a
leal -0x2(%rbx), %ecx
movl $0x1, %edx
shrq $0x8, %r13
testl %ebp, %ebp
movl %edx, %esi
cmovel %ecx, %esi
movslq %esi, %rsi
movb %r13b, (%rax,%rsi)
incl %edx
addl $-0x1, %ecx
jb 0x1f180
testl %r12d, %r12d
sete %cl
cmpl $0x9, %ebx
setl %dl
orb %cl, %dl
jne 0x1f50a
leal 0x7(%rbx), %ecx
leal -0x9(%rbx), %edx
movd %edx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
addl $-0x18, %ebx
andl $-0x10, %ecx
negl %ecx
movl $0x17, %edx
movdqa 0x52ef(%rip), %xmm1     # 0x244c0
movdqa 0x52f7(%rip), %xmm2     # 0x244d0
movdqa 0x52ff(%rip), %xmm3     # 0x244e0
movdqa 0x5307(%rip), %xmm4     # 0x244f0
movdqa 0x2f0f(%rip), %xmm5     # 0x22100
pxor %xmm5, %xmm0
pcmpeqd %xmm6, %xmm6
leal -0x17(%rdx), %esi
movd %esi, %xmm7
movdqa %xmm7, %xmm8
pxor %xmm5, %xmm8
pcmpgtd %xmm0, %xmm8
movd %xmm8, %esi
notl %esi
testb $0x1, %sil
je 0x1f22e
leal -0xf(%rdx), %esi
leal 0xf(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
pshufd $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,0,0,0]
movdqa %xmm7, %xmm8
por %xmm4, %xmm8
pxor %xmm5, %xmm8
pcmpgtd %xmm0, %xmm8
pxor %xmm6, %xmm8
movdqa %xmm8, %xmm9
psrlq $0x18, %xmm9
movd %xmm9, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1f277
leal -0xe(%rdx), %esi
leal 0xe(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
psrldq $0x6, %xmm8             # xmm8 = xmm8[6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero
movd %xmm8, %esi
shrl $0x10, %esi
testb $0x1, %sil
je 0x1f29d
leal -0xd(%rdx), %esi
leal 0xd(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
packsswb %xmm8, %xmm8
movd %xmm8, %esi
shrl $0x18, %esi
testb $0x1, %sil
je 0x1f2c2
leal -0xc(%rdx), %esi
leal 0xc(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
movdqa %xmm7, %xmm8
por %xmm3, %xmm8
pxor %xmm5, %xmm8
pcmpgtd %xmm0, %xmm8
pshufd $0x0, %xmm8, %xmm9      # xmm9 = xmm8[0,0,0,0]
pxor %xmm6, %xmm9
pextrw $0x2, %xmm9, %esi
testb $0x1, %sil
je 0x1f2ff
leal -0xb(%rdx), %esi
leal 0xb(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
pxor %xmm6, %xmm8
movdqa %xmm8, %xmm9
pslldq $0x6, %xmm9             # xmm9 = zero,zero,zero,zero,zero,zero,xmm9[0,1,2,3,4,5,6,7,8,9]
packsswb %xmm9, %xmm9
pextrw $0x2, %xmm9, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1f335
leal -0xa(%rdx), %esi
leal 0xa(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
pextrw $0x4, %xmm8, %esi
testb $0x1, %sil
je 0x1f353
leal -0x9(%rdx), %esi
leal 0x9(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
psrldq $0x5, %xmm8             # xmm8 = xmm8[5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero
pextrw $0x3, %xmm8, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1f37a
leal -0x8(%rdx), %esi
leal 0x8(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
movdqa %xmm7, %xmm8
por %xmm2, %xmm8
pxor %xmm5, %xmm8
pcmpgtd %xmm0, %xmm8
pshufd $0x44, %xmm8, %xmm9     # xmm9 = xmm8[0,1,0,1]
pxor %xmm6, %xmm9
pextrw $0x4, %xmm9, %esi
testb $0x1, %sil
je 0x1f3b7
leal -0x7(%rdx), %esi
leal 0x7(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
movdqa %xmm8, %xmm9
pxor %xmm6, %xmm9
movdqa %xmm9, %xmm10
pslldq $0x5, %xmm10            # xmm10 = zero,zero,zero,zero,zero,xmm10[0,1,2,3,4,5,6,7,8,9,10]
pextrw $0x4, %xmm10, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1f3ed
leal -0x6(%rdx), %esi
leal 0x6(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
pshufhw $0x0, %xmm8, %xmm8      # xmm8 = xmm8[0,1,2,3,4,4,4,4]
pxor %xmm6, %xmm8
pextrw $0x5, %xmm8, %esi
testb $0x1, %sil
je 0x1f416
leal -0x5(%rdx), %esi
leal 0x5(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
psrldq $0x6, %xmm9             # xmm9 = xmm9[6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero
packsswb %xmm9, %xmm8
pextrw $0x5, %xmm8, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1f442
leal -0x4(%rdx), %esi
leal 0x4(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
por %xmm1, %xmm7
pxor %xmm5, %xmm7
pcmpgtd %xmm0, %xmm7
pshufd $0x0, %xmm7, %xmm8      # xmm8 = xmm7[0,0,0,0]
pxor %xmm6, %xmm8
pextrw $0x6, %xmm8, %esi
testb $0x1, %sil
je 0x1f477
leal -0x3(%rdx), %esi
leal 0x3(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
movdqa %xmm7, %xmm8
pxor %xmm6, %xmm8
movdqa %xmm8, %xmm9
pslldq $0x6, %xmm9             # xmm9 = zero,zero,zero,zero,zero,zero,xmm9[0,1,2,3,4,5,6,7,8,9]
packsswb %xmm9, %xmm9
pextrw $0x6, %xmm9, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1f4b2
leal -0x2(%rdx), %esi
leal 0x2(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
pshufhw $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,1,2,3,4,4,4,4]
pxor %xmm6, %xmm7
pextrw $0x7, %xmm7, %esi
testb $0x1, %sil
je 0x1f4d8
leal -0x1(%rdx), %esi
leal 0x1(%rbx), %edi
testl %ebp, %ebp
cmovnel %esi, %edi
movslq %edi, %rsi
movb $-0x1, (%rax,%rsi)
pextrw $0x7, %xmm8, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1f4f5
testl %ebp, %ebp
movl %edx, %esi
cmovel %ebx, %esi
movslq %esi, %rsi
movb $-0x1, (%rax,%rsi)
addl $-0x10, %ebx
leal (%rcx,%rdx), %esi
addl $0x10, %esi
addl $0x10, %edx
cmpl $0x17, %esi
jne 0x1f1f9
addq %r15, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq