#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 jogar(int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  int ev1, ev2, at, d, dado, menor;
  do {
    scanf("%d%d%d%d", &ev1, &ev2, &at, &d);
    if (ev1 + ev2 + at + d == 0) {
      break;
    } else {
      printf("Ganhador: Vampiro %d\n", jogar(ev1, ev2, at, d));
    }
  } while (1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    $0x0,%eax
jne    1175 <main+0x45>
jmp    11a8 <main+0x78>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <jogar@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <main+0x69>
mov    $0x1,%al
test   $0x1,%al
jne    113f <main+0xf>
jmp    11a8 <main+0x78>
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    0xebb(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
lea    (%rsi,%rdi,1),%eax
mov    0xc(%rsp),%edx
add    %edx,%eax
mov    0x8(%rsp),%ecx
add    %ecx,%eax
je     11dc <main+0xac>
lea    0xe8b(%rip),%r14
lea    0xe7b(%rip),%r15
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%rbp
nopl   0x0(%rax)
call   1040 <jogar@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
lea    (%rsi,%rdi,1),%eax
mov    0xc(%rsp),%edx
add    %edx,%eax
mov    0x8(%rsp),%ecx
add    %ecx,%eax
jne    11a0 <main+0x70>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [22 x i8] c"Ganhador: Vampiro %d\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 = %27, %0
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %8
br label %28
19: ; preds = %8
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i32 @jogar(i32 %20, i32 %21, i32 %22, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %19
br label %27
27: ; preds = %26
br i1 true, label %8, label %28
28: ; preds = %27, %18
ret i32 0
}

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