// File: /workspace/github_cpp_makefile_star2_O2/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 $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
movq %rsi, %rax
orq %rdx, %rax
je 0x48f11
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rbx, %rdi
callq 0x8dc8
testb %al, %al
je 0x48c35
movq %r14, %rdi
movq %r12, %rsi
callq 0x465c3
jmp 0x48efc
movq %r12, 0x18(%rsp)
movq %r15, 0x28(%rsp)
movq %r14, 0x20(%rsp)
leaq 0x2c454(%rip), %r15     # 0x7509f
leaq 0x17b35(%rip), %rsi     # 0x60787
movq %r15, %rdi
callq 0x2ccbe
movl %eax, 0x10(%rsp)
leaq 0x17b2b(%rip), %rsi     # 0x60790
movq %r15, %rdi
callq 0x2ccbe
movl %eax, 0x14(%rsp)
testl %eax, %eax
leaq 0x2fbe0(%rip), %rax     # 0x7885a
leaq 0x2fbe2(%rip), %r14     # 0x78863
cmovneq %rax, %r14
leaq 0x2cfcb(%rip), %rsi     # 0x75c57
movq %r15, %rdi
callq 0x2ccbe
movl %eax, (%rsp)
testl %eax, %eax
leaq 0x2fbe3(%rip), %r12     # 0x78883
cmovneq %r14, %r12
leaq 0x2cfb5(%rip), %rsi     # 0x75c60
movq %r15, %rdi
callq 0x2ccbe
movl %eax, %r14d
testl %eax, %eax
leaq 0x2fbcd(%rip), %rbp     # 0x7888c
cmovneq %r12, %rbp
leaq 0x2b887(%rip), %rsi     # 0x74551
movq %r15, %rdi
callq 0x2ccbe
movl %eax, 0xc(%rsp)
testl %eax, %eax
leaq 0x2fbce(%rip), %r12     # 0x788ad
cmovneq %rbp, %r12
leaq 0x2b870(%rip), %rsi     # 0x7455a
movq %r15, %rdi
callq 0x2ccbe
movl %eax, 0x8(%rsp)
testl %eax, %eax
leaq 0x2fbb7(%rip), %rbp     # 0x788b6
cmovneq %r12, %rbp
leaq 0x2b841(%rip), %rsi     # 0x7454b
movq %r15, %rdi
callq 0x2ccbe
movl %eax, %r12d
testl %eax, %eax
leaq 0x2fbb9(%rip), %r13     # 0x788d7
cmovneq %rbp, %r13
movq %r15, %rdi
movq %r15, %rsi
callq 0x2ccbe
leaq 0x2fbb9(%rip), %rbp     # 0x788ed
testl %eax, %eax
cmovneq %r13, %rbp
je 0x48d6c
testl %r14d, %r14d
je 0x48d6c
cmpl $0x0, (%rsp)
je 0x48d6c
cmpl $0x0, 0x14(%rsp)
je 0x48d6c
cmpl $0x0, 0x10(%rsp)
je 0x48d6c
testl %r12d, %r12d
je 0x48d6c
cmpl $0x0, 0xc(%rsp)
je 0x48d6c
cmpl $0x0, 0x8(%rsp)
jne 0x48f71
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x48d8f
leaq 0x2c25c(%rip), %rsi     # 0x74fdd
movq 0x18(%rsp), %rdi
callq 0x2dca5
movq %rax, (%rsp)
leaq 0x30(%rsp), %r14
movl $0x101, %edx            # imm = 0x101
movq %r14, %rdi
xorl %esi, %esi
callq 0x4280
movl (%rbx), %ecx
movl 0x4(%rbx), %r8d
movl 0x8(%rbx), %r9d
movl 0xc(%rbx), %r10d
subq $0x8, %rsp
leaq 0x2fbab(%rip), %rdx     # 0x78967
movl $0x101, %esi            # imm = 0x101
movq %r14, %rdi
xorl %eax, %eax
pushq %r10
callq 0x4890
popq %rcx
popq %rdx
movl %eax, %r14d
movq 0x28(%rsp), %rcx
testq %rcx, %rcx
je 0x48e06
movslq %r14d, %rax
leaq (%rsp,%rax), %rdi
addq $0x30, %rdi
cvtss2sd (%rcx), %xmm0
cvtss2sd 0x4(%rcx), %xmm1
cvtss2sd 0x8(%rcx), %xmm2
leaq 0x2fb9a(%rip), %rsi     # 0x78996
movb $0x3, %al
callq 0x4090
addl %eax, %r14d
movslq %r14d, %r15
leaq (%rsp,%r15), %rdi
addq $0x30, %rdi
leaq 0x2fb91(%rip), %rsi     # 0x789a9
leaq 0x2fb9a(%rip), %rcx     # 0x789b9
xorl %r14d, %r14d
movq %rbp, %rdx
xorl %eax, %eax
callq 0x4090
addl %eax, %r15d
movslq %r15d, %rax
leaq (%rsp,%rax), %rdi
addq $0x30, %rdi
movl $0xfc, %ecx
subl %eax, %ecx
movslq %ecx, %rdx
pushq $0xa
popq %rsi
callq 0x4280
leaq 0x30(%rsp), %rdi
movl $0xa7d2323, 0xfc(%rdi)  # imm = 0xA7D2323
movl $0x100, %esi            # imm = 0x100
movq (%rsp), %rdx
callq 0x48aef
pushq $0x1
popq %r12
movslq 0x8(%rbx), %rax
cmpq %rax, %r14
jge 0x48eeb
xorl %r13d, %r13d
movslq 0x4(%rbx), %rax
cmpq %rax, %r13
jge 0x48ee6
xorl %ebp, %ebp
movslq (%rbx), %rax
cmpq %rax, %rbp
jge 0x48ee1
xorl %r15d, %r15d
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jge 0x48edc
movl (%rbx), %eax
movl 0x4(%rbx), %ecx
movq %r13, %rdx
imulq %rax, %rdx
imulq %rax, %rcx
movl 0x8(%rbx), %eax
imulq %r15, %rax
imulq %rcx, %rax
shlq $0x3, %rdx
addq 0x18(%rbx), %rdx
imulq %r14, %rcx
leaq (%rdx,%rbp,8), %rdx
leaq (%rdx,%rcx,8), %rcx
leaq (%rcx,%rax,8), %rdi
movq %r12, %rsi
movq (%rsp), %rdx
callq 0x489e9
incq %r15
jmp 0x48e8f
incq %rbp
jmp 0x48e84
incq %r13
jmp 0x48e79
incq %r14
jmp 0x48e6d
cmpq $0x0, 0x20(%rsp)
jne 0x48efc
movq (%rsp), %rdi
callq 0x2a2f8
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
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
leaq 0xb8b6(%rip), %rax      # 0x547e8
leaq 0xcc89(%rip), %r10      # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x2c153(%rip), %r11     # 0x7509f
leaq 0x2f8af(%rip), %rsi     # 0x78802
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x9d52
addq $0x20, %rsp
leaq 0x46cf1(%rip), %rsi     # 0x8fc60
jmp 0x48fdf
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
leaq 0xb863(%rip), %rax      # 0x547e8
leaq 0xcc36(%rip), %r10      # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
movq 0x18(%rsp), %rax
testq %rax, %rax
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x2c5b7(%rip), %r11     # 0x75567
cmovneq %rax, %r11
subq $0x8, %rsp
leaq 0x2f944(%rip), %rsi     # 0x78903
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r15
pushq %r10
pushq 0x18(%rbx)
callq 0x2a3de
addq $0x30, %rsp
leaq 0x46d21(%rip), %rsi     # 0x8fd00
movq 0x46ff2(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
jmp 0x48ff0
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
movq %rbx, %rdi
callq 0x4950
nop