#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*/ crash(char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ set_verbose(int);
void options(int argc, char *argv[]) {
  int option;
  while ((option = getopt(argc, argv, "v")) != -1)
    switch (option) {
    case 'v':
      set_verbose(1);
      break;
    default:
      crash("option processing");
    }
}


x86 assembly (clang, -O0):
<options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     118f <options+0x5f>
mov    -0x14(%rbp),%eax
sub    $0x76,%eax
jne    117e <options+0x4e>
jmp    116f <options+0x3f>
mov    $0x1,%edi
call   1050 <set_verbose@plt>
jmp    118a <options+0x5a>
lea    0xe7d(%rip),%rdi
call   1030 <crash@plt>
jmp    113f <options+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xebd(%rip),%r14
lea    0xeb8(%rip),%r15
jmp    115a <options+0x2a>
nopl   0x0(%rax)
mov    $0x1,%edi
call   1050 <set_verbose@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <getopt@plt>
cmp    $0x76,%eax
je     1150 <options+0x20>
cmp    $0xffffffff,%eax
je     117b <options+0x4b>
mov    %r15,%rdi
call   1030 <crash@plt>
jmp    115a <options+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"v\00"
@.str.1 = [18 x i8] c"option processing\00"
define void @options(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @getopt(i32 %7, i8** %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %5
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = load i32, i32* %5
switch i32 %12, label %15 [
i32 118, label %13
]
13: ; preds = %11
%14 = call i32 @set_verbose(i32 1)
br label %17
15: ; preds = %11
%16 = call i32 @crash(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"v\00"
@.str.1 = [18 x i8] c"option processing\00"
define void @options(i32 %0, i8** %1) {
br label %3
3: ; preds = %9, %2
%4 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
switch i32 %4, label %7 [
i32 -1, label %10
i32 118, label %5
]
5: ; preds = %3
%6 = tail call i32 @set_verbose(i32 1)
br label %9
7: ; preds = %3
%8 = tail call i32 @crash(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
br label %3
10: ; preds = %3
ret void
}