#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 getopt(int, char **, char *);
char *optarg;
scalar_t__ optopt;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int oc;
  char ec;
  char *b_opt_arg;
  while ((oc = getopt(argc, argv, ":ngl:")) != -1) {
    switch (oc) {
    case 'n':
      printf("My name is Lyong.\n");
      break;
    case 'g':
      printf("Her name is Xxiong.\n");
      break;
    case 'l':
      b_opt_arg = optarg;
      printf("Our love is %s\n", optarg);
      break;
    case '?':
      ec = (char)optopt;
      printf("ÎÞÐ§µÄÑ¡Ïî×Ö·û \' %c \'!\n", ec);
      break;
    case ':':
      printf("È±ÉÙÑ¡Ïî²ÎÊý£¡\n");
      break;
    }
  }
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1235 <main+0x115>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x3a,%eax
je     1222 <main+0x102>
jmp    1169 <main+0x49>
mov    -0x24(%rbp),%eax
sub    $0x3f,%eax
je     11fe <main+0xde>
jmp    117a <main+0x5a>
mov    -0x24(%rbp),%eax
sub    $0x67,%eax
je     11c0 <main+0xa0>
jmp    118b <main+0x6b>
mov    -0x24(%rbp),%eax
sub    $0x6c,%eax
je     11d3 <main+0xb3>
jmp    119c <main+0x7c>
mov    -0x24(%rbp),%eax
sub    $0x6e,%eax
jne    1230 <main+0x110>
jmp    11ad <main+0x8d>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
mov    0x2e1e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e10(%rip),%rax
mov    (%rax),%rsi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
mov    0x2ddb(%rip),%rax
mov    (%rax),%rax
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%esi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb9(%rip),%r14
lea    0xf0b(%rip),%r13
lea    0xeb1(%rip),%r15
lea    0xf11(%rip),%r12
jmp    1170 <main+0x40>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <getopt@plt>
cmp    $0x66,%eax
jle    11a0 <main+0x70>
cmp    $0x67,%eax
je     11c4 <main+0x94>
cmp    $0x6c,%eax
je     11ce <main+0x9e>
cmp    $0x6e,%eax
jne    1170 <main+0x40>
mov    %r12,%rdi
call   1030 <puts@plt>
jmp    1170 <main+0x40>
nopl   0x0(%rax,%rax,1)
cmp    $0x3a,%eax
je     115e <main+0x2e>
cmp    $0x3f,%eax
jne    11e4 <main+0xb4>
mov    0x2e2f(%rip),%rax
movsbl (%rax),%esi
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1170 <main+0x40>
mov    %r13,%rdi
call   1030 <puts@plt>
jmp    1170 <main+0x40>
mov    0x2e23(%rip),%rax
mov    (%rax),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1170 <main+0x40>
cmp    $0xffffffff,%eax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c":ngl:\00"
@.str.1 = [19 x i8] c"My name is Lyong.\0A\00"
@.str.2 = [21 x i8] c"Her name is Xxiong.\0A\00"
@optarg = global i8* null
@.str.3 = [16 x i8] c"Our love is %s\0A\00"
@optopt = global i64 0
@.str.4 = [38 x i8] c"\C3\8E\C3\9E\C3\90\C2\A7\C2\B5\C3\84\C3\91\C2\A1\C3\8F\C3\AE\C3\97\C3\96\C2\B7\C3\BB ' %c '!\0A\00"
@.str.5 = [30 x i8] c"\C3\88\C2\B1\C3\89\C3\99\C3\91\C2\A1\C3\8F\C3\AE\C2\B2\C3\8E\C3\8A\C3\BD\C2\A3\C2\A1\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %9
9: ; preds = %32, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt(i32 %10, i8** %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %6
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %33
14: ; preds = %9
%15 = load i32, i32* %6
switch i32 %15, label %32 [
i32 110, label %16
i32 103, label %18
i32 108, label %20
i32 63, label %24
i32 58, label %30
]
16: ; preds = %14
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %32
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %32
20: ; preds = %14
%21 = load i8*, i8** @optarg
store i8* %21, i8** %8
%22 = load i8*, i8** @optarg
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %32
24: ; preds = %14
%25 = load i64, i64* @optopt
%26 = trunc i64 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %28)
br label %32
30: ; preds = %14
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
br label %32
32: ; preds = %14, %30, %24, %20, %18, %16
br label %9
33: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c":ngl:\00"
@optarg = global i8* null
@.str.3 = [16 x i8] c"Our love is %s\0A\00"
@optopt = global i64 0
@.str.4 = [38 x i8] c"\C3\8E\C3\9E\C3\90\C2\A7\C2\B5\C3\84\C3\91\C2\A1\C3\8F\C3\AE\C3\97\C3\96\C2\B7\C3\BB ' %c '!\0A\00"
@str = [29 x i8] c"\C3\88\C2\B1\C3\89\C3\99\C3\91\C2\A1\C3\8F\C3\AE\C2\B2\C3\8E\C3\8A\C3\BD\C2\A3\C2\A1\00"
@str.6 = [20 x i8] c"Her name is Xxiong.\00"
@str.7 = [18 x i8] c"My name is Lyong.\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %5, %2
%4 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
switch i32 %4, label %5 [
i32 -1, label %21
i32 110, label %6
i32 103, label %8
i32 108, label %10
i32 63, label %13
i32 58, label %19
]
5: ; preds = %3, %19, %13, %10, %8, %6
br label %3
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
br label %5
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
br label %5
10: ; preds = %3
%11 = load i8*, i8** @optarg
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %11)
br label %5
13: ; preds = %3
%14 = load i64, i64* @optopt
%15 = trunc i64 %14 to i32
%16 = shl i32 %15, 24
%17 = ashr exact i32 %16, 24
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %17)
br label %5
19: ; preds = %3
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %5
21: ; preds = %3
ret i32 0
}