#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 *, int *, int *, int *);
int main(void) {
  int escolheuPar, numeroDoJogador01, numeroDoJogador02, roubou, acusou;
  int vitoria;
  scanf("%d %d %d %d %d", &escolheuPar, &numeroDoJogador01, &numeroDoJogador02,
        &roubou, &acusou);
  if ((numeroDoJogador01 + numeroDoJogador02) % 2 == 0) {
    if (escolheuPar) {
      vitoria = 1;
    } else {
      vitoria = 2;
    }
  } else {
    if (escolheuPar) {
      vitoria = 2;
    } else {
      vitoria = 1;
    }
  }
  if (roubou) {
    if (acusou) {
      printf("Jogador 2 ganha!\n");
    } else {
      printf("Jogador 1 ganha!\n");
    }
  } else {
    if (vitoria == 1) {
      printf("Jogador 1 ganha!\n");
    } else {
      printf("Jogador 2 ganha!\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1188 <main+0x68>
cmpl   $0x0,-0x8(%rbp)
je     117c <main+0x5c>
movl   $0x1,-0x1c(%rbp)
jmp    1183 <main+0x63>
movl   $0x2,-0x1c(%rbp)
jmp    11aa <main+0x8a>
cmpl   $0x0,-0x8(%rbp)
je     119e <main+0x7e>
movl   $0x2,-0x1c(%rbp)
jmp    11a5 <main+0x85>
movl   $0x1,-0x1c(%rbp)
jmp    11aa <main+0x8a>
cmpl   $0x0,-0x14(%rbp)
je     11e0 <main+0xc0>
cmpl   $0x0,-0x18(%rbp)
je     11cf <main+0xaf>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xbb>
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
jmp    120c <main+0xec>
cmpl   $0x1,-0x1c(%rbp)
jne    11fb <main+0xdb>
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
jmp    1207 <main+0xe7>
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
jmp    120c <main+0xec>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
je     1169 <main+0x49>
cmpl   $0x0,0x4(%rsp)
lea    0xeb3(%rip),%rax
lea    0xebd(%rip),%rdi
cmove  %rax,%rdi
jmp    1199 <main+0x79>
mov    0xc(%rsp),%eax
add    0x10(%rsp),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmpl   $0x0,0x14(%rsp)
setne  %cl
sete   %dl
test   $0x1,%al
cmove  %ecx,%edx
lea    0xe83(%rip),%rax
lea    0xe8d(%rip),%rdi
test   %dl,%dl
cmovne %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d %d %d %d %d\00"
@.str.1 = [18 x i8] c"Jogador 2 ganha!\0A\00"
@.str.2 = [18 x i8] c"Jogador 1 ganha!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %0
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %7
br label %19
18: ; preds = %14
store i32 2, i32* %7
br label %19
19: ; preds = %18, %17
br label %26
20: ; preds = %0
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 2, i32* %7
br label %25
24: ; preds = %20
store i32 1, i32* %7
br label %25
25: ; preds = %24, %23
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %5
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %36
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
br label %45
37: ; preds = %26
%38 = load i32, i32* %7
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %44
42: ; preds = %37
%43 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
br label %45
45: ; preds = %44, %36
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d %d %d %d %d\00"
@str.4 = [17 x i8] c"Jogador 1 ganha!\00"
@str.5 = [17 x i8] c"Jogador 2 ganha!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
%12 = load i32, i32* %1
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %0
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0)
br label %29
19: ; preds = %0
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = add nsw i32 %20, %21
%23 = and i32 %22, 1
%24 = icmp eq i32 %23, 0
%25 = icmp ne i32 %12, 0
%26 = icmp eq i32 %12, 0
%27 = select i1 %24, i1 %25, i1 %26
%28 = select i1 %27, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0)
br label %29
29: ; preds = %19, %15
%30 = phi i8* [ %18, %15 ], [ %28, %19 ]
%31 = call i32 @puts(i8* dereferenceable(1) %30)
ret i32 0
}