// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbi_write_hdr_core
static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data)
{
   if (y <= 0 || x <= 0 || data == NULL)
      return 0;
   else {
      // Each component is stored separately. Allocate scratch space for full output scanline.
      unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4);
      int i, len;
      char buffer[128];
      char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n";
      s->func(s->context, header, sizeof(header)-1);

#ifdef __STDC_WANT_SECURE_LIB__
      len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE=          1.0000000000000\n\n-Y %d +X %d\n", y, x);
#else
      len = sprintf(buffer, "EXPOSURE=          1.0000000000000\n\n-Y %d +X %d\n", y, x);
#endif
      s->func(s->context, buffer, len);

      for(i=0; i < y; i++)
         stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i));
      STBIW_FREE(scratch);
      return 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %ecx, %r15d
movl %edx, %ebx
testl %edx, %edx
setle %al
testl %esi, %esi
setle %cl
orb %al, %cl
movq %r8, -0x90(%rbp)
testq %r8, %r8
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x1d13
movl %esi, %r14d
movq %rdi, %r13
leal (,%r14,4), %edi
callq 0x1170
movq %rax, %r12
leaq 0xde85(%rip), %rsi      # 0xf7c0
leaq -0x120(%rbp), %rax
movl $0x8, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movw $0xa, 0x40(%rax)
movq 0x8(%r13), %rdi
movq %rax, %rsi
movl $0x41, %edx
callq *(%r13)
leaq 0xd5ef(%rip), %rsi      # 0xef59
movq %r14, -0x40(%rbp)
leaq -0x1a0(%rbp), %r14
movq %r14, %rdi
movl %ebx, %edx
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x11f0
movq 0x8(%r13), %rdi
movq %r14, %rsi
movq -0x40(%rbp), %r14
movl %eax, %edx
callq *(%r13)
xorl %eax, %eax
movl %r15d, %ecx
imull %r14d, %ecx
movl %ecx, -0x6c(%rbp)
movl %r14d, %ecx
shrl $0x8, %ecx
movl %ecx, -0x68(%rbp)
leal -0x8000(%r14), %ecx
movl %ecx, -0x64(%rbp)
leal (%r14,%r14), %ecx
leal (%r14,%r14,2), %edx
movslq %r15d, %rsi
addl $-0x3, %r15d
movl %r14d, %edi
leaq (%r12,%rdi), %r8
movq %r8, -0xa8(%rbp)
addq %r12, %rcx
movq %rcx, -0xb8(%rbp)
addq %r12, %rdx
movq %rdx, -0xb0(%rbp)
movq %rdi, %rdx
leaq -0x3(%rdi), %rcx
movq %rcx, -0xd0(%rbp)
movq %rdi, %rcx
negq %rcx
movq %rcx, -0xa0(%rbp)
shlq $0x2, %rsi
movq %rsi, -0x78(%rbp)
movq %rdi, -0x58(%rbp)
movl %r15d, -0x44(%rbp)
movl %ebx, -0x70(%rbp)
movq %r12, -0xc0(%rbp)
movq %r13, -0x60(%rbp)
movq %rax, %rcx
notl %eax
addl %ebx, %eax
cmpl $0x0, 0x10703(%rip)     # 0x12130
movq %rcx, -0x98(%rbp)
cmovel %ecx, %eax
imull -0x6c(%rbp), %eax
cltq
movq -0x90(%rbp), %rcx
leaq (%rcx,%rax,4), %rbx
movl $0x202, -0x34(%rbp)     # imm = 0x202
movl -0x68(%rbp), %eax
movb %al, -0x32(%rbp)
movb %r14b, -0x31(%rbp)
cmpl $0xffff8008, -0x64(%rbp) # imm = 0xFFFF8008
jae 0x1aca
movq %rdx, %r14
cmpl $0x1, %r15d
ja 0x1a7b
movss 0x8(%rbx), %xmm0
movss (%rbx), %xmm1
movss 0x4(%rbx), %xmm2
jmp 0x1a85
movss (%rbx), %xmm0
movaps %xmm0, %xmm2
movaps %xmm0, %xmm1
movss %xmm0, -0x48(%rbp)
movss %xmm2, -0x4c(%rbp)
movss %xmm1, -0x50(%rbp)
leaq -0x2e(%rbp), %r15
movq %r15, %rdi
leaq -0x50(%rbp), %rsi
callq 0xa11d
movq 0x8(%r13), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq *(%r13)
addq -0x78(%rbp), %rbx
decq %r14
movq -0x58(%rbp), %rdx
movl -0x44(%rbp), %r15d
jne 0x1a65
jmp 0x1cee
xorl %r14d, %r14d
cmpl $0x1, %r15d
ja 0x1ae3
movss 0x8(%rbx), %xmm0
movss (%rbx), %xmm1
movss 0x4(%rbx), %xmm2
jmp 0x1aed
movss (%rbx), %xmm0
movaps %xmm0, %xmm2
movaps %xmm0, %xmm1
movss %xmm0, -0x48(%rbp)
movss %xmm2, -0x4c(%rbp)
movss %xmm1, -0x50(%rbp)
leaq -0x2e(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa11d
movb -0x2e(%rbp), %al
movb %al, (%r12,%r14)
movb -0x2d(%rbp), %al
movq -0xa8(%rbp), %rcx
movb %al, (%rcx,%r14)
movb -0x2c(%rbp), %al
movq -0xb8(%rbp), %rcx
movb %al, (%rcx,%r14)
movb -0x2b(%rbp), %al
movq -0xb0(%rbp), %rcx
movb %al, (%rcx,%r14)
incq %r14
addq -0x78(%rbp), %rbx
movq -0xa0(%rbp), %rax
addq %r14, %rax
jne 0x1acd
movq 0x8(%r13), %rdi
leaq -0x34(%rbp), %rsi
movl $0x4, %edx
callq *(%r13)
movq %r12, %rdi
xorl %eax, %eax
movq -0x58(%rbp), %rdx
movq %rax, -0xc8(%rbp)
movq %rax, %r8
imulq %rdx, %r8
addq %r12, %r8
xorl %r15d, %r15d
movq -0x40(%rbp), %r9
movq %r8, -0x88(%rbp)
movq %rdi, -0x80(%rbp)
leal 0x2(%r15), %eax
movl %r9d, %r12d
cmpl %r9d, %eax
jge 0x1bc8
movslq %r15d, %rax
movb (%r8,%rax), %cl
decq %rax
movl %r15d, %r12d
movq -0xd0(%rbp), %rsi
movb 0x2(%rdi,%rax), %dl
cmpb %dl, %cl
jne 0x1bb8
cmpb 0x3(%rdi,%rax), %cl
je 0x1bc8
incl %r12d
incq %rax
movl %edx, %ecx
cmpq %rsi, %rax
jl 0x1baa
movl %r9d, %r12d
cmpl %r12d, %r15d
jge 0x1c18
movq -0x60(%rbp), %r13
movl %r12d, %ebx
subl %r15d, %ebx
movl $0x80, %eax
cmpl %eax, %ebx
cmovgel %eax, %ebx
movslq %r15d, %r15
leaq (%r8,%r15), %r14
movb %bl, -0x29(%rbp)
movq 0x8(%r13), %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq *(%r13)
movq 0x8(%r13), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq *(%r13)
movq -0x88(%rbp), %r8
addl %ebx, %r15d
cmpl %r12d, %r15d
jl 0x1bd1
leal 0x2(%r12), %eax
movq -0x40(%rbp), %rdi
cmpl %edi, %eax
jge 0x1c54
movslq %r15d, %rax
movb (%r8,%rax), %cl
movslq %r12d, %rax
incl %r12d
cmpl %r12d, %edi
cmovgl %edi, %r12d
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %r13
movq -0x80(%rbp), %rsi
cmpb %cl, (%rsi,%rax)
jne 0x1c5a
incq %rax
cmpq %rdx, %rax
jl 0x1c45
jmp 0x1c5d
movq -0x60(%rbp), %r13
jmp 0x1cb7
movl %eax, %r12d
cmpl %r12d, %r15d
jge 0x1cb7
leaq -0x2a(%rbp), %r14
movl %r12d, %ebx
subl %r15d, %ebx
cmpl $0x7f, %ebx
movl $0x7f, %eax
cmovgel %eax, %ebx
movslq %r15d, %r15
movb (%r8,%r15), %al
movb %al, -0x29(%rbp)
leal -0x80(%rbx), %eax
movb %al, -0x2a(%rbp)
movq 0x8(%r13), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq *(%r13)
movq 0x8(%r13), %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq *(%r13)
movq -0x88(%rbp), %r8
addl %ebx, %r15d
cmpl %r12d, %r15d
jl 0x1c66
movq -0x40(%rbp), %r9
cmpl %r9d, %r15d
movq -0x80(%rbp), %rdi
jl 0x1b8a
movq -0xc8(%rbp), %rax
incq %rax
movq -0x58(%rbp), %rdx
addq %rdx, %rdi
cmpq $0x4, %rax
movl -0x44(%rbp), %r15d
movq -0xc0(%rbp), %r12
jne 0x1b67
movq -0x98(%rbp), %rax
incl %eax
movl -0x70(%rbp), %ebx
cmpl %ebx, %eax
movq -0x40(%rbp), %r14
jne 0x1a1f
movq %r12, %rdi
callq 0x1030
movl $0x1, %eax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq