#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 goldbach_number(int n) {
  int i;
  for (i = 1; i < n; ++i) {
    if (is_prime(i) && is_prime(n - i)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<goldbach_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1174 <goldbach_number+0x64>
mov    -0xc(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     1161 <goldbach_number+0x51>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     1161 <goldbach_number+0x51>
movl   $0x1,-0x4(%rbp)
jmp    117b <goldbach_number+0x6b>
jmp    1166 <goldbach_number+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <goldbach_number+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goldbach_number>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
cmp    $0x2,%edi
jl     1156 <goldbach_number+0x46>
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
jmp    1138 <goldbach_number+0x28>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
add    $0xffffffff,%ebp
je     1156 <goldbach_number+0x46>
mov    %ebx,%edi
call   1030 <is_prime@plt>
test   %rax,%rax
je     1130 <goldbach_number+0x20>
mov    %ebp,%edi
call   1030 <is_prime@plt>
test   %rax,%rax
je     1130 <goldbach_number+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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