int main(argc, argv)
int argc;
char *argv[];
{
  char name1[80], name2[80];
  int i, is_ok, il1, ie1, ll1, le1, il2, ie2, ll2, le2;
  long length1, length2, width1, width2;
  short **the_image, **out_image;
  if (argc != 9) {
    printf("\n"
           "\n usage: maincp in-file out_file "
           "in-il in-ie in-ll in-le out-il out-ie"
           "\n"
           "\n The image portion is pasted from the "
           "\n in-file into the out-file"
           "\n");
    exit(0);
  }
  strcpy(name1, argv[1]);
  strcpy(name2, argv[2]);
  if (does_not_exist(name1)) {
    printf("\nERROR input file %s does not exist", name1);
    exit(0);
  }
  if (does_not_exist(name2)) {
    printf("\nERROR input file %s does not exist", name2);
    exit(0);
  }
  il1 = atoi(argv[3]);
  ie1 = atoi(argv[4]);
  ll1 = atoi(argv[5]);
  le1 = atoi(argv[6]);
  il2 = atoi(argv[7]);
  ie2 = atoi(argv[8]);
  get_image_size(name1, &length1, &width1);
  get_image_size(name2, &length2, &width2);
  the_image = allocate_image_array(length1, width1);
  out_image = allocate_image_array(length2, width2);
  read_image_array(name1, the_image);
  read_image_array(name2, out_image);
  check_cut_and_paste_limits(il1, ie1, ll1, le1, il2, ie2, length1, width1,
                             length2, width2, &is_ok);
  printf("\nMAIN> is_ok=%d", is_ok);
  if (is_ok)
    paste_image_piece(the_image, out_image, il1, ie1, ll1, le1, il2, ie2);
  write_image_array(name2, out_image);
  free_image_array(out_image, length2);
  free_image_array(the_image, length1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x130,%rsp
movl   $0x0,-0x14(%rbp)
mov    %edi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
cmpl   $0x9,-0x18(%rbp)
je     11fb <main+0x3b>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x0,%al
call   1090 <does_not_exist@plt>
cmp    $0x0,%eax
je     124d <main+0x8d>
lea    -0x70(%rbp),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
lea    -0xc0(%rbp),%rdi
mov    $0x0,%al
call   1090 <does_not_exist@plt>
cmp    $0x0,%eax
je     1280 <main+0xc0>
lea    -0xc0(%rbp),%rsi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x0,%al
call   10b0 <atoi@plt>
mov    %eax,-0xcc(%rbp)
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rdi
mov    $0x0,%al
call   10b0 <atoi@plt>
mov    %eax,-0xd0(%rbp)
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rdi
mov    $0x0,%al
call   10b0 <atoi@plt>
mov    %eax,-0xd4(%rbp)
mov    -0x20(%rbp),%rax
mov    0x30(%rax),%rdi
mov    $0x0,%al
call   10b0 <atoi@plt>
mov    %eax,-0xd8(%rbp)
mov    -0x20(%rbp),%rax
mov    0x38(%rax),%rdi
mov    $0x0,%al
call   10b0 <atoi@plt>
mov    %eax,-0xdc(%rbp)
mov    -0x20(%rbp),%rax
mov    0x40(%rax),%rdi
mov    $0x0,%al
call   10b0 <atoi@plt>
mov    %eax,-0xe0(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
lea    -0x100(%rbp),%rdx
mov    $0x0,%al
call   1070 <get_image_size@plt>
lea    -0xc0(%rbp),%rdi
lea    -0xf8(%rbp),%rsi
lea    -0x108(%rbp),%rdx
mov    $0x0,%al
call   1070 <get_image_size@plt>
mov    -0xf0(%rbp),%rdi
mov    -0x100(%rbp),%rsi
mov    $0x0,%al
call   10d0 <allocate_image_array@plt>
cltq
mov    %rax,-0x110(%rbp)
mov    -0xf8(%rbp),%rdi
mov    -0x108(%rbp),%rsi
mov    $0x0,%al
call   10d0 <allocate_image_array@plt>
cltq
mov    %rax,-0x118(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x110(%rbp),%rsi
mov    $0x0,%al
call   10a0 <read_image_array@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x118(%rbp),%rsi
mov    $0x0,%al
call   10a0 <read_image_array@plt>
mov    -0xcc(%rbp),%edi
mov    -0xd0(%rbp),%esi
mov    -0xd4(%rbp),%edx
mov    -0xd8(%rbp),%ecx
mov    -0xdc(%rbp),%r8d
mov    -0xe0(%rbp),%r9d
mov    -0xf0(%rbp),%r14
mov    -0x100(%rbp),%rbx
mov    -0xf8(%rbp),%r11
mov    -0x108(%rbp),%r10
lea    -0xc8(%rbp),%rax
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1080 <check_cut_and_paste_limits@plt>
mov    -0xc8(%rbp),%esi
lea    0xca5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0xc8(%rbp)
je     1463 <main+0x2a3>
mov    -0x110(%rbp),%rdi
mov    -0x118(%rbp),%rsi
mov    -0xcc(%rbp),%edx
mov    -0xd0(%rbp),%ecx
mov    -0xd4(%rbp),%r8d
mov    -0xd8(%rbp),%r9d
mov    -0xdc(%rbp),%r10d
mov    -0xe0(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1040 <paste_image_piece@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x118(%rbp),%rsi
mov    $0x0,%al
call   1060 <write_image_array@plt>
mov    -0x118(%rbp),%rdi
mov    -0xf8(%rbp),%rsi
mov    $0x0,%al
call   10e0 <free_image_array@plt>
mov    -0x110(%rbp),%rdi
mov    -0xf0(%rbp),%rsi
mov    $0x0,%al
call   10e0 <free_image_array@plt>
mov    -0x14(%rbp),%eax
add    $0x130,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
cmp    $0x9,%edi
jne    13d3 <main+0x203>
mov    %rsi,%rbp
mov    0x8(%rsi),%rsi
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbp),%rsi
lea    0x50(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <does_not_exist@plt>
test   %eax,%eax
jne    13e6 <main+0x216>
lea    0x50(%rsp),%rdi
xor    %eax,%eax
call   10a0 <does_not_exist@plt>
test   %eax,%eax
jne    13f7 <main+0x227>
mov    0x18(%rbp),%rdi
xor    %eax,%eax
call   10c0 <atoi@plt>
mov    %eax,0x2c(%rsp)
mov    0x20(%rbp),%rdi
xor    %eax,%eax
call   10c0 <atoi@plt>
mov    %eax,%r13d
mov    0x28(%rbp),%rdi
xor    %eax,%eax
call   10c0 <atoi@plt>
mov    %eax,%ebx
mov    0x30(%rbp),%rdi
xor    %eax,%eax
call   10c0 <atoi@plt>
mov    %eax,0x28(%rsp)
mov    0x38(%rbp),%rdi
xor    %eax,%eax
call   10c0 <atoi@plt>
mov    %rax,0x30(%rsp)
mov    0x40(%rbp),%rdi
xor    %eax,%eax
call   10c0 <atoi@plt>
mov    %rax,0x48(%rsp)
lea    0xa0(%rsp),%r12
lea    0x18(%rsp),%rsi
lea    0x40(%rsp),%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <get_image_size@plt>
lea    0x50(%rsp),%rbp
lea    0x10(%rsp),%rsi
lea    0x38(%rsp),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <get_image_size@plt>
mov    0x18(%rsp),%rdi
mov    0x40(%rsp),%rsi
xor    %eax,%eax
call   10e0 <allocate_image_array@plt>
movslq %eax,%r14
mov    0x10(%rsp),%rdi
mov    0x38(%rsp),%rsi
xor    %eax,%eax
call   10e0 <allocate_image_array@plt>
movslq %eax,%r15
mov    %r12,%rdi
mov    0x2c(%rsp),%r12d
mov    %r14,%rsi
xor    %eax,%eax
call   10b0 <read_image_array@plt>
mov    %rbp,%rdi
mov    0x28(%rsp),%ebp
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <read_image_array@plt>
sub    $0x8,%rsp
lea    0x14(%rsp),%r10
mov    %r12d,%edi
mov    %r13d,0x28(%rsp)
mov    %r13d,%esi
mov    %ebx,0x2c(%rsp)
mov    %ebx,%edx
mov    %ebp,%ecx
mov    0x38(%rsp),%r8
mov    0x50(%rsp),%rbx
mov    %ebx,%r9d
xor    %eax,%eax
push   %r10
push   0x48(%rsp)
push   0x28(%rsp)
push   0x60(%rsp)
push   0x40(%rsp)
call   1090 <check_cut_and_paste_limits@plt>
add    $0x30,%rsp
mov    0xc(%rsp),%esi
lea    0xcc5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0xc(%rsp)
je     1392 <main+0x1c2>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
mov    0x20(%rsp),%ecx
mov    0x24(%rsp),%r8d
mov    %ebp,%r9d
xor    %eax,%eax
push   %rbx
push   0x38(%rsp)
call   1050 <paste_image_piece@plt>
add    $0x10,%rsp
lea    0x50(%rsp),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <write_image_array@plt>
mov    0x10(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   10f0 <free_image_array@plt>
mov    0x18(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   10f0 <free_image_array@plt>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc5a(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0xc13(%rip),%rdi
lea    0xa0(%rsp),%rsi
jmp    1403 <main+0x233>
lea    0xc02(%rip),%rdi
lea    0x50(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [140 x i8] c"\0A\0A usage: maincp in-file out_file in-il in-ie in-ll in-le out-il out-ie\0A\0A The image portion is pasted from the \0A in-file into the out-file\0A\00"
@.str.1 = [36 x i8] c"\0AERROR input file %s does not exist\00"
@.str.2 = [16 x i8] c"\0AMAIN> is_ok=%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca [80 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
%22 = alloca i16**
%23 = alloca i16**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 9
br i1 %25, label %26, label %28
26: ; preds = %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0))
unreachable
28: ; preds = %2
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i8* @strcpy(i8* %29, i8* %32)
%34 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i8* @strcpy(i8* %34, i8* %37)
%39 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%40 = call i32 (i8*, ...) bitcast (i32 (...)* @does_not_exist to i32 (i8*, ...)*)(i8* %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %28
%43 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %43)
unreachable
45: ; preds = %28
%46 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%47 = call i32 (i8*, ...) bitcast (i32 (...)* @does_not_exist to i32 (i8*, ...)*)(i8* %46)
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %50)
unreachable
52: ; preds = %45
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 3
%55 = load i8*, i8** %54
%56 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %55)
store i32 %56, i32* %10
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 4
%59 = load i8*, i8** %58
%60 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %59)
store i32 %60, i32* %11
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 5
%63 = load i8*, i8** %62
%64 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %63)
store i32 %64, i32* %12
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 6
%67 = load i8*, i8** %66
%68 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %67)
store i32 %68, i32* %13
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 7
%71 = load i8*, i8** %70
%72 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %71)
store i32 %72, i32* %14
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 8
%75 = load i8*, i8** %74
%76 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %75)
store i32 %76, i32* %15
%77 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%78 = call i32 (i8*, i64*, i64*, ...) bitcast (i32 (...)* @get_image_size to i32 (i8*, i64*, i64*, ...)*)(i8* %77, i64* %18, i64* %20)
%79 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%80 = call i32 (i8*, i64*, i64*, ...) bitcast (i32 (...)* @get_image_size to i32 (i8*, i64*, i64*, ...)*)(i8* %79, i64* %19, i64* %21)
%81 = load i64, i64* %18
%82 = load i64, i64* %20
%83 = call i32 (i64, i64, ...) bitcast (i32 (...)* @allocate_image_array to i32 (i64, i64, ...)*)(i64 %81, i64 %82)
%84 = sext i32 %83 to i64
%85 = inttoptr i64 %84 to i16**
store i16** %85, i16*** %22
%86 = load i64, i64* %19
%87 = load i64, i64* %21
%88 = call i32 (i64, i64, ...) bitcast (i32 (...)* @allocate_image_array to i32 (i64, i64, ...)*)(i64 %86, i64 %87)
%89 = sext i32 %88 to i64
%90 = inttoptr i64 %89 to i16**
store i16** %90, i16*** %23
%91 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%92 = load i16**, i16*** %22
%93 = call i32 (i8*, i16**, ...) bitcast (i32 (...)* @read_image_array to i32 (i8*, i16**, ...)*)(i8* %91, i16** %92)
%94 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%95 = load i16**, i16*** %23
%96 = call i32 (i8*, i16**, ...) bitcast (i32 (...)* @read_image_array to i32 (i8*, i16**, ...)*)(i8* %94, i16** %95)
%97 = load i32, i32* %10
%98 = load i32, i32* %11
%99 = load i32, i32* %12
%100 = load i32, i32* %13
%101 = load i32, i32* %14
%102 = load i32, i32* %15
%103 = load i64, i64* %18
%104 = load i64, i64* %20
%105 = load i64, i64* %19
%106 = load i64, i64* %21
%107 = call i32 (i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i32*, ...) bitcast (i32 (...)* @check_cut_and_paste_limits to i32 (i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i32*, ...)*)(i32 %97, i32 %98, i32 %99, i32 %100, i32 %101, i32 %102, i64 %103, i64 %104, i64 %105, i64 %106, i32* %9)
%108 = load i32, i32* %9
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %108)
%110 = load i32, i32* %9
%111 = icmp ne i32 %110, 0
br i1 %111, label %112, label %122
112: ; preds = %52
%113 = load i16**, i16*** %22
%114 = load i16**, i16*** %23
%115 = load i32, i32* %10
%116 = load i32, i32* %11
%117 = load i32, i32* %12
%118 = load i32, i32* %13
%119 = load i32, i32* %14
%120 = load i32, i32* %15
%121 = call i32 (i16**, i16**, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @paste_image_piece to i32 (i16**, i16**, i32, i32, i32, i32, i32, i32, ...)*)(i16** %113, i16** %114, i32 %115, i32 %116, i32 %117, i32 %118, i32 %119, i32 %120)
br label %122
122: ; preds = %112, %52
%123 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%124 = load i16**, i16*** %23
%125 = call i32 (i8*, i16**, ...) bitcast (i32 (...)* @write_image_array to i32 (i8*, i16**, ...)*)(i8* %123, i16** %124)
%126 = load i16**, i16*** %23
%127 = load i64, i64* %19
%128 = call i32 (i16**, i64, ...) bitcast (i32 (...)* @free_image_array to i32 (i16**, i64, ...)*)(i16** %126, i64 %127)
%129 = load i16**, i16*** %22
%130 = load i64, i64* %18
%131 = call i32 (i16**, i64, ...) bitcast (i32 (...)* @free_image_array to i32 (i16**, i64, ...)*)(i16** %129, i64 %130)
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"\0AERROR input file %s does not exist\00"
@.str.2 = [16 x i8] c"\0AMAIN> is_ok=%d\00"
@str = [139 x i8] c"\0A\0A usage: maincp in-file out_file in-il in-ie in-ll in-le out-il out-ie\0A\0A The image portion is pasted from the \0A in-file into the out-file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%12 = bitcast i32* %5 to i8*
%13 = bitcast i64* %6 to i8*
%14 = bitcast i64* %7 to i8*
%15 = bitcast i64* %8 to i8*
%16 = bitcast i64* %9 to i8*
%17 = icmp eq i32 %0, 9
br i1 %17, label %20, label %18
18: ; preds = %2
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
20: ; preds = %2
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = call i8* @strcpy(i8* %10, i8* dereferenceable(1) %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i8* @strcpy(i8* %11, i8* dereferenceable(1) %25)
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @does_not_exist to i32 (i8*, ...)*)(i8* %10)
%28 = icmp eq i32 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %20
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %10)
unreachable
31: ; preds = %20
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @does_not_exist to i32 (i8*, ...)*)(i8* %11)
%33 = icmp eq i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %11)
unreachable
36: ; preds = %31
%37 = getelementptr inbounds i8*, i8** %1, i64 3
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %38)
%40 = getelementptr inbounds i8*, i8** %1, i64 4
%41 = load i8*, i8** %40
%42 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %41)
%43 = getelementptr inbounds i8*, i8** %1, i64 5
%44 = load i8*, i8** %43
%45 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %44)
%46 = getelementptr inbounds i8*, i8** %1, i64 6
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %47)
%49 = getelementptr inbounds i8*, i8** %1, i64 7
%50 = load i8*, i8** %49
%51 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %50)
%52 = getelementptr inbounds i8*, i8** %1, i64 8
%53 = load i8*, i8** %52
%54 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %53)
%55 = call i32 (i8*, i64*, i64*, ...) bitcast (i32 (...)* @get_image_size to i32 (i8*, i64*, i64*, ...)*)(i8* %10, i64* %6, i64* %8)
%56 = call i32 (i8*, i64*, i64*, ...) bitcast (i32 (...)* @get_image_size to i32 (i8*, i64*, i64*, ...)*)(i8* %11, i64* %7, i64* %9)
%57 = load i64, i64* %6
%58 = load i64, i64* %8
%59 = call i32 (i64, i64, ...) bitcast (i32 (...)* @allocate_image_array to i32 (i64, i64, ...)*)(i64 %57, i64 %58)
%60 = sext i32 %59 to i64
%61 = inttoptr i64 %60 to i16**
%62 = load i64, i64* %7
%63 = load i64, i64* %9
%64 = call i32 (i64, i64, ...) bitcast (i32 (...)* @allocate_image_array to i32 (i64, i64, ...)*)(i64 %62, i64 %63)
%65 = sext i32 %64 to i64
%66 = inttoptr i64 %65 to i16**
%67 = call i32 (i8*, i16**, ...) bitcast (i32 (...)* @read_image_array to i32 (i8*, i16**, ...)*)(i8* %10, i16** %61)
%68 = call i32 (i8*, i16**, ...) bitcast (i32 (...)* @read_image_array to i32 (i8*, i16**, ...)*)(i8* %11, i16** %66)
%69 = load i64, i64* %6
%70 = load i64, i64* %8
%71 = load i64, i64* %7
%72 = load i64, i64* %9
%73 = call i32 (i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i32*, ...) bitcast (i32 (...)* @check_cut_and_paste_limits to i32 (i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i32*, ...)*)(i32 %39, i32 %42, i32 %45, i32 %48, i32 %51, i32 %54, i64 %69, i64 %70, i64 %71, i64 %72, i32* %5)
%74 = load i32, i32* %5
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %5
%77 = icmp eq i32 %76, 0
br i1 %77, label %80, label %78
78: ; preds = %36
%79 = call i32 (i16**, i16**, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @paste_image_piece to i32 (i16**, i16**, i32, i32, i32, i32, i32, i32, ...)*)(i16** %61, i16** %66, i32 %39, i32 %42, i32 %45, i32 %48, i32 %51, i32 %54)
br label %80
80: ; preds = %78, %36
%81 = call i32 (i8*, i16**, ...) bitcast (i32 (...)* @write_image_array to i32 (i8*, i16**, ...)*)(i8* %11, i16** %66)
%82 = load i64, i64* %7
%83 = call i32 (i16**, i64, ...) bitcast (i32 (...)* @free_image_array to i32 (i16**, i64, ...)*)(i16** %66, i64 %82)
%84 = load i64, i64* %6
%85 = call i32 (i16**, i64, ...) bitcast (i32 (...)* @free_image_array to i32 (i16**, i64, ...)*)(i16** %61, i64 %84)
ret i32 0
}