#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 */
int checkPrime(int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, flag = 0;
  scanf("%d", &n);
  for (i = 2; i <= n / 2; ++i) {
    if (checkPrime(i) == 1) {
      if (checkPrime(n - i) == 1) {
        printf("%d=%d+%d\n", n, i, n - i);
        flag = 1;
      }
    }
  }
  if (flag == 0)
    printf("%d nie da się rozłożyć na sumę.", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     11d9 <main+0xa9>
mov    -0xc(%rbp),%edi
call   1030 <checkPrime@plt>
cmp    $0x1,%eax
jne    11c6 <main+0x96>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <checkPrime@plt>
cmp    $0x1,%eax
jne    11c1 <main+0x91>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    11c6 <main+0x96>
jmp    11cb <main+0x9b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x2d>
cmpl   $0x0,-0x10(%rbp)
jne    11f4 <main+0xc4>
mov    -0x8(%rbp),%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0x4,%esi
jl     11c3 <main+0x93>
mov    $0x1,%ebp
mov    $0xfffffffe,%ebx
lea    0xea1(%rip),%r14
xor    %r15d,%r15d
jmp    1184 <main+0x54>
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    $0xffffffff,%ebx
cmp    %eax,%ebp
jge    11be <main+0x8e>
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <checkPrime@plt>
cmp    $0x1,%eax
jne    1170 <main+0x40>
mov    0x4(%rsp),%edi
add    %ebx,%edi
call   1030 <checkPrime@plt>
cmp    $0x1,%eax
jne    1170 <main+0x40>
mov    0x4(%rsp),%esi
lea    (%rbx,%rsi,1),%ecx
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r15d
jmp    1170 <main+0x40>
test   %r15d,%r15d
jne    11d1 <main+0xa1>
lea    0xe43(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d=%d+%d\0A\00"
@.str.2 = [37 x i8] c"%d nie da si\C4\99 roz\C5\82o\C5\BCy\C4\87 na sum\C4\99.\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 = %30, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 2
%10 = icmp sle i32 %7, %9
br i1 %10, label %11, label %33
11: ; preds = %6
%12 = load i32, i32* %3
%13 = call i32 @checkPrime(i32 %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %29
15: ; preds = %11
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %16, %17
%19 = call i32 @checkPrime(i32 %18)
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = sub nsw i32 %24, %25
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23, i32 %26)
store i32 1, i32* %4
br label %28
28: ; preds = %21, %15
br label %29
29: ; preds = %28, %11
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %6
33: ; preds = %6
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load i32, i32* %2
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %33
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d=%d+%d\0A\00"
@.str.2 = [37 x i8] c"%d nie da si\C4\99 roz\C5\82o\C5\BCy\C4\87 na sum\C4\99.\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, %20
%7 = phi i32 [ %21, %20 ], [ 0, %0 ]
%8 = phi i32 [ %22, %20 ], [ 2, %0 ]
%9 = call i32 @checkPrime(i32 %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %20
11: ; preds = %6
%12 = load i32, i32* %1
%13 = sub nsw i32 %12, %8
%14 = call i32 @checkPrime(i32 %13)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i32, i32* %1
%18 = sub nsw i32 %17, %8
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %8, i32 %18)
br label %20
20: ; preds = %6, %16, %11
%21 = phi i32 [ 1, %16 ], [ %7, %11 ], [ %7, %6 ]
%22 = add nuw nsw i32 %8, 1
%23 = load i32, i32* %1
%24 = sdiv i32 %23, 2
%25 = icmp slt i32 %8, %24
br i1 %25, label %6, label %26
26: ; preds = %20
%27 = icmp eq i32 %21, 0
br i1 %27, label %28, label %31
28: ; preds = %0, %26
%29 = phi i32 [ %23, %26 ], [ %4, %0 ]
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %26
ret i32 0
}