#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() {
  int s, i, ans = 0;
  scanf("%d", &s);
  for (i = 2; i <= s - 2; ++i) {
    if (is_prime(i) && is_prime(s - i) && ans < i * (s - i))
      ans = i * (s - i);
  }
  printf("%d\n", ans);
  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
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     11ce <main+0x9e>
mov    -0xc(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     11bb <main+0x8b>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     11bb <main+0x8b>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    -0xc(%rbp),%edx
imul   %edx,%ecx
cmp    %ecx,%eax
jge    11bb <main+0x8b>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    11c0 <main+0x90>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x2d>
mov    -0x10(%rbp),%esi
lea    0xe2b(%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    0xea9(%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    $0x1,%ebp
mov    $0xfffffffe,%ebx
jmp    118e <main+0x5e>
nopl   0x0(%rax)
mov    0xc(%rsp),%eax
add    $0xfffffffe,%eax
add    $0xffffffff,%ebx
cmp    %eax,%ebp
jge    1153 <main+0x23>
add    $0x1,%ebp
mov    %ebp,%edi
call   1040 <is_prime@plt>
test   %rax,%rax
je     1180 <main+0x50>
mov    0xc(%rsp),%edi
add    %ebx,%edi
call   1040 <is_prime@plt>
test   %rax,%rax
je     1180 <main+0x50>
mov    0xc(%rsp),%eax
add    %ebx,%eax
imul   %ebp,%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = %36, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 2
%10 = icmp sle i32 %7, %9
br i1 %10, label %11, label %39
11: ; preds = %6
%12 = load i32, i32* %3
%13 = call i64 @is_prime(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %35
15: ; preds = %11
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %16, %17
%19 = call i64 @is_prime(i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %35
21: ; preds = %15
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = sub nsw i32 %24, %25
%27 = mul nsw i32 %23, %26
%28 = icmp slt i32 %22, %27
br i1 %28, label %29, label %35
29: ; preds = %21
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = load i32, i32* %3
%33 = sub nsw i32 %31, %32
%34 = mul nsw i32 %30, %33
store i32 %34, i32* %4
br label %35
35: ; preds = %29, %21, %15, %11
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %6
39: ; preds = %6
%40 = load i32, i32* %4
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
ret i32 0
}

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