#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__ is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  int count = 0;
  scanf("%d", &n);
  for (int i = 2; i <= n - 2; i++) {
    if (is_prime(i) && is_prime(i + 2))
      count++;
  }
  printf("%d", count);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
xor    %r14d,%r14d
cmpl   $0x4,0xc(%rsp)
jge    116d <main+0x3d>
lea    0xea6(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %r14d,%r14d
mov    $0x4,%ebx
jmp    118e <main+0x5e>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
add    $0xfffffffe,%eax
add    $0x1,%ebx
cmp    %eax,%ebp
jge    1153 <main+0x23>
lea    -0x2(%rbx),%ebp
mov    %ebp,%edi
call   1040 <is_prime@plt>
test   %rax,%rax
je     1180 <main+0x50>
mov    %ebx,%edi
call   1040 <is_prime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r14d
jmp    1180 <main+0x50>

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* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 2, i32* %4
br label %6
6: ; preds = %24, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 2
%10 = icmp sle i32 %7, %9
br i1 %10, label %11, label %27
11: ; preds = %6
%12 = load i32, i32* %4
%13 = call i64 @is_prime(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 2
%18 = call i64 @is_prime(i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %15, %11
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
%28 = load i32, i32* %3
%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 slt i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %20, %0
%7 = phi i32 [ 0, %0 ], [ %21, %20 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
9: ; preds = %0, %20
%10 = phi i32 [ %22, %20 ], [ 2, %0 ]
%11 = phi i32 [ %21, %20 ], [ 0, %0 ]
%12 = call i64 @is_prime(i32 %10)
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %9
%15 = add nuw nsw i32 %10, 2
%16 = call i64 @is_prime(i32 %15)
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i32
%19 = add nsw i32 %11, %18
br label %20
20: ; preds = %14, %9
%21 = phi i32 [ %11, %9 ], [ %19, %14 ]
%22 = add nuw nsw i32 %10, 1
%23 = load i32, i32* %1
%24 = add nsw i32 %23, -2
%25 = icmp slt i32 %10, %24
br i1 %25, label %9, label %6
}