// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: stbrp_pack_rects
STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
{
   int i, all_rects_packed = 1;

   /*  we use the 'was_packed' field internally to allow sorting/unsorting */
   for (i=0; i < num_rects; ++i) {
      rects[i].was_packed = i;
   }

   /*  sort according to heuristic */
   STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare);

   for (i=0; i < num_rects; ++i) {
      if (rects[i].w == 0 || rects[i].h == 0) {
         rects[i].x = rects[i].y = 0;  /*  empty rect needs no space */
      } else {
         stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
         if (fr.prev_link) {
            rects[i].x = (stbrp_coord) fr.x;
            rects[i].y = (stbrp_coord) fr.y;
         } else {
            rects[i].x = rects[i].y = STBRP__MAXVAL;
         }
      }
   }

   /*  unsort */
   STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);

   /*  set was_packed flags and all_rects_packed status */
   for (i=0; i < num_rects; ++i) {
      rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
      if (!rects[i].was_packed)
         all_rects_packed = 0;
   }

   /*  return the all_rects_packed status */
   return all_rects_packed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %r14d
movq %rsi, %r12
testl %edx, %edx
jle 0x2cce9
movq %rdi, %rbp
movl %r14d, %ebx
leal 0x1(%r14), %eax
andl $-0x2, %eax
leaq -0x1(%rbx), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x14(%r12), %rcx
movdqa 0x40d00(%rip), %xmm1    # 0x6d590
xorl %edx, %edx
movdqa 0x40cd6(%rip), %xmm2    # 0x6d570
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x40d86(%rip), %xmm4    # 0x6d630
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 0x2c8de
movl %edx, (%rcx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x2c8f3
leal 0x1(%rdx), %esi
movl %esi, 0x18(%rcx)
addq $0x2, %rdx
paddq %xmm4, %xmm1
addq $0x30, %rcx
cmpq %rdx, %rax
jne 0x2c8aa
leaq 0x480(%rip), %rcx       # 0x2cd8b
movl $0x18, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12450
testl %r14d, %r14d
jle 0x2cd03
movq %r14, 0x60(%rsp)
leaq 0x18(%rbp), %rax
movq %rax, 0x18(%rsp)
xorl %r14d, %r14d
movq %rbp, 0x28(%rsp)
movq %r12, 0x48(%rsp)
movq %rbx, 0x40(%rsp)
leaq (%r14,%r14,2), %rax
leaq (%r12,%rax,8), %r8
movl 0x4(%r8), %esi
movl $0xc, %edi
movl $0x10, %r10d
testl %esi, %esi
je 0x2c9f5
movl 0x8(%r8), %ecx
movq %rcx, 0x20(%rsp)
testl %ecx, %ecx
je 0x2c9f5
movl 0x8(%rbp), %ecx
leal (%rsi,%rcx), %r15d
decl %r15d
movl %r15d, %eax
cltd
idivl %ecx
subl %edx, %r15d
movl %r15d, %eax
cltd
idivl %ecx
testl %edx, %edx
jne 0x2cd6c
movl (%rbp), %eax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpl %eax, %r15d
jg 0x2cb99
movq 0x20(%rsp), %rcx
cmpl %ecx, 0x4(%rbp)
jl 0x2cb99
movq %rsi, 0x38(%rsp)
movq %r8, 0x50(%rsp)
movq 0x18(%rsp), %rbx
movq (%rbx), %r13
movl (%r13), %esi
leal (%rsi,%r15), %ecx
cmpl %eax, %ecx
jle 0x2c9fe
movl 0x10(%rbp), %ecx
xorl %r12d, %r12d
movl $0x40000000, 0xc(%rsp)  # imm = 0x40000000
movl $0x40000000, 0x14(%rsp) # imm = 0x40000000
movl $0x0, 0x10(%rsp)
jmp 0x2caaa
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x2cb9e
movl $0x40000000, 0xc(%rsp)  # imm = 0x40000000
xorl %r12d, %r12d
movl $0x40000000, 0x14(%rsp) # imm = 0x40000000
movq %r13, %rdi
movl %r15d, %edx
leaq 0x34(%rsp), %rcx
callq 0x541e5
movl 0x10(%rbp), %ecx
testl %ecx, %ecx
je 0x2ca60
movq 0x20(%rsp), %rdx
addl %eax, %edx
cmpl 0x4(%rbp), %edx
jg 0x2ca71
movl 0x34(%rsp), %edx
cmpl 0xc(%rsp), %eax
jl 0x2ca53
sete %sil
cmpl 0x14(%rsp), %edx
setl %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x2ca71
movl %edx, 0x14(%rsp)
movl %eax, 0xc(%rsp)
movq %rbx, %r12
jmp 0x2ca71
movl 0xc(%rsp), %edx
cmpl %edx, %eax
cmovll %eax, %edx
movl %edx, 0xc(%rsp)
cmovlq %rbx, %r12
movq %r13, %rbx
movq 0x8(%r13), %r13
addq $0x8, %rbx
movl (%r13), %esi
leal (%rsi,%r15), %eax
cmpl (%rbp), %eax
jle 0x2ca11
testq %r12, %r12
je 0x2ca9a
movq (%r12), %rax
movl (%rax), %eax
movl %eax, 0x10(%rsp)
jmp 0x2caa5
xorl %r12d, %r12d
movl $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rbx
movq %r12, 0x58(%rsp)
cmpl $0x1, %ecx
jne 0x2cb5d
movq (%rbx), %r13
movq %r13, %rbx
cmpl %r15d, (%r13)
jge 0x2cad0
movq %r13, %rbx
movq 0x8(%rbx), %rbx
cmpl %r15d, (%rbx)
jl 0x2cac7
movq 0x18(%rsp), %r12
movl (%rbx), %ebp
subl %r15d, %ebp
movq %r12, %rax
movq %r13, %rcx
js 0x2cd2e
movq %rcx, %r13
movq %rax, %r12
leaq 0x8(%rcx), %rax
movq 0x8(%rcx), %rcx
cmpl %ebp, (%rcx)
jle 0x2cae6
cmpl %ebp, (%r13)
jg 0x2cd4d
movq %r13, %rdi
movl %ebp, %esi
movl %r15d, %edx
leaq 0x30(%rsp), %rcx
callq 0x541e5
movq 0x20(%rsp), %rcx
addl %eax, %ecx
movq 0x28(%rsp), %rdx
cmpl 0x4(%rdx), %ecx
jg 0x2cb50
cmpl 0xc(%rsp), %eax
jg 0x2cb50
movl 0x30(%rsp), %ecx
jb 0x2cb3f
cmpl 0x14(%rsp), %ecx
jl 0x2cb3f
jne 0x2cb50
cmpl 0x10(%rsp), %ebp
jge 0x2cb50
movl %ecx, 0x14(%rsp)
movl %ebp, 0x10(%rsp)
movl %eax, 0xc(%rsp)
movq %r12, 0x58(%rsp)
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x2cad5
movq 0x58(%rsp), %r11
testq %r11, %r11
je 0x2cbb7
movq 0x20(%rsp), %rax
addl 0xc(%rsp), %eax
movq 0x28(%rsp), %rbp
cmpl 0x4(%rbp), %eax
movq 0x48(%rsp), %r12
movq 0x40(%rsp), %rbx
movq 0x50(%rsp), %r8
movl $0xc, %edi
movl $0x10, %r10d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
jle 0x2cbe2
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %edx, (%r8,%r10)
movl %ecx, (%r8,%rdi)
incq %r14
cmpq %rbx, %r14
jne 0x2c944
jmp 0x2cc7f
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq 0x48(%rsp), %r12
movq 0x40(%rsp), %rbx
movq 0x28(%rsp), %rbp
movq 0x50(%rsp), %r8
movl $0xc, %edi
movl $0x10, %r10d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
jmp 0x2cb9e
movq %rax, %rsi
movq 0x20(%rbp), %rax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
testq %rax, %rax
je 0x2cb9e
movl 0x10(%rsp), %edx
movl %edx, (%rax)
movl %esi, 0x4(%rax)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rbp)
movq (%r11), %rcx
cmpl %edx, (%rcx)
jge 0x2cc19
movq 0x8(%rcx), %rdx
addq $0x8, %rcx
movq %rcx, %r11
movq %rdx, %rcx
movq 0x38(%rsp), %r9
movq %rax, (%r11)
movq 0x8(%rcx), %rsi
addl 0x10(%rsp), %r9d
testq %rsi, %rsi
je 0x2cc58
leaq 0x8(%rcx), %rdi
cmpl %r9d, (%rsi)
jg 0x2cc58
movq %rsi, %rdx
movq 0x20(%rbp), %rsi
movq %rsi, (%rdi)
movq %rcx, 0x20(%rbp)
leaq 0x8(%rdx), %rdi
movq 0x8(%rdx), %rsi
movq %rdx, %rcx
testq %rsi, %rsi
jne 0x2cc33
jmp 0x2cc5b
movq %rcx, %rdx
movq %rdx, 0x8(%rax)
movl $0x10, %edi
movl $0xc, %r10d
cmpl %r9d, (%rdx)
jge 0x2cc72
movl %r9d, (%rdx)
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
jmp 0x2cb9e
leaq 0x12d(%rip), %rcx       # 0x2cdb3
movl $0x18, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12450
cmpl $0x0, 0x60(%rsp)
jle 0x2cd1a
shlq $0x3, %rbx
leaq (%rbx,%rbx,2), %rcx
movl $0x1, %esi
xorl %edx, %edx
cmpl $0x7fffffff, 0xc(%r12,%rdx) # imm = 0x7FFFFFFF
jne 0x2ccd1
xorl %eax, %eax
xorl %edi, %edi
cmpl $0x7fffffff, 0x10(%r12,%rdx) # imm = 0x7FFFFFFF
setne %dil
movl %edi, 0x14(%r12,%rdx)
jne 0x2ccda
jmp 0x2ccdc
movl $0x1, 0x14(%r12,%rdx)
movl %esi, %eax
addq $0x18, %rdx
movl %eax, %esi
cmpq %rdx, %rcx
jne 0x2ccac
jmp 0x2cd1f
movslq %r14d, %rbx
leaq 0x98(%rip), %rcx        # 0x2cd8b
movl $0x18, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12450
leaq 0xa9(%rip), %rcx        # 0x2cdb3
movl $0x18, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12450
movl $0x1, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44331(%rip), %rdi     # 0x71066
leaq 0x4407e(%rip), %rsi     # 0x70dba
leaq 0x442d9(%rip), %rcx     # 0x7101c
movl $0x2bf1, %edx           # imm = 0x2BF1
callq 0x12a50
leaq 0x4431c(%rip), %rdi     # 0x71070
leaq 0x4405f(%rip), %rsi     # 0x70dba
leaq 0x442ba(%rip), %rcx     # 0x7101c
movl $0x2bf7, %edx           # imm = 0x2BF7
callq 0x12a50
leaq 0x44293(%rip), %rdi     # 0x71006
leaq 0x44040(%rip), %rsi     # 0x70dba
leaq 0x4429b(%rip), %rcx     # 0x7101c
movl $0x2bb1, %edx           # imm = 0x2BB1
callq 0x12a50