#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*/ api_boxfilwin(int, int, int, int, int, int);
int /*<<< orphan*/ api_end();
int api_getkey(int);
int api_openwin(char *, int, int, int, char *);
void HariMain(void) {
  int win;
  char buf[150 * 70];
  win = api_openwin(buf, 150, 70, 255, "notrec");
  api_boxfilwin(win, 0, 50, 34, 69, 255);
  api_boxfilwin(win, 115, 50, 149, 69, 255);
  api_boxfilwin(win, 50, 30, 99, 49, 255);
  for (;;) {
    if (api_getkey(1) == 0x0a) {
      break;
    }
  }
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2910,%rsp
lea    -0x2910(%rbp),%rdi
mov    $0x96,%esi
mov    $0x46,%edx
mov    $0xff,%ecx
lea    0xe98(%rip),%r8
call   1050 <api_openwin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x32,%edx
mov    $0x22,%ecx
mov    $0x45,%r8d
mov    $0xff,%r9d
call   1060 <api_boxfilwin@plt>
mov    -0x4(%rbp),%edi
mov    $0x73,%esi
mov    $0x32,%edx
mov    $0x95,%ecx
mov    $0x45,%r8d
mov    $0xff,%r9d
call   1060 <api_boxfilwin@plt>
mov    -0x4(%rbp),%edi
mov    $0x32,%esi
mov    $0x1e,%edx
mov    $0x63,%ecx
mov    $0x31,%r8d
mov    $0xff,%r9d
call   1060 <api_boxfilwin@plt>
mov    $0x1,%edi
call   1040 <api_getkey@plt>
cmp    $0xa,%eax
jne    11ee <HariMain+0xae>
jmp    11f3 <HariMain+0xb3>
jmp    11d6 <HariMain+0x96>
mov    $0x0,%al
call   1030 <api_end@plt>
add    $0x2910,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rbx
sub    $0x2910,%rsp
lea    0xeb1(%rip),%r8
mov    %rsp,%rdi
mov    $0x96,%esi
mov    $0x46,%edx
mov    $0xff,%ecx
call   1050 <api_openwin@plt>
mov    %eax,%ebx
mov    %eax,%edi
xor    %esi,%esi
mov    $0x32,%edx
mov    $0x22,%ecx
mov    $0x45,%r8d
mov    $0xff,%r9d
call   1060 <api_boxfilwin@plt>
mov    %ebx,%edi
mov    $0x73,%esi
mov    $0x32,%edx
mov    $0x95,%ecx
mov    $0x45,%r8d
mov    $0xff,%r9d
call   1060 <api_boxfilwin@plt>
mov    %ebx,%edi
mov    $0x32,%esi
mov    $0x1e,%edx
mov    $0x63,%ecx
mov    $0x31,%r8d
mov    $0xff,%r9d
call   1060 <api_boxfilwin@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <api_getkey@plt>
cmp    $0xa,%eax
jne    11d0 <HariMain+0x90>
xor    %eax,%eax
call   1030 <api_end@plt>
add    $0x2910,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"notrec\00"
define void @HariMain() {
%1 = alloca i32
%2 = alloca [10500 x i8]
%3 = getelementptr inbounds [10500 x i8], [10500 x i8]* %2, i64 0, i64 0
%4 = call i32 @api_openwin(i8* %3, i32 150, i32 70, i32 255, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @api_boxfilwin(i32 %5, i32 0, i32 50, i32 34, i32 69, i32 255)
%7 = load i32, i32* %1
%8 = call i32 @api_boxfilwin(i32 %7, i32 115, i32 50, i32 149, i32 69, i32 255)
%9 = load i32, i32* %1
%10 = call i32 @api_boxfilwin(i32 %9, i32 50, i32 30, i32 99, i32 49, i32 255)
br label %11
11: ; preds = %15, %0
%12 = call i32 @api_getkey(i32 1)
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %15
14: ; preds = %11
br label %16
15: ; preds = %11
br label %11
16: ; preds = %14
%17 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"notrec\00"
define void @HariMain() {
%1 = alloca [10500 x i8]
%2 = getelementptr inbounds [10500 x i8], [10500 x i8]* %1, i64 0, i64 0
%3 = call i32 @api_openwin(i8* %2, i32 150, i32 70, i32 255, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @api_boxfilwin(i32 %3, i32 0, i32 50, i32 34, i32 69, i32 255)
%5 = call i32 @api_boxfilwin(i32 %3, i32 115, i32 50, i32 149, i32 69, i32 255)
%6 = call i32 @api_boxfilwin(i32 %3, i32 50, i32 30, i32 99, i32 49, i32 255)
br label %7
7: ; preds = %7, %0
%8 = call i32 @api_getkey(i32 1)
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %7
10: ; preds = %7
%11 = call i32 (...) @api_end()
ret void
}