#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*/ scanf(char *, int *);
int /*<<< orphan*/ vezhumano(int **, int);
int /*<<< orphan*/ vezhumanodificil(int **, int);
int /*<<< orphan*/ vezhumanomedio(int **, int);
int /*<<< orphan*/ vezpc(int **, int);
int /*<<< orphan*/ vezpcdificil(int **, int);
int /*<<< orphan*/ vezpcmedio(int **, int);
int humanonivel(int tab[3][3], int vez) {
  int nivel;
  printf("Escolha um nivel de dificuldade: \n");
  printf("1-facil \n2-medio \n3-dificil\n");
  scanf("%d", &nivel);
  switch (nivel) {
  case 1: {
    int jogar;
    printf("nivel facil\n");
    printf("voce quer comecar jogando?: 1-s\t0-n\n");
    scanf("%d", &jogar);
    vez *= -1;
    if (jogar == 1) {
      vezhumano(tab, vez);
      vez = 1;
    } else if (jogar == 0) {
      vezpc(tab, vez);
      vez = 1;
    }
  } break;
  case 2: {
    int jogar;
    printf("nivel medio\n");
    printf("voce quer comecar jogando?: 1-s\t0-n\n");
    scanf("%d", &jogar);
    vez *= -1;
    if (jogar == 1) {
      vezhumanomedio(tab, vez);
      vez = 1;
    } else if (jogar == 0) {
      vezpcmedio(tab, vez);
      vez = 1;
    }
  } break;
  case 3: {
    int jogar;
    printf("nivel dificil\n");
    printf("voce quer comecar jogando?: 1-s\t0-n\n");
    scanf("%d", &jogar);
    vez *= -1;
    if (jogar == 1) {
      vezhumanodificil(tab, vez);
      vez = 1;
    } else if (jogar == 0) {
      vezpcdificil(tab, vez);
      vez = 1;
    }
  } break;
  default:
    printf("ERRO.\nÉ DE 1 ATÉ 3\nObrigado por jogar\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<humanonivel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe81(%rip),%rdi
call   1050 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     11ed <humanonivel+0x6d>
jmp    11cb <humanonivel+0x4b>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
je     1265 <humanonivel+0xe5>
jmp    11dc <humanonivel+0x5c>
mov    -0x20(%rbp),%eax
sub    $0x3,%eax
je     12dd <humanonivel+0x15d>
jmp    1355 <humanonivel+0x1d5>
lea    0xe4f(%rip),%rdi
call   1050 <printf@plt>
lea    0xe50(%rip),%rdi
call   1050 <printf@plt>
lea    0xe34(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10a0 <scanf@plt>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    123e <humanonivel+0xbe>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <vezhumano@plt>
movl   $0x1,-0xc(%rbp)
jmp    1260 <humanonivel+0xe0>
cmpl   $0x0,-0x14(%rbp)
jne    125b <humanonivel+0xdb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vezpc@plt>
movl   $0x1,-0xc(%rbp)
jmp    1260 <humanonivel+0xe0>
jmp    1361 <humanonivel+0x1e1>
lea    0xe09(%rip),%rdi
call   1050 <printf@plt>
lea    0xdd8(%rip),%rdi
call   1050 <printf@plt>
lea    0xdbc(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   10a0 <scanf@plt>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    12b6 <humanonivel+0x136>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <vezhumanomedio@plt>
movl   $0x1,-0xc(%rbp)
jmp    12d8 <humanonivel+0x158>
cmpl   $0x0,-0x18(%rbp)
jne    12d3 <humanonivel+0x153>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1090 <vezpcmedio@plt>
movl   $0x1,-0xc(%rbp)
jmp    12d8 <humanonivel+0x158>
jmp    1361 <humanonivel+0x1e1>
lea    0xd9e(%rip),%rdi
call   1050 <printf@plt>
lea    0xd60(%rip),%rdi
call   1050 <printf@plt>
lea    0xd44(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   10a0 <scanf@plt>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    132e <humanonivel+0x1ae>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <vezhumanodificil@plt>
movl   $0x1,-0xc(%rbp)
jmp    1350 <humanonivel+0x1d0>
cmpl   $0x0,-0x1c(%rbp)
jne    134b <humanonivel+0x1cb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <vezpcdificil@plt>
movl   $0x1,-0xc(%rbp)
jmp    1350 <humanonivel+0x1d0>
jmp    1361 <humanonivel+0x1e1>
lea    0xd35(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<humanonivel>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
lea    0xe58(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10a0 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     125a <humanonivel+0xda>
cmp    $0x2,%eax
je     1219 <humanonivel+0x99>
cmp    $0x1,%eax
jne    129b <humanonivel+0x11b>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
lea    0xe14(%rip),%rdi
mov    %rsp,%rsi
call   10a0 <scanf@plt>
neg    %ebx
mov    (%rsp),%eax
test   %eax,%eax
je     12a9 <humanonivel+0x129>
cmp    $0x1,%eax
jne    12cb <humanonivel+0x14b>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <vezhumano@plt>
jmp    12cb <humanonivel+0x14b>
lea    0xe2f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe3b(%rip),%rdi
call   1040 <puts@plt>
lea    0xdc8(%rip),%rdi
mov    %rsp,%rsi
call   10a0 <scanf@plt>
neg    %ebx
mov    (%rsp),%eax
test   %eax,%eax
je     12b5 <humanonivel+0x135>
cmp    $0x1,%eax
jne    12cb <humanonivel+0x14b>
mov    %r14,%rdi
mov    %ebx,%esi
call   1070 <vezhumanomedio@plt>
jmp    12cb <humanonivel+0x14b>
lea    0xde0(%rip),%rdi
call   1040 <puts@plt>
lea    0xdfa(%rip),%rdi
call   1040 <puts@plt>
lea    0xd87(%rip),%rdi
mov    %rsp,%rsi
call   10a0 <scanf@plt>
neg    %ebx
mov    (%rsp),%eax
test   %eax,%eax
je     12c1 <humanonivel+0x141>
cmp    $0x1,%eax
jne    12cb <humanonivel+0x14b>
mov    %r14,%rdi
mov    %ebx,%esi
call   1080 <vezhumanodificil@plt>
jmp    12cb <humanonivel+0x14b>
lea    0xde9(%rip),%rdi
call   1040 <puts@plt>
jmp    12cb <humanonivel+0x14b>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <vezpc@plt>
jmp    12cb <humanonivel+0x14b>
mov    %r14,%rdi
mov    %ebx,%esi
call   1090 <vezpcmedio@plt>
jmp    12cb <humanonivel+0x14b>
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <vezpcdificil@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
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 = [37 x i8] c"voce quer comecar jogando?: 1-s\090-n\0A\00"
@.str.5 = [13 x i8] c"nivel medio\0A\00"
@.str.6 = [15 x i8] c"nivel dificil\0A\00"
@.str.7 = [41 x i8] c"ERRO.\0A\C3\89 DE 1 AT\C3\89 3\0AObrigado por jogar\0A\00"
define i32 @humanonivel([3 x i32]* %0, i32 %1) {
%3 = alloca [3 x i32]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [3 x i32]* %0, [3 x i32]** %3
store i32 %1, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%12 = load i32, i32* %5
switch i32 %12, label %82 [
i32 1, label %13
i32 2, label %36
i32 3, label %59
]
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%17 = load i32, i32* %4
%18 = mul nsw i32 %17, -1
store i32 %18, i32* %4
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %26
21: ; preds = %13
%22 = load [3 x i32]*, [3 x i32]** %3
%23 = bitcast [3 x i32]* %22 to i32**
%24 = load i32, i32* %4
%25 = call i32 @vezhumano(i32** %23, i32 %24)
store i32 1, i32* %4
br label %35
26: ; preds = %13
%27 = load i32, i32* %6
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load [3 x i32]*, [3 x i32]** %3
%31 = bitcast [3 x i32]* %30 to i32**
%32 = load i32, i32* %4
%33 = call i32 @vezpc(i32** %31, i32 %32)
store i32 1, i32* %4
br label %34
34: ; preds = %29, %26
br label %35
35: ; preds = %34, %21
br label %84
36: ; preds = %2
%37 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%38 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%40 = load i32, i32* %4
%41 = mul nsw i32 %40, -1
store i32 %41, i32* %4
%42 = load i32, i32* %7
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %49
44: ; preds = %36
%45 = load [3 x i32]*, [3 x i32]** %3
%46 = bitcast [3 x i32]* %45 to i32**
%47 = load i32, i32* %4
%48 = call i32 @vezhumanomedio(i32** %46, i32 %47)
store i32 1, i32* %4
br label %58
49: ; preds = %36
%50 = load i32, i32* %7
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = load [3 x i32]*, [3 x i32]** %3
%54 = bitcast [3 x i32]* %53 to i32**
%55 = load i32, i32* %4
%56 = call i32 @vezpcmedio(i32** %54, i32 %55)
store i32 1, i32* %4
br label %57
57: ; preds = %52, %49
br label %58
58: ; preds = %57, %44
br label %84
59: ; preds = %2
%60 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%61 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%62 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%63 = load i32, i32* %4
%64 = mul nsw i32 %63, -1
store i32 %64, i32* %4
%65 = load i32, i32* %8
%66 = icmp eq i32 %65, 1
br i1 %66, label %67, label %72
67: ; preds = %59
%68 = load [3 x i32]*, [3 x i32]** %3
%69 = bitcast [3 x i32]* %68 to i32**
%70 = load i32, i32* %4
%71 = call i32 @vezhumanodificil(i32** %69, i32 %70)
store i32 1, i32* %4
br label %81
72: ; preds = %59
%73 = load i32, i32* %8
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %80
75: ; preds = %72
%76 = load [3 x i32]*, [3 x i32]** %3
%77 = bitcast [3 x i32]* %76 to i32**
%78 = load i32, i32* %4
%79 = call i32 @vezpcdificil(i32** %77, i32 %78)
store i32 1, i32* %4
br label %80
80: ; preds = %75, %72
br label %81
81: ; preds = %80, %67
br label %84
82: ; preds = %2
%83 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
br label %84
84: ; preds = %82, %81, %58, %35
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.8 = [28 x i8] c"1-facil \0A2-medio \0A3-dificil\00"
@str.9 = [14 x i8] c"nivel dificil\00"
@str.11 = [12 x i8] c"nivel medio\00"
@str.13 = [12 x i8] c"nivel facil\00"
@str.14 = [36 x i8] c"voce quer comecar jogando?: 1-s\090-n\00"
@str.15 = [40 x i8] c"ERRO.\0A\C3\89 DE 1 AT\C3\89 3\0AObrigado por jogar\00"
define i32 @humanonivel([3 x i32]* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.8, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
switch i32 %11, label %54 [
i32 1, label %12
i32 2, label %26
i32 3, label %40
]
12: ; preds = %2
%13 = bitcast i32* %4 to i8*
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%17 = sub nsw i32 0, %1
%18 = load i32, i32* %4
switch i32 %18, label %25 [
i32 1, label %19
i32 0, label %22
]
19: ; preds = %12
%20 = bitcast [3 x i32]* %0 to i32**
%21 = call i32 @vezhumano(i32** %20, i32 %17)
br label %25
22: ; preds = %12
%23 = bitcast [3 x i32]* %0 to i32**
%24 = call i32 @vezpc(i32** %23, i32 %17)
br label %25
25: ; preds = %12, %22, %19
br label %56
26: ; preds = %2
%27 = bitcast i32* %5 to i8*
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.11, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%31 = sub nsw i32 0, %1
%32 = load i32, i32* %5
switch i32 %32, label %39 [
i32 1, label %33
i32 0, label %36
]
33: ; preds = %26
%34 = bitcast [3 x i32]* %0 to i32**
%35 = call i32 @vezhumanomedio(i32** %34, i32 %31)
br label %39
36: ; preds = %26
%37 = bitcast [3 x i32]* %0 to i32**
%38 = call i32 @vezpcmedio(i32** %37, i32 %31)
br label %39
39: ; preds = %26, %36, %33
br label %56
40: ; preds = %2
%41 = bitcast i32* %6 to i8*
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.9, i64 0, i64 0))
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%45 = sub nsw i32 0, %1
%46 = load i32, i32* %6
switch i32 %46, label %53 [
i32 1, label %47
i32 0, label %50
]
47: ; preds = %40
%48 = bitcast [3 x i32]* %0 to i32**
%49 = call i32 @vezhumanodificil(i32** %48, i32 %45)
br label %53
50: ; preds = %40
%51 = bitcast [3 x i32]* %0 to i32**
%52 = call i32 @vezpcdificil(i32** %51, i32 %45)
br label %53
53: ; preds = %40, %50, %47
br label %56
54: ; preds = %2
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.15, i64 0, i64 0))
br label %56
56: ; preds = %54, %53, %39, %25
ret i32 0
}