#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/unpair.py", "unpair.py", NULL);
  } else if (argc == 3 && strncmp("-f", argv[1], 2) == 0) {
    execl("/usr/lib/latch/system/unpair.py", "unpair.py", "-f", argv[3], NULL);
  } else {
    printf("use 'unpairSYS [-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    0xe99(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11c9 <main+0x99>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xe56(%rip),%rdi
lea    0xe65(%rip),%rsi
lea    0xe68(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1050 <execl@plt>
jmp    11d5 <main+0xa5>
lea    0xe53(%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    0xebe(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     117f <main+0x4f>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
jmp    11a2 <main+0x72>
mov    0x18(%rbx),%rcx
lea    0xe76(%rip),%rdi
lea    0xe85(%rip),%rsi
lea    0xe88(%rip),%rdx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <execl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"/usr/lib/latch/system/unpair.py\00"
@.str.1 = [10 x i8] c"unpair.py\00"
@.str.2 = [3 x i8] c"-f\00"
@.str.3 = [33 x i8] c"use 'unpairSYS [-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 ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 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 3
%22 = load i8*, i8** %21
%23 = call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, 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 ([33 x i8], [33 x i8]* @.str.3, 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 = [32 x i8] c"/usr/lib/latch/system/unpair.py\00"
@.str.1 = [10 x i8] c"unpair.py\00"
@.str.2 = [3 x i8] c"-f\00"
@str = [32 x i8] c"use 'unpairSYS [-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 ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 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 3
%12 = load i8*, i8** %11
%13 = tail call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, 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 ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %10, %14, %3
ret i32 0
}