#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 MINUS(int, int);
scalar_t__ PRIMEp(int);
int GOLDBACHp(int N) {
  int output = 0;
  int cell0 = 0;
  cell0 = 2;
  {
    int ctr1;
    for (ctr1 = N; ctr1 > 0; ctr1--) {
      if ((PRIMEp(cell0)) && (PRIMEp(MINUS(N, cell0)))) {
        output = 1;
        goto quit0;
      }
      cell0 = (cell0 + 1);
    }
  }
quit0:
  return output;
}


x86 assembly (clang, -O0):
<GOLDBACHp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11a1 <GOLDBACHp+0x81>
mov    -0xc(%rbp),%edi
call   1040 <PRIMEp@plt>
cmp    $0x0,%rax
je     118a <GOLDBACHp+0x6a>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <MINUS@plt>
mov    %eax,%edi
call   1040 <PRIMEp@plt>
cmp    $0x0,%rax
je     118a <GOLDBACHp+0x6a>
movl   $0x1,-0x8(%rbp)
jmp    11a6 <GOLDBACHp+0x86>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <GOLDBACHp+0x26>
jmp    11a6 <GOLDBACHp+0x86>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GOLDBACHp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
test   %edi,%edi
jle    117a <GOLDBACHp+0x5a>
mov    %edi,%r15d
mov    %edi,%ebp
neg    %ebp
mov    $0x2,%ebx
jmp    1152 <GOLDBACHp+0x32>
nopl   0x0(%rax)
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x2,%eax
je     117a <GOLDBACHp+0x5a>
mov    %ebx,%edi
call   1040 <PRIMEp@plt>
test   %rax,%rax
je     1140 <GOLDBACHp+0x20>
mov    %r15d,%edi
mov    %ebx,%esi
call   1030 <MINUS@plt>
mov    %eax,%edi
call   1040 <PRIMEp@plt>
test   %rax,%rax
je     1140 <GOLDBACHp+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GOLDBACHp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 2, i32* %4
%6 = load i32, i32* %2
store i32 %6, i32* %5
br label %7
7: ; preds = %24, %1
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i32, i32* %4
%12 = call i64 @PRIMEp(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = call i32 @MINUS(i32 %15, i32 %16)
%18 = call i64 @PRIMEp(i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 1, i32* %3
br label %28
21: ; preds = %14, %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %24
24: ; preds = %21
%25 = load i32, i32* %5
%26 = add nsw i32 %25, -1
store i32 %26, i32* %5
br label %7
27: ; preds = %7
br label %28
28: ; preds = %27, %20
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @GOLDBACHp(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = add i32 %0, 1
br label %5
5: ; preds = %3, %13
%6 = phi i32 [ %14, %13 ], [ 2, %3 ]
%7 = tail call i64 @PRIMEp(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = tail call i32 @MINUS(i32 %0, i32 %6)
%11 = tail call i64 @PRIMEp(i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9, %5
%14 = add nuw i32 %6, 1
%15 = icmp eq i32 %6, %4
br i1 %15, label %16, label %5
16: ; preds = %9, %13, %1
%17 = phi i32 [ 0, %1 ], [ 0, %13 ], [ 1, %9 ]
ret i32 %17
}