#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*/ draw_something();
int /*<<< orphan*/ dump_fb_fix_info();
int /*<<< orphan*/ dump_fb_var_info();
int /*<<< orphan*/ fb_acquire();
int /*<<< orphan*/ fb_release();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc > 1) {
    if (!strcmp(argv[1], "-fi"))
      dump_fb_fix_info();
    else if (!strcmp(argv[1], "-vi"))
      dump_fb_var_info();
    else
      printf("Unknown option '%s'\n", argv[1]);
    return 0;
  }
  if (!fb_acquire()) {
    fb_release();
    return 1;
  }
  draw_something();
  getchar();
  fb_release();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1217 <main+0x97>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe51(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11c9 <main+0x49>
mov    $0x0,%al
call   10a0 <dump_fb_fix_info@plt>
jmp    120b <main+0x8b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11f2 <main+0x72>
mov    $0x0,%al
call   1080 <dump_fb_var_info@plt>
jmp    1206 <main+0x86>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe07(%rip),%rdi
call   1040 <printf@plt>
jmp    120b <main+0x8b>
movl   $0x0,-0x4(%rbp)
jmp    1256 <main+0xd6>
mov    $0x0,%al
call   1030 <fb_acquire@plt>
cmp    $0x0,%eax
jne    123a <main+0xba>
mov    $0x0,%al
call   1090 <fb_release@plt>
movl   $0x1,-0x4(%rbp)
jmp    1256 <main+0xd6>
mov    $0x0,%al
call   1050 <draw_something@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
mov    $0x0,%al
call   1090 <fb_release@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     11c3 <main+0x43>
mov    0x8(%rsi),%rbx
lea    0xe6f(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     11e7 <main+0x67>
lea    0xe60(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1200 <main+0x80>
lea    0xe51(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %ebx,%ebx
jmp    1209 <main+0x89>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <fb_acquire@plt>
test   %eax,%eax
je     11f2 <main+0x72>
xor    %eax,%eax
call   1050 <draw_something@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
call   1090 <fb_release@plt>
jmp    1209 <main+0x89>
xor    %ebx,%ebx
xor    %eax,%eax
call   10a0 <dump_fb_fix_info@plt>
jmp    1209 <main+0x89>
xor    %eax,%eax
call   1090 <fb_release@plt>
mov    $0x1,%ebx
jmp    1209 <main+0x89>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <dump_fb_var_info@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"-fi\00"
@.str.1 = [4 x i8] c"-vi\00"
@.str.2 = [21 x i8] c"Unknown option '%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %31
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = call i32 (...) @dump_fb_fix_info()
br label %30
16: ; preds = %8
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = call i32 (...) @dump_fb_var_info()
br label %29
24: ; preds = %16
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %24, %22
br label %30
30: ; preds = %29, %14
store i32 0, i32* %3
br label %40
31: ; preds = %2
%32 = call i32 (...) @fb_acquire()
%33 = icmp ne i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = call i32 (...) @fb_release()
store i32 1, i32* %3
br label %40
36: ; preds = %31
%37 = call i32 (...) @draw_something()
%38 = call i32 (...) @getchar()
%39 = call i32 (...) @fb_release()
store i32 0, i32* %3
br label %40
40: ; preds = %36, %34, %30
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
@.str = [4 x i8] c"-fi\00"
@.str.1 = [4 x i8] c"-vi\00"
@.str.2 = [21 x i8] c"Unknown option '%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @dump_fb_fix_info()
br label %27
11: ; preds = %4
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (...) @dump_fb_var_info()
br label %27
16: ; preds = %11
%17 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %27
18: ; preds = %2
%19 = tail call i32 (...) @fb_acquire()
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 (...) @fb_release()
br label %27
23: ; preds = %18
%24 = tail call i32 (...) @draw_something()
%25 = tail call i32 (...) @getchar()
%26 = tail call i32 (...) @fb_release()
br label %27
27: ; preds = %9, %16, %14, %23, %21
%28 = phi i32 [ 0, %23 ], [ 1, %21 ], [ 0, %14 ], [ 0, %16 ], [ 0, %9 ]
ret i32 %28
}