#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*/ niveldificil(int **, int, int);
int /*<<< orphan*/ nivelfacil(int **, int);
int /*<<< orphan*/ nivelmedio(int **, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int imprimemenunivel(int tab[3][3], int vez) {
  int nivel;
  int novamente = 0;
  printf("Escolha um nivel de dificuldade: \n");
  printf("1-facil \n2-medio \n3-dificil\n");
  scanf("%d", &nivel);
  switch (nivel) {
  case 1:
    printf("nivel facil\n");
    nivelfacil(tab, vez);
    break;
  case 2:
    printf("nivel medio\n");
    nivelmedio(tab, vez, novamente);
    break;
  case 3:
    printf("nivel dificil\n");
    niveldificil(tab, vez, novamente);
    break;
  default:
    printf("ERRO.\nObrigado por jogar\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<imprimemenunivel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     11c4 <imprimemenunivel+0x74>
jmp    11a2 <imprimemenunivel+0x52>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     11e1 <imprimemenunivel+0x91>
jmp    11b3 <imprimemenunivel+0x63>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
je     1201 <imprimemenunivel+0xb1>
jmp    1221 <imprimemenunivel+0xd1>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <nivelfacil@plt>
jmp    122d <imprimemenunivel+0xdd>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <nivelmedio@plt>
jmp    122d <imprimemenunivel+0xdd>
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1070 <niveldificil@plt>
jmp    122d <imprimemenunivel+0xdd>
lea    0xe44(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimemenunivel>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xe89(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     11ac <imprimemenunivel+0x5c>
cmp    $0x2,%eax
je     11c6 <imprimemenunivel+0x76>
cmp    $0x1,%eax
jne    11e0 <imprimemenunivel+0x90>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <nivelfacil@plt>
jmp    11ec <imprimemenunivel+0x9c>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1070 <niveldificil@plt>
jmp    11ec <imprimemenunivel+0x9c>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <nivelmedio@plt>
jmp    11ec <imprimemenunivel+0x9c>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Escolha um nivel de dificuldade: \0A\00"
@.str.1 = [29 x i8] c"1-facil \0A2-medio \0A3-dificil\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [13 x i8] c"nivel facil\0A\00"
@.str.4 = [13 x i8] c"nivel medio\0A\00"
@.str.5 = [15 x i8] c"nivel dificil\0A\00"
@.str.6 = [26 x i8] c"ERRO.\0AObrigado por jogar\0A\00"
define i32 @imprimemenunivel([3 x i32]* %0, i32 %1) {
%3 = alloca [3 x i32]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store [3 x i32]* %0, [3 x i32]** %3
store i32 %1, i32* %4
store i32 0, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%10 = load i32, i32* %5
switch i32 %10, label %31 [
i32 1, label %11
i32 2, label %17
i32 3, label %24
]
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%13 = load [3 x i32]*, [3 x i32]** %3
%14 = bitcast [3 x i32]* %13 to i32**
%15 = load i32, i32* %4
%16 = call i32 @nivelfacil(i32** %14, i32 %15)
br label %33
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%19 = load [3 x i32]*, [3 x i32]** %3
%20 = bitcast [3 x i32]* %19 to i32**
%21 = load i32, i32* %4
%22 = load i32, i32* %6
%23 = call i32 @nivelmedio(i32** %20, i32 %21, i32 %22)
br label %33
24: ; preds = %2
%25 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%26 = load [3 x i32]*, [3 x i32]** %3
%27 = bitcast [3 x i32]* %26 to i32**
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = call i32 @niveldificil(i32** %27, i32 %28, i32 %29)
br label %33
31: ; preds = %2
%32 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %31, %24, %17, %11
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@str = [34 x i8] c"Escolha um nivel de dificuldade: \00"
@str.7 = [28 x i8] c"1-facil \0A2-medio \0A3-dificil\00"
@str.8 = [14 x i8] c"nivel dificil\00"
@str.9 = [12 x i8] c"nivel medio\00"
@str.10 = [12 x i8] c"nivel facil\00"
@str.11 = [25 x i8] c"ERRO.\0AObrigado por jogar\00"
define i32 @imprimemenunivel([3 x i32]* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
switch i32 %8, label %21 [
i32 1, label %9
i32 2, label %13
i32 3, label %17
]
9: ; preds = %2
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.10, i64 0, i64 0))
%11 = bitcast [3 x i32]* %0 to i32**
%12 = call i32 @nivelfacil(i32** %11, i32 %1)
br label %23
13: ; preds = %2
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0))
%15 = bitcast [3 x i32]* %0 to i32**
%16 = call i32 @nivelmedio(i32** %15, i32 %1, i32 0)
br label %23
17: ; preds = %2
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
%19 = bitcast [3 x i32]* %0 to i32**
%20 = call i32 @niveldificil(i32** %19, i32 %1, i32 0)
br label %23
21: ; preds = %2
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.11, i64 0, i64 0))
br label %23
23: ; preds = %21, %17, %13, %9
ret i32 0
}