#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() {
  int p, q1, q2, a, b;
  scanf("%d%d%d%d%d", &p, &q1, &q2, &a, &b);
  if (a == 1 && b == 0) {
    printf("Jogador 1 ganha!\n");
  } else if (a == 1 && b == 1) {
    printf("Jogador 2 ganha!\n");
  } else {
    if ((q1 + q2) % 2 == 0 && p == 1) {
      printf("Jogador 1 ganha!\n");
    } else if ((q1 + q2) % 2 != 0 && p == 0) {
      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>
cmpl   $0x1,-0x14(%rbp)
jne    1174 <main+0x54>
cmpl   $0x0,-0x18(%rbp)
jne    1174 <main+0x54>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1218 <main+0xf8>
cmpl   $0x1,-0x14(%rbp)
jne    1199 <main+0x79>
cmpl   $0x1,-0x18(%rbp)
jne    1199 <main+0x79>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1213 <main+0xf3>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11cb <main+0xab>
cmpl   $0x1,-0x8(%rbp)
jne    11cb <main+0xab>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    120e <main+0xee>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11fd <main+0xdd>
cmpl   $0x0,-0x8(%rbp)
jne    11fd <main+0xdd>
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <main+0xe9>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
jmp    120e <main+0xee>
jmp    1213 <main+0xf3>
jmp    1218 <main+0xf8>
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>
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%eax
lea    0xec4(%rip),%rdi
cmp    $0x1,%ecx
jne    1161 <main+0x41>
test   %eax,%eax
je     11ad <main+0x8d>
cmp    $0x1,%ecx
jne    1174 <main+0x54>
cmp    $0x1,%eax
jne    1174 <main+0x54>
lea    0xe99(%rip),%rdi
jmp    11ad <main+0x8d>
mov    0xc(%rsp),%eax
add    0x10(%rsp),%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
and    $0xfffffffe,%edx
mov    0x14(%rsp),%ecx
sub    %edx,%eax
jne    1193 <main+0x73>
cmp    $0x1,%ecx
je     11ad <main+0x8d>
test   %ecx,%ecx
lea    0xe80(%rip),%rdi
lea    0xe68(%rip),%rcx
cmovne %rcx,%rdi
test   %eax,%eax
cmove  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

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