#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__ check_prime(int);
int check_sum_of_primes(int a) {
  int m;
  int n;
  for (m = 2; m < a; m++) {
    n = a - m;
    if (check_prime(m) && check_prime(n))
      return 1;
    else
      continue;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_sum_of_primes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117a <check_sum_of_primes+0x6a>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <check_prime@plt>
cmp    $0x0,%rax
je     1167 <check_sum_of_primes+0x57>
mov    -0x10(%rbp),%edi
call   1030 <check_prime@plt>
cmp    $0x0,%rax
je     1167 <check_sum_of_primes+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1181 <check_sum_of_primes+0x71>
jmp    116c <check_sum_of_primes+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <check_sum_of_primes+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @check_sum_of_primes(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %14
3: ; preds = %1, %11
%4 = phi i32 [ %12, %11 ], [ 2, %1 ]
%5 = tail call i64 @check_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 @check_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
}