// File: /workspace/github_cpp_makefile_star2_O1/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 $0x888, %rsp            # imm = 0x888
movq %rdi, %rbx
testq %rsi, %rsi
je 0x66f12
movq %rsi, %r14
movq 0x8(%rbx), %r12
testq %r12, %r12
sete %dil
movl (%rbx), %eax
testl %eax, %eax
sete %sil
orb %dil, %sil
je 0x66965
leaq 0x2d21e(%rip), %rsi     # 0x93b2d
movq %r14, %rdi
callq 0x3ceb3
testq %rax, %rax
je 0x66ea2
movq 0x46681(%rip), %rcx     # 0xacfa8
cmpq %rax, (%rcx)
je 0x66eb0
movq 0x46651(%rip), %rcx     # 0xacf88
cmpq %rax, (%rcx)
je 0x66eb0
movq %rax, %rdi
callq 0x4540
testl %eax, %eax
je 0x66eb0
leaq 0x2d175(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
jmp 0x66eb0
movl %r8d, 0x1c(%rsp)
movq %rcx, %rbp
movl %edx, 0x18(%rsp)
movl %eax, %r13d
movq %r14, %rax
movq %rax, %r15
movq %rax, %rdi
movl $0x2e, %esi
callq 0x41a0
incq %rax
cmpq %r14, %rax
jae 0x66977
cmpq %r14, %r15
jne 0x669a2
movq %r14, %rdi
callq 0x41e0
movq %rax, %r15
addq %r14, %r15
testq %rbp, %rbp
jne 0x66a2f
movq %r15, %rdi
callq 0x41e0
cmpl $0x3, %eax
movl $0x3, %ecx
cmovbl %eax, %ecx
incl %ecx
movl %eax, %eax
cmpq $0x3, %rax
movl $0x3, %esi
cmovbq %rax, %rsi
incq %rsi
xorl %edx, %edx
leaq 0x2d380(%rip), %rax     # 0x93d5b
movzbl (%r15,%rdx), %r8d
leal -0x5b(%r8), %edi
leal 0x20(%r8), %r9d
cmpb $-0x1a, %dil
movzbl %r9b, %edi
cmovbl %r8d, %edi
movzbl (%rdx,%rax), %r9d
leal -0x5b(%r9), %r8d
leal 0x20(%r9), %r10d
cmpb $-0x1a, %r8b
movzbl %r10b, %r8d
cmovbl %r9d, %r8d
cmpb %r8b, %dil
jne 0x66a1b
incq %rdx
cmpl %edx, %esi
jne 0x669db
movl %ecx, %edx
cmpb %r8b, %dil
leaq 0x30e0c(%rip), %rbp     # 0x97831
cmoveq %rax, %rbp
cmpl %ecx, %edx
cmoveq %rax, %rbp
movq %rbp, 0x58(%rsp)
leaq 0x480(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4290
leaq 0x80(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x4290
leaq 0x280(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x4290
pxor %xmm0, %xmm0
movdqa %xmm0, 0x40(%rsp)
testl %r13d, %r13d
jle 0x66afe
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 0x66ec5
shrb %dl
je 0x66ec5
cmpl %eax, 0x8(%r12,%rcx)
jne 0x66ec5
addq $0x20, %rcx
cmpq %rcx, %r13
jne 0x66a90
jmp 0x66afe
movq 0x464d7(%rip), %rcx     # 0xacfa8
cmpq %rax, (%rcx)
je 0x66afe
movq 0x464ab(%rip), %rcx     # 0xacf88
cmpq %rax, (%rcx)
je 0x66afe
movq %rax, %rdi
callq 0x4540
testl %eax, %eax
je 0x66afe
leaq 0x2cfd7(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
xorl %edi, %edi
xorl %esi, %esi
callq 0x38039
movq %rax, %r15
callq 0x384af
leaq 0x2d010(%rip), %rdx     # 0x93b26
leaq 0x80(%rsp), %r12
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdi
movq %r15, %rcx
movl $0x2f, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x4880
leaq 0x2efed(%rip), %rdx     # 0x95b2d
leaq 0x280(%rsp), %r15
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x4880
leaq 0x2d254(%rip), %rsi     # 0x93db5
movq %r15, %rdi
callq 0x45c0
testq %rax, %rax
jne 0x66aca
movq %r14, 0x50(%rsp)
cmpl $0x0, (%rbx)
jle 0x66cbe
leaq 0x280(%rsp), %rbp
leaq 0x20(%rsp), %r12
xorl %r14d, %r14d
xorl %r15d, %r15d
incq %r15
movl $0x200, %esi            # imm = 0x200
movq %rbp, %rdi
leaq 0x2efc2(%rip), %rdx     # 0x95b67
leaq 0x80(%rsp), %rcx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x4880
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 0x106cc
movl 0x40(%rsp), %r13d
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
movl %r13d, %edx
callq 0x4ba9a
shlq $0x5, %r13
addq 0x8(%rax), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x10872
cmpb $0x0, 0x30(%rsp)
jne 0x66c25
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x66c25
callq 0x4680
movq 0x8(%rbx), %rax
leaq (%rax,%r14), %rsi
cmpl $0x1, 0x8(%rax,%r14)
ja 0x66c4e
cmpl $0x3, 0xc(%rax,%r14)
jne 0x66c4e
movq %rsi, %rdi
xorl %esi, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x60e60
jmp 0x66cae
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 0x3e35c
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x60e60
cmpb $0x0, 0x30(%rsp)
jne 0x66cae
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x66cae
callq 0x4680
movslq (%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x66b93
xorl %edi, %edi
xorl %esi, %esi
callq 0x5b2c5
movq 0x50(%rsp), %r14
movq %rax, %r15
leaq 0x80(%rsp), %r12
movq %r12, %rdi
callq 0x41e0
leal 0x1(%rax), %edx
movl $0x0, (%rsp)
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x106cc
movl 0x1c(%rsp), %ebp
leaq 0x20(%rsp), %rdi
callq 0x4b1dc
movq 0x18(%rax), %r12
movq %r14, %rdi
callq 0x41e0
leal 0x1(%rax), %edx
movl $0x0, (%rsp)
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x106cc
leaq 0x60(%rsp), %rdi
callq 0x4b1dc
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rsp)
movl %ebp, (%rsp)
leaq 0x30b34(%rip), %rdx     # 0x978a2
leaq 0x480(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rcx
movq %r12, %r8
movq 0x58(%rsp), %r9
xorl %eax, %eax
callq 0x4880
cmpb $0x0, 0x70(%rsp)
jne 0x66da3
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x66da3
callq 0x4680
cmpb $0x0, 0x30(%rsp)
jne 0x66db9
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x66db9
callq 0x4680
leaq 0x480(%rsp), %rdi
callq 0x41e0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
andq %rax, %r15
je 0x66e1f
addl $0x10, %eax
movq %rax, %rdi
callq 0x4040
movq %rax, %r12
leaq 0x480(%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 0x4480
movq %r12, %rdi
callq 0x4680
leaq 0x2cf8f(%rip), %rsi     # 0x93db5
movq %r14, %rdi
callq 0x45c0
testq %rax, %rax
je 0x66f56
movq 0x4616a(%rip), %rcx     # 0xacfa8
cmpq %rax, (%rcx)
je 0x66e6b
movq 0x4613e(%rip), %rcx     # 0xacf88
cmpq %rax, (%rcx)
je 0x66e6b
movq %rax, %rdi
callq 0x4540
testl %eax, %eax
je 0x66e6b
leaq 0x2cc6a(%rip), %rdi     # 0x93acc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb52
cmpl $0x0, (%rbx)
jle 0x66e96
movl $0x18, %r14d
xorl %r15d, %r15d
movq 0x48(%rsp), %rax
movq (%rax,%r14), %rdi
callq 0x49a0
incq %r15
movslq (%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x66e79
leaq 0x40(%rsp), %rdi
callq 0x108e4
jmp 0x66eb0
leaq 0x2cbf9(%rip), %rdi     # 0x93aa2
xorl %eax, %eax
callq 0xbb52
movq %rbx, %rax
addq $0x888, %rsp            # imm = 0x888
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 0x30956(%rip), %rsi     # 0x9783c
leaq 0x2cd02(%rip), %r9      # 0x93bef
movq %rax, %rdi
xorl %eax, %eax
callq 0xbfd8
leaq 0x45d0a(%rip), %rsi     # 0xacc08
movq 0x460cb(%rip), %rdx     # 0xacfd0
movq %r15, %rdi
callq 0x4900
jmp 0x66f9e
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
leaq 0x308a9(%rip), %rsi     # 0x977d8
leaq 0x2ccb9(%rip), %r9      # 0x93bef
movq %rax, %rdi
xorl %eax, %eax
callq 0xc196
leaq 0x45cd9(%rip), %rsi     # 0xacc20
movq 0x46082(%rip), %rdx     # 0xacfd0
movq %r14, %rdi
callq 0x4900
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 0x3096f(%rip), %rsi     # 0x978e6
leaq 0x2cc71(%rip), %r9      # 0x93bef
movq %rax, %rdi
xorl %eax, %eax
callq 0x385b4
leaq 0x45d61(%rip), %rsi     # 0xaccf0
movq 0x4603a(%rip), %rdx     # 0xacfd0
movq %r15, %rdi
callq 0x4900
jmp 0x66fd4
movq %rax, %rbx
cmpb $0x0, 0x70(%rsp)
jne 0x66fea
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x66fea
callq 0x4680
jmp 0x66fea
jmp 0x66fe7
jmp 0x66fe7
jmp 0x67002
movq %rax, %rbx
movq %r14, %rdi
callq 0x43b0
jmp 0x6700f
jmp 0x67002
jmp 0x67002
jmp 0x67002
movq %rax, %rbx
movq %r15, %rdi
callq 0x43b0
jmp 0x67005
jmp 0x66fe7
jmp 0x67002
jmp 0x67002
movq %rax, %rbx
cmpb $0x0, 0x30(%rsp)
jne 0x67005
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x67005
callq 0x4680
jmp 0x67005
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x108e4
movq %rbx, %rdi
callq 0x4950
nop