#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ main();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void jogarnovamente(void) {
  int parada;
  printf("deseja jogar novamente?\n1-sim\n0-nao\n");
  scanf("%d", &parada);
  if (parada == 1)
    main();
  if (parada == 0) {
    printf("Obrigado por jogar o Jogo da Velha\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<jogarnovamente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1175 <jogarnovamente+0x35>
mov    $0x0,%al
call   1040 <main@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1192 <jogarnovamente+0x52>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jogarnovamente>:
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
jne    1172 <jogarnovamente+0x32>
xor    %eax,%eax
call   1040 <main@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     1178 <jogarnovamente+0x38>
pop    %rax
ret
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"deseja jogar novamente?\0A1-sim\0A0-nao\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Obrigado por jogar o Jogo da Velha\0A\00"
define void @jogarnovamente() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @main()
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [36 x i8] c"deseja jogar novamente?\0A1-sim\0A0-nao\00"
@str.3 = [35 x i8] c"Obrigado por jogar o Jogo da Velha\00"
define void @jogarnovamente() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 (...) @main()
%9 = load i32, i32* %1
br label %10
10: ; preds = %7, %0
%11 = phi i32 [ %9, %7 ], [ %5, %0 ]
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.3, i64 0, i64 0))
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %10
ret void
}