#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 */
char EOF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char getopt(int, char **, char *);
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char *delivery = "";
  int thick = 0;
  int count = 0;
  char ch;
  while ((ch = getopt(argc, argv, "d:t")) != EOF) {
    switch (ch) {
    case 'd':
      delivery = optarg;
      break;
    case 't':
      thick = 1;
      break;
    default:
      fprintf(stderr, "unkown option: %s\n", optarg);
      return 1;
    }
  }
  argc -= optind;
  argv += optind;
  if (thick) {
    puts("Thick crust");
  }
  if (delivery[0]) {
    printf("To be delivered %s.\n", delivery);
  }
  puts("Ingredients:");
  for (count = 0; count < argc; count++) {
  }
}


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)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe83(%rip),%rdx
call   1060 <getopt@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%eax
mov    0x2e51(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     120f <main+0xcf>
movsbl -0x21(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x64,%eax
je     11c0 <main+0x80>
jmp    11af <main+0x6f>
mov    -0x28(%rbp),%eax
sub    $0x74,%eax
je     11d3 <main+0x93>
jmp    11df <main+0x9f>
mov    0x2e31(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    120a <main+0xca>
movl   $0x1,-0x1c(%rbp)
jmp    120a <main+0xca>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
mov    0x2e09(%rip),%rax
mov    (%rax),%rdx
lea    0xe0b(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x15e>
jmp    116f <main+0x2f>
mov    0x2dc2(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2dae(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     124f <main+0x10f>
lea    0xdcd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     126c <main+0x12c>
mov    -0x18(%rbp),%rsi
lea    0xdbc(%rip),%rdi
call   1040 <printf@plt>
lea    0xdc5(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    129e <main+0x15e>
jmp    1290 <main+0x150>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    127f <main+0x13f>
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
lea    0xea9(%rip),%rdx
call   1060 <getopt@plt>
mov    0x2e7d(%rip),%r12
cmp    (%r12),%al
jne    1172 <main+0x32>
lea    0xec7(%rip),%r14
jmp    11d9 <main+0x99>
lea    0xebe(%rip),%r14
xor    %ecx,%ecx
lea    0xe7e(%rip),%r15
jmp    11a6 <main+0x66>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1060 <getopt@plt>
mov    %r13d,%ecx
cmp    (%r12),%al
je     11c8 <main+0x88>
movsbl %al,%eax
mov    $0x1,%r13d
cmp    $0x74,%eax
je     1190 <main+0x50>
cmp    $0x64,%eax
jne    120b <main+0xcb>
mov    0x2e38(%rip),%rax
mov    (%rax),%r14
mov    %ecx,%r13d
jmp    1190 <main+0x50>
test   %r13d,%r13d
je     11d9 <main+0x99>
lea    0xe43(%rip),%rdi
call   1030 <puts@plt>
cmpb   $0x0,(%r14)
je     11ee <main+0xae>
lea    0xe3d(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0xe43(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
mov    0x2ddd(%rip),%rax
mov    (%rax),%rdx
lea    0xddf(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%eax
jmp    11fc <main+0xbc>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"d:t\00"
@EOF = global i8 0
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [19 x i8] c"unkown option: %s\0A\00"
@optind = global i64 0
@.str.3 = [12 x i8] c"Thick crust\00"
@.str.4 = [21 x i8] c"To be delivered %s.\0A\00"
@.str.5 = [13 x i8] c"Ingredients:\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %28, %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call signext i8 @getopt(i32 %11, i8** %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8 %13, i8* %9
%14 = sext i8 %13 to i32
%15 = load i8, i8* @EOF
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %14, %16
br i1 %17, label %18, label %29
18: ; preds = %10
%19 = load i8, i8* %9
%20 = sext i8 %19 to i32
switch i32 %20, label %24 [
i32 100, label %21
i32 116, label %23
]
21: ; preds = %18
%22 = load i8*, i8** @optarg
store i8* %22, i8** %6
br label %28
23: ; preds = %18
store i32 1, i32* %7
br label %28
24: ; preds = %18
%25 = load i32, i32* @stderr
%26 = load i8*, i8** @optarg
%27 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %26)
store i32 1, i32* %3
br label %60
28: ; preds = %23, %21
br label %10
29: ; preds = %10
%30 = load i64, i64* @optind
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = sub nsw i64 %32, %30
%34 = trunc i64 %33 to i32
store i32 %34, i32* %4
%35 = load i64, i64* @optind
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 %35
store i8** %37, i8*** %5
%38 = load i32, i32* %7
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %29
%41 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40, %29
%43 = load i8*, i8** %6
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i8, i8* %44
%46 = icmp ne i8 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load i8*, i8** %6
%49 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %47, %42
%51 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %8
br label %52
52: ; preds = %57, %50
%53 = load i32, i32* %8
%54 = load i32, i32* %4
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %60
56: ; preds = %52
br label %57
57: ; preds = %56
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 1
store i32 %59, i32* %8
br label %52
60: ; preds = %24, %52
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"d:t\00"
@EOF = global i8 0
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [19 x i8] c"unkown option: %s\0A\00"
@optind = global i64 0
@.str.3 = [12 x i8] c"Thick crust\00"
@.str.4 = [21 x i8] c"To be delivered %s.\0A\00"
@.str.5 = [13 x i8] c"Ingredients:\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %27, label %6
6: ; preds = %2, %17
%7 = phi i8 [ %20, %17 ], [ %3, %2 ]
%8 = phi i32 [ %19, %17 ], [ 0, %2 ]
%9 = phi i8* [ %18, %17 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ]
%10 = sext i8 %7 to i32
switch i32 %10, label %13 [
i32 100, label %11
i32 116, label %17
]
11: ; preds = %6
%12 = load i8*, i8** @optarg
br label %17
13: ; preds = %6
%14 = load i32, i32* @stderr
%15 = load i8*, i8** @optarg
%16 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %35
17: ; preds = %6, %11
%18 = phi i8* [ %12, %11 ], [ %9, %6 ]
%19 = phi i32 [ %8, %11 ], [ 1, %6 ]
%20 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = load i8, i8* @EOF
%22 = icmp eq i8 %20, %21
br i1 %22, label %23, label %6
23: ; preds = %17
%24 = icmp eq i32 %19, 0
br i1 %24, label %27, label %25
25: ; preds = %23
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %2, %25, %23
%28 = phi i8* [ %18, %25 ], [ %18, %23 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ]
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %28)
br label %33
33: ; preds = %31, %27
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %35
35: ; preds = %33, %13
%36 = phi i32 [ 1, %13 ], [ 0, %33 ]
ret i32 %36
}