// File: srajangarg[P]raytracer/src/core/stb_image_write.hpp
// Function: stbiw__writefv(stbi__write_context*, char const*, __va_list_tag*)
static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v)
{
   while (*fmt) {
      switch (*fmt++) {
         case ' ': break;
         case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int));
                     s->func(s->context,&x,1);
                     break; }
         case '2': { int x = va_arg(v,int);
                     unsigned char b[2];
                     b[0] = STBIW_UCHAR(x);
                     b[1] = STBIW_UCHAR(x>>8);
                     s->func(s->context,b,2);
                     break; }
         case '4': { stbiw_uint32 x = va_arg(v,int);
                     unsigned char b[4];
                     b[0]=STBIW_UCHAR(x);
                     b[1]=STBIW_UCHAR(x>>8);
                     b[2]=STBIW_UCHAR(x>>16);
                     b[3]=STBIW_UCHAR(x>>24);
                     s->func(s->context,b,4);
                     break; }
         default:
            STBIW_ASSERT(0);
            return;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3a6d2
movq -0x10(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x10(%rbp)
movsbl (%rax), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x14, %eax
ja 0x3a6ae
movq -0x38(%rbp), %rax
leaq 0xe396(%rip), %rcx      # 0x488a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x3a6cd
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x28, %eax
ja 0x3a54b
movq -0x48(%rbp), %rcx
movl -0x3c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x50(%rbp)
jmp 0x3a562
movq -0x48(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdi
leaq -0x19(%rbp), %rsi
movl $0x1, %edx
callq *%rax
jmp 0x3a6cd
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movl (%rax), %eax
movl %eax, -0x54(%rbp)
cmpl $0x28, %eax
ja 0x3a5ba
movq -0x60(%rbp), %rcx
movl -0x54(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x68(%rbp)
jmp 0x3a5d1
movq -0x60(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
andl $0xff, %eax
movb %al, -0x22(%rbp)
movl -0x20(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdi
leaq -0x22(%rbp), %rsi
movl $0x2, %edx
callq *%rax
jmp 0x3a6cd
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
cmpl $0x28, %eax
ja 0x3a63d
movq -0x78(%rbp), %rcx
movl -0x6c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x80(%rbp)
jmp 0x3a654
movq -0x78(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $0xff, %eax
movb %al, -0x2c(%rbp)
movl -0x28(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, -0x2b(%rbp)
movl -0x28(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, -0x2a(%rbp)
movl -0x28(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, -0x29(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdi
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
callq *%rax
jmp 0x3a6cd
leaq 0xe05e(%rip), %rdi      # 0x48713
leaq 0xe27d(%rip), %rsi      # 0x48939
movl $0x109, %edx            # imm = 0x109
leaq 0xe40e(%rip), %rcx      # 0x48ad6
callq 0x52c0
jmp 0x3a4d7
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)