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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11b6 <main+0x86>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     11a3 <main+0x73>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     11a3 <main+0x73>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x2,%edx
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x86>
jmp    11a8 <main+0x78>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <main+0x28>
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>
mov    0x4(%rsp),%ebx
cmp    $0x5,%ebx
jge    1158 <main+0x28>
jmp    1183 <main+0x53>
nop
add    $0xffffffff,%ebx
cmp    $0x3,%ebp
jle    1183 <main+0x53>
lea    -0x2(%rbx),%ebp
mov    %ebp,%edi
call   1040 <is_prime@plt>
test   %rax,%rax
je     1150 <main+0x20>
mov    %ebx,%edi
call   1040 <is_prime@plt>
test   %rax,%rax
je     1150 <main+0x20>
lea    0xe89(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\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, 4
br i1 %5, label %6, label %21
6: ; preds = %0
%7 = add nsw i32 %4, -2
br label %8
8: ; preds = %6, %18
%9 = phi i32 [ %19, %18 ], [ %7, %6 ]
%10 = call i64 @is_prime(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %8
%13 = add nuw nsw i32 %9, 2
%14 = call i64 @is_prime(i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %13)
br label %21
18: ; preds = %8, %12
%19 = add nsw i32 %9, -1
%20 = icmp sgt i32 %9, 3
br i1 %20, label %8, label %21
21: ; preds = %18, %0, %16
ret i32 0
}