#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 print_menu() {
  int i = 0;
  for (i = 0; i < 10; i++)
    printf("\n");
  printf("\n\n----------------------------------------------------");
  printf("\n\n    H D   o v e r   I P       S Y S T E M T E S T ");
  printf("\n\n----------------------------------------------------");
  printf("\n\nChoose one of the following:\n");
  printf("\n  A:  Ethernet Connection Test\n");
  printf("\n  B:  Video Tests\n");
  printf("\n  C:  USB Tests\n");
  printf("\n  Q:  Quit.");
  printf("\n\n  Enter a choice in { A, B, C, Q } : ");
}


x86 assembly (clang, -O0):
<print_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    114a <print_menu+0x3a>
lea    0xf53(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <print_menu+0x16>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
call   1030 <printf@plt>
lea    0xf28(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_menu>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe64(%rip),%rbx
mov    %rbx,%rdi
call   1050 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
lea    0xee2(%rip),%rdi
call   1040 <puts@plt>
lea    0xef5(%rip),%rdi
call   1040 <puts@plt>
lea    0xf09(%rip),%rdi
call   1040 <puts@plt>
lea    0xf10(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe7e(%rip),%rdi
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [55 x i8] c"\0A\0A----------------------------------------------------\00"
@.str.2 = [53 x i8] c"\0A\0A H D o v e r I P S Y S T E M T E S T \00"
@.str.3 = [32 x i8] c"\0A\0AChoose one of the following:\0A\00"
@.str.4 = [33 x i8] c"\0A A: Ethernet Connection Test\0A\00"
@.str.5 = [20 x i8] c"\0A B: Video Tests\0A\00"
@.str.6 = [18 x i8] c"\0A C: USB Tests\0A\00"
@.str.7 = [13 x i8] c"\0A Q: Quit.\00"
@.str.8 = [40 x i8] c"\0A\0A Enter a choice in { A, B, C, Q } : \00"
define void @print_menu() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [55 x i8] c"\0A\0A----------------------------------------------------\00"
@.str.2 = [53 x i8] c"\0A\0A H D o v e r I P S Y S T E M T E S T \00"
@.str.7 = [13 x i8] c"\0A Q: Quit.\00"
@.str.8 = [40 x i8] c"\0A\0A Enter a choice in { A, B, C, Q } : \00"
@str = [31 x i8] c"\0A\0AChoose one of the following:\00"
@str.9 = [32 x i8] c"\0A A: Ethernet Connection Test\00"
@str.10 = [19 x i8] c"\0A B: Video Tests\00"
@str.11 = [17 x i8] c"\0A C: USB Tests\00"
define void @print_menu() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.9, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.11, i64 0, i64 0))
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
ret void
}