#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*/ go_back_n(int, char **);
int /*<<< orphan*/ lprintf(char *);
int /*<<< orphan*/ selective(int, char **);
int strlen(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    lprintf("Too less arguments.\n");
    return 0;
  }
  switch (argv[1][strlen(argv[1]) - 1]) {
  case 'G':
  case 'g':
    argv[1][strlen(argv[1]) - 1] = 0;
    go_back_n(argc, argv);
    break;
  case 'S':
  case 's':
    argv[1][strlen(argv[1]) - 1] = 0;
    selective(argc, argv);
    break;
  default:
    lprintf("Please select a mode before starting.\n");
    return 0;
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jge    1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1060 <lprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1270 <main+0x130>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    %rdi,-0x20(%rbp)
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
add    $0xffffffff,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
sub    $0x47,%eax
je     11dd <main+0x9d>
jmp    11aa <main+0x6a>
mov    -0x14(%rbp),%eax
sub    $0x53,%eax
je     1217 <main+0xd7>
jmp    11bb <main+0x7b>
mov    -0x14(%rbp),%eax
sub    $0x67,%eax
je     11dd <main+0x9d>
jmp    11cc <main+0x8c>
mov    -0x14(%rbp),%eax
sub    $0x73,%eax
je     1217 <main+0xd7>
jmp    1251 <main+0x111>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <go_back_n@plt>
jmp    1269 <main+0x129>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <selective@plt>
jmp    1269 <main+0x129>
lea    0xdbd(%rip),%rdi
call   1060 <lprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1270 <main+0x130>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jg     1157 <main+0x17>
lea    0xeb0(%rip),%rdi
call   1060 <lprintf@plt>
jmp    11c6 <main+0x86>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movsbl -0x1(%rax,%rbx,1),%eax
cmp    $0x66,%eax
jg     1180 <main+0x40>
cmp    $0x47,%eax
je     118a <main+0x4a>
cmp    $0x53,%eax
je     11a9 <main+0x69>
jmp    11cd <main+0x8d>
cmp    $0x73,%eax
je     11a9 <main+0x69>
cmp    $0x67,%eax
jne    11cd <main+0x8d>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <go_back_n@plt>
jmp    11c6 <main+0x86>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1050 <selective@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe41(%rip),%rdi
jmp    1150 <main+0x10>

LLVM IR (-O0):
@.str = [21 x i8] c"Too less arguments.\0A\00"
@.str.1 = [39 x i8] c"Please select a mode before starting.\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 slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @lprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %54
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strlen(i8* %16)
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %13, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
switch i32 %22, label %51 [
i32 71, label %23
i32 103, label %23
i32 83, label %37
i32 115, label %37
]
23: ; preds = %10, %10
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @strlen(i8* %29)
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %26, i64 %32
store i8 0, i8* %33
%34 = load i32, i32* %4
%35 = load i8**, i8*** %5
%36 = call i32 @go_back_n(i32 %34, i8** %35)
br label %53
37: ; preds = %10, %10
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i32 @strlen(i8* %43)
%45 = sub nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %40, i64 %46
store i8 0, i8* %47
%48 = load i32, i32* %4
%49 = load i8**, i8*** %5
%50 = call i32 @selective(i32 %48, i8** %49)
br label %53
51: ; preds = %10
%52 = call i32 @lprintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %54
53: ; preds = %37, %23
store i32 0, i32* %3
br label %54
54: ; preds = %53, %51, %8
%55 = load i32, i32* %3
ret i32 %55
}

LLVM IR (-O2):
@.str = [21 x i8] c"Too less arguments.\0A\00"
@.str.1 = [39 x i8] c"Please select a mode before starting.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @lprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %31
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
switch i32 %14, label %29 [
i32 71, label %15
i32 103, label %15
i32 83, label %22
i32 115, label %22
]
15: ; preds = %6, %6
%16 = load i8*, i8** %7
%17 = tail call i32 @strlen(i8* %16)
%18 = add nsw i32 %17, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 0, i8* %20
%21 = tail call i32 @go_back_n(i32 %0, i8** %1)
br label %31
22: ; preds = %6, %6
%23 = load i8*, i8** %7
%24 = tail call i32 @strlen(i8* %23)
%25 = add nsw i32 %24, -1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %23, i64 %26
store i8 0, i8* %27
%28 = tail call i32 @selective(i32 %0, i8** %1)
br label %31
29: ; preds = %6
%30 = tail call i32 @lprintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %15, %22, %29, %4
ret i32 0
}