#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*/ abort();
int /*<<< orphan*/ exit(int);
char *get_hextime(int);
char getopt(int, char **, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char c;
  int uppercase = 0;
  while ((c = getopt(argc, argv, "hu")) != -1)
    switch (c) {
    case 'h':
      printf("u: uppercase, h: this message");
      exit(0);
    case 'u':
      uppercase = 1;
      break;
    case '?':
      printf("u: uppercase, h: this message");
      exit(1);
    default:
      abort();
    }
  printf("%s\n", get_hextime(uppercase));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe85(%rip),%rdx
call   1050 <getopt@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     120b <main+0xbb>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x3f,%eax
je     11e7 <main+0x97>
jmp    11a4 <main+0x54>
mov    -0x1c(%rbp),%eax
sub    $0x68,%eax
je     11c6 <main+0x76>
jmp    11b5 <main+0x65>
mov    -0x1c(%rbp),%eax
sub    $0x75,%eax
je     11db <main+0x8b>
jmp    11ff <main+0xaf>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
movl   $0x1,-0x18(%rbp)
jmp    1206 <main+0xb6>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    116d <main+0x1d>
mov    -0x18(%rbp),%edi
call   1060 <get_hextime@plt>
mov    %rax,%rsi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe90(%rip),%rdx
call   1060 <getopt@plt>
cmp    $0xff,%al
je     11a0 <main+0x40>
lea    0xe80(%rip),%r14
movsbl %al,%eax
cmp    $0x75,%eax
jne    11b6 <main+0x56>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
cmp    $0xff,%al
jne    1180 <main+0x20>
mov    $0x1,%edi
jmp    11a2 <main+0x42>
xor    %edi,%edi
call   1070 <get_hextime@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
cmp    $0x3f,%eax
je     11d5 <main+0x75>
cmp    $0x68,%eax
jne    11ed <main+0x8d>
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xe27(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"hu\00"
@.str.1 = [30 x i8] c"u: uppercase, h: this message\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %8
8: ; preds = %26, %2
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call signext i8 @getopt(i32 %9, i8** %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8 %11, i8* %6
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %27
14: ; preds = %8
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
switch i32 %16, label %24 [
i32 104, label %17
i32 117, label %20
i32 63, label %21
]
17: ; preds = %14
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %14
store i32 1, i32* %7
br label %26
21: ; preds = %14
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %14
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %20
br label %8
27: ; preds = %8
%28 = load i32, i32* %7
%29 = call i8* @get_hextime(i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"hu\00"
@.str.1 = [30 x i8] c"u: uppercase, h: this message\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8 %3, -1
br i1 %4, label %19, label %8
5: ; preds = %8
%6 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8 %6, -1
br i1 %7, label %19, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = sext i8 %9 to i32
switch i32 %10, label %17 [
i32 104, label %11
i32 117, label %5
i32 63, label %14
]
11: ; preds = %8
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @exit(i32 0)
unreachable
14: ; preds = %8
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %8
%18 = tail call i32 (...) @abort()
unreachable
19: ; preds = %5, %2
%20 = phi i32 [ 0, %2 ], [ 1, %5 ]
%21 = tail call i8* @get_hextime(i32 %20)
%22 = tail call i32 @puts(i8* dereferenceable(1) %21)
ret i32 0
}