#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 */
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int EXIT_SUCCESS;
int getopt_long(int, char **, char *, struct option *, int /*<<< orphan*/ *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ no_argument;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int opt;
  char *optstr = "h";
  struct option longopts[] = {{"help", no_argument, NULL, 'h'},
                              {NULL, no_argument, NULL, 0}};
  while ((opt = getopt_long(argc, argv, optstr, longopts, NULL)) != -1) {
    switch (opt) {
    case 'h':
      help();
    default:
      usage();
    }
  }
  printf("EichornCAD\n");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
lea    0xe7a(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2e4d(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x58(%rbp)
movl   $0x68,-0x48(%rbp)
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x60(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11f4 <main+0xa4>
mov    -0x14(%rbp),%eax
sub    $0x68,%eax
jne    11e8 <main+0x98>
jmp    11e1 <main+0x91>
mov    $0x0,%al
call   1070 <help@plt>
mov    $0x0,%al
call   1060 <usage@plt>
jmp    11ab <main+0x5b>
lea    0xe0c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
lea    0xe96(%rip),%rax
mov    %rax,(%rsp)
mov    0x2e69(%rip),%rax
mov    (%rax),%al
mov    %al,0x8(%rsp)
movl   $0x68,0x18(%rsp)
mov    %al,0x28(%rsp)
lea    0xe70(%rip),%r14
mov    %rsp,%r15
jmp    11ae <main+0x6e>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1060 <help@plt>
xor    %eax,%eax
call   1050 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1040 <getopt_long@plt>
cmp    $0x68,%eax
je     11a0 <main+0x60>
cmp    $0xffffffff,%eax
jne    11a7 <main+0x67>
lea    0xe35(%rip),%rdi
call   1030 <puts@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
@.str = [2 x i8] c"h\00"
@.str.1 = [5 x i8] c"help\00"
@no_argument = global i32 0
@.str.2 = [12 x i8] c"EichornCAD\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [2 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = bitcast [2 x %struct.option]* %8 to i8*
%10 = getelementptr inbounds [2 x %struct.option], [2 x %struct.option]* %8, i64 0, i64 0
%11 = getelementptr inbounds %struct.option, %struct.option* %10, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds %struct.option, %struct.option* %10, i32 0, i32 1
%13 = load i32, i32* @no_argument
%14 = trunc i32 %13 to i8
store i8 %14, i8* %12
%15 = getelementptr inbounds %struct.option, %struct.option* %10, i32 0, i32 3
store i32 104, i32* %15
%16 = getelementptr inbounds %struct.option, %struct.option* %10, i64 1
%17 = getelementptr inbounds %struct.option, %struct.option* %16, i32 0, i32 1
%18 = load i32, i32* @no_argument
%19 = trunc i32 %18 to i8
store i8 %19, i8* %17
br label %20
20: ; preds = %33, %2
%21 = load i32, i32* %4
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %7
%24 = getelementptr inbounds [2 x %struct.option], [2 x %struct.option]* %8, i64 0, i64 0
%25 = call i32 @getopt_long(i32 %21, i8** %22, i8* %23, %struct.option* %24, i32* null)
store i32 %25, i32* %6
%26 = icmp ne i32 %25, -1
br i1 %26, label %27, label %34
27: ; preds = %20
%28 = load i32, i32* %6
switch i32 %28, label %31 [
i32 104, label %29
]
29: ; preds = %27
%30 = call i32 (...) @help()
br label %31
31: ; preds = %27, %29
%32 = call i32 (...) @usage()
br label %33
33: ; preds = %31
br label %20
34: ; preds = %20
%35 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* @EXIT_SUCCESS
ret i32 %36
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
@.str = [2 x i8] c"h\00"
@.str.1 = [5 x i8] c"help\00"
@no_argument = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [11 x i8] c"EichornCAD\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [2 x %struct.option]
%4 = bitcast [2 x %struct.option]* %3 to i8*
%5 = getelementptr inbounds [2 x %struct.option], [2 x %struct.option]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x %struct.option], [2 x %struct.option]* %3, i64 0, i64 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [2 x %struct.option], [2 x %struct.option]* %3, i64 0, i64 0, i32 1
%8 = load i32, i32* @no_argument
%9 = trunc i32 %8 to i8
store i8 %9, i8* %7
%10 = getelementptr inbounds [2 x %struct.option], [2 x %struct.option]* %3, i64 0, i64 0, i32 3
store i32 104, i32* %10
%11 = getelementptr inbounds [2 x %struct.option], [2 x %struct.option]* %3, i64 0, i64 1, i32 1
store i8 %9, i8* %11
br label %12
12: ; preds = %16, %2
%13 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.option* %5, i32* null)
switch i32 %13, label %16 [
i32 -1, label %18
i32 104, label %14
]
14: ; preds = %12
%15 = call i32 (...) @help()
br label %16
16: ; preds = %12, %14
%17 = call i32 (...) @usage()
br label %12
18: ; preds = %12
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}