// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::cimg::load_network_external(char const*, char*)
inline char *load_network_external(const char *const filename, char *const filename_local) {
      if (!filename)
        throw CImgArgumentException("cimg::load_network_external(): Specified filename is (null).");
      if (!filename_local)
        throw CImgArgumentException("cimg::load_network_external(): Specified destination string is (null).");
      const char *const _ext = cimg::split_filename(filename), *const ext = (*_ext && _ext>filename)?_ext-1:_ext;
      char command[1024] = { 0 };
      std::FILE *file = 0;
      *filename_local = 0;
      do {
        cimg_snprintf(filename_local,512,"%s%c%s%s",
                      cimg::temporary_path(),cimg_file_separator,cimg::filenamerand(),ext);
        if ((file=std::fopen(filename_local,"rb"))!=0) cimg::fclose(file);
      } while (file);

      // Try with 'curl' first.
      cimg_snprintf(command,sizeof(command),"%s -f --silent --compressed -o \"%s\" \"%s\"",
                    cimg::curl_path(),filename_local,filename);
      cimg::system(command);
      if (!(file = std::fopen(filename_local,"rb"))) {

        // Try with 'wget' else.
        cimg_snprintf(command,sizeof(command),"%s -q -r -l 0 --no-cache -O \"%s\" \"%s\"",
                      cimg::wget_path(),filename_local,filename);
        cimg::system(command);
        if (!(file = std::fopen(filename_local,"rb")))
          throw CImgIOException("cimg::load_network_external(): Failed to load file '%s' with external commands "
                                "'wget' or 'curl'.",filename);
        cimg::fclose(file);

        // Try gunzip it.
        cimg_snprintf(command,sizeof(command),"%s.gz",filename_local);
        std::rename(filename_local,command);
        cimg_snprintf(command,sizeof(command),"%s --quiet \"%s.gz\"",
                      gunzip_path(),filename_local);
        cimg::system(command);
        file = std::fopen(filename_local,"rb");
        if (!file) {
          cimg_snprintf(command,sizeof(command),"%s.gz",filename_local);
          std::rename(command,filename_local);
          file = std::fopen(filename_local,"rb");
        }
      }
      std::fseek(file,0,SEEK_END); // Check if file size is 0.
      if (std::ftell(file)<=0)
        throw CImgIOException("cimg::load_network_external(): Failed to load file '%s' with external commands "
                              "'wget' or 'curl'.",filename);
      cimg::fclose(file);
      return filename_local;
    }

// Assembly:
subq $0x498, %rsp            # imm = 0x498
movq %rdi, 0x490(%rsp)
movq %rsi, 0x488(%rsp)
cmpq $0x0, 0x490(%rsp)
jne 0x62e12
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x50(%rsp)
leaq 0x86442(%rip), %rsi     # 0xe9210
xorl %eax, %eax
callq 0x12220
jmp 0x62dd7
movq 0x50(%rsp), %rdi
leaq 0x9cd7d(%rip), %rsi     # 0xffb60
leaq -0x5098a(%rip), %rdx    # 0x12460
callq 0x5920
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x480(%rsp)
movl %eax, 0x47c(%rsp)
callq 0x53a0
jmp 0x6326a
cmpq $0x0, 0x488(%rsp)
jne 0x62e7d
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x48(%rsp)
leaq 0x86414(%rip), %rsi     # 0xe924d
xorl %eax, %eax
callq 0x12220
jmp 0x62e42
movq 0x48(%rsp), %rdi
leaq 0x9cd12(%rip), %rsi     # 0xffb60
leaq -0x509f5(%rip), %rdx    # 0x12460
callq 0x5920
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x480(%rsp)
movl %eax, 0x47c(%rsp)
callq 0x53a0
jmp 0x6326a
movq 0x490(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x63280
movq %rax, 0x470(%rsp)
movq 0x470(%rsp), %rax
cmpb $0x0, (%rax)
je 0x62ec8
movq 0x470(%rsp), %rax
cmpq 0x490(%rsp), %rax
jbe 0x62ec8
movq 0x470(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x62ed5
movq 0x470(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x468(%rsp)
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x52a0
movq $0x0, 0x58(%rsp)
movq 0x488(%rsp), %rax
movb $0x0, (%rax)
movq 0x488(%rsp), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x5c290
movq %rax, 0x38(%rsp)
callq 0x5c7a0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rcx
movq %rax, %r9
movq 0x468(%rsp), %rax
movl $0x200, %esi            # imm = 0x200
leaq 0x8634a(%rip), %rdx     # 0xe9294
movl $0x2f, %r8d
movq %rax, (%rsp)
movb $0x0, %al
callq 0x5890
movq 0x488(%rsp), %rdi
leaq 0x861f4(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0x62f84
movq 0x58(%rsp), %rdi
callq 0x5c6f0
jmp 0x62f86
cmpq $0x0, 0x58(%rsp)
jne 0x62f07
leaq 0x60(%rsp), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x66210
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movq 0x488(%rsp), %r8
movq 0x490(%rsp), %r9
movl $0x400, %esi            # imm = 0x400
leaq 0x862d2(%rip), %rdx     # 0xe929d
movb $0x0, %al
callq 0x5890
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x66380
movq 0x488(%rsp), %rdi
leaq 0x8616f(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
jne 0x631c8
leaq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x66440
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movq 0x488(%rsp), %r8
movq 0x490(%rsp), %r9
movl $0x400, %esi            # imm = 0x400
leaq 0x8628a(%rip), %rdx     # 0xe92c6
movb $0x0, %al
callq 0x5890
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x66380
movq 0x488(%rsp), %rdi
leaq 0x860fe(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
jne 0x630d8
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq 0x490(%rsp), %rdx
leaq 0x86258(%rip), %rsi     # 0xe92ec
xorl %eax, %eax
callq 0x5c880
jmp 0x6309d
movq 0x18(%rsp), %rdi
leaq 0x9cbc7(%rip), %rsi     # 0xffc70
leaq -0x65f0(%rip), %rdx     # 0x5cac0
callq 0x5920
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x480(%rsp)
movl %eax, 0x47c(%rsp)
callq 0x53a0
jmp 0x6326a
movq 0x58(%rsp), %rdi
callq 0x5c6f0
leaq 0x60(%rsp), %rdi
movq 0x488(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x86252(%rip), %rdx     # 0xe934d
movb $0x0, %al
callq 0x5890
movq 0x488(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x52f0
leaq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x665b0
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movq 0x488(%rsp), %r8
movl $0x400, %esi            # imm = 0x400
leaq 0x8620e(%rip), %rdx     # 0xe9353
movb $0x0, %al
callq 0x5890
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x66380
movq 0x488(%rsp), %rdi
leaq 0x85ff5(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x631c6
leaq 0x60(%rsp), %rdi
movq 0x488(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x861b9(%rip), %rdx     # 0xe934d
movb $0x0, %al
callq 0x5890
leaq 0x60(%rsp), %rdi
movq 0x488(%rsp), %rsi
callq 0x52f0
movq 0x488(%rsp), %rdi
leaq 0x85fa2(%rip), %rsi     # 0xe915e
callq 0x55c0
movq %rax, 0x58(%rsp)
jmp 0x631c8
movq 0x58(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x55a0
movq 0x58(%rsp), %rdi
callq 0x5030
cmpq $0x0, %rax
jg 0x63250
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq 0x490(%rsp), %rdx
leaq 0x860dd(%rip), %rsi     # 0xe92ec
xorl %eax, %eax
callq 0x5c880
jmp 0x63218
movq 0x8(%rsp), %rdi
leaq 0x9ca4c(%rip), %rsi     # 0xffc70
leaq -0x676b(%rip), %rdx     # 0x5cac0
callq 0x5920
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x480(%rsp)
movl %eax, 0x47c(%rsp)
callq 0x53a0
jmp 0x6326a
movq 0x58(%rsp), %rdi
callq 0x5c6f0
movq 0x488(%rsp), %rax
addq $0x498, %rsp            # imm = 0x498
retq
movq 0x480(%rsp), %rdi
callq 0x5970
nopw (%rax,%rax)