#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 main(void) {
  unsigned int even(int numeroInserito);
  int valoreSentinella = -1;
  int numeroInserito;
  do {
    printf("%s", "Inserire il primo numero ( -1 per uscire ): ");
    scanf("%d", &numeroInserito);
    if (numeroInserito != valoreSentinella) {
      if (even(numeroInserito) == 1) {
        printf("Il numero: %d e' pari.\n", numeroInserito);
      } else {
        printf("Il numero: %d non e' pari.\n", numeroInserito);
      }
    }
  } while (numeroInserito != valoreSentinella);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     11b4 <main+0x84>
mov    -0xc(%rbp),%edi
call   1040 <even@plt>
cmp    $0x1,%eax
jne    119e <main+0x6e>
mov    -0xc(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11af <main+0x7f>
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b4 <main+0x84>
jmp    11b9 <main+0x89>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%r14
lea    0xeba(%rip),%r15
lea    0xee0(%rip),%r12
lea    0x4(%rsp),%rbx
lea    0xed7(%rip),%r13
lea    0xee8(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0xffffffff,%edi
je     11b2 <main+0x82>
call   1040 <even@plt>
cmp    $0x1,%eax
mov    0x4(%rsp),%esi
mov    %rbp,%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0xffffffff,0x4(%rsp)
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [45 x i8] c"Inserire il primo numero ( -1 per uscire ): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [24 x i8] c"Il numero: %d e' pari.\0A\00"
@.str.4 = [28 x i8] c"Il numero: %d non e' pari.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
br label %4
4: ; preds = %22, %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %4
%11 = load i32, i32* %3
%12 = call i32 @even(i32 %11)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %15)
br label %20
17: ; preds = %10
%18 = load i32, i32* %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %14
br label %21
21: ; preds = %20, %4
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = icmp ne i32 %23, %24
br i1 %25, label %4, label %26
26: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [45 x i8] c"Inserire il primo numero ( -1 per uscire ): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [24 x i8] c"Il numero: %d e' pari.\0A\00"
@.str.4 = [28 x i8] c"Il numero: %d non e' pari.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %8, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, -1
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = call i32 @even(i32 %6)
%10 = icmp eq i32 %9, 1
%11 = load i32, i32* %1
%12 = select i1 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %12, i32 %11)
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %3
16: ; preds = %3, %8
ret i32 0
}