#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*/ compressFile_orDie(char const *const, char const *const,
                                      int);
char *createOutFilename_orDie(char const *const);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char **argv) {
  const char *const exeName = argv[0];
  if (argc != 2) {
    printf("wrong arguments\n");
    printf("usage:\n");
    printf("%s FILE\n", exeName);
    return 1;
  }
  const char *const inFilename = argv[1];
  const char *const outFilename = createOutFilename_orDie(inFilename);
  compressFile_orDie(inFilename, outFilename, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1195 <main+0x65>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c7 <main+0x97>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <createOutFilename_orDie@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1050 <compressFile_orDie@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1166 <main+0x26>
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1050 <createOutFilename_orDie@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1060 <compressFile_orDie@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    (%rsi),%rbx
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"wrong arguments\0A\00"
@.str.1 = [8 x i8] c"usage:\0A\00"
@.str.2 = [9 x i8] c"%s FILE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%17 = load i8*, i8** %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %28
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
store i8* %22, i8** %7
%23 = load i8*, i8** %7
%24 = call i8* @createOutFilename_orDie(i8* %23)
store i8* %24, i8** %8
%25 = load i8*, i8** %7
%26 = load i8*, i8** %8
%27 = call i32 @compressFile_orDie(i8* %25, i8* %26, i32 1)
store i32 0, i32* %3
br label %28
28: ; preds = %19, %14
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@.str.2 = [9 x i8] c"%s FILE\0A\00"
@str = [16 x i8] c"wrong arguments\00"
@str.3 = [7 x i8] c"usage:\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %5)
br label %14
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i8* @createOutFilename_orDie(i8* %11)
%13 = tail call i32 @compressFile_orDie(i8* %11, i8* %12, i32 1)
br label %14
14: ; preds = %9, %4
%15 = phi i32 [ 1, %4 ], [ 0, %9 ]
ret i32 %15
}