#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__ Diagonali(int, int, int, int);
int /*<<< orphan*/ Posizione(char *, int *, int *);
scalar_t__ RigaColonna(int, int, int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int ReX, ReY, ReginaX, ReginaY;
  Posizione("del Re", &ReX, &ReY);
  do {
    Posizione("della Regina", &ReginaX, &ReginaY);
  } while (ReX == ReginaX && ReY == ReginaY);
  if (RigaColonna(ReX, ReY, ReginaX, ReginaY) ||
      Diagonali(ReX, ReY, ReginaX, ReginaY))
    printf("La Reggina mangia il Re.");
  else
    printf("Il Re vive.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <Posizione@plt>
lea    0xe9d(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <Posizione@plt>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x15(%rbp)
jne    1194 <main+0x54>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1163 <main+0x23>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1060 <RigaColonna@plt>
cmp    $0x0,%rax
jne    11d5 <main+0x95>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <Diagonali@plt>
cmp    $0x0,%rax
je     11e6 <main+0xa6>
lea    0xe38(%rip),%rdi
call   1050 <printf@plt>
jmp    11f2 <main+0xb2>
lea    0xe40(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb0(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <Posizione@plt>
lea    0xea1(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <Posizione@plt>
mov    0xc(%rsp),%edi
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%esi
mov    (%rsp),%ecx
cmp    %edx,%edi
jne    1195 <main+0x55>
cmp    %ecx,%esi
je     1170 <main+0x30>
call   1060 <RigaColonna@plt>
test   %rax,%rax
je     11a8 <main+0x68>
lea    0xe6e(%rip),%rdi
jmp    11d1 <main+0x91>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
call   1030 <Diagonali@plt>
test   %rax,%rax
lea    0xe67(%rip),%rax
lea    0xe47(%rip),%rdi
cmove  %rax,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"del Re\00"
@.str.1 = [13 x i8] c"della Regina\00"
@.str.2 = [25 x i8] c"La Reggina mangia il Re.\00"
@.str.3 = [12 x i8] c"Il Re vive.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @Posizione(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
br label %7
7: ; preds = %17, %0
%8 = call i32 @Posizione(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
br label %9
9: ; preds = %7
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = icmp eq i32 %14, %15
br label %17
17: ; preds = %13, %9
%18 = phi i1 [ false, %9 ], [ %16, %13 ]
br i1 %18, label %7, label %19
19: ; preds = %17
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i64 @RigaColonna(i32 %20, i32 %21, i32 %22, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %33, label %26
26: ; preds = %19
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = call i64 @Diagonali(i32 %27, i32 %28, i32 %29, i32 %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %26, %19
%34 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %37
35: ; preds = %26
%36 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [7 x i8] c"del Re\00"
@.str.1 = [13 x i8] c"della Regina\00"
@.str.2 = [25 x i8] c"La Reggina mangia il Re.\00"
@.str.3 = [12 x i8] c"Il Re vive.\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 @Posizione(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
br label %10
10: ; preds = %10, %0
%11 = call i32 @Posizione(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%12 = load i32, i32* %1
%13 = load i32, i32* %3
%14 = icmp eq i32 %12, %13
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = icmp eq i32 %15, %16
%18 = select i1 %14, i1 %17, i1 false
br i1 %18, label %10, label %19
19: ; preds = %10
%20 = call i64 @RigaColonna(i32 %12, i32 %15, i32 %13, i32 %16)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %19
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = call i64 @Diagonali(i32 %23, i32 %24, i32 %25, i32 %26)
%28 = icmp eq i64 %27, 0
%29 = select i1 %28, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0)
br label %30
30: ; preds = %22, %19
%31 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %19 ], [ %29, %22 ]
%32 = call i32 @printf(i8* dereferenceable(1) %31)
ret i32 0
}