#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__ espar(int);
scalar_t__ esprimo(int);
int /*<<< orphan*/ goldbach(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main(void) {
  int num;
  int i = 1;
  printf("Introduce un numero par \n");
  scanf("%d", &num);
  if (espar(num)) {
    printf("El numero %d no es par \n", num);
  } else {
    while (i < num) {
      if (esprimo(i)) {
        goldbach(i, num);
      }
      i++;
    }
  }
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1070 <espar@plt>
cmp    $0x0,%rax
je     11bc <main+0x5c>
mov    -0x8(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11fd <main+0x9d>
jmp    11c1 <main+0x61>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f8 <main+0x98>
mov    -0xc(%rbp),%edi
call   1050 <esprimo@plt>
cmp    $0x0,%rax
je     11ea <main+0x8a>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1080 <goldbach@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c1 <main+0x61>
jmp    11fd <main+0x9d>
lea    0xe32(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%edi
call   1080 <espar@plt>
mov    0xc(%rsp),%esi
test   %rax,%rax
je     11b4 <main+0x44>
lea    0xe58(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11e2 <main+0x72>
cmp    $0x2,%esi
jl     11e2 <main+0x72>
mov    $0x1,%ebx
jmp    11c9 <main+0x59>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jge    11e2 <main+0x72>
mov    %ebx,%edi
call   1060 <esprimo@plt>
test   %rax,%rax
je     11c0 <main+0x50>
mov    0xc(%rsp),%esi
mov    %ebx,%edi
call   1090 <goldbach@plt>
jmp    11c0 <main+0x50>
lea    0xe33(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Introduce un numero par \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"El numero %d no es par \0A\00"
@.str.3 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i64 @espar(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %29
12: ; preds = %0
br label %13
13: ; preds = %25, %12
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i32, i32* %3
%19 = call i64 @esprimo(i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = call i32 @goldbach(i32 %22, i32 %23)
br label %25
25: ; preds = %21, %17
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %13
28: ; preds = %13
br label %29
29: ; preds = %28, %9
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"El numero %d no es par \0A\00"
@.str.3 = [6 x i8] c"PAUSE\00"
@str = [25 x i8] c"Introduce un numero par \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @espar(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* %1
br i1 %7, label %9, label %11
9: ; preds = %0
%10 = icmp sgt i32 %8, 1
br i1 %10, label %13, label %24
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %24
13: ; preds = %9, %20
%14 = phi i32 [ %21, %20 ], [ 1, %9 ]
%15 = call i64 @esprimo(i32 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = load i32, i32* %1
%19 = call i32 @goldbach(i32 %14, i32 %18)
br label %20
20: ; preds = %17, %13
%21 = add nuw nsw i32 %14, 1
%22 = load i32, i32* %1
%23 = icmp slt i32 %21, %22
br i1 %23, label %13, label %24
24: ; preds = %20, %9, %11
%25 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}