#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*/ execl(char *, char *, char *, ...);
int /*<<< orphan*/ printf(char *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char **argv) {
  if (argc == 1) {
    execl("/usr/lib/latch/system/settingsGUI.py", "settingsGUI.py", NULL);
  } else if (argc == 3 && strncmp("-f", argv[1], 2) == 0) {
    execl("/usr/lib/latch/system/settings.py", "settings.py", "-f", argv[2],
          NULL);
  } else {
    printf("use 'sudo config_latchSYS [-f latch.conf]'\n");
  }
  return 0;
}


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)
cmpl   $0x1,-0x8(%rbp)
jne    116e <main+0x3e>
lea    0xea9(%rip),%rdi
lea    0xeb8(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1050 <execl@plt>
jmp    11da <main+0xaa>
cmpl   $0x3,-0x8(%rbp)
jne    11c9 <main+0x99>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11c9 <main+0x99>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe7e(%rip),%rdi
lea    0xe8d(%rip),%rsi
lea    0xe6d(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1050 <execl@plt>
jmp    11d5 <main+0xa5>
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
jmp    11da <main+0xaa>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
je     1154 <main+0x24>
cmp    $0x1,%edi
jne    1171 <main+0x41>
lea    0xebe(%rip),%rdi
lea    0xecd(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <execl@plt>
jmp    11a2 <main+0x72>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0xec3(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     117f <main+0x4f>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
jmp    11a2 <main+0x72>
mov    0x10(%rbx),%rcx
lea    0xe9e(%rip),%rdi
lea    0xead(%rip),%rsi
lea    0xe8d(%rip),%rdx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <execl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"/usr/lib/latch/system/settingsGUI.py\00"
@.str.1 = [15 x i8] c"settingsGUI.py\00"
@.str.2 = [3 x i8] c"-f\00"
@.str.3 = [34 x i8] c"/usr/lib/latch/system/settings.py\00"
@.str.4 = [12 x i8] c"settings.py\00"
@.str.5 = [44 x i8] c"use 'sudo config_latchSYS [-f latch.conf]'\0A\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 eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* null)
br label %27
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 3
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %16, i32 2)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %13
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %22, i8* null)
br label %26
24: ; preds = %13, %10
%25 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
br label %26
26: ; preds = %24, %19
br label %27
27: ; preds = %26, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"/usr/lib/latch/system/settingsGUI.py\00"
@.str.1 = [15 x i8] c"settingsGUI.py\00"
@.str.2 = [3 x i8] c"-f\00"
@.str.3 = [34 x i8] c"/usr/lib/latch/system/settings.py\00"
@.str.4 = [12 x i8] c"settings.py\00"
@str = [43 x i8] c"use 'sudo config_latchSYS [-f latch.conf]'\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %14 [
i32 1, label %3
i32 3, label %5
]
3: ; preds = %2
%4 = tail call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* null)
br label %16
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %12, i8* null)
br label %16
14: ; preds = %2, %5
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %10, %14, %3
ret i32 0
}