#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*/ clear_screen();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char option_selected();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
char print_welcome(void) {
  clear_screen();
  printf("**************FPGA FIRMWARE DEBUGGER*************\n");
  printf("Chose your device\n");
  printf("\n1-HDMI2USB\n");
  printf("\n2-HDMI2ETHERNET\n");
  printf("\nq-QUIT\n");
  printf("\nTo select press [1/2/q]: ");
  fflush(stdout);
  return option_selected();
}


x86 assembly (clang, -O0):
<print_welcome>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clear_screen@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   1060 <option_selected@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_welcome>:
push   %rax
xor    %eax,%eax
call   1060 <clear_screen@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <option_selected@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"**************FPGA FIRMWARE DEBUGGER*************\0A\00"
@.str.1 = [19 x i8] c"Chose your device\0A\00"
@.str.2 = [13 x i8] c"\0A1-HDMI2USB\0A\00"
@.str.3 = [18 x i8] c"\0A2-HDMI2ETHERNET\0A\00"
@.str.4 = [9 x i8] c"\0Aq-QUIT\0A\00"
@.str.5 = [27 x i8] c"\0ATo select press [1/2/q]: \00"
@stdout = global i32 0
define signext i8 @print_welcome() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call signext i8 (...) @option_selected()
ret i8 %10
}

LLVM IR (-O2):
@.str.5 = [27 x i8] c"\0ATo select press [1/2/q]: \00"
@stdout = global i32 0
@str = [50 x i8] c"**************FPGA FIRMWARE DEBUGGER*************\00"
@str.6 = [18 x i8] c"Chose your device\00"
@str.7 = [12 x i8] c"\0A1-HDMI2USB\00"
@str.8 = [17 x i8] c"\0A2-HDMI2ETHERNET\00"
@str.9 = [8 x i8] c"\0Aq-QUIT\00"
define signext i8 @print_welcome() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call signext i8 (...) @option_selected()
ret i8 %10
}