#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*/ alloc_16g();
int /*<<< orphan*/ alloc_16g_above_hint();
int /*<<< orphan*/ alloc_16g_below_hint();
int /*<<< orphan*/ alloc_16m();
int /*<<< orphan*/ alloc_16m_above_hint();
int /*<<< orphan*/ alloc_16m_below_hint();
int /*<<< orphan*/ alloc_64k_full();
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fixed_position();
int getopt(int, char **, char *);
int /*<<< orphan*/ mixed_position_16G();
int /*<<< orphan*/ mixed_position_16M();
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int option = 0;
  int scenario = 0;
  int ret = 0;
  if (argc < 2) {
    printf("Usage <execname> -s <scenario_no> \n");
    exit(-1);
  }
  option = getopt(argc, argv, "s:");
  if (option != -1) {
    scenario = atoi(optarg);
  }
  switch (scenario) {
  case 1:
    printf("\nScenario 1 : Alloc 64k page from 0-512 tb VA\n\n");
    alloc_64k_full();
    break;
  case 2:
    printf("\nScenario 2 : Get hugepage VA Below 128Tb mark \n\n");
    printf("1024 16M hugepages must be configured \n");
    printf("Else Test Fails\n\n");
    alloc_16m_below_hint();
    break;
  case 3:
    printf("\nScenario 3 : Get hugepage VA Above 128Tb mark \n\n");
    printf("1024 16M hugepages must be configured \n");
    printf("Else Test Fails\n\n");
    alloc_16m_above_hint();
    break;
  case 4:
    printf("\nScenario 4 : Get hugepage VA Above and Below 128Tb mark \n\n");
    printf("131072 16M hugepages must be configured \n");
    printf("Else Test Fails\n\n");
    alloc_16m();
    break;
  case 5:
    printf("\nScenario 5 : Get 16g hugepage VA Below 128T mark\n\n");
    printf("1 16G hugepages must be configured \n");
    printf("Else Test Fails\n\n");
    alloc_16g_below_hint();
    break;
  case 6:
    printf("\nScenario 6 : Get 16g hugepage VA Above 128T mark\n\n");
    printf("1 16G hugepages must be configured \n");
    printf("Else Test Fails\n\n");
    alloc_16g_above_hint();
    break;
  case 7:
    printf("\nScenario 7 : Get 16g hugepage VA below and Above 128T mark\n\n");
    printf("2 16G hugepages must be configured \n");
    printf("Else Test Fails\n\n");
    alloc_16g();
    break;
  case 8:
    printf("\nScenario 8 : Mix of all 64k 16M and 16G pages in VA\n\n");
    printf("130172 16M hugepages must be configured \n");
    printf("2 16G hugepages must be configured \n");
    printf("Else Test Fails\n\n");
    fixed_position();
    break;
  case 9:
    printf("\nScenario 9 : Mix 16M in between 64k and 16G pages in VA\n\n");
    printf("130172 16M hugepages must be configured \n");
    printf("2 16G hugepages must be configured \n\n");
    printf("Else Test Fails\n");
    mixed_position_16M();
    break;
  case 10:
    printf("\nScenario 9 : Mix 16G in between 64k and 16M pages in VA\n\n");
    printf("130172 16M hugepages must be configured \n");
    printf("2 16G hugepages must be configured \n");
    printf("Else Test Fails\n");
    mixed_position_16G();
    break;
  default:
    printf("Please Provide valid scenario\n");
    break;
  }
  printf("Test Passed!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    122b <main+0x4b>
lea    0xe0c(%rip),%rdi
call   1070 <printf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe13(%rip),%rdx
call   10d0 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     125c <main+0x7c>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x9,%eax
ja     1471 <main+0x291>
mov    -0x28(%rbp),%rax
lea    0xd84(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdc3(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <alloc_64k_full@plt>
jmp    147d <main+0x29d>
lea    0xddb(%rip),%rdi
call   1070 <printf@plt>
lea    0xe01(%rip),%rdi
call   1070 <printf@plt>
lea    0xe1d(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1080 <alloc_16m_below_hint@plt>
jmp    147d <main+0x29d>
lea    0xe17(%rip),%rdi
call   1070 <printf@plt>
lea    0xdd1(%rip),%rdi
call   1070 <printf@plt>
lea    0xded(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1100 <alloc_16m_above_hint@plt>
jmp    147d <main+0x29d>
lea    0xe19(%rip),%rdi
call   1070 <printf@plt>
lea    0xe49(%rip),%rdi
call   1070 <printf@plt>
lea    0xdbd(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10b0 <alloc_16m@plt>
jmp    147d <main+0x29d>
lea    0xe4f(%rip),%rdi
call   1070 <printf@plt>
lea    0xe77(%rip),%rdi
call   1070 <printf@plt>
lea    0xd8d(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1090 <alloc_16g_below_hint@plt>
jmp    147d <main+0x29d>
lea    0xe78(%rip),%rdi
call   1070 <printf@plt>
lea    0xe47(%rip),%rdi
call   1070 <printf@plt>
lea    0xd5d(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1050 <alloc_16g_above_hint@plt>
jmp    147d <main+0x29d>
lea    0xe7c(%rip),%rdi
call   1070 <printf@plt>
lea    0xeae(%rip),%rdi
call   1070 <printf@plt>
lea    0xd2d(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10c0 <alloc_16g@plt>
jmp    147d <main+0x29d>
lea    0xeaf(%rip),%rdi
call   1070 <printf@plt>
lea    0xeda(%rip),%rdi
call   1070 <printf@plt>
lea    0xe72(%rip),%rdi
call   1070 <printf@plt>
lea    0xcf1(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10a0 <fixed_position@plt>
jmp    147d <main+0x29d>
lea    0xed4(%rip),%rdi
call   1070 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1070 <printf@plt>
lea    0xef7(%rip),%rdi
call   1070 <printf@plt>
lea    0xf11(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1030 <mixed_position_16M@plt>
jmp    147d <main+0x29d>
lea    0xf0a(%rip),%rdi
call   1070 <printf@plt>
lea    0xe62(%rip),%rdi
call   1070 <printf@plt>
lea    0xdfa(%rip),%rdi
call   1070 <printf@plt>
lea    0xed5(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <mixed_position_16G@plt>
jmp    147d <main+0x29d>
lea    0xf09(%rip),%rdi
call   1070 <printf@plt>
lea    0xf1c(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1420 <main+0x240>
lea    0xe37(%rip),%rdx
call   10d0 <getopt@plt>
cmp    $0xffffffff,%eax
je     1236 <main+0x56>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
add    $0xffffffff,%eax
cmp    $0x9,%eax
ja     1236 <main+0x56>
lea    0xde8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1102(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1070 <alloc_64k_full@plt>
jmp    1242 <main+0x62>
lea    0x111c(%rip),%rdi
call   1060 <puts@plt>
lea    0xe1c(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0x1037(%rip),%rdi
call   1060 <puts@plt>
lea    0x108d(%rip),%rdi
call   1060 <puts@plt>
lea    0x10a8(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1100 <alloc_16m_above_hint@plt>
jmp    1242 <main+0x62>
lea    0xfa6(%rip),%rdi
call   1060 <puts@plt>
lea    0xfd5(%rip),%rdi
call   1060 <puts@plt>
lea    0x107b(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10b0 <alloc_16m@plt>
jmp    1242 <main+0x62>
lea    0xf22(%rip),%rdi
call   1060 <puts@plt>
lea    0xf49(%rip),%rdi
call   1060 <puts@plt>
lea    0x104e(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1090 <alloc_16g_below_hint@plt>
jmp    1242 <main+0x62>
lea    0xdff(%rip),%rdi
call   1060 <puts@plt>
lea    0xe29(%rip),%rdi
call   1060 <puts@plt>
lea    0xe83(%rip),%rdi
call   1060 <puts@plt>
lea    0x1012(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10a0 <fixed_position@plt>
jmp    1242 <main+0x62>
lea    0xd0c(%rip),%rdi
call   1060 <puts@plt>
lea    0xded(%rip),%rdi
call   1060 <puts@plt>
lea    0xe47(%rip),%rdi
call   1060 <puts@plt>
lea    0xd8f(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1040 <mixed_position_16G@plt>
jmp    1242 <main+0x62>
lea    0xf66(%rip),%rdi
call   1060 <puts@plt>
lea    0xf8b(%rip),%rdi
call   1060 <puts@plt>
lea    0xfa6(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1080 <alloc_16m_below_hint@plt>
jmp    1242 <main+0x62>
lea    0xe17(%rip),%rdi
call   1060 <puts@plt>
lea    0xe71(%rip),%rdi
call   1060 <puts@plt>
lea    0xf76(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1050 <alloc_16g_above_hint@plt>
jmp    1242 <main+0x62>
lea    0xd86(%rip),%rdi
call   1060 <puts@plt>
lea    0xdb7(%rip),%rdi
call   1060 <puts@plt>
lea    0xf46(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10c0 <alloc_16g@plt>
jmp    1242 <main+0x62>
lea    0xc88(%rip),%rdi
call   1060 <puts@plt>
lea    0xd21(%rip),%rdi
call   1060 <puts@plt>
lea    0xcaa(%rip),%rdi
call   1060 <puts@plt>
lea    0xcc3(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1030 <mixed_position_16M@plt>
jmp    1242 <main+0x62>
lea    0xf50(%rip),%rdi
call   1060 <puts@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage <execname> -s <scenario_no> \0A\00"
@.str.1 = [3 x i8] c"s:\00"
@optarg = global i32 0
@.str.2 = [48 x i8] c"\0AScenario 1 : Alloc 64k page from 0-512 tb VA\0A\0A\00"
@.str.3 = [50 x i8] c"\0AScenario 2 : Get hugepage VA Below 128Tb mark \0A\0A\00"
@.str.4 = [40 x i8] c"1024 16M hugepages must be configured \0A\00"
@.str.5 = [18 x i8] c"Else Test Fails\0A\0A\00"
@.str.6 = [50 x i8] c"\0AScenario 3 : Get hugepage VA Above 128Tb mark \0A\0A\00"
@.str.7 = [60 x i8] c"\0AScenario 4 : Get hugepage VA Above and Below 128Tb mark \0A\0A\00"
@.str.8 = [42 x i8] c"131072 16M hugepages must be configured \0A\00"
@.str.9 = [52 x i8] c"\0AScenario 5 : Get 16g hugepage VA Below 128T mark\0A\0A\00"
@.str.10 = [37 x i8] c"1 16G hugepages must be configured \0A\00"
@.str.11 = [52 x i8] c"\0AScenario 6 : Get 16g hugepage VA Above 128T mark\0A\0A\00"
@.str.12 = [62 x i8] c"\0AScenario 7 : Get 16g hugepage VA below and Above 128T mark\0A\0A\00"
@.str.13 = [37 x i8] c"2 16G hugepages must be configured \0A\00"
@.str.14 = [55 x i8] c"\0AScenario 8 : Mix of all 64k 16M and 16G pages in VA\0A\0A\00"
@.str.15 = [42 x i8] c"130172 16M hugepages must be configured \0A\00"
@.str.16 = [59 x i8] c"\0AScenario 9 : Mix 16M in between 64k and 16G pages in VA\0A\0A\00"
@.str.17 = [38 x i8] c"2 16G hugepages must be configured \0A\0A\00"
@.str.18 = [17 x i8] c"Else Test Fails\0A\00"
@.str.19 = [59 x i8] c"\0AScenario 9 : Mix 16G in between 64k and 16M pages in VA\0A\0A\00"
@.str.20 = [31 x i8] c"Please Provide valid scenario\0A\00"
@.str.21 = [15 x i8] c"Test Passed!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @getopt(i32 %15, i8** %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, -1
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i32, i32* @optarg
%22 = call i32 @atoi(i32 %21)
store i32 %22, i32* %7
br label %23
23: ; preds = %20, %14
%24 = load i32, i32* %7
switch i32 %24, label %76 [
i32 1, label %25
i32 2, label %28
i32 3, label %33
i32 4, label %38
i32 5, label %43
i32 6, label %48
i32 7, label %53
i32 8, label %58
i32 9, label %64
i32 10, label %70
]
25: ; preds = %23
%26 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (...) @alloc_64k_full()
br label %78
28: ; preds = %23
%29 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%30 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%32 = call i32 (...) @alloc_16m_below_hint()
br label %78
33: ; preds = %23
%34 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%35 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%37 = call i32 (...) @alloc_16m_above_hint()
br label %78
38: ; preds = %23
%39 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%40 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%41 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%42 = call i32 (...) @alloc_16m()
br label %78
43: ; preds = %23
%44 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0))
%45 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%46 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%47 = call i32 (...) @alloc_16g_below_hint()
br label %78
48: ; preds = %23
%49 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0))
%50 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%51 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%52 = call i32 (...) @alloc_16g_above_hint()
br label %78
53: ; preds = %23
%54 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.12, i64 0, i64 0))
%55 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%56 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%57 = call i32 (...) @alloc_16g()
br label %78
58: ; preds = %23
%59 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0))
%60 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0))
%61 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%62 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%63 = call i32 (...) @fixed_position()
br label %78
64: ; preds = %23
%65 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.16, i64 0, i64 0))
%66 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0))
%67 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.17, i64 0, i64 0))
%68 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
%69 = call i32 (...) @mixed_position_16M()
br label %78
70: ; preds = %23
%71 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.19, i64 0, i64 0))
%72 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0))
%73 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%74 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
%75 = call i32 (...) @mixed_position_16G()
br label %78
76: ; preds = %23
%77 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.20, i64 0, i64 0))
br label %78
78: ; preds = %76, %70, %64, %58, %53, %48, %43, %38, %33, %28, %25
%79 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"s:\00"
@optarg = global i32 0
@str = [58 x i8] c"\0AScenario 9 : Mix 16G in between 64k and 16M pages in VA\0A\00"
@str.25 = [14 x i8] c"Test Passed!!\00"
@str.26 = [58 x i8] c"\0AScenario 9 : Mix 16M in between 64k and 16G pages in VA\0A\00"
@str.28 = [37 x i8] c"2 16G hugepages must be configured \0A\00"
@str.29 = [16 x i8] c"Else Test Fails\00"
@str.30 = [54 x i8] c"\0AScenario 8 : Mix of all 64k 16M and 16G pages in VA\0A\00"
@str.31 = [41 x i8] c"130172 16M hugepages must be configured \00"
@str.34 = [61 x i8] c"\0AScenario 7 : Get 16g hugepage VA below and Above 128T mark\0A\00"
@str.35 = [36 x i8] c"2 16G hugepages must be configured \00"
@str.37 = [51 x i8] c"\0AScenario 6 : Get 16g hugepage VA Above 128T mark\0A\00"
@str.40 = [51 x i8] c"\0AScenario 5 : Get 16g hugepage VA Below 128T mark\0A\00"
@str.41 = [36 x i8] c"1 16G hugepages must be configured \00"
@str.43 = [59 x i8] c"\0AScenario 4 : Get hugepage VA Above and Below 128Tb mark \0A\00"
@str.44 = [41 x i8] c"131072 16M hugepages must be configured \00"
@str.46 = [49 x i8] c"\0AScenario 3 : Get hugepage VA Above 128Tb mark \0A\00"
@str.49 = [49 x i8] c"\0AScenario 2 : Get hugepage VA Below 128Tb mark \0A\00"
@str.50 = [39 x i8] c"1024 16M hugepages must be configured \00"
@str.51 = [17 x i8] c"Else Test Fails\0A\00"
@str.52 = [47 x i8] c"\0AScenario 1 : Alloc 64k page from 0-512 tb VA\0A\00"
@str.53 = [30 x i8] c"Please Provide valid scenario\00"
@str.54 = [35 x i8] c"Usage <execname> -s <scenario_no> \00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.54, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, -1
br i1 %9, label %64, label %10
10: ; preds = %7
%11 = load i32, i32* @optarg
%12 = tail call i32 @atoi(i32 %11)
switch i32 %12, label %64 [
i32 1, label %13
i32 2, label %16
i32 3, label %21
i32 4, label %26
i32 5, label %31
i32 6, label %36
i32 7, label %41
i32 8, label %46
i32 9, label %52
i32 10, label %58
]
13: ; preds = %10
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.52, i64 0, i64 0))
%15 = tail call i32 (...) @alloc_64k_full()
br label %66
16: ; preds = %10
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.49, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.50, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.51, i64 0, i64 0))
%20 = tail call i32 (...) @alloc_16m_below_hint()
br label %66
21: ; preds = %10
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.46, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.50, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.51, i64 0, i64 0))
%25 = tail call i32 (...) @alloc_16m_above_hint()
br label %66
26: ; preds = %10
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.43, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.44, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.51, i64 0, i64 0))
%30 = tail call i32 (...) @alloc_16m()
br label %66
31: ; preds = %10
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.40, i64 0, i64 0))
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.41, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.51, i64 0, i64 0))
%35 = tail call i32 (...) @alloc_16g_below_hint()
br label %66
36: ; preds = %10
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.37, i64 0, i64 0))
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.41, i64 0, i64 0))
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.51, i64 0, i64 0))
%40 = tail call i32 (...) @alloc_16g_above_hint()
br label %66
41: ; preds = %10
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.34, i64 0, i64 0))
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.35, i64 0, i64 0))
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.51, i64 0, i64 0))
%45 = tail call i32 (...) @alloc_16g()
br label %66
46: ; preds = %10
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.30, i64 0, i64 0))
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.31, i64 0, i64 0))
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.35, i64 0, i64 0))
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.51, i64 0, i64 0))
%51 = tail call i32 (...) @fixed_position()
br label %66
52: ; preds = %10
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.26, i64 0, i64 0))
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.31, i64 0, i64 0))
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.28, i64 0, i64 0))
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.29, i64 0, i64 0))
%57 = tail call i32 (...) @mixed_position_16M()
br label %66
58: ; preds = %10
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.31, i64 0, i64 0))
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.35, i64 0, i64 0))
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.29, i64 0, i64 0))
%63 = tail call i32 (...) @mixed_position_16G()
br label %66
64: ; preds = %7, %10
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.53, i64 0, i64 0))
br label %66
66: ; preds = %64, %58, %52, %46, %41, %36, %31, %26, %21, %16, %13
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.25, i64 0, i64 0))
ret i32 0
}