#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ atoi(char *);
scalar_t__ deconvolute_image(char *, char *, char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 4) {
    fprintf(stderr, "Usage: deconvolute [input 16-bit TIFF image] [psf 8-bit "
                    "TIFF image] [number of iterations]\n");
    fflush(stderr);
    return EXIT_FAILURE;
  }
  if (deconvolute_image(argv[1], argv[2], "deconvoluted_image.tif",
                        atoi(argv[3]), 8) != 0) {
    return EXIT_FAILURE;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1194 <main+0x54>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11f7 <main+0xb7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%ecx
lea    0xe92(%rip),%rdx
mov    $0x8,%r8d
call   1030 <deconvolute_image@plt>
cmp    $0x0,%rax
je     11f0 <main+0xb0>
mov    0x2df2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11f7 <main+0xb7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x4,%edi
jne    1180 <main+0x40>
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%r14
mov    0x18(%rsi),%rdi
call   1060 <atoi@plt>
lea    0xefb(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%ecx
mov    $0x8,%r8d
call   1030 <deconvolute_image@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    119c <main+0x5c>
jmp    11a5 <main+0x65>
mov    0x2e59(%rip),%rbx
mov    (%rbx),%edi
lea    0xe70(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [92 x i8] c"Usage: deconvolute [input 16-bit TIFF image] [psf 8-bit TIFF image] [number of iterations]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [23 x i8] c"deconvoluted_image.tif\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 4
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
%13 = load i32, i32* @EXIT_FAILURE
store i32 %13, i32* %3
br label %30
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
%25 = call i64 @deconvolute_image(i8* %17, i8* %20, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 8)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %14
%28 = load i32, i32* @EXIT_FAILURE
store i32 %28, i32* %3
br label %30
29: ; preds = %14
store i32 0, i32* %3
br label %30
30: ; preds = %29, %27, %8
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [92 x i8] c"Usage: deconvolute [input 16-bit TIFF image] [psf 8-bit TIFF image] [number of iterations]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [23 x i8] c"deconvoluted_image.tif\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
br label %22
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = tail call i64 @deconvolute_image(i8* %12, i8* %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 8)
%19 = icmp eq i64 %18, 0
%20 = load i32, i32* @EXIT_FAILURE
%21 = select i1 %19, i32 0, i32 %20
br label %22
22: ; preds = %10, %4
%23 = phi i32 [ %9, %4 ], [ %21, %10 ]
ret i32 %23
}