// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::_save_inr(_IO_FILE*, char const*, float const*) const
const CImg<T>& _save_inr(std::FILE *const file, const char *const filename, const float *const voxel_size) const {
      if (!file && !filename)
        throw CImgArgumentException(_cimg_instance
                                    "save_inr(): Specified filename is (null).",
                                    cimg_instance);
      if (is_empty()) { cimg::fempty(file,filename); return *this; }

      int inrpixsize=-1;
      const char *inrtype = "unsigned fixed\nPIXSIZE=8 bits\nSCALE=2**0";
      if (!cimg::strcasecmp(pixel_type(),"unsigned char")) {
        inrtype = "unsigned fixed\nPIXSIZE=8 bits\nSCALE=2**0"; inrpixsize = 1;
      }
      if (!cimg::strcasecmp(pixel_type(),"char")) {
        inrtype = "fixed\nPIXSIZE=8 bits\nSCALE=2**0"; inrpixsize = 1;
      }
      if (!cimg::strcasecmp(pixel_type(),"unsigned short")) {
        inrtype = "unsigned fixed\nPIXSIZE=16 bits\nSCALE=2**0";inrpixsize = 2;
      }
      if (!cimg::strcasecmp(pixel_type(),"short")) {
        inrtype = "fixed\nPIXSIZE=16 bits\nSCALE=2**0"; inrpixsize = 2;
      }
      if (!cimg::strcasecmp(pixel_type(),"unsigned int")) {
        inrtype = "unsigned fixed\nPIXSIZE=32 bits\nSCALE=2**0";inrpixsize = 4;
      }
      if (!cimg::strcasecmp(pixel_type(),"int")) {
        inrtype = "fixed\nPIXSIZE=32 bits\nSCALE=2**0"; inrpixsize = 4;
      }
      if (!cimg::strcasecmp(pixel_type(),"float")) {
        inrtype = "float\nPIXSIZE=32 bits"; inrpixsize = 4;
      }
      if (!cimg::strcasecmp(pixel_type(),"double")) {
        inrtype = "float\nPIXSIZE=64 bits"; inrpixsize = 8;
      }
      if (inrpixsize<=0)
        throw CImgIOException(_cimg_instance
                              "save_inr(): Unsupported pixel type '%s' for file '%s'",
                              cimg_instance,
                              pixel_type(),filename?filename:"(FILE*)");

      std::FILE *const nfile = file?file:cimg::fopen(filename,"wb");
      char header[257] = { 0 };
      int err = cimg_snprintf(header,sizeof(header),"#INRIMAGE-4#{\nXDIM=%u\nYDIM=%u\nZDIM=%u\nVDIM=%u\n",
                              _width,_height,_depth,_spectrum);
      if (voxel_size) err+=std::sprintf(header + err,"VX=%g\nVY=%g\nVZ=%g\n",voxel_size[0],voxel_size[1],voxel_size[2]);
      err+=std::sprintf(header + err,"TYPE=%s\nCPU=%s\n",inrtype,cimg::endianness()?"sun":"decm");
      std::memset(header + err,'\n',252 - err);
      std::memcpy(header + 252,"##}\n",4);
      cimg::fwrite(header,256,nfile);
      cimg_forXYZ(*this,x,y,z) cimg_forC(*this,c) cimg::fwrite(&((*this)(x,y,z,c)),1,nfile);
      if (!file) cimg::fclose(nfile);
      return *this;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, 0x218(%rsp)
movq %rsi, 0x210(%rsp)
movq %rdx, 0x208(%rsp)
movq %rcx, 0x200(%rsp)
movq 0x218(%rsp), %rax
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0x210(%rsp)
jne 0xa2c44
cmpq $0x0, 0x208(%rsp)
jne 0xa2c44
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0xb0(%rsp), %rax
movq %rcx, 0x80(%rsp)
movl (%rax), %ecx
movl %ecx, 0x88(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x8c(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0x90(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0x94(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x98(%rsp)
movb 0x10(%rax), %dl
leaq 0x45e50(%rip), %rcx     # 0xe89d2
leaq 0x26f58(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0xa0(%rsp)
callq 0x118f0
movq %rax, 0xa8(%rsp)
jmp 0xa2ba7
movl 0x94(%rsp), %r9d
movl 0x90(%rsp), %r8d
movl 0x8c(%rsp), %ecx
movl 0x88(%rsp), %edx
movq 0x80(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %r10
movq 0xa8(%rsp), %r11
movq %rsp, %rax
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x49b87(%rip), %rsi     # 0xec781
xorl %eax, %eax
callq 0x12220
jmp 0xa2c03
movq 0x80(%rsp), %rdi
leaq 0x5cf4e(%rip), %rsi     # 0xffb60
leaq -0x907b9(%rip), %rdx    # 0x12460
callq 0x5920
movq 0x80(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
callq 0x53a0
jmp 0xa327f
movq 0xb0(%rsp), %rdi
callq 0x10320
testb $0x1, %al
jne 0xa2c57
jmp 0xa2c81
movq 0x210(%rsp), %rdi
movq 0x208(%rsp), %rsi
callq 0x9c310
movq 0xb0(%rsp), %rax
movq %rax, 0x220(%rsp)
jmp 0xa326c
movl $0xffffffff, 0x1f0(%rsp) # imm = 0xFFFFFFFF
leaq 0x49b46(%rip), %rax     # 0xec7d9
movq %rax, 0x1e8(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x319fc(%rip), %rsi     # 0xd46a6
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2cce
leaq 0x49b1e(%rip), %rax     # 0xec7d9
movq %rax, 0x1e8(%rsp)
movl $0x1, 0x1f0(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x319d2(%rip), %rsi     # 0xd46af
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2d01
leaq 0x49af4(%rip), %rax     # 0xec7e2
movq %rax, 0x1e8(%rsp)
movl $0x1, 0x1f0(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x46e6a(%rip), %rsi     # 0xe9b7a
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2d34
leaq 0x49ae1(%rip), %rax     # 0xec802
movq %rax, 0x1e8(%rsp)
movl $0x2, 0x1f0(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x46e40(%rip), %rsi     # 0xe9b83
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2d67
leaq 0x49ab7(%rip), %rax     # 0xec80b
movq %rax, 0x1e8(%rsp)
movl $0x2, 0x1f0(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x456fa(%rip), %rsi     # 0xe8470
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2d9a
leaq 0x49aa5(%rip), %rax     # 0xec82c
movq %rax, 0x1e8(%rsp)
movl $0x4, 0x1f0(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x456d0(%rip), %rsi     # 0xe8479
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2dcd
leaq 0x49a7b(%rip), %rax     # 0xec835
movq %rax, 0x1e8(%rsp)
movl $0x4, 0x1f0(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x4568e(%rip), %rsi     # 0xe846a
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2e00
leaq 0x49a69(%rip), %rax     # 0xec856
movq %rax, 0x1e8(%rsp)
movl $0x4, 0x1f0(%rsp)
callq 0x118f0
movq %rax, %rdi
leaq 0x461b3(%rip), %rsi     # 0xe8fc2
callq 0x633b0
cmpl $0x0, %eax
jne 0xa2e33
leaq 0x49a4c(%rip), %rax     # 0xec86c
movq %rax, 0x1e8(%rsp)
movl $0x8, 0x1f0(%rsp)
cmpl $0x0, 0x1f0(%rsp)
jg 0xa2f6d
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0xb0(%rsp), %rax
movq %rcx, 0x50(%rsp)
movl (%rax), %ecx
movl %ecx, 0x58(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x5c(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0x60(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0x64(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x68(%rsp)
movb 0x10(%rax), %dl
leaq 0x45b49(%rip), %rcx     # 0xe89d2
leaq 0x26c51(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x70(%rsp)
callq 0x118f0
movq %rax, 0x78(%rsp)
jmp 0xa2ea8
callq 0x118f0
movq %rax, 0x48(%rsp)
jmp 0xa2eb4
cmpq $0x0, 0x208(%rsp)
je 0xa2ece
movq 0x208(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0xa2edc
leaq 0x465b5(%rip), %rax     # 0xe948a
movq %rax, 0x40(%rsp)
jmp 0xa2edc
movl 0x64(%rsp), %r9d
movl 0x60(%rsp), %r8d
movl 0x5c(%rsp), %ecx
movl 0x58(%rsp), %edx
movq 0x50(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %r10
movq 0x78(%rsp), %r11
movq 0x48(%rsp), %rbx
movq 0x40(%rsp), %r14
movq %rsp, %rax
movq %r14, 0x20(%rax)
movq %rbx, 0x18(%rax)
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x49959(%rip), %rsi     # 0xec882
xorl %eax, %eax
callq 0x5c880
jmp 0xa2f32
movq 0x50(%rsp), %rdi
leaq 0x5cd32(%rip), %rsi     # 0xffc70
leaq -0x46485(%rip), %rdx    # 0x5cac0
callq 0x5920
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
callq 0x53a0
jmp 0xa327f
cmpq $0x0, 0x210(%rsp)
je 0xa2f87
movq 0x210(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0xa2fa0
movq 0x208(%rsp), %rdi
leaq 0x45f6a(%rip), %rsi     # 0xe8f00
callq 0x654a0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x1e0(%rsp)
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
movl $0x101, %edx            # imm = 0x101
callq 0x52a0
movq 0xb0(%rsp), %rax
leaq 0xd0(%rsp), %rdi
movl (%rax), %ecx
movl 0x4(%rax), %r8d
movl 0x8(%rax), %r9d
movl 0xc(%rax), %eax
movl $0x101, %esi            # imm = 0x101
leaq 0x498fc(%rip), %rdx     # 0xec8e6
movl %eax, (%rsp)
movb $0x0, %al
callq 0x5890
movl %eax, 0xcc(%rsp)
cmpq $0x0, 0x200(%rsp)
je 0xa3067
leaq 0xd0(%rsp), %rdi
movslq 0xcc(%rsp), %rax
addq %rax, %rdi
movq 0x200(%rsp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x200(%rsp), %rax
movss 0x4(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movq 0x200(%rsp), %rax
movss 0x8(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x498c3(%rip), %rsi     # 0xec915
movb $0x3, %al
callq 0x50a0
addl 0xcc(%rsp), %eax
movl %eax, 0xcc(%rsp)
leaq 0xd0(%rsp), %rax
movslq 0xcc(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x1e8(%rsp), %rax
movq %rax, 0x30(%rsp)
callq 0x43af0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movb %al, %sil
leaq 0x49893(%rip), %rcx     # 0xec938
leaq 0x476ee(%rip), %rax     # 0xea79a
testb $0x1, %sil
cmovneq %rax, %rcx
leaq 0x4986d(%rip), %rsi     # 0xec928
movb $0x0, %al
callq 0x50a0
addl 0xcc(%rsp), %eax
movl %eax, 0xcc(%rsp)
leaq 0xd0(%rsp), %rdi
movslq 0xcc(%rsp), %rax
addq %rax, %rdi
movl $0xfc, %eax
subl 0xcc(%rsp), %eax
movslq %eax, %rdx
movl $0xa, %esi
callq 0x52a0
movl 0x4983b(%rip), %eax     # 0xec93d
movl %eax, 0x1cc(%rsp)
leaq 0xd0(%rsp), %rdi
movq 0x1e0(%rsp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0xa28b0
movl $0x0, 0xc8(%rsp)
movq 0xb0(%rsp), %rcx
movl 0xc8(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0xa3244
movl $0x0, 0xc4(%rsp)
movq 0xb0(%rsp), %rcx
movl 0xc4(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0xa322c
movl $0x0, 0xc0(%rsp)
movq 0xb0(%rsp), %rcx
movl 0xc0(%rsp), %eax
cmpl (%rcx), %eax
jge 0xa3214
movl $0x0, 0xbc(%rsp)
movq 0xb0(%rsp), %rcx
movl 0xbc(%rsp), %eax
cmpl 0xc(%rcx), %eax
jge 0xa31fc
movq 0xb0(%rsp), %rdi
movl 0xc0(%rsp), %esi
movl 0xc4(%rsp), %edx
movl 0xc8(%rsp), %ecx
movl 0xbc(%rsp), %r8d
callq 0x73720
movq %rax, %rdi
movq 0x1e0(%rsp), %rdx
movl $0x1, %esi
callq 0xa2680
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0xa3196
jmp 0xa31fe
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
jmp 0xa3174
jmp 0xa3216
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
jmp 0xa3151
jmp 0xa322e
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
jmp 0xa312e
cmpq $0x0, 0x210(%rsp)
jne 0xa325c
movq 0x1e0(%rsp), %rdi
callq 0x5c6f0
movq 0xb0(%rsp), %rax
movq %rax, 0x220(%rsp)
movq 0x220(%rsp), %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
retq
movq 0x1f8(%rsp), %rdi
callq 0x5970
nopl (%rax)