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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c5 <main+0x95>
mov    -0xc(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     11b2 <main+0x82>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     11b2 <main+0x82>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     11b2 <main+0x82>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
sub    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
jmp    11b7 <main+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x3,0xc(%rsp)
jl     11b2 <main+0x82>
mov    $0x2,%ebx
mov    $0xfffffffe,%r15d
lea    0xea0(%rip),%r14
jmp    117d <main+0x4d>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
add    $0xffffffff,%r15d
cmp    0xc(%rsp),%ebx
jge    11b2 <main+0x82>
mov    %ebx,%edi
call   1040 <isPrime@plt>
test   %rax,%rax
je     1170 <main+0x40>
mov    0xc(%rsp),%edi
add    %r15d,%edi
call   1040 <isPrime@plt>
test   %rax,%rax
je     1170 <main+0x40>
mov    0xc(%rsp),%ecx
lea    (%r15,%rcx,1),%edx
cmp    %edx,%ebx
jg     1170 <main+0x40>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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