#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
void getEnter(void) {
  int ch;
  while ((ch = getchar()) != '\n' && ch != EOF)
    ;
  printf("\n\n\n\n\n\n\tPress ENTER to go back to the menu.");
  while ((ch = getchar()) != '\n' && ch != EOF)
    ;
  printf("\033[H\033[J");
}


x86 assembly (clang, -O0):
<getEnter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1154 <getEnter+0x34>
mov    -0x4(%rbp),%eax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1164 <getEnter+0x44>
jmp    1169 <getEnter+0x49>
jmp    1128 <getEnter+0x8>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x6(%rbp)
je     11a1 <getEnter+0x81>
mov    -0x4(%rbp),%eax
mov    0x2e4f(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    11b1 <getEnter+0x91>
jmp    11b6 <getEnter+0x96>
jmp    1175 <getEnter+0x55>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEnter>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1140 <getEnter+0x20>
cmp    (%rbx),%eax
jne    1130 <getEnter+0x10>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1160 <getEnter+0x40>
cmp    (%rbx),%eax
jne    1150 <getEnter+0x30>
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [43 x i8] c"\0A\0A\0A\0A\0A\0A\09Press ENTER to go back to the menu.\00"
@.str.1 = [7 x i8] c"\1B[H\1B[J\00"
define void @getEnter() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %23, %12
%15 = call i32 (...) @getchar()
store i32 %15, i32* %1
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %1
%19 = load i32, i32* @EOF
%20 = icmp ne i32 %18, %19
br label %21
21: ; preds = %17, %14
%22 = phi i1 [ false, %14 ], [ %20, %17 ]
br i1 %22, label %23, label %24
23: ; preds = %21
br label %14
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [43 x i8] c"\0A\0A\0A\0A\0A\0A\09Press ENTER to go back to the menu.\00"
@.str.1 = [7 x i8] c"\1B[H\1B[J\00"
define void @getEnter() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %9, %7
%10 = tail call i32 (...) @getchar()
%11 = icmp ne i32 %10, 10
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %10, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %9, label %15
15: ; preds = %9
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}