#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_partition_status(uint8_t status) {
  fprintf(stdout, " - status: ");
  if (status == 0x80) {
    fprintf(stdout, "bootable\n");
    return;
  }
  if (status == 0x00) {
    fprintf(stdout, "non-bootable\n");
    return;
  }
  if (status == 0x81) {
    fprintf(stdout, "bootable lba\n");
    return;
  }
  if (status == 0x01) {
    fprintf(stdout, "non-bootable lba\n");
    return;
  }
  fprintf(stdout, "invalid partition status\n");
}


x86 assembly (clang, -O0):
<print_partition_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x80,-0x4(%rbp)
jne    1157 <print_partition_status+0x47>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11db <print_partition_status+0xcb>
cmpl   $0x0,-0x4(%rbp)
jne    117b <print_partition_status+0x6b>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11db <print_partition_status+0xcb>
cmpl   $0x81,-0x4(%rbp)
jne    11a2 <print_partition_status+0x92>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xe86(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11db <print_partition_status+0xcb>
cmpl   $0x1,-0x4(%rbp)
jne    11c6 <print_partition_status+0xb6>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
lea    0xe5e(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11db <print_partition_status+0xcb>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe56(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_partition_status>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec3(%rip),%r14
mov    (%r14),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x7f,%ebx
jg     1143 <print_partition_status+0x33>
test   %ebx,%ebx
je     1165 <print_partition_status+0x55>
cmp    $0x1,%ebx
jne    115c <print_partition_status+0x4c>
lea    0xed9(%rip),%rsi
jmp    1175 <print_partition_status+0x65>
cmp    $0x80,%ebx
je     116e <print_partition_status+0x5e>
cmp    $0x81,%ebx
jne    115c <print_partition_status+0x4c>
lea    0xec4(%rip),%rsi
jmp    1175 <print_partition_status+0x65>
lea    0xec9(%rip),%rsi
jmp    1175 <print_partition_status+0x65>
lea    0xea0(%rip),%rsi
jmp    1175 <print_partition_status+0x65>
lea    0xe9b(%rip),%rsi
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c" - status: \00"
@.str.1 = [10 x i8] c"bootable\0A\00"
@.str.2 = [14 x i8] c"non-bootable\0A\00"
@.str.3 = [14 x i8] c"bootable lba\0A\00"
@.str.4 = [18 x i8] c"non-bootable lba\0A\00"
@.str.5 = [26 x i8] c"invalid partition status\0A\00"
define void @print_partition_status(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 128
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %31
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* @stdout
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %31
16: ; preds = %10
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 129
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* @stdout
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %31
22: ; preds = %16
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* @stdout
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %31
28: ; preds = %22
%29 = load i32, i32* @stdout
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %28, %25, %19, %13, %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c" - status: \00"
@.str.1 = [10 x i8] c"bootable\0A\00"
@.str.2 = [14 x i8] c"non-bootable\0A\00"
@.str.3 = [14 x i8] c"bootable lba\0A\00"
@.str.4 = [18 x i8] c"non-bootable lba\0A\00"
@.str.5 = [26 x i8] c"invalid partition status\0A\00"
define void @print_partition_status(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %7 [
i32 128, label %8
i32 0, label %4
i32 129, label %5
i32 1, label %6
]
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4
%9 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %1 ]
%10 = load i32, i32* @stdout
%11 = tail call i32 @fprintf(i32 %10, i8* %9)
ret void
}