#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*/ printf(char *, ...);
void screen_initialize() {
  int opt;
  printf("%60sPOCKET-DB\n%59s+---------+", "", "");
  char *option_menu[] = {"INSERT DATA", "SEARCH KEY", "DUMP TABLE",
                         "FILE MERGER", "QUIT"};
  printf("\n");
  for (opt = 0; opt < 5; opt++)
    printf("\n|| %-20s --> %d ||", option_menu[opt], opt + 1);
  printf("\n\n");
}


x86 assembly (clang, -O0):
<screen_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
lea    0xf31(%rip),%rdx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xec7(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    11d1 <screen_initialize+0xb1>
movslq -0x4(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rsi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    119c <screen_initialize+0x7c>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_initialize>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xf27(%rip),%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xef7(%rip),%rbx
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe96(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%60sPOCKET-DB\0A%59s+---------+\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [12 x i8] c"INSERT DATA\00"
@.str.3 = [11 x i8] c"SEARCH KEY\00"
@.str.4 = [11 x i8] c"DUMP TABLE\00"
@.str.5 = [12 x i8] c"FILE MERGER\00"
@.str.6 = [5 x i8] c"QUIT\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [20 x i8] c"\0A|| %-20s --> %d ||\00"
@.str.9 = [3 x i8] c"\0A\0A\00"
define void @screen_initialize() {
%1 = alloca i32
%2 = alloca [5 x i8*]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = bitcast [5 x i8*]* %2 to i8*
%5 = bitcast i8* %4 to [5 x i8*]*
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8** %10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %12
12: ; preds = %23, %0
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 %17
%19 = load i8*, i8** %18
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* %19, i32 %21)
br label %23
23: ; preds = %15
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %12
26: ; preds = %12
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%60sPOCKET-DB\0A%59s+---------+\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [12 x i8] c"INSERT DATA\00"
@.str.3 = [11 x i8] c"SEARCH KEY\00"
@.str.4 = [11 x i8] c"DUMP TABLE\00"
@.str.5 = [12 x i8] c"FILE MERGER\00"
@.str.6 = [5 x i8] c"QUIT\00"
@.str.8 = [20 x i8] c"\0A|| %-20s --> %d ||\00"
@str = [2 x i8] c"\0A\00"
define void @screen_initialize() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 3)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 4)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 5)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}