// File: /workspace/github_c_makefile_star2_O1/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 $0x188, %rsp            # imm = 0x188
movl %ecx, %r15d
movl %edx, %ebx
testl %edx, %edx
setle %al
testl %esi, %esi
setle %cl
orb %al, %cl
movq %r8, -0xa0(%rbp)
testq %r8, %r8
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x1d48
movl %esi, %r14d
movq %rdi, %r13
leal (,%r14,4), %edi
callq 0x1170
movq %rax, %r12
leaq 0xdea6(%rip), %rsi      # 0xf7f0
leaq -0x130(%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 0xd5e0(%rip), %rsi      # 0xef59
movq %r14, -0x48(%rbp)
leaq -0x1b0(%rbp), %r14
movq %r14, %rdi
movl %ebx, %edx
movq -0x48(%rbp), %rcx
xorl %eax, %eax
callq 0x11f0
movq 0x8(%r13), %rdi
movq %r14, %rsi
movq -0x48(%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 -0x3(%rdi), %r8
movq %r8, -0xe0(%rbp)
shlq $0x2, %rsi
movq %rsi, -0x78(%rbp)
movq %rdi, %rsi
negq %rsi
movq %rsi, -0xb8(%rbp)
addq %r12, %rdx
movq %rdx, -0xc0(%rbp)
addq %r12, %rcx
movq %rcx, -0xc8(%rbp)
leaq (%r12,%rdi), %rcx
movq %rcx, -0xb0(%rbp)
leaq 0x2(%r12), %rcx
movq %rcx, -0x98(%rbp)
movq %rdi, -0x58(%rbp)
movl %r15d, -0x4c(%rbp)
movl %ebx, -0x70(%rbp)
movq %r12, -0xd0(%rbp)
movq %r13, -0x60(%rbp)
movq %rax, %rcx
notl %eax
addl %ebx, %eax
cmpl $0x0, 0x106eb(%rip)     # 0x12130
movq %rcx, -0xa8(%rbp)
cmovel %ecx, %eax
imull -0x6c(%rbp), %eax
cltq
movq -0xa0(%rbp), %rcx
leaq (%rcx,%rax,4), %rbx
movl $0x202, -0x40(%rbp)     # imm = 0x202
movl -0x68(%rbp), %eax
movb %al, -0x3e(%rbp)
movb %r14b, -0x3d(%rbp)
cmpl $0xffff8008, -0x64(%rbp) # imm = 0xFFFF8008
jae 0x1ae6
movq %rdi, %r14
cmpl $0x1, %r15d
ja 0x1a9d
movss 0x8(%rbx), %xmm0
movss %xmm0, -0x34(%rbp)
movss 0x4(%rbx), %xmm0
movss %xmm0, -0x38(%rbp)
movss (%rbx), %xmm0
jmp 0x1aab
movss (%rbx), %xmm0
movss %xmm0, -0x34(%rbp)
movss %xmm0, -0x38(%rbp)
movss %xmm0, -0x3c(%rbp)
leaq -0x2e(%rbp), %r15
movq %r15, %rdi
leaq -0x3c(%rbp), %rsi
callq 0xa4c3
movq 0x8(%r13), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq *(%r13)
addq -0x78(%rbp), %rbx
decq %r14
movq -0x58(%rbp), %rdi
movl -0x4c(%rbp), %r15d
jne 0x1a7d
jmp 0x1d23
xorl %r14d, %r14d
cmpl $0x1, %r15d
ja 0x1b09
movss 0x8(%rbx), %xmm0
movss %xmm0, -0x34(%rbp)
movss 0x4(%rbx), %xmm0
movss %xmm0, -0x38(%rbp)
movss (%rbx), %xmm0
jmp 0x1b17
movss (%rbx), %xmm0
movss %xmm0, -0x34(%rbp)
movss %xmm0, -0x38(%rbp)
movss %xmm0, -0x3c(%rbp)
leaq -0x2e(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xa4c3
movb -0x2e(%rbp), %al
movb %al, (%r12,%r14)
movb -0x2d(%rbp), %al
movq -0xb0(%rbp), %rcx
movb %al, (%rcx,%r14)
movb -0x2c(%rbp), %al
movq -0xc8(%rbp), %rcx
movb %al, (%rcx,%r14)
movb -0x2b(%rbp), %al
movq -0xc0(%rbp), %rcx
movb %al, (%rcx,%r14)
incq %r14
addq -0x78(%rbp), %rbx
movq -0xb8(%rbp), %rax
addq %r14, %rax
jne 0x1ae9
movq 0x8(%r13), %rdi
leaq -0x40(%rbp), %rsi
movl $0x4, %edx
callq *(%r13)
movq %r12, -0x88(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x80(%rbp)
xorl %eax, %eax
movq -0x58(%rbp), %rdi
movq %rax, -0xd8(%rbp)
movq %rax, %r8
imulq %rdi, %r8
addq %r12, %r8
xorl %r12d, %r12d
movq -0x48(%rbp), %r9
movq %r8, -0x90(%rbp)
leal 0x2(%r12), %eax
movl %r9d, %r15d
cmpl %r9d, %eax
jge 0x1bf7
movslq %r12d, %rax
decq %rax
movl %r12d, %r15d
movq -0xe0(%rbp), %rdx
movq -0x80(%rbp), %rsi
movb -0x1(%rsi,%rax), %cl
cmpb (%rsi,%rax), %cl
jne 0x1be9
cmpb 0x1(%rsi,%rax), %cl
je 0x1bf7
incl %r15d
incq %rax
cmpq %rdx, %rax
jl 0x1bda
movl %r9d, %r15d
cmpl %r15d, %r12d
jge 0x1c47
movq -0x60(%rbp), %r13
movl %r15d, %ebx
subl %r12d, %ebx
movl $0x80, %eax
cmpl %eax, %ebx
cmovgel %eax, %ebx
movslq %r12d, %r12
leaq (%r8,%r12), %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 -0x90(%rbp), %r8
addl %ebx, %r12d
cmpl %r15d, %r12d
jl 0x1c00
leal 0x2(%r15), %eax
movq -0x48(%rbp), %rdi
cmpl %edi, %eax
jge 0x1c85
movslq %r12d, %rax
movb (%r8,%rax), %cl
movslq %r15d, %rax
incl %r15d
cmpl %r15d, %edi
cmovgl %edi, %r15d
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %r13
movq -0x88(%rbp), %rsi
cmpb %cl, (%rsi,%rax)
jne 0x1c8b
incq %rax
cmpq %rdx, %rax
jl 0x1c76
jmp 0x1c8e
movq -0x60(%rbp), %r13
jmp 0x1ce8
movl %eax, %r15d
cmpl %r15d, %r12d
jge 0x1ce8
leaq -0x2a(%rbp), %r14
movl %r15d, %ebx
subl %r12d, %ebx
cmpl $0x7f, %ebx
movl $0x7f, %eax
cmovgel %eax, %ebx
movslq %r12d, %r12
movb (%r8,%r12), %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 -0x90(%rbp), %r8
addl %ebx, %r12d
cmpl %r15d, %r12d
jl 0x1c97
movq -0x48(%rbp), %r9
cmpl %r9d, %r12d
movq -0x58(%rbp), %rdi
jl 0x1bb9
movq -0xd8(%rbp), %rax
incq %rax
addq %rdi, -0x80(%rbp)
addq %rdi, -0x88(%rbp)
cmpq $0x4, %rax
movl -0x4c(%rbp), %r15d
movq -0xd0(%rbp), %r12
jne 0x1b9a
movq -0xa8(%rbp), %rax
incl %eax
movl -0x70(%rbp), %ebx
cmpl %ebx, %eax
movq -0x48(%rbp), %r14
jne 0x1a37
movq %r12, %rdi
callq 0x1030
movl $0x1, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq