#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*/ load_menu();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raext1024();
int /*<<< orphan*/ raext2048();
int /*<<< orphan*/ raext256();
int /*<<< orphan*/ raext3072();
int /*<<< orphan*/ raext4096();
int /*<<< orphan*/ raext512();
int /*<<< orphan*/ scanf(char *, int *);
void readaheadext() {
  printf("Cache size of External SDCard?\n\n");
  printf(" [1] 256kb (default)\n");
  printf(" [2] 512kb\n");
  printf(" [3] 1024kb\n");
  printf(" [4] 2048kb\n");
  printf(" [5] 3072kb\n");
  printf(" [6] 4096kb\n");
  printf(" [0] Cancel\n");
  printf("\nChoice: ");
  int raext;
  scanf("%d", &raext);
  if (raext == 1)
    raext256();
  if (raext == 2)
    raext512();
  if (raext == 3)
    raext1024();
  if (raext == 4)
    raext2048();
  if (raext == 5)
    raext3072();
  if (raext == 6)
    raext4096();
  if (raext == 0)
    load_menu();
}


x86 assembly (clang, -O0):
<readaheadext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe61(%rip),%rdi
call   1060 <printf@plt>
lea    0xe76(%rip),%rdi
call   1060 <printf@plt>
lea    0xe80(%rip),%rdi
call   1060 <printf@plt>
lea    0xe80(%rip),%rdi
call   1060 <printf@plt>
lea    0xe81(%rip),%rdi
call   1060 <printf@plt>
lea    0xe82(%rip),%rdi
call   1060 <printf@plt>
lea    0xe83(%rip),%rdi
call   1060 <printf@plt>
lea    0xe84(%rip),%rdi
call   1060 <printf@plt>
lea    0xe85(%rip),%rdi
call   1060 <printf@plt>
lea    0xe83(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1080 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1225 <readaheadext+0x95>
mov    $0x0,%al
call   1030 <raext256@plt>
cmpl   $0x2,-0x4(%rbp)
jne    1236 <readaheadext+0xa6>
mov    $0x0,%al
call   1070 <raext512@plt>
cmpl   $0x3,-0x4(%rbp)
jne    1247 <readaheadext+0xb7>
mov    $0x0,%al
call   1050 <raext1024@plt>
cmpl   $0x4,-0x4(%rbp)
jne    1258 <readaheadext+0xc8>
mov    $0x0,%al
call   10b0 <raext2048@plt>
cmpl   $0x5,-0x4(%rbp)
jne    1269 <readaheadext+0xd9>
mov    $0x0,%al
call   1090 <raext3072@plt>
cmpl   $0x6,-0x4(%rbp)
jne    127a <readaheadext+0xea>
mov    $0x0,%al
call   10a0 <raext4096@plt>
cmpl   $0x0,-0x4(%rbp)
jne    128b <readaheadext+0xfb>
mov    $0x0,%al
call   1040 <load_menu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readaheadext>:
push   %rax
lea    0xe65(%rip),%rdi
call   1050 <puts@plt>
lea    0xe79(%rip),%rdi
call   1050 <puts@plt>
lea    0xe82(%rip),%rdi
call   1050 <puts@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
lea    0xdf8(%rip),%rdi
call   1070 <printf@plt>
lea    0xdf6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1090 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     1246 <readaheadext+0xa6>
cmp    $0x2,%eax
je     1256 <readaheadext+0xb6>
cmp    $0x3,%eax
je     1266 <readaheadext+0xc6>
cmp    $0x4,%eax
je     1276 <readaheadext+0xd6>
cmp    $0x5,%eax
je     1286 <readaheadext+0xe6>
cmp    $0x6,%eax
je     1296 <readaheadext+0xf6>
test   %eax,%eax
je     12a5 <readaheadext+0x105>
pop    %rax
ret
xor    %eax,%eax
call   1030 <raext256@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jne    122c <readaheadext+0x8c>
xor    %eax,%eax
call   1080 <raext512@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
jne    1231 <readaheadext+0x91>
xor    %eax,%eax
call   1060 <raext1024@plt>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
jne    1236 <readaheadext+0x96>
xor    %eax,%eax
call   10c0 <raext2048@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
jne    123b <readaheadext+0x9b>
xor    %eax,%eax
call   10a0 <raext3072@plt>
mov    0x4(%rsp),%eax
cmp    $0x6,%eax
jne    1240 <readaheadext+0xa0>
xor    %eax,%eax
call   10b0 <raext4096@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jne    1244 <readaheadext+0xa4>
xor    %eax,%eax
call   1040 <load_menu@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Cache size of External SDCard?\0A\0A\00"
@.str.1 = [22 x i8] c" [1] 256kb (default)\0A\00"
@.str.2 = [12 x i8] c" [2] 512kb\0A\00"
@.str.3 = [13 x i8] c" [3] 1024kb\0A\00"
@.str.4 = [13 x i8] c" [4] 2048kb\0A\00"
@.str.5 = [13 x i8] c" [5] 3072kb\0A\00"
@.str.6 = [13 x i8] c" [6] 4096kb\0A\00"
@.str.7 = [13 x i8] c" [0] Cancel\0A\00"
@.str.8 = [10 x i8] c"\0AChoice: \00"
@.str.9 = [3 x i8] c"%d\00"
define void @readaheadext() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (...) @raext256()
br label %16
16: ; preds = %14, %0
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @raext512()
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %1
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (...) @raext1024()
br label %26
26: ; preds = %24, %21
%27 = load i32, i32* %1
%28 = icmp eq i32 %27, 4
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @raext2048()
br label %31
31: ; preds = %29, %26
%32 = load i32, i32* %1
%33 = icmp eq i32 %32, 5
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 (...) @raext3072()
br label %36
36: ; preds = %34, %31
%37 = load i32, i32* %1
%38 = icmp eq i32 %37, 6
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 (...) @raext4096()
br label %41
41: ; preds = %39, %36
%42 = load i32, i32* %1
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 (...) @load_menu()
br label %46
46: ; preds = %44, %41
ret void
}

LLVM IR (-O2):
@.str.8 = [10 x i8] c"\0AChoice: \00"
@.str.9 = [3 x i8] c"%d\00"
@str = [32 x i8] c"Cache size of External SDCard?\0A\00"
@str.10 = [21 x i8] c" [1] 256kb (default)\00"
@str.11 = [11 x i8] c" [2] 512kb\00"
@str.12 = [12 x i8] c" [3] 1024kb\00"
@str.13 = [12 x i8] c" [4] 2048kb\00"
@str.14 = [12 x i8] c" [5] 3072kb\00"
@str.15 = [12 x i8] c" [6] 4096kb\00"
@str.16 = [12 x i8] c" [0] Cancel\00"
define void @readaheadext() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.11, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.12, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.14, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.15, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.16, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%11 = bitcast i32* %1 to i8*
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = call i32 (...) @raext256()
%17 = load i32, i32* %1
br label %18
18: ; preds = %15, %0
%19 = phi i32 [ %17, %15 ], [ %13, %0 ]
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = call i32 (...) @raext512()
%23 = load i32, i32* %1
br label %24
24: ; preds = %21, %18
%25 = phi i32 [ %23, %21 ], [ %19, %18 ]
%26 = icmp eq i32 %25, 3
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i32 (...) @raext1024()
%29 = load i32, i32* %1
br label %30
30: ; preds = %27, %24
%31 = phi i32 [ %29, %27 ], [ %25, %24 ]
%32 = icmp eq i32 %31, 4
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = call i32 (...) @raext2048()
%35 = load i32, i32* %1
br label %36
36: ; preds = %33, %30
%37 = phi i32 [ %35, %33 ], [ %31, %30 ]
%38 = icmp eq i32 %37, 5
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 (...) @raext3072()
%41 = load i32, i32* %1
br label %42
42: ; preds = %39, %36
%43 = phi i32 [ %41, %39 ], [ %37, %36 ]
%44 = icmp eq i32 %43, 6
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = call i32 (...) @raext4096()
%47 = load i32, i32* %1
br label %48
48: ; preds = %45, %42
%49 = phi i32 [ %47, %45 ], [ %43, %42 ]
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (...) @load_menu()
br label %53
53: ; preds = %51, %48
ret void
}