#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 /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ createStatsFile(char *, char *);
int /*<<< orphan*/ createStegImg(char *, char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ readStegImg(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  switch (argc) {
  case 2:
    createStatsFile(argv[1], "picts/resultOrig.dat");
    createStegImg(argv[1], "picts/stegano.tga", "Labor omnia vincit improbus.");
    createStatsFile("picts/stegano.tga", "picts/resultSteg.dat");
    readStegImg("picts/stegano.tga");
    exit(EXIT_SUCCESS);
    break;
  default:
    usage();
    exit(EXIT_FAILURE);
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
jne    11d3 <main+0x83>
jmp    1177 <main+0x27>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7a(%rip),%rsi
call   1030 <createStatsFile@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7b(%rip),%rsi
lea    0xe86(%rip),%rdx
call   1040 <createStegImg@plt>
lea    0xe68(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1030 <createStatsFile@plt>
lea    0xe55(%rip),%rdi
call   1050 <readStegImg@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1060 <usage@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    11a8 <main+0x58>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe9c(%rip),%rsi
call   1030 <createStatsFile@plt>
mov    0x8(%rbx),%rdi
lea    0xea1(%rip),%rbx
lea    0xeac(%rip),%rdx
mov    %rbx,%rsi
call   1040 <createStegImg@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <createStatsFile@plt>
mov    %rbx,%rdi
call   1050 <readStegImg@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1060 <usage@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"picts/resultOrig.dat\00"
@.str.1 = [18 x i8] c"picts/stegano.tga\00"
@.str.2 = [29 x i8] c"Labor omnia vincit improbus.\00"
@.str.3 = [21 x i8] c"picts/resultSteg.dat\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
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
switch i32 %6, label %20 [
i32 2, label %7
]
7: ; preds = %2
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @createStatsFile(i8* %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @createStegImg(i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @createStatsFile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @readStegImg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @EXIT_SUCCESS
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %2
%21 = call i32 (...) @usage()
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"picts/resultOrig.dat\00"
@.str.1 = [18 x i8] c"picts/stegano.tga\00"
@.str.2 = [29 x i8] c"Labor omnia vincit improbus.\00"
@.str.3 = [21 x i8] c"picts/resultSteg.dat\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @createStatsFile(i8* %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %5
%9 = tail call i32 @createStegImg(i8* %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @createStatsFile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @readStegImg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_SUCCESS
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = tail call i32 (...) @usage()
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
}