#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 *);
char *getToken(char *, int, int, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setToken(char *, int, int, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int vencRodada(char mensagem[32], char *placarJogo) {
  int i, cont_A = 0, cont_B = 0, cont_ = 0, cont_jogadas = 0;
  char placarRodada[3];
  char valorRodada[3];
  strcpy(placarRodada, getToken(mensagem, 14, 16, placarRodada));
  printf("O placar da rodada esta: %s\n\n", placarRodada);
  for (i = 0; i < 3; i++) {
    if (placarRodada[i] != '0') {
      cont_jogadas++;
    }
    if (placarRodada[i] == 'a') {
      cont_A++;
    }
    if (placarRodada[i] == 'b') {
      cont_B++;
    }
    if (placarRodada[i] == '-') {
      cont_++;
    }
  }
  int rodada, valorPlacar;
  char placar[3];
  char aux[2];
  getToken(mensagem, 17, 18, valorRodada);
  rodada = atoi(valorRodada);
  if (cont_jogadas >= 2) {
    if (cont_A > cont_B) {
      getToken(placarJogo, 0, 1, placar);
      valorPlacar = atoi(placar);
      valorPlacar += rodada;
      sprintf(aux, "%d", valorPlacar);
      if (valorPlacar < 10) {
        strcpy(placar, "0");
        strcat(placar, aux);
      } else {
        strcpy(placar, aux);
      }
      setToken(placarJogo, 0, 1, placar);
      printf("A equipe A venceu a rodada!\n\n");
      return 1;
    } else if (cont_B > cont_A) {
      getToken(placarJogo, 2, 3, placar);
      valorPlacar = atoi(placar);
      valorPlacar += rodada;
      sprintf(aux, "%d", valorPlacar);
      if (valorPlacar < 10) {
        strcpy(placar, "0");
        strcat(placar, aux);
      } else {
        strcpy(placar, aux);
      }
      setToken(placarJogo, 2, 3, placar);
      printf("A equipe B venceu a rodada!\n\n");
      return 1;
    } else if ((cont_A == cont_B) && (cont_ >= 1)) {
      for (i = 0; i < 3; i++) {
        if (placarRodada[i] == 'a') {
          getToken(placarJogo, 0, 1, placar);
          valorPlacar = atoi(placar);
          valorPlacar += rodada;
          sprintf(aux, "%d", valorPlacar);
          if (valorPlacar < 10) {
            strcpy(placar, "0");
            strcat(placar, aux);
          } else {
            strcpy(placar, aux);
          }
          setToken(placarJogo, 0, 1, placar);
          printf("A equipe A venceu a rodada!\n\n");
          return 1;
        } else if (placarRodada[i] == 'b') {
          getToken(placarJogo, 2, 3, placar);
          valorPlacar = atoi(placar);
          valorPlacar += rodada;
          sprintf(aux, "%d", valorPlacar);
          if (valorPlacar < 10) {
            strcpy(placar, "0");
            strcat(placar, aux);
          } else {
            strcpy(placar, aux);
          }
          setToken(placarJogo, 2, 3, placar);
          printf("A equipe B venceu a rodada!\n\n");
          return 1;
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<vencRodada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x2f(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x2f(%rbp),%rcx
mov    $0xe,%esi
mov    $0x10,%edx
call   1050 <getToken@plt>
mov    -0x50(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x2f(%rbp),%rsi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1269 <vencRodada+0xf9>
movslq -0x1c(%rbp),%rax
movsbl -0x2f(%rbp,%rax,1),%eax
cmp    $0x30,%eax
je     1205 <vencRodada+0x95>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movslq -0x1c(%rbp),%rax
movsbl -0x2f(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jne    1220 <vencRodada+0xb0>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movslq -0x1c(%rbp),%rax
movsbl -0x2f(%rbp,%rax,1),%eax
cmp    $0x62,%eax
jne    123b <vencRodada+0xcb>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movslq -0x1c(%rbp),%rax
movsbl -0x2f(%rbp,%rax,1),%eax
cmp    $0x2d,%eax
jne    1256 <vencRodada+0xe6>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    125b <vencRodada+0xeb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e0 <vencRodada+0x70>
mov    -0x10(%rbp),%rdi
lea    -0x32(%rbp),%rcx
mov    $0x11,%esi
mov    $0x12,%edx
call   1050 <getToken@plt>
lea    -0x32(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jl     15bd <vencRodada+0x44d>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    1345 <vencRodada+0x1d5>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <getToken@plt>
lea    -0x3f(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x41(%rbp),%rdi
mov    -0x3c(%rbp),%edx
lea    0xd45(%rip),%rsi
call   1090 <sprintf@plt>
cmpl   $0xa,-0x3c(%rbp)
jge    130a <vencRodada+0x19a>
lea    -0x3f(%rbp),%rdi
lea    0xd2e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1080 <strcat@plt>
jmp    1317 <vencRodada+0x1a7>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <setToken@plt>
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15c4 <vencRodada+0x454>
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    13fa <vencRodada+0x28a>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <getToken@plt>
lea    -0x3f(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x41(%rbp),%rdi
mov    -0x3c(%rbp),%edx
lea    0xc93(%rip),%rsi
call   1090 <sprintf@plt>
cmpl   $0xa,-0x3c(%rbp)
jge    13bc <vencRodada+0x24c>
lea    -0x3f(%rbp),%rdi
lea    0xc7c(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1080 <strcat@plt>
jmp    13c9 <vencRodada+0x259>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
mov    $0x2,%esi
mov    $0x3,%edx
call   1060 <setToken@plt>
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15c4 <vencRodada+0x454>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    15ae <vencRodada+0x43e>
cmpl   $0x1,-0x28(%rbp)
jl     15ae <vencRodada+0x43e>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    15a9 <vencRodada+0x439>
movslq -0x1c(%rbp),%rax
movsbl -0x2f(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jne    14d6 <vencRodada+0x366>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <getToken@plt>
lea    -0x3f(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x41(%rbp),%rdi
mov    -0x3c(%rbp),%edx
lea    0xbb4(%rip),%rsi
call   1090 <sprintf@plt>
cmpl   $0xa,-0x3c(%rbp)
jge    149b <vencRodada+0x32b>
lea    -0x3f(%rbp),%rdi
lea    0xb9d(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1080 <strcat@plt>
jmp    14a8 <vencRodada+0x338>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <setToken@plt>
lea    0xb60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15c4 <vencRodada+0x454>
movslq -0x1c(%rbp),%rax
movsbl -0x2f(%rbp,%rax,1),%eax
cmp    $0x62,%eax
jne    1591 <vencRodada+0x421>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <getToken@plt>
lea    -0x3f(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x41(%rbp),%rdi
mov    -0x3c(%rbp),%edx
lea    0xafc(%rip),%rsi
call   1090 <sprintf@plt>
cmpl   $0xa,-0x3c(%rbp)
jge    1553 <vencRodada+0x3e3>
lea    -0x3f(%rbp),%rdi
lea    0xae5(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1080 <strcat@plt>
jmp    1560 <vencRodada+0x3f0>
lea    -0x3f(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x3f(%rbp),%rcx
mov    $0x2,%esi
mov    $0x3,%edx
call   1060 <setToken@plt>
lea    0xac3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15c4 <vencRodada+0x454>
jmp    1596 <vencRodada+0x426>
jmp    159b <vencRodada+0x42b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1417 <vencRodada+0x2a7>
jmp    15ae <vencRodada+0x43e>
jmp    15b3 <vencRodada+0x443>
jmp    15b8 <vencRodada+0x448>
jmp    15bd <vencRodada+0x44d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vencRodada>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,0x20(%rsp)
mov    %rdi,0x30(%rsp)
lea    0x14(%rsp),%rbp
mov    $0xe,%esi
mov    $0x10,%edx
mov    %rbp,%rcx
call   1060 <getToken@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xe3f(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%al
mov    0x15(%rsp),%cl
xor    %edx,%edx
cmp    $0x30,%al
setne  %dl
cmp    $0x61,%al
sete   0x1f(%rsp)
cmp    $0x62,%al
sete   0x1e(%rsp)
cmp    $0x2d,%al
sete   0x19(%rsp)
xor    %eax,%eax
cmp    $0x30,%cl
setne  %al
add    %edx,%eax
xor    %r14d,%r14d
cmp    $0x61,%cl
sete   0x1c(%rsp)
xor    %r15d,%r15d
cmp    $0x62,%cl
sete   0x1d(%rsp)
cmp    $0x2d,%cl
sete   0x18(%rsp)
mov    0x16(%rsp),%cl
xor    %ebx,%ebx
cmp    $0x30,%cl
setne  %bl
add    %eax,%ebx
xor    %r13d,%r13d
cmp    $0x61,%cl
sete   0x1a(%rsp)
xor    %r12d,%r12d
cmp    $0x62,%cl
sete   0x1b(%rsp)
cmp    $0x2d,%cl
sete   0x17(%rsp)
lea    0x2d(%rsp),%rbp
mov    0x30(%rsp),%rdi
mov    $0x11,%esi
mov    $0x12,%edx
mov    %rbp,%rcx
call   1060 <getToken@plt>
mov    %rbp,%rdi
call   1080 <atoi@plt>
cmp    $0x2,%ebx
jb     13ef <vencRodada+0x26f>
mov    %eax,%edx
xor    %ecx,%ecx
mov    0x1f(%rsp),%al
mov    %al,%cl
xor    %eax,%eax
mov    0x1e(%rsp),%bl
mov    %bl,%al
mov    0x1c(%rsp),%bl
mov    %bl,%r14b
add    %ecx,%r14d
mov    0x1d(%rsp),%cl
mov    %cl,%r15b
add    %eax,%r15d
mov    0x1a(%rsp),%al
mov    %al,%r13b
add    %r14d,%r13d
mov    0x1b(%rsp),%al
mov    %al,%r12b
add    %r15d,%r12d
cmp    %r12d,%r13d
jbe    131b <vencRodada+0x19b>
lea    0x11(%rsp),%rbp
mov    0x20(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    %edx,%ebx
mov    $0x1,%edx
mov    %rbp,%rcx
call   1060 <getToken@plt>
mov    %rbp,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
add    %ebx,%ebp
lea    0xd3e(%rip),%rsi
lea    0xf(%rsp),%rdi
mov    %ebp,%edx
call   10a0 <sprintf@plt>
cmp    $0x9,%ebp
jg     1488 <vencRodada+0x308>
lea    0xd25(%rip),%rsi
lea    0x11(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0xf(%rsp),%rsi
mov    %rbp,%rdi
call   1090 <strcat@plt>
jmp    1497 <vencRodada+0x317>
mov    0x20(%rsp),%r14
jae    1389 <vencRodada+0x209>
lea    0x11(%rsp),%rbp
mov    %r14,%rdi
mov    $0x2,%esi
mov    %edx,%ebx
mov    $0x3,%edx
mov    %rbp,%rcx
call   1060 <getToken@plt>
mov    %rbp,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
add    %ebx,%ebp
lea    0xccd(%rip),%rsi
lea    0xf(%rsp),%rdi
mov    %ebp,%edx
call   10a0 <sprintf@plt>
cmp    $0x9,%ebp
jg     13f6 <vencRodada+0x276>
lea    0xcb4(%rip),%rsi
lea    0x11(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <strcat@plt>
jmp    1405 <vencRodada+0x285>
jne    13ef <vencRodada+0x26f>
xor    %eax,%eax
mov    0x19(%rsp),%cl
mov    %cl,%al
xor    %ecx,%ecx
mov    0x18(%rsp),%bl
mov    %bl,%cl
add    %eax,%ecx
xor    %eax,%eax
mov    0x17(%rsp),%bl
mov    %bl,%al
neg    %eax
cmp    %eax,%ecx
mov    $0x0,%eax
je     14bc <vencRodada+0x33c>
mov    0x14(%rsp),%cl
cmp    $0x62,%cl
je     1322 <vencRodada+0x1a2>
cmp    $0x61,%cl
je     1428 <vencRodada+0x2a8>
mov    0x15(%rsp),%cl
cmp    $0x61,%cl
je     1428 <vencRodada+0x2a8>
cmp    $0x62,%cl
je     1322 <vencRodada+0x1a2>
mov    0x16(%rsp),%cl
cmp    $0x61,%cl
je     1428 <vencRodada+0x2a8>
cmp    $0x62,%cl
je     1322 <vencRodada+0x1a2>
jmp    14bc <vencRodada+0x33c>
xor    %eax,%eax
jmp    14bc <vencRodada+0x33c>
lea    0x11(%rsp),%rdi
lea    0xf(%rsp),%rsi
call   1030 <strcpy@plt>
lea    0x11(%rsp),%rcx
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1070 <setToken@plt>
lea    0xc00(%rip),%rdi
jmp    14b2 <vencRodada+0x332>
lea    0x11(%rsp),%rbp
mov    %r14,%rdi
xor    %esi,%esi
mov    %edx,%ebx
mov    $0x1,%edx
mov    %rbp,%rcx
call   1060 <getToken@plt>
mov    %rbp,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
add    %ebx,%ebp
lea    0xbca(%rip),%rsi
lea    0xf(%rsp),%rdi
mov    %ebp,%edx
call   10a0 <sprintf@plt>
cmp    $0x9,%ebp
jg     1488 <vencRodada+0x308>
lea    0xbb5(%rip),%rsi
lea    0x11(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <strcat@plt>
jmp    1497 <vencRodada+0x317>
lea    0x11(%rsp),%rdi
lea    0xf(%rsp),%rsi
call   1030 <strcpy@plt>
lea    0x11(%rsp),%rcx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <setToken@plt>
lea    0xb8e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"O placar da rodada esta: %s\0A\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [30 x i8] c"A equipe A venceu a rodada!\0A\0A\00"
@.str.4 = [30 x i8] c"A equipe B venceu a rodada!\0A\0A\00"
define i32 @vencRodada(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [3 x i8]
%12 = alloca [3 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca [3 x i8]
%16 = alloca [2 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%18 = load i8*, i8** %4
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%20 = call i8* @getToken(i8* %18, i32 14, i32 16, i8* %19)
%21 = call i32 @strcpy(i8* %17, i8* %20)
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 0, i32* %6
br label %24
24: ; preds = %68, %2
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 3
br i1 %26, label %27, label %71
27: ; preds = %24
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 48
br i1 %33, label %34, label %37
34: ; preds = %27
%35 = load i32, i32* %10
%36 = add nsw i32 %35, 1
store i32 %36, i32* %10
br label %37
37: ; preds = %34, %27
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 97
br i1 %43, label %44, label %47
44: ; preds = %37
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %47
47: ; preds = %44, %37
%48 = load i32, i32* %6
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 98
br i1 %53, label %54, label %57
54: ; preds = %47
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
store i32 %56, i32* %8
br label %57
57: ; preds = %54, %47
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 45
br i1 %63, label %64, label %67
64: ; preds = %57
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
store i32 %66, i32* %9
br label %67
67: ; preds = %64, %57
br label %68
68: ; preds = %67
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
br label %24
71: ; preds = %24
%72 = load i8*, i8** %4
%73 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%74 = call i8* @getToken(i8* %72, i32 17, i32 18, i8* %73)
%75 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%76 = call i32 @atoi(i8* %75)
store i32 %76, i32* %13
%77 = load i32, i32* %10
%78 = icmp sge i32 %77, 2
br i1 %78, label %79, label %237
79: ; preds = %71
%80 = load i32, i32* %7
%81 = load i32, i32* %8
%82 = icmp sgt i32 %80, %81
br i1 %82, label %83, label %112
83: ; preds = %79
%84 = load i8*, i8** %5
%85 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%86 = call i8* @getToken(i8* %84, i32 0, i32 1, i8* %85)
%87 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%88 = call i32 @atoi(i8* %87)
store i32 %88, i32* %14
%89 = load i32, i32* %13
%90 = load i32, i32* %14
%91 = add nsw i32 %90, %89
store i32 %91, i32* %14
%92 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%93 = load i32, i32* %14
%94 = call i32 @sprintf(i8* %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %93)
%95 = load i32, i32* %14
%96 = icmp slt i32 %95, 10
br i1 %96, label %97, label %103
97: ; preds = %83
%98 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%99 = call i32 @strcpy(i8* %98, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%100 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%101 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%102 = call i32 @strcat(i8* %100, i8* %101)
br label %107
103: ; preds = %83
%104 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%105 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%106 = call i32 @strcpy(i8* %104, i8* %105)
br label %107
107: ; preds = %103, %97
%108 = load i8*, i8** %5
%109 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%110 = call i32 @setToken(i8* %108, i32 0, i32 1, i8* %109)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %238
112: ; preds = %79
%113 = load i32, i32* %8
%114 = load i32, i32* %7
%115 = icmp sgt i32 %113, %114
br i1 %115, label %116, label %145
116: ; preds = %112
%117 = load i8*, i8** %5
%118 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%119 = call i8* @getToken(i8* %117, i32 2, i32 3, i8* %118)
%120 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%121 = call i32 @atoi(i8* %120)
store i32 %121, i32* %14
%122 = load i32, i32* %13
%123 = load i32, i32* %14
%124 = add nsw i32 %123, %122
store i32 %124, i32* %14
%125 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%126 = load i32, i32* %14
%127 = call i32 @sprintf(i8* %125, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %126)
%128 = load i32, i32* %14
%129 = icmp slt i32 %128, 10
br i1 %129, label %130, label %136
130: ; preds = %116
%131 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%132 = call i32 @strcpy(i8* %131, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%133 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%134 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%135 = call i32 @strcat(i8* %133, i8* %134)
br label %140
136: ; preds = %116
%137 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%138 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%139 = call i32 @strcpy(i8* %137, i8* %138)
br label %140
140: ; preds = %136, %130
%141 = load i8*, i8** %5
%142 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%143 = call i32 @setToken(i8* %141, i32 2, i32 3, i8* %142)
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %238
145: ; preds = %112
%146 = load i32, i32* %7
%147 = load i32, i32* %8
%148 = icmp eq i32 %146, %147
br i1 %148, label %149, label %234
149: ; preds = %145
%150 = load i32, i32* %9
%151 = icmp sge i32 %150, 1
br i1 %151, label %152, label %234
152: ; preds = %149
store i32 0, i32* %6
br label %153
153: ; preds = %230, %152
%154 = load i32, i32* %6
%155 = icmp slt i32 %154, 3
br i1 %155, label %156, label %233
156: ; preds = %153
%157 = load i32, i32* %6
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %158
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = icmp eq i32 %161, 97
br i1 %162, label %163, label %192
163: ; preds = %156
%164 = load i8*, i8** %5
%165 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%166 = call i8* @getToken(i8* %164, i32 0, i32 1, i8* %165)
%167 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%168 = call i32 @atoi(i8* %167)
store i32 %168, i32* %14
%169 = load i32, i32* %13
%170 = load i32, i32* %14
%171 = add nsw i32 %170, %169
store i32 %171, i32* %14
%172 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%173 = load i32, i32* %14
%174 = call i32 @sprintf(i8* %172, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %173)
%175 = load i32, i32* %14
%176 = icmp slt i32 %175, 10
br i1 %176, label %177, label %183
177: ; preds = %163
%178 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%179 = call i32 @strcpy(i8* %178, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%180 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%181 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%182 = call i32 @strcat(i8* %180, i8* %181)
br label %187
183: ; preds = %163
%184 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%185 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%186 = call i32 @strcpy(i8* %184, i8* %185)
br label %187
187: ; preds = %183, %177
%188 = load i8*, i8** %5
%189 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%190 = call i32 @setToken(i8* %188, i32 0, i32 1, i8* %189)
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %238
192: ; preds = %156
%193 = load i32, i32* %6
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %194
%196 = load i8, i8* %195
%197 = sext i8 %196 to i32
%198 = icmp eq i32 %197, 98
br i1 %198, label %199, label %228
199: ; preds = %192
%200 = load i8*, i8** %5
%201 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%202 = call i8* @getToken(i8* %200, i32 2, i32 3, i8* %201)
%203 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%204 = call i32 @atoi(i8* %203)
store i32 %204, i32* %14
%205 = load i32, i32* %13
%206 = load i32, i32* %14
%207 = add nsw i32 %206, %205
store i32 %207, i32* %14
%208 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%209 = load i32, i32* %14
%210 = call i32 @sprintf(i8* %208, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %209)
%211 = load i32, i32* %14
%212 = icmp slt i32 %211, 10
br i1 %212, label %213, label %219
213: ; preds = %199
%214 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%215 = call i32 @strcpy(i8* %214, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%216 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%217 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%218 = call i32 @strcat(i8* %216, i8* %217)
br label %223
219: ; preds = %199
%220 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%221 = getelementptr inbounds [2 x i8], [2 x i8]* %16, i64 0, i64 0
%222 = call i32 @strcpy(i8* %220, i8* %221)
br label %223
223: ; preds = %219, %213
%224 = load i8*, i8** %5
%225 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%226 = call i32 @setToken(i8* %224, i32 2, i32 3, i8* %225)
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %238
228: ; preds = %192
br label %229
229: ; preds = %228
br label %230
230: ; preds = %229
%231 = load i32, i32* %6
%232 = add nsw i32 %231, 1
store i32 %232, i32* %6
br label %153
233: ; preds = %153
br label %234
234: ; preds = %233, %149, %145
br label %235
235: ; preds = %234
br label %236
236: ; preds = %235
br label %237
237: ; preds = %236, %71
store i32 0, i32* %3
br label %238
238: ; preds = %237, %223, %187, %140, %107
%239 = load i32, i32* %3
ret i32 %239
}

LLVM IR (-O2):
@.str = [30 x i8] c"O placar da rodada esta: %s\0A\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"0\00"
@str.6 = [29 x i8] c"A equipe B venceu a rodada!\0A\00"
@str.7 = [29 x i8] c"A equipe A venceu a rodada!\0A\00"
define i32 @vencRodada(i8* %0, i8* %1) {
%3 = alloca [3 x i8]
%4 = alloca [3 x i8]
%5 = alloca [3 x i8]
%6 = alloca [2 x i8]
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%9 = call i8* @getToken(i8* %0, i32 14, i32 16, i8* %7)
%10 = call i32 @strcpy(i8* %7, i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7)
%12 = load i8, i8* %7
%13 = icmp ne i8 %12, 48
%14 = zext i1 %13 to i32
%15 = icmp eq i8 %12, 97
%16 = zext i1 %15 to i32
%17 = icmp eq i8 %12, 98
%18 = zext i1 %17 to i32
%19 = icmp eq i8 %12, 45
%20 = zext i1 %19 to i32
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 48
%24 = zext i1 %23 to i32
%25 = add nuw nsw i32 %14, %24
%26 = icmp eq i8 %22, 97
%27 = zext i1 %26 to i32
%28 = add nuw nsw i32 %16, %27
%29 = icmp eq i8 %22, 98
%30 = zext i1 %29 to i32
%31 = add nuw nsw i32 %18, %30
%32 = icmp eq i8 %22, 45
%33 = zext i1 %32 to i32
%34 = add nuw nsw i32 %20, %33
%35 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%36 = load i8, i8* %35
%37 = icmp ne i8 %36, 48
%38 = zext i1 %37 to i32
%39 = add nuw nsw i32 %25, %38
%40 = icmp eq i8 %36, 97
%41 = zext i1 %40 to i32
%42 = add nuw nsw i32 %28, %41
%43 = icmp eq i8 %36, 98
%44 = zext i1 %43 to i32
%45 = add nuw nsw i32 %31, %44
%46 = icmp eq i8 %36, 45
%47 = sext i1 %46 to i32
%48 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%49 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%50 = call i8* @getToken(i8* %0, i32 17, i32 18, i8* %8)
%51 = call i32 @atoi(i8* %8)
%52 = icmp ugt i32 %39, 1
br i1 %52, label %53, label %122
53: ; preds = %2
%54 = icmp ugt i32 %42, %45
br i1 %54, label %55, label %68
55: ; preds = %53
%56 = call i8* @getToken(i8* %1, i32 0, i32 1, i8* %48)
%57 = call i32 @atoi(i8* %48)
%58 = add nsw i32 %57, %51
%59 = call i32 @sprintf(i8* %49, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %58)
%60 = icmp slt i32 %58, 10
br i1 %60, label %61, label %64
61: ; preds = %55
%62 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%63 = call i32 @strcat(i8* %48, i8* %49)
br label %66
64: ; preds = %55
%65 = call i32 @strcpy(i8* %48, i8* %49)
br label %66
66: ; preds = %64, %61
%67 = call i32 @setToken(i8* %1, i32 0, i32 1, i8* %48)
br label %119
68: ; preds = %53
%69 = icmp ugt i32 %45, %42
br i1 %69, label %70, label %83
70: ; preds = %68
%71 = call i8* @getToken(i8* %1, i32 2, i32 3, i8* %48)
%72 = call i32 @atoi(i8* %48)
%73 = add nsw i32 %72, %51
%74 = call i32 @sprintf(i8* %49, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %73)
%75 = icmp slt i32 %73, 10
br i1 %75, label %76, label %79
76: ; preds = %70
%77 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%78 = call i32 @strcat(i8* %48, i8* %49)
br label %81
79: ; preds = %70
%80 = call i32 @strcpy(i8* %48, i8* %49)
br label %81
81: ; preds = %79, %76
%82 = call i32 @setToken(i8* %1, i32 2, i32 3, i8* %48)
br label %119
83: ; preds = %68
%84 = icmp eq i32 %42, %45
%85 = icmp ne i32 %34, %47
%86 = select i1 %84, i1 %85, i1 false
br i1 %86, label %87, label %122
87: ; preds = %83
%88 = load i8, i8* %7
switch i8 %88, label %115 [
i8 97, label %89
i8 98, label %102
]
89: ; preds = %117, %115, %87
%90 = call i8* @getToken(i8* %1, i32 0, i32 1, i8* %48)
%91 = call i32 @atoi(i8* %48)
%92 = add nsw i32 %91, %51
%93 = call i32 @sprintf(i8* %49, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %92)
%94 = icmp slt i32 %92, 10
br i1 %94, label %95, label %98
95: ; preds = %89
%96 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%97 = call i32 @strcat(i8* %48, i8* %49)
br label %100
98: ; preds = %89
%99 = call i32 @strcpy(i8* %48, i8* %49)
br label %100
100: ; preds = %98, %95
%101 = call i32 @setToken(i8* %1, i32 0, i32 1, i8* %48)
br label %119
102: ; preds = %117, %115, %87
%103 = call i8* @getToken(i8* %1, i32 2, i32 3, i8* %48)
%104 = call i32 @atoi(i8* %48)
%105 = add nsw i32 %104, %51
%106 = call i32 @sprintf(i8* %49, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %105)
%107 = icmp slt i32 %105, 10
br i1 %107, label %108, label %111
108: ; preds = %102
%109 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%110 = call i32 @strcat(i8* %48, i8* %49)
br label %113
111: ; preds = %102
%112 = call i32 @strcpy(i8* %48, i8* %49)
br label %113
113: ; preds = %111, %108
%114 = call i32 @setToken(i8* %1, i32 2, i32 3, i8* %48)
br label %119
115: ; preds = %87
%116 = load i8, i8* %21
switch i8 %116, label %117 [
i8 97, label %89
i8 98, label %102
]
117: ; preds = %115
%118 = load i8, i8* %35
switch i8 %118, label %122 [
i8 97, label %89
i8 98, label %102
]
119: ; preds = %66, %81, %100, %113
%120 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0), %113 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0), %100 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0), %81 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0), %66 ]
%121 = call i32 @puts(i8* dereferenceable(1) %120)
br label %122
122: ; preds = %119, %117, %2, %83
%123 = phi i32 [ 0, %83 ], [ 0, %2 ], [ 0, %117 ], [ 1, %119 ]
ret i32 %123
}