#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*/ check_par_primo(int);
int check_primo(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, buscar_hasta, retorno_check_primo;
  printf("\nBuscar los pares primos hasta el n°: ");
  scanf("%d", &buscar_hasta);
  for (num = 2; num <= buscar_hasta; num++) {
    retorno_check_primo = check_primo(num);
    if (retorno_check_primo == 1)
      ;
    else {
      check_par_primo(retorno_check_primo);
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11b3 <main+0x73>
mov    -0x8(%rbp),%edi
call   1040 <check_primo@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1198 <main+0x58>
jmp    11a0 <main+0x60>
mov    -0x10(%rbp),%edi
call   1030 <check_par_primo@plt>
jmp    11a5 <main+0x65>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <main+0x32>
lea    0xe71(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
call   1060 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x2,0xc(%rsp)
jge    118b <main+0x3b>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x1,%ebx
jmp    11a6 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    0xc(%rsp),%ebx
jge    1179 <main+0x29>
add    $0x1,%ebx
mov    %ebx,%edi
call   1050 <check_primo@plt>
cmp    $0x1,%eax
je     11a0 <main+0x50>
mov    %eax,%edi
call   1040 <check_par_primo@plt>
jmp    11a0 <main+0x50>

LLVM IR (-O0):
@.str = [40 x i8] c"\0ABuscar los pares primos hasta el n\C2\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 2, i32* %2
br label %7
7: ; preds = %21, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @check_primo(i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %11
br label %20
17: ; preds = %11
%18 = load i32, i32* %4
%19 = call i32 @check_par_primo(i32 %18)
br label %20
20: ; preds = %17, %16
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %7
24: ; preds = %7
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0ABuscar los pares primos hasta el n\C2\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 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 = icmp slt i32 %5, 2
br i1 %6, label %17, label %7
7: ; preds = %0, %13
%8 = phi i32 [ %14, %13 ], [ 2, %0 ]
%9 = call i32 @check_primo(i32 %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = call i32 @check_par_primo(i32 %9)
br label %13
13: ; preds = %11, %7
%14 = add nuw nsw i32 %8, 1
%15 = load i32, i32* %1
%16 = icmp slt i32 %8, %15
br i1 %16, label %7, label %17
17: ; preds = %13, %0
%18 = call i32 @putchar(i32 10)
ret i32 0
}