#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *, int *, int *, int *, int *);
int main(void) {
  int p, j1, j2, r, a, sum_2;
  while (scanf("%i %i %i %i %i", &p, &j1, &j2, &r, &a) != EOF) {
    sum_2 = (j1 + j2) % 2;
    if (r != a || (r == 0 && p != sum_2)) {
      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    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     11b4 <main+0x94>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1192 <main+0x72>
cmpl   $0x0,-0x14(%rbp)
jne    11a3 <main+0x83>
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     11a3 <main+0x83>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x8f>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%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>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea9(%rip),%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r13
lea    0x8(%rsp),%rbx
lea    0x4(%rsp),%rbp
jmp    11d2 <main+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
cmovne %rdx,%rdi
call   1030 <puts@plt>
lea    0xe4e(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
call   1040 <scanf@plt>
mov    0x2e1b(%rip),%rcx
cmp    (%rcx),%rax
je     115f <main+0x3f>
mov    0x8(%rsp),%eax
mov    %r14,%rdi
cmp    0x4(%rsp),%eax
jne    11a6 <main+0x86>
mov    0xc(%rsp),%ecx
add    0x10(%rsp),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
and    $0xfffffffe,%edx
sub    %edx,%ecx
lea    0xe15(%rip),%rdx
mov    %rdx,%rdi
cmp    %ecx,0x14(%rsp)
je     11a0 <main+0x80>
mov    %r14,%rdi
jmp    11a0 <main+0x80>

LLVM IR (-O0):
@.str = [15 x i8] c"%i %i %i %i %i\00"
@EOF = global i64 0
@.str.1 = [18 x i8] c"Jogador 1 ganha!\0A\00"
@.str.2 = [18 x i8] c"Jogador 2 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
br label %8
8: ; preds = %31, %0
%9 = call i64 @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)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
%16 = srem i32 %15, 2
store i32 %16, i32* %7
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp ne i32 %17, %18
br i1 %19, label %27, label %20
20: ; preds = %12
%21 = load i32, i32* %5
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %2
%25 = load i32, i32* %7
%26 = icmp ne i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %23, %12
%28 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %31
29: ; preds = %23, %20
%30 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
br label %8
32: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%i %i %i %i %i\00"
@EOF = global i64 0
@str = [17 x i8] c"Jogador 2 ganha!\00"
@str.3 = [17 x i8] c"Jogador 1 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 i64 @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 i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %34, label %14
14: ; preds = %0, %28
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, %19
%22 = srem i32 %21, 2
%23 = icmp ne i32 %15, 0
%24 = load i32, i32* %1
%25 = icmp eq i32 %24, %22
%26 = select i1 %23, i1 true, i1 %25
%27 = select i1 %26, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0)
br label %28
28: ; preds = %18, %14
%29 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0), %14 ], [ %27, %18 ]
%30 = call i32 @puts(i8* dereferenceable(1) %29)
%31 = call i64 @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)
%32 = load i64, i64* @EOF
%33 = icmp eq i64 %31, %32
br i1 %33, label %34, label %14
34: ; preds = %28, %0
ret i32 0
}