#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*/ DeleteMessage();
int /*<<< orphan*/ DrawMessage(char *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getch();
void WaitForUserLaunch(void) {
  int Key;
  DrawMessage("Hit L to launch.");
  while ((Key = getch()) != 'l' && Key != 'L' && Key != 27)
    ;
  DeleteMessage();
  if (Key == 27) {
    endwin();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<WaitForUserLaunch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1030 <DrawMessage@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0x6c,%ecx
mov    %al,-0x5(%rbp)
je     1197 <WaitForUserLaunch+0x47>
xor    %eax,%eax
cmpl   $0x4c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1197 <WaitForUserLaunch+0x47>
cmpl   $0x1b,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    11a7 <WaitForUserLaunch+0x57>
jmp    11ac <WaitForUserLaunch+0x5c>
jmp    1164 <WaitForUserLaunch+0x14>
mov    $0x0,%al
call   1040 <DeleteMessage@plt>
cmpl   $0x1b,-0x4(%rbp)
jne    11cb <WaitForUserLaunch+0x7b>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %edi,%edi
call   1070 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitForUserLaunch>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1030 <DrawMessage@plt>
nopl   (%rax)
xor    %eax,%eax
call   1050 <getch@plt>
mov    %eax,%ebx
cmp    $0x1b,%eax
je     1178 <WaitForUserLaunch+0x28>
cmp    $0x6c,%ebx
je     1178 <WaitForUserLaunch+0x28>
cmp    $0x4c,%ebx
jne    1160 <WaitForUserLaunch+0x10>
xor    %eax,%eax
call   1040 <DeleteMessage@plt>
cmp    $0x1b,%ebx
je     1186 <WaitForUserLaunch+0x36>
pop    %rbx
ret
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Hit L to launch.\00"
define void @WaitForUserLaunch() {
%1 = alloca i32
%2 = call i32 @DrawMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %14, %0
%4 = call i32 (...) @getch()
store i32 %4, i32* %1
%5 = icmp ne i32 %4, 108
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 76
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 27
br label %12
12: ; preds = %9, %6, %3
%13 = phi i1 [ false, %6 ], [ false, %3 ], [ %11, %9 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %3
15: ; preds = %12
%16 = call i32 (...) @DeleteMessage()
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 27
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = call i32 (...) @endwin()
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Hit L to launch.\00"
define void @WaitForUserLaunch() {
%1 = tail call i32 @DrawMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @getch()
switch i32 %3, label %2 [
i32 108, label %4
i32 76, label %4
i32 27, label %4
]
4: ; preds = %2, %2, %2
%5 = tail call i32 (...) @DeleteMessage()
%6 = icmp eq i32 %3, 27
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 (...) @endwin()
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %4
ret void
}