#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__ check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N, num;
  int pair = 0;
  scanf("%d", &N);
  for (num = 2; num < N; num++) {
    if (check_prime(num)) {
      if (check_prime(num + 2)) {
        pair = pair + 1;
      }
    }
  }
  printf("%d", pair);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b1 <main+0x81>
mov    -0xc(%rbp),%edi
call   1030 <check_prime@plt>
cmp    $0x0,%rax
je     119e <main+0x6e>
mov    -0xc(%rbp),%edi
add    $0x2,%edi
call   1030 <check_prime@plt>
cmp    $0x0,%rax
je     1199 <main+0x69>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119e <main+0x6e>
jmp    11a3 <main+0x73>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x2d>
mov    -0x10(%rbp),%esi
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xor    %ebp,%ebp
cmpl   $0x3,0x4(%rsp)
jl     1186 <main+0x56>
mov    $0x2,%ebx
xor    %ebp,%ebp
jmp    1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jge    1186 <main+0x56>
mov    %ebx,%edi
call   1030 <check_prime@plt>
test   %rax,%rax
je     1160 <main+0x30>
lea    0x2(%rbx),%edi
call   1030 <check_prime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
jmp    1160 <main+0x30>
lea    0xe73(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 2
br i1 %5, label %6, label %22
6: ; preds = %0, %17
%7 = phi i32 [ %18, %17 ], [ 0, %0 ]
%8 = phi i32 [ %19, %17 ], [ 2, %0 ]
%9 = call i64 @check_prime(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = add nuw nsw i32 %8, 2
%13 = call i64 @check_prime(i32 %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
%16 = add nsw i32 %7, %15
br label %17
17: ; preds = %11, %6
%18 = phi i32 [ %7, %6 ], [ %16, %11 ]
%19 = add nuw nsw i32 %8, 1
%20 = load i32, i32* %1
%21 = icmp slt i32 %19, %20
br i1 %21, label %6, label %22
22: ; preds = %17, %0
%23 = phi i32 [ 0, %0 ], [ %18, %17 ]
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
ret i32 0
}