#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 atoi(char *);
int /*<<< orphan*/ getToken(char *, int, int, char *);
int /*<<< orphan*/ printf(char *, ...);
int vencJogo(char mensagem[32]) {
  char placar[5], aux[3], aux2[3];
  int pA = 0, pB = 0;
  getToken(mensagem, 10, 13, placar);
  getToken(placar, 0, 1, aux);
  getToken(placar, 2, 3, aux2);
  pA = atoi(aux);
  pB = atoi(aux2);
  printf("Placar do jogo -------- %s\n", placar);
  if (pA > 11) {
    printf("\nA equipe A venceu o jogo!\n");
    return 1;
  }
  if (pB > 11) {
    printf("\nA equipe B venceu o jogo!\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<vencJogo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x15(%rbp),%rcx
mov    $0xa,%esi
mov    $0xd,%edx
call   1040 <getToken@plt>
lea    -0x15(%rbp),%rdi
lea    -0x18(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <getToken@plt>
lea    -0x15(%rbp),%rdi
lea    -0x1b(%rbp),%rcx
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <getToken@plt>
lea    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x20(%rbp)
lea    -0x1b(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x24(%rbp)
lea    -0x15(%rbp),%rsi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xb,-0x20(%rbp)
jle    11da <vencJogo+0xaa>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1205 <vencJogo+0xd5>
cmpl   $0xb,-0x24(%rbp)
jle    11fe <vencJogo+0xce>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1205 <vencJogo+0xd5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vencJogo>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%r14
mov    $0xa,%esi
mov    $0xd,%edx
mov    %r14,%rcx
call   1050 <getToken@plt>
xor    %r12d,%r12d
lea    0x8(%rsp),%r15
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <getToken@plt>
lea    0x5(%rsp),%rbp
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    %rbp,%rcx
call   1050 <getToken@plt>
mov    %r15,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
lea    0xe4e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0xb,%ebx
jle    11ca <vencJogo+0x8a>
lea    0xe6f(%rip),%rdi
jmp    11d6 <vencJogo+0x96>
cmp    $0xc,%ebp
jl     11e1 <vencJogo+0xa1>
lea    0xe46(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r12d
mov    %r12d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Placar do jogo -------- %s\0A\00"
@.str.1 = [28 x i8] c"\0AA equipe A venceu o jogo!\0A\00"
@.str.2 = [28 x i8] c"\0AA equipe B venceu o jogo!\0A\00"
define i32 @vencJogo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [5 x i8]
%5 = alloca [3 x i8]
%6 = alloca [3 x i8]
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%11 = call i32 @getToken(i8* %9, i32 10, i32 13, i8* %10)
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%14 = call i32 @getToken(i8* %12, i32 0, i32 1, i8* %13)
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%17 = call i32 @getToken(i8* %15, i32 2, i32 3, i8* %16)
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %7
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %8
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i32, i32* %7
%25 = icmp sgt i32 %24, 11
br i1 %25, label %26, label %28
26: ; preds = %1
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %34
28: ; preds = %1
%29 = load i32, i32* %8
%30 = icmp sgt i32 %29, 11
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %34
33: ; preds = %28
store i32 0, i32* %2
br label %34
34: ; preds = %33, %31, %26
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
@.str = [28 x i8] c"Placar do jogo -------- %s\0A\00"
@str = [27 x i8] c"\0AA equipe B venceu o jogo!\00"
@str.3 = [27 x i8] c"\0AA equipe A venceu o jogo!\00"
define i32 @vencJogo(i8* %0) {
%2 = alloca [5 x i8]
%3 = alloca [3 x i8]
%4 = alloca [3 x i8]
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%8 = call i32 @getToken(i8* %0, i32 10, i32 13, i8* %5)
%9 = call i32 @getToken(i8* %5, i32 0, i32 1, i8* %6)
%10 = call i32 @getToken(i8* %5, i32 2, i32 3, i8* %7)
%11 = call i32 @atoi(i8* %6)
%12 = call i32 @atoi(i8* %7)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %5)
%14 = icmp sgt i32 %11, 11
br i1 %14, label %17, label %15
15: ; preds = %1
%16 = icmp sgt i32 %12, 11
br i1 %16, label %17, label %20
17: ; preds = %15, %1
%18 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0), %1 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0), %15 ]
%19 = call i32 @puts(i8* dereferenceable(1) %18)
br label %20
20: ; preds = %17, %15
%21 = phi i32 [ 0, %15 ], [ 1, %17 ]
ret i32 %21
}