// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %rbx
movq %rsi, %rax
orq %rdx, %rax
je 0x6036b
cmpq $0x0, 0x18(%rbx)
sete %al
movl (%rbx), %ebp
movl 0x4(%rbx), %r13d
testl %ebp, %ebp
sete %r8b
orb %al, %r8b
testl %r13d, %r13d
sete %al
movl 0x8(%rbx), %r14d
testl %r14d, %r14d
sete %dil
orb %al, %dil
orb %r8b, %dil
movl 0xc(%rbx), %r12d
testl %r12d, %r12d
sete %al
orb %dil, %al
cmpb $0x1, %al
jne 0x60015
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x5ce0e
jmp 0x602d2
movq %rcx, 0x18(%rsp)
testq %rsi, %rsi
movq %rsi, 0x38(%rsp)
je 0x60029
movq %rsi, %r15
jmp 0x60049
leaq 0x2f02d(%rip), %rsi     # 0x8f05d
movq %rdx, %rdi
callq 0x3b111
movq %rax, %r15
movl (%rbx), %ebp
movl 0x4(%rbx), %r13d
movl 0x8(%rbx), %r14d
movl 0xc(%rbx), %r12d
leaq 0x40(%rsp), %rdi
movl $0x101, %edx            # imm = 0x101
xorl %esi, %esi
callq 0x4290
movl %r12d, (%rsp)
leaq 0x3284c(%rip), %rdx     # 0x928b1
movl $0x101, %esi            # imm = 0x101
leaq 0x40(%rsp), %rdi
movl %ebp, %ecx
movl %r13d, %r8d
movl %r14d, %r9d
xorl %eax, %eax
callq 0x4890
movl %eax, %ebp
movq 0x18(%rsp), %rcx
testq %rcx, %rcx
movq %rbx, 0x30(%rsp)
je 0x600b8
movslq %ebp, %rax
leaq (%rsp,%rax), %rdi
addq $0x40, %rdi
cvtss2sd (%rcx), %xmm0
cvtss2sd 0x4(%rcx), %xmm1
cvtss2sd 0x8(%rcx), %xmm2
leaq 0x32831(%rip), %rsi     # 0x928e0
movb $0x3, %al
callq 0x40a0
addl %eax, %ebp
movslq %ebp, %rbx
leaq (%rsp,%rbx), %rdi
addq $0x40, %rdi
leaq 0x32829(%rip), %rsi     # 0x928f3
leaq 0x327ca(%rip), %rdx     # 0x9289b
leaq 0x3282b(%rip), %rcx     # 0x92903
xorl %eax, %eax
callq 0x40a0
addl %eax, %ebx
movslq %ebx, %rax
leaq (%rsp,%rax), %rdi
addq $0x40, %rdi
movl $0xfc, %ecx
subl %eax, %ecx
movslq %ecx, %rdx
movl $0xa, %esi
callq 0x4290
movl $0xa7d2323, 0x13c(%rsp) # imm = 0xA7D2323
testq %r15, %r15
je 0x603db
movl $0x100, %r13d           # imm = 0x100
xorl %r14d, %r14d
movl $0x3f00000, %ebx        # imm = 0x3F00000
cmpq %rbx, %r13
movl $0x3f00000, %r12d       # imm = 0x3F00000
cmovbq %r13, %r12
leaq 0x40(%rsp,%r14), %rdi
movl $0x1, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x4a80
addq %rax, %r14
subq %rax, %r13
cmpq %rax, %r12
jne 0x60154
testq %r13, %r13
jne 0x60122
testq %r13, %r13
je 0x6016f
leaq 0x31aa5(%rip), %rdi     # 0x91c05
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
xorl %eax, %eax
callq 0xbb10
movq 0x30(%rsp), %rbx
movl 0x8(%rbx), %ecx
testl %ecx, %ecx
jle 0x602ca
movl 0x4(%rbx), %eax
movq $0x0, 0x20(%rsp)
testl %eax, %eax
jle 0x602b1
movl (%rbx), %ecx
movq $0x0, 0x28(%rsp)
testl %ecx, %ecx
jle 0x60295
movl 0xc(%rbx), %eax
movq $0x0, 0x18(%rsp)
testl %eax, %eax
jle 0x60279
xorl %r12d, %r12d
movl (%rbx), %eax
movl 0x4(%rbx), %ecx
movq 0x28(%rsp), %rdx
imulq %rax, %rdx
imulq %rax, %rcx
movl 0x8(%rbx), %ebp
imulq %r12, %rbp
imulq %rcx, %rbp
imulq 0x20(%rsp), %rcx
shlq $0x3, %rdx
addq 0x18(%rbx), %rdx
movq 0x18(%rsp), %rax
leaq (%rdx,%rax,8), %rax
leaq (%rax,%rcx,8), %rax
shlq $0x3, %rbp
addq %rax, %rbp
je 0x6031d
movl $0x1, %ebx
xorl %r14d, %r14d
leaq (,%rbx,8), %rax
cmpq $0x3f00000, %rax        # imm = 0x3F00000
movl $0x7e0000, %r13d        # imm = 0x7E0000
cmovbq %rbx, %r13
leaq (%rbp,%r14,8), %rdi
movl $0x8, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x4a80
addq %rax, %r14
subq %rax, %rbx
cmpq %rax, %r13
jne 0x60247
testq %rbx, %rbx
jne 0x6020a
testq %rbx, %rbx
je 0x60262
movl $0x1, %edx
leaq 0x319ad(%rip), %rdi     # 0x91c05
movq %r14, %rsi
xorl %eax, %eax
callq 0xbb10
incq %r12
movq 0x30(%rsp), %rbx
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jl 0x601bd
movl (%rbx), %ecx
movq 0x18(%rsp), %rdi
incq %rdi
movslq %ecx, %rdx
movq %rdi, 0x18(%rsp)
cmpq %rdx, %rdi
jl 0x601b2
movl 0x4(%rbx), %eax
movq 0x28(%rsp), %rdi
incq %rdi
movslq %eax, %rdx
movq %rdi, 0x28(%rsp)
cmpq %rdx, %rdi
jl 0x6019e
movl 0x8(%rbx), %ecx
movq 0x20(%rsp), %rdi
incq %rdi
movslq %ecx, %rdx
movq %rdi, 0x20(%rsp)
cmpq %rdx, %rdi
jl 0x6018b
cmpq $0x0, 0x38(%rsp)
je 0x602e7
movq %rbx, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x47cba(%rip), %rax     # 0xa7fa8
cmpq %r15, (%rax)
je 0x602d2
movq 0x47c8e(%rip), %rax     # 0xa7f88
cmpq %r15, (%rax)
je 0x602d2
movq %r15, %rdi
callq 0x4550
testl %eax, %eax
je 0x602d2
leaq 0x2ecea(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
jmp 0x602d2
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
movq %r15, (%rsp)
leaq 0x31882(%rip), %rsi     # 0x91bb7
leaq 0x2ede3(%rip), %rcx     # 0x8f11f
leaq 0xe525(%rip), %r8       # 0x6e868
movl $0x1, %edx
movq %rax, %rdi
xorl %r9d, %r9d
xorl %eax, %eax
callq 0xc16a
leaq 0x478f4(%rip), %rsi     # 0xa7c50
movq 0x47c6d(%rip), %rdx     # 0xa7fd0
movq %rbx, %rdi
callq 0x4910
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
movq 0x18(%rbx), %rax
leaq 0xe4d8(%rip), %rsi      # 0x6e868
leaq 0xf8ab(%rip), %rdi      # 0x6fc42
cmpb $0x0, 0x10(%rbx)
cmovneq %rsi, %rdi
leaq 0x2ed79(%rip), %rsi     # 0x8f11f
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x32488(%rip), %rsi     # 0x92843
movq %r14, %rdi
xorl %eax, %eax
callq 0xc16a
leaq 0x47884(%rip), %rsi     # 0xa7c50
movq 0x47bfd(%rip), %rdx     # 0xa7fd0
movq %r14, %rdi
callq 0x4910
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
movq $0x0, (%rsp)
leaq 0x317c0(%rip), %rsi     # 0x91bb7
leaq 0x1a412(%rip), %rcx     # 0x7a810
leaq 0x3052d(%rip), %r8      # 0x90932
leaq 0x40(%rsp), %r9
movl $0x100, %edx            # imm = 0x100
movq %rax, %rdi
xorl %eax, %eax
callq 0xc16a
jmp 0x60355
jmp 0x60428
movq %rax, %r15
movq %r14, %rdi
jmp 0x6042e
movq %rax, %r15
movq %rbx, %rdi
callq 0x43c0
movq %r15, %rdi
callq 0x4960
nop