// File: /workspace/github_cpp_makefile_star2_O3/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImgList<double>::save_ffmpeg_external(char const*, unsigned int, char const*, unsigned int) const
const CImgList<T>& save_ffmpeg_external(const char *const filename, const unsigned int fps=25,
                                            const char *const codec=0, const unsigned int bitrate=2048) const {
      if (!filename)
        throw CImgArgumentException(_cimglist_instance
                                    "save_ffmpeg_external(): Specified filename is (null).",
                                    cimglist_instance);
      if (is_empty()) { cimg::fempty(0,filename); return *this; }

      const char
        *const ext = cimg::split_filename(filename),
        *const _codec = codec?codec:!cimg::strcasecmp(ext,"flv")?"flv":"mpeg2video";

      char command[1024] = { 0 }, filetmp[512] = { 0 }, filetmp2[512] = { 0 };
      CImgList<charT> filenames;
      std::FILE *file = 0;
      cimglist_for(*this,l) if (!_data[l].is_sameXYZ(_data[0]))
        throw CImgInstanceException(_cimglist_instance
                                    "save_ffmpeg_external(): Invalid instance dimensions for file '%s'.",
                                    cimglist_instance,
                                    filename);
      do {
        cimg_snprintf(filetmp,sizeof(filetmp),"%s%c%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
        cimg_snprintf(filetmp2,sizeof(filetmp2),"%s_000001.ppm",filetmp);
        if ((file=std::fopen(filetmp2,"rb"))!=0) cimg::fclose(file);
      } while (file);
      cimglist_for(*this,l) {
        cimg_snprintf(filetmp2,sizeof(filetmp2),"%s_%.6u.ppm",filetmp,l+1);
        CImg<charT>::string(filetmp2).move_to(filenames);
        if (_data[l]._depth>1 || _data[l]._spectrum!=3) _data[l].get_resize(-100,-100,1,3).save_pnm(filetmp2);
        else _data[l].save_pnm(filetmp2);
      }
#if cimg_OS!=2
      cimg_snprintf(command,sizeof(command),"%s -i \"%s_%%6d.ppm\" -vcodec %s -b %uk -r %u -y \"%s\" >/dev/null 2>&1",
                    cimg::ffmpeg_path(),
                    CImg<charT>::string(filetmp)._system_strescape().data(),
                    _codec,bitrate,fps,
                    CImg<charT>::string(filename)._system_strescape().data());
#else
      cimg_snprintf(command,sizeof(command),"\"%s -i \"%s_%%6d.ppm\" -vcodec %s -b %uk -r %u -y \"%s\"\" >NUL 2>&1",
                    cimg::ffmpeg_path(),
                    CImg<charT>::string(filetmp)._system_strescape().data(),
                    _codec,bitrate,fps,
                    CImg<charT>::string(filename)._system_strescape().data());
#endif
      cimg::system(command);
      file = std::fopen(filename,"rb");
      if (!file)
        throw CImgIOException(_cimglist_instance
                              "save_ffmpeg_external(): Failed to save file '%s' with external command 'ffmpeg'.",
                              cimglist_instance,
                              filename);
      else cimg::fclose(file);
      cimglist_for(*this,l) std::remove(filenames[l]);
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x898, %rsp            # imm = 0x898
movq %rcx, 0x20(%rsp)
movq %rdi, %rbx
testq %rsi, %rsi
je 0x64205
movq %rsi, %r14
movq 0x8(%rbx), %r12
testq %r12, %r12
sete %cl
movl (%rbx), %eax
testl %eax, %eax
sete %sil
orb %cl, %sil
je 0x63c4b
leaq 0x2b468(%rip), %rsi     # 0x8f05d
movq %r14, %rdi
callq 0x3b111
testq %rax, %rax
je 0x63cfb
movq 0x4439b(%rip), %rcx     # 0xa7fa8
cmpq %rax, (%rcx)
je 0x641a3
movq 0x4436b(%rip), %rcx     # 0xa7f88
cmpq %rax, (%rcx)
je 0x641a3
movq %rax, %rdi
callq 0x4550
testl %eax, %eax
je 0x641a3
leaq 0x2b3bf(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
jmp 0x641a3
movl %r8d, %ebp
movl %edx, 0x2c(%rsp)
movl %eax, %r13d
movq %r14, %rax
movq %rax, %r15
movq %rax, %rdi
movl $0x2e, %esi
callq 0x41a0
incq %rax
cmpq %r14, %rax
jae 0x63c58
cmpq %r14, %r15
jne 0x63c83
movq %r14, %rdi
callq 0x41e0
movq %rax, %r15
addq %r14, %r15
cmpq $0x0, 0x20(%rsp)
jne 0x63d2d
movq %r15, %rdi
callq 0x41e0
movl %eax, %eax
cmpq $0x3, %rax
movl $0x3, %edx
cmovbq %rax, %rdx
incq %rdx
xorl %ecx, %ecx
leaq 0x2b5d9(%rip), %rsi     # 0x8f28b
movq %rsi, 0x20(%rsp)
movzbl (%r15,%rcx), %esi
leal -0x5b(%rsi), %edi
leal 0x20(%rsi), %r8d
cmpb $-0x1a, %dil
movzbl %r8b, %edi
cmovbl %esi, %edi
leaq 0x2b5b6(%rip), %rsi     # 0x8f28b
movzbl (%rcx,%rsi), %esi
leal -0x5b(%rsi), %r8d
leal 0x20(%rsi), %r9d
cmpb $-0x1a, %r8b
movzbl %r9b, %r8d
cmovbl %esi, %r8d
cmpb %r8b, %dil
jne 0x63d0e
incq %rcx
cmpl %ecx, %edx
jne 0x63cb7
jmp 0x63d2d
leaq 0x2b2d0(%rip), %rdi     # 0x8efd2
xorl %eax, %eax
callq 0xbb10
jmp 0x641a3
cmpq $0x3, %rax
movl $0x3, %edx
cmovbq %rax, %rdx
incl %edx
cmpl %ecx, %edx
je 0x63d2d
leaq 0x2ef43(%rip), %rax     # 0x92c6b
movq %rax, 0x20(%rsp)
leaq 0x490(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4290
leaq 0x90(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x4290
leaq 0x290(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x4290
pxor %xmm0, %xmm0
movdqa %xmm0, 0x50(%rsp)
testl %r13d, %r13d
jle 0x63df7
movq (%r12), %xmm0
movl 0x8(%r12), %eax
shlq $0x5, %r13
xorl %ecx, %ecx
movq (%r12,%rcx), %xmm1
pcmpeqd %xmm0, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
movmskpd %xmm1, %edx
testb $0x1, %dl
je 0x641b8
shrb %dl
je 0x641b8
cmpl %eax, 0x8(%r12,%rcx)
jne 0x641b8
addq $0x20, %rcx
cmpq %rcx, %r13
jne 0x63d89
jmp 0x63df7
movq 0x441de(%rip), %rcx     # 0xa7fa8
cmpq %rax, (%rcx)
je 0x63df7
movq 0x441b2(%rip), %rcx     # 0xa7f88
cmpq %rax, (%rcx)
je 0x63df7
movq %rax, %rdi
callq 0x4550
testl %eax, %eax
je 0x63df7
leaq 0x2b20e(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
xorl %edi, %edi
xorl %esi, %esi
callq 0x36475
movq %rax, %r15
callq 0x36803
leaq 0x2b247(%rip), %rdx     # 0x8f056
leaq 0x90(%rsp), %r12
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdi
movq %r15, %rcx
movl $0x2f, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x4890
leaq 0x2d224(%rip), %rdx     # 0x9105d
leaq 0x290(%rsp), %r15
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x4890
leaq 0x2b48b(%rip), %rsi     # 0x8f2e5
movq %r15, %rdi
callq 0x45d0
testq %rax, %rax
jne 0x63dc3
movl %ebp, 0x28(%rsp)
movq %r14, 0x68(%rsp)
cmpl $0x0, (%rbx)
jle 0x63fbb
leaq 0x290(%rsp), %rbp
leaq 0x30(%rsp), %r12
xorl %r14d, %r14d
xorl %r15d, %r15d
incq %r15
movl $0x200, %esi            # imm = 0x200
movq %rbp, %rdi
leaq 0x2d1f5(%rip), %rdx     # 0x91097
leaq 0x90(%rsp), %rcx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x4890
movq %rbp, %rdi
callq 0x41e0
leal 0x1(%rax), %edx
movl $0x0, (%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x1073a
movl 0x50(%rsp), %r13d
leaq 0x50(%rsp), %rdi
movl $0x1, %esi
movl %r13d, %edx
callq 0x49baa
shlq $0x5, %r13
addq 0x8(%rax), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x108e0
cmpb $0x0, 0x40(%rsp)
jne 0x63f22
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x63f22
callq 0x4690
movq 0x8(%rbx), %rax
leaq (%rax,%r14), %rsi
cmpl $0x1, 0x8(%rax,%r14)
ja 0x63f4b
cmpl $0x3, 0xc(%rax,%r14)
jne 0x63f4b
movq %rsi, %rdi
xorl %esi, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x5e298
jmp 0x63fab
movl $0x0, 0x8(%rsp)
movl $0x1, (%rsp)
pxor %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
xorps %xmm3, %xmm3
movq %r12, %rdi
movl $0xffffff9c, %edx       # imm = 0xFFFFFF9C
movl $0xffffff9c, %ecx       # imm = 0xFFFFFF9C
movl $0x1, %r8d
movl $0x3, %r9d
callq 0x3c576
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x5e298
cmpb $0x0, 0x40(%rsp)
jne 0x63fab
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x63fab
callq 0x4690
movslq (%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x63e90
xorl %edi, %edi
xorl %esi, %esi
callq 0x58772
movq 0x68(%rsp), %r14
movq %rax, %r15
leaq 0x90(%rsp), %r12
movq %r12, %rdi
callq 0x41e0
leal 0x1(%rax), %edx
movl $0x0, (%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x1073a
movl 0x28(%rsp), %ebp
leaq 0x30(%rsp), %rdi
callq 0x492e0
movq 0x18(%rax), %r12
movq %r14, %rdi
callq 0x41e0
leal 0x1(%rax), %edx
movl $0x0, (%rsp)
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x1073a
leaq 0x70(%rsp), %rdi
callq 0x492e0
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x8(%rsp)
movl %ebp, (%rsp)
leaq 0x2ec71(%rip), %rdx     # 0x92cdc
leaq 0x490(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rcx
movq %r12, %r8
movq 0x20(%rsp), %r9
xorl %eax, %eax
callq 0x4890
cmpb $0x0, 0x80(%rsp)
jne 0x640a6
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x640a6
callq 0x4690
cmpb $0x0, 0x40(%rsp)
jne 0x640bc
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x640bc
callq 0x4690
leaq 0x490(%rsp), %rdi
callq 0x41e0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
andq %rax, %r15
je 0x64122
addl $0x10, %eax
movq %rax, %rdi
callq 0x4040
movq %rax, %r12
leaq 0x490(%rsp), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x4240
movabsq $0x7665642f203e3220, %rax # imm = 0x7665642F203E3220
movq %rax, (%r12,%r15)
movabsq $0x6c6c756e2f7665, %rax # imm = 0x6C6C756E2F7665
movq %rax, 0x6(%r12,%r15)
movq %r12, %rdi
callq 0x4490
movq %r12, %rdi
callq 0x4690
leaq 0x2b1bc(%rip), %rsi     # 0x8f2e5
movq %r14, %rdi
callq 0x45d0
testq %rax, %rax
je 0x64249
movq 0x43e67(%rip), %rcx     # 0xa7fa8
cmpq %rax, (%rcx)
je 0x6416e
movq 0x43e3b(%rip), %rcx     # 0xa7f88
cmpq %rax, (%rcx)
je 0x6416e
movq %rax, %rdi
callq 0x4550
testl %eax, %eax
je 0x6416e
leaq 0x2ae97(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
cmpl $0x0, (%rbx)
jle 0x64199
movl $0x18, %r14d
xorl %r15d, %r15d
movq 0x58(%rsp), %rax
movq (%rax,%r14), %rdi
callq 0x49b0
incq %r15
movslq (%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x6417c
leaq 0x50(%rsp), %rdi
callq 0x10952
movq %rbx, %rax
addq $0x898, %rsp            # imm = 0x898
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r15
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
movq %r14, (%rsp)
leaq 0x2ea9d(%rip), %rsi     # 0x92c76
leaq 0x2af3f(%rip), %r9      # 0x8f11f
movq %rax, %rdi
xorl %eax, %eax
callq 0xbfac
leaq 0x43a47(%rip), %rsi     # 0xa7c38
movq 0x43dd8(%rip), %rdx     # 0xa7fd0
movq %r15, %rdi
callq 0x4910
jmp 0x64291
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
leaq 0x2e9f0(%rip), %rsi     # 0x92c12
leaq 0x2aef6(%rip), %r9      # 0x8f11f
movq %rax, %rdi
xorl %eax, %eax
callq 0xc16a
leaq 0x43a16(%rip), %rsi     # 0xa7c50
movq 0x43d8f(%rip), %rdx     # 0xa7fd0
movq %r14, %rdi
callq 0x4910
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r15
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
movq %r14, (%rsp)
leaq 0x2eab6(%rip), %rsi     # 0x92d20
leaq 0x2aeae(%rip), %r9      # 0x8f11f
movq %rax, %rdi
xorl %eax, %eax
callq 0x36908
leaq 0x43a6e(%rip), %rsi     # 0xa7cf0
movq 0x43d47(%rip), %rdx     # 0xa7fd0
movq %r15, %rdi
callq 0x4910
jmp 0x642cd
movq %rax, %rbx
cmpb $0x0, 0x80(%rsp)
jne 0x642e3
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x642e3
callq 0x4690
jmp 0x642e3
jmp 0x642e0
jmp 0x642e0
jmp 0x642fb
movq %rax, %rbx
movq %r14, %rdi
callq 0x43c0
jmp 0x64308
jmp 0x642fb
jmp 0x642fb
jmp 0x642fb
movq %rax, %rbx
movq %r15, %rdi
callq 0x43c0
jmp 0x642fe
jmp 0x642e0
jmp 0x642fb
jmp 0x642fb
movq %rax, %rbx
cmpb $0x0, 0x40(%rsp)
jne 0x642fe
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x642fe
callq 0x4690
jmp 0x642fe
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x10952
movq %rbx, %rdi
callq 0x4960