// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: int cimg_library::cimg::fwrite<unsigned char>(unsigned char const*, unsigned long, _IO_FILE*)
inline int fwrite(const T *ptr, const unsigned long nmemb, std::FILE *stream) {
      if (!ptr || !stream)
        throw CImgArgumentException("cimg::fwrite(): Invalid writing request of %u %s%s from buffer %p to file %p.",
                                    nmemb,cimg::type<T>::string(),nmemb>1?"s":"",ptr,stream);
      if (nmemb<=0) return 0;
      const unsigned long wlimitT = 63*1024*1024, wlimit = wlimitT/sizeof(T);
      unsigned long to_write = nmemb, al_write = 0, l_to_write = 0, l_al_write = 0;
      do {
        l_to_write = (to_write*sizeof(T))<wlimitT?to_write:wlimit;
        l_al_write = (unsigned long)std::fwrite((void*)(ptr+al_write),sizeof(T),l_to_write,stream);
        al_write+=l_al_write;
        to_write-=l_al_write;
      } while (l_to_write==l_al_write && to_write>0);
      if (to_write>0)
        warn("cimg::fwrite(): Only %u/%u elements could be written in file.",
             al_write,nmemb);
      return al_write;
    }

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0x9d3c3
cmpq $0x0, 0x78(%rsp)
jne 0x9d46c
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, 0x28(%rsp)
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
callq 0x1c2f0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movq %rax, %rcx
movq 0x80(%rsp), %rax
subq $0x2, %rax
leaq 0x4d3a4(%rip), %rax     # 0xea7ad
leaq 0x4b5c2(%rip), %r8      # 0xe89d2
cmovaeq %rax, %r8
movq 0x88(%rsp), %r9
movq 0x78(%rsp), %rsi
movq %rsp, %rax
movq %rsi, (%rax)
leaq 0x4e616(%rip), %rsi     # 0xeba44
xorl %eax, %eax
callq 0x12220
jmp 0x9d437
movq 0x20(%rsp), %rdi
leaq 0x6271d(%rip), %rsi     # 0xffb60
leaq -0x8afea(%rip), %rdx    # 0x12460
callq 0x5920
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
callq 0x53a0
jmp 0x9d5a4
cmpq $0x0, 0x80(%rsp)
ja 0x9d487
movl $0x0, 0x94(%rsp)
jmp 0x9d595
movq $0x3f00000, 0x60(%rsp)  # imm = 0x3F00000
movq $0x3f00000, 0x58(%rsp)  # imm = 0x3F00000
movq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x50(%rsp), %rax
shlq $0x0, %rax
cmpq $0x3f00000, %rax        # imm = 0x3F00000
jae 0x9d4de
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x9d4ea
movl $0x3f00000, %eax        # imm = 0x3F00000
movq %rax, 0x18(%rsp)
jmp 0x9d4ea
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x88(%rsp), %rdi
addq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rdx
movq 0x78(%rsp), %rcx
movl $0x1, %esi
callq 0x5aa0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rcx
movq 0x50(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rcx
xorl %eax, %eax
cmpq 0x38(%rsp), %rcx
movb %al, 0x17(%rsp)
jne 0x9d55a
cmpq $0x0, 0x50(%rsp)
seta %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x9d4c1
cmpq $0x0, 0x50(%rsp)
jbe 0x9d589
movq 0x48(%rsp), %rsi
movq 0x80(%rsp), %rdx
leaq 0x4e510(%rip), %rdi     # 0xeba92
movb $0x0, %al
callq 0x117e0
movq 0x48(%rsp), %rax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
movq 0x70(%rsp), %rdi
callq 0x5970
nop