#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*/ exit(int /*<<< orphan*/);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int Quit(int argc, char *argv[]) {
  int oc;
  char *b_opt_arg;
  while ((oc = getopt(argc, argv, "cl:\n")) != -1) {
    switch (oc) {
    case 'c':
      printf("Clean Success,exiting\n");
      sleep(2);
      break;
    case 'l':
      b_opt_arg = optarg;
      printf("Log :%s\n", optarg);
      sleep(2);
      break;
    case '\n':
      break;
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<Quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1200 <Quit+0xc0>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0xa,%eax
je     11f6 <Quit+0xb6>
jmp    1182 <Quit+0x42>
mov    -0x24(%rbp),%eax
sub    $0x63,%eax
je     11a4 <Quit+0x64>
jmp    1193 <Quit+0x53>
mov    -0x24(%rbp),%eax
sub    $0x6c,%eax
je     11c1 <Quit+0x81>
jmp    11fb <Quit+0xbb>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
jmp    11fb <Quit+0xbb>
mov    0x2e30(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e22(%rip),%rax
mov    (%rax),%rsi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
jmp    11fb <Quit+0xbb>
jmp    11fb <Quit+0xbb>
jmp    114f <Quit+0xf>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Quit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe99(%rip),%r14
lea    0xea0(%rip),%r15
mov    0x2e83(%rip),%r13
lea    0xe89(%rip),%r12
jmp    1198 <Quit+0x48>
xchg   %ax,%ax
mov    0x0(%r13),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <getopt@plt>
cmp    $0x63,%eax
je     11c0 <Quit+0x70>
cmp    $0x6c,%eax
je     1180 <Quit+0x30>
cmp    $0xffffffff,%eax
jne    1198 <Quit+0x48>
jmp    11ca <Quit+0x7a>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <puts@plt>
jmp    118e <Quit+0x3e>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"cl:\0A\00"
@.str.1 = [23 x i8] c"Clean Success,exiting\0A\00"
@optarg = global i8* null
@.str.2 = [9 x i8] c"Log :%s\0A\00"
define i32 @Quit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %3
%9 = load i8**, i8*** %4
%10 = call i32 @getopt(i32 %8, i8** %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %5
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %24
12: ; preds = %7
%13 = load i32, i32* %5
switch i32 %13, label %23 [
i32 99, label %14
i32 108, label %17
i32 10, label %22
]
14: ; preds = %12
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @sleep(i32 2)
br label %23
17: ; preds = %12
%18 = load i8*, i8** @optarg
store i8* %18, i8** %6
%19 = load i8*, i8** @optarg
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = call i32 @sleep(i32 2)
br label %23
22: ; preds = %12
br label %23
23: ; preds = %12, %22, %17, %14
br label %7
24: ; preds = %7
%25 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"cl:\0A\00"
@optarg = global i8* null
@.str.2 = [9 x i8] c"Log :%s\0A\00"
@str = [22 x i8] c"Clean Success,exiting\00"
define i32 @Quit(i32 %0, i8** %1) {
br label %3
3: ; preds = %12, %2
%4 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %4, label %12 [
i32 -1, label %13
i32 99, label %5
i32 108, label %7
]
5: ; preds = %3
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %10
7: ; preds = %3
%8 = load i8*, i8** @optarg
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %5, %7
%11 = tail call i32 @sleep(i32 2)
br label %12
12: ; preds = %10, %3
br label %3
13: ; preds = %3
%14 = tail call i32 @exit(i32 0)
unreachable
}