#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;
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char *argv[]) {
  int opt;
  char *config = NULL;
  char *type = NULL;
  while ((opt = getopt(argc, argv, "c:t:")) != -1) {
    switch (opt) {
    case 'c':
      config = optarg;
      break;
    case 't':
      type = optarg;
      break;
    }
  }
  printf("config %s, type %s\n", config, type);
}


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)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11b0 <main+0x90>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x63,%eax
je     118a <main+0x6a>
jmp    1179 <main+0x59>
mov    -0x2c(%rbp),%eax
sub    $0x74,%eax
je     119d <main+0x7d>
jmp    11ab <main+0x8b>
mov    0x2e67(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    11ab <main+0x8b>
mov    0x2e54(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1146 <main+0x26>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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
xor    %r14d,%r14d
lea    0xec6(%rip),%r12
mov    0x2eb7(%rip),%r13
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1040 <getopt@plt>
cmp    $0xffffffff,%eax
je     1178 <main+0x58>
cmp    $0x74,%eax
je     1172 <main+0x52>
cmp    $0x63,%eax
jne    1150 <main+0x30>
mov    0x0(%r13),%r14
jmp    1150 <main+0x30>
mov    0x0(%r13),%r15
jmp    1150 <main+0x30>
lea    0xe86(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"c:t:\00"
@optarg = global i8* null
@.str.1 = [20 x i8] c"config %s, type %s\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
store i8* null, i8** %7
store i8* null, i8** %8
br label %9
9: ; preds = %20, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt(i32 %10, i8** %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %6
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %21
14: ; preds = %9
%15 = load i32, i32* %6
switch i32 %15, label %20 [
i32 99, label %16
i32 116, label %18
]
16: ; preds = %14
%17 = load i8*, i8** @optarg
store i8* %17, i8** %7
br label %20
18: ; preds = %14
%19 = load i8*, i8** @optarg
store i8* %19, i8** %8
br label %20
20: ; preds = %14, %18, %16
br label %9
21: ; preds = %9
%22 = load i8*, i8** %7
%23 = load i8*, i8** %8
%24 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %22, i8* %23)
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [5 x i8] c"c:t:\00"
@optarg = global i8* null
@.str.1 = [20 x i8] c"config %s, type %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i8* [ %11, %10 ], [ null, %2 ]
%5 = phi i8* [ %7, %10 ], [ null, %2 ]
br label %6
6: ; preds = %3, %12
%7 = phi i8* [ %5, %3 ], [ %13, %12 ]
br label %8
8: ; preds = %6, %8
%9 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %9, label %8 [
i32 -1, label %14
i32 99, label %10
i32 116, label %12
]
10: ; preds = %8
%11 = load i8*, i8** @optarg
br label %3
12: ; preds = %8
%13 = load i8*, i8** @optarg
br label %6
14: ; preds = %8
%15 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %7)
ret i32 0
}