#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 EXIT_SUCCESS;
int /*<<< orphan*/ extractPanel(char *, char *);
int /*<<< orphan*/ finalizeInstall(char *, char *);
int /*<<< orphan*/ logOut(char *, ...);
int /*<<< orphan*/ logOutFile(char *, char *);
int validateDependencies();
int innerMain(bool testInstall, char *installPath, char *installUser) {
  logOut("PufferPanel Installer - Version C-%s (%s)\n", "0.0.1", "0.8.1-beta");
  logOutFile("Testing install: %s\n", testInstall ? "true" : "false");
  logOutFile("Install path: %s\n", installPath);
  logOutFile("Install user: %s\n", installUser);
  logOut("-----\n");
  bool result = validateDependencies();
  logOut("-----\n");
  if (result) {
    logOut("Dependencies are met, installing.\n");
    if (testInstall) {
      logOut("Halting installation due to test flag being present.\n");
      return (EXIT_SUCCESS);
    }
  } else {
    logOut("Halting installation as dependencies are not met. Please fix this "
           "before continuing.\n");
    return (EXIT_FAILURE);
  }
  logOut("-----\n");
  logOut("Extracting panel\n");
  if (!extractPanel(installPath, installUser)) {
    return (EXIT_FAILURE);
  }
  logOut("-----\n");
  if (!finalizeInstall(installPath, installUser)) {
    return (EXIT_FAILURE);
  }
  logOut("-----\n");
  logOut("Installation complete, thank you for choosing PufferPanel!\n");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<innerMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe96(%rip),%rdi
lea    0xeba(%rip),%rsi
lea    0xeb9(%rip),%rdx
mov    $0x0,%al
call   1070 <logOut@plt>
mov    -0x8(%rbp),%ecx
lea    0xecd(%rip),%rsi
lea    0xec1(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe9e(%rip),%rdi
call   1040 <logOutFile@plt>
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <logOutFile@plt>
mov    -0x18(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <logOutFile@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
mov    $0x0,%al
call   1050 <validateDependencies@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
cmpl   $0x0,-0x1c(%rbp)
je     122f <innerMain+0xdf>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
cmpl   $0x0,-0x8(%rbp)
je     122a <innerMain+0xda>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
mov    0x2db8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12ee <innerMain+0x19e>
jmp    124e <innerMain+0xfe>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12ee <innerMain+0x19e>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <extractPanel@plt>
cmp    $0x0,%eax
jne    1291 <innerMain+0x141>
mov    0x2d59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12ee <innerMain+0x19e>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <finalizeInstall@plt>
cmp    $0x0,%eax
jne    12c6 <innerMain+0x176>
mov    0x2d24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12ee <innerMain+0x19e>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1070 <logOut@plt>
mov    0x2cef(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<innerMain>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xe98(%rip),%rdi
lea    0xebc(%rip),%rsi
lea    0xebb(%rip),%rdx
xor    %eax,%eax
call   1070 <logOut@plt>
test   %r12d,%r12d
lea    0xecf(%rip),%rax
lea    0xec3(%rip),%rsi
cmove  %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <logOutFile@plt>
lea    0xeb7(%rip),%rdi
mov    %r15,%rsi
call   1040 <logOutFile@plt>
lea    0xeba(%rip),%rdi
mov    %r14,%rsi
call   1040 <logOutFile@plt>
lea    0xebd(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
xor    %eax,%eax
call   1050 <validateDependencies@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
test   %ebp,%ebp
je     1207 <innerMain+0xb7>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
mov    0x2ddf(%rip),%rbp
test   %r12d,%r12d
je     1217 <innerMain+0xc7>
lea    0xea5(%rip),%rdi
jmp    127b <innerMain+0x12b>
mov    0x2dd2(%rip),%rbp
lea    0xecb(%rip),%rdi
jmp    127b <innerMain+0x12b>
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
lea    0xf0a(%rip),%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <extractPanel@plt>
mov    0x2d9b(%rip),%rbx
test   %eax,%eax
je     1285 <innerMain+0x135>
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <finalizeInstall@plt>
test   %eax,%eax
je     1285 <innerMain+0x135>
lea    0xe13(%rip),%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1070 <logOut@plt>
mov    %rbp,%rbx
mov    (%rbx),%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"PufferPanel Installer - Version C-%s (%s)\0A\00"
@.str.1 = [6 x i8] c"0.0.1\00"
@.str.2 = [11 x i8] c"0.8.1-beta\00"
@.str.3 = [21 x i8] c"Testing install: %s\0A\00"
@.str.4 = [5 x i8] c"true\00"
@.str.5 = [6 x i8] c"false\00"
@.str.6 = [18 x i8] c"Install path: %s\0A\00"
@.str.7 = [18 x i8] c"Install user: %s\0A\00"
@.str.8 = [7 x i8] c"-----\0A\00"
@.str.9 = [35 x i8] c"Dependencies are met, installing.\0A\00"
@.str.10 = [54 x i8] c"Halting installation due to test flag being present.\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.11 = [86 x i8] c"Halting installation as dependencies are not met. Please fix this before continuing.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.12 = [18 x i8] c"Extracting panel\0A\00"
@.str.13 = [60 x i8] c"Installation complete, thank you for choosing PufferPanel!\0A\00"
define i32 @innerMain(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0)
%14 = call i32 @logOutFile(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %6
%16 = call i32 @logOutFile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %7
%18 = call i32 @logOutFile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 (...) @validateDependencies()
store i32 %20, i32* %8
%21 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%22 = load i32, i32* %8
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %3
%25 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
%26 = load i32, i32* %5
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.10, i64 0, i64 0))
%30 = load i32, i32* @EXIT_SUCCESS
store i32 %30, i32* %4
br label %56
31: ; preds = %24
br label %35
32: ; preds = %3
%33 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.11, i64 0, i64 0))
%34 = load i32, i32* @EXIT_FAILURE
store i32 %34, i32* %4
br label %56
35: ; preds = %31
%36 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%37 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
%38 = load i8*, i8** %6
%39 = load i8*, i8** %7
%40 = call i32 @extractPanel(i8* %38, i8* %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %35
%43 = load i32, i32* @EXIT_FAILURE
store i32 %43, i32* %4
br label %56
44: ; preds = %35
%45 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%46 = load i8*, i8** %6
%47 = load i8*, i8** %7
%48 = call i32 @finalizeInstall(i8* %46, i8* %47)
%49 = icmp ne i32 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %44
%51 = load i32, i32* @EXIT_FAILURE
store i32 %51, i32* %4
br label %56
52: ; preds = %44
%53 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%54 = call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.13, i64 0, i64 0))
%55 = load i32, i32* @EXIT_SUCCESS
store i32 %55, i32* %4
br label %56
56: ; preds = %52, %50, %42, %32, %28
%57 = load i32, i32* %4
ret i32 %57
}

LLVM IR (-O2):
@.str = [43 x i8] c"PufferPanel Installer - Version C-%s (%s)\0A\00"
@.str.1 = [6 x i8] c"0.0.1\00"
@.str.2 = [11 x i8] c"0.8.1-beta\00"
@.str.3 = [21 x i8] c"Testing install: %s\0A\00"
@.str.4 = [5 x i8] c"true\00"
@.str.5 = [6 x i8] c"false\00"
@.str.6 = [18 x i8] c"Install path: %s\0A\00"
@.str.7 = [18 x i8] c"Install user: %s\0A\00"
@.str.8 = [7 x i8] c"-----\0A\00"
@.str.9 = [35 x i8] c"Dependencies are met, installing.\0A\00"
@.str.10 = [54 x i8] c"Halting installation due to test flag being present.\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.11 = [86 x i8] c"Halting installation as dependencies are not met. Please fix this before continuing.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.12 = [18 x i8] c"Extracting panel\0A\00"
@.str.13 = [60 x i8] c"Installation complete, thank you for choosing PufferPanel!\0A\00"
define i32 @innerMain(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0)
%7 = tail call i32 @logOutFile(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%8 = tail call i32 @logOutFile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %1)
%9 = tail call i32 @logOutFile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %2)
%10 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 (...) @validateDependencies()
%12 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%13 = icmp eq i32 %11, 0
br i1 %13, label %27, label %14
14: ; preds = %3
%15 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
br i1 %5, label %16, label %27
16: ; preds = %14
%17 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
%19 = tail call i32 @extractPanel(i8* %1, i8* %2)
%20 = icmp eq i32 %19, 0
br i1 %20, label %31, label %21
21: ; preds = %16
%22 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%23 = tail call i32 @finalizeInstall(i8* %1, i8* %2)
%24 = icmp eq i32 %23, 0
br i1 %24, label %31, label %25
25: ; preds = %21
%26 = tail call i32 (i8*, ...) @logOut(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
br label %27
27: ; preds = %3, %14, %25
%28 = phi i8* [ getelementptr inbounds ([60 x i8], [60 x i8]* @.str.13, i64 0, i64 0), %25 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str.10, i64 0, i64 0), %14 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.11, i64 0, i64 0), %3 ]
%29 = phi i32* [ @EXIT_SUCCESS, %25 ], [ @EXIT_SUCCESS, %14 ], [ @EXIT_FAILURE, %3 ]
%30 = tail call i32 (i8*, ...) @logOut(i8* %28)
br label %31
31: ; preds = %27, %21, %16
%32 = phi i32* [ @EXIT_FAILURE, %16 ], [ @EXIT_FAILURE, %21 ], [ %29, %27 ]
%33 = load i32, i32* %32
ret i32 %33
}