#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 *);
int /*<<< orphan*/ puts(char *);
void printMenu() {
  int i = 0;
  for (i = 80; i-- > 0; printf("-"))
    ;
  printf("\n");
  puts("1. Sfida!");
  puts("2. Visualizza classifica");
  puts("");
  puts("3. Inserisci nuovo partecipante");
  puts("4. Elimina partecipante");
  puts("");
  puts("5. Carica dati da file");
  puts("6. Salva dati su file");
  puts("");
  puts("0. Esci");
  for (i = 80; i-- > 0; printf("-"))
    ;
  printf("\n");
  puts("");
  printf("> ");
}


x86 assembly (clang, -O0):
<printMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x50,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1160 <printMenu+0x40>
jmp    114f <printMenu+0x2f>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
jmp    1136 <printMenu+0x16>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
lea    0xe30(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
movl   $0x50,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1215 <printMenu+0xf5>
jmp    1204 <printMenu+0xe4>
lea    0xdf5(%rip),%rdi
call   1040 <printf@plt>
jmp    11eb <printMenu+0xcb>
lea    0xde6(%rip),%rdi
call   1040 <printf@plt>
lea    0xddb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMenu>:
push   %rbx
mov    $0x51,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1140 <printMenu+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
mov    $0x51,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     11e0 <printMenu+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe83(%rip),%rdi
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [10 x i8] c"1. Sfida!\00"
@.str.3 = [25 x i8] c"2. Visualizza classifica\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [32 x i8] c"3. Inserisci nuovo partecipante\00"
@.str.6 = [24 x i8] c"4. Elimina partecipante\00"
@.str.7 = [23 x i8] c"5. Carica dati da file\00"
@.str.8 = [22 x i8] c"6. Salva dati su file\00"
@.str.9 = [8 x i8] c"0. Esci\00"
@.str.10 = [3 x i8] c"> \00"
define void @printMenu() {
%1 = alloca i32
store i32 0, i32* %1
store i32 80, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %2
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
store i32 80, i32* %1
br label %21
21: ; preds = %26, %9
%22 = load i32, i32* %1
%23 = add nsw i32 %22, -1
store i32 %23, i32* %1
%24 = icmp sgt i32 %22, 0
br i1 %24, label %25, label %28
25: ; preds = %21
br label %26
26: ; preds = %25
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %21
28: ; preds = %21
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [10 x i8] c"1. Sfida!\00"
@.str.3 = [25 x i8] c"2. Visualizza classifica\00"
@.str.5 = [32 x i8] c"3. Inserisci nuovo partecipante\00"
@.str.6 = [24 x i8] c"4. Elimina partecipante\00"
@.str.7 = [23 x i8] c"5. Carica dati da file\00"
@.str.8 = [22 x i8] c"6. Salva dati su file\00"
@.str.9 = [8 x i8] c"0. Esci\00"
@.str.10 = [3 x i8] c"> \00"
define void @printMenu() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 80, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, -1
%4 = tail call i32 @putchar(i32 45)
%5 = icmp ugt i32 %2, 1
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %18
18: ; preds = %6, %18
%19 = phi i32 [ 80, %6 ], [ %20, %18 ]
%20 = add nsw i32 %19, -1
%21 = tail call i32 @putchar(i32 45)
%22 = icmp ugt i32 %19, 1
br i1 %22, label %18, label %23
23: ; preds = %18
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
ret void
}