#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_tprime(long);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long i, sum = 0;
  ;
  int count = 0;
  for (i = 23; count < 11 && i > 0; i += 2) {
    if (is_tprime(i)) {
      ++count;
      sum += i;
      printf("%ld, ", i);
    }
  }
  printf("\n%ld\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x17,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0xb,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jge    1160 <main+0x40>
cmpq   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1170 <main+0x50>
jmp    11be <main+0x9e>
mov    -0x10(%rbp),%rdi
call   1030 <is_tprime@plt>
cmp    $0x0,%rax
je     11a8 <main+0x88>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
jmp    11ad <main+0x8d>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    1146 <main+0x26>
mov    -0x18(%rbp),%rsi
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x17,%ebx
xor    %r12d,%r12d
lea    0xec9(%rip),%r15
xor    %r14d,%r14d
jmp    114a <main+0x2a>
nopl   0x0(%rax)
add    $0x2,%rbx
cmp    $0xb,%r12d
jge    116b <main+0x4b>
mov    %rbx,%rdi
call   1030 <is_tprime@plt>
test   %rax,%rax
je     1140 <main+0x20>
add    $0x1,%r12d
add    %rbx,%r14
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1140 <main+0x20>
lea    0xe94(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%ld, \00"
@.str.1 = [6 x i8] c"\0A%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %3
store i32 0, i32* %4
store i64 23, i64* %2
br label %5
5: ; preds = %26, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 11
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i64, i64* %2
%10 = icmp sgt i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %29
13: ; preds = %11
%14 = load i64, i64* %2
%15 = call i64 @is_tprime(i64 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
%20 = load i64, i64* %2
%21 = load i64, i64* %3
%22 = add nsw i64 %21, %20
store i64 %22, i64* %3
%23 = load i64, i64* %2
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %23)
br label %25
25: ; preds = %17, %13
br label %26
26: ; preds = %25
%27 = load i64, i64* %2
%28 = add nsw i64 %27, 2
store i64 %28, i64* %2
br label %5
29: ; preds = %11
%30 = load i64, i64* %3
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%ld, \00"
@.str.1 = [6 x i8] c"\0A%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %11
%2 = phi i32 [ 0, %0 ], [ %13, %11 ]
%3 = phi i64 [ 0, %0 ], [ %12, %11 ]
%4 = phi i64 [ 23, %0 ], [ %14, %11 ]
%5 = tail call i64 @is_tprime(i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = add nsw i32 %2, 1
%9 = add nsw i64 %3, %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %4)
br label %11
11: ; preds = %1, %7
%12 = phi i64 [ %9, %7 ], [ %3, %1 ]
%13 = phi i32 [ %8, %7 ], [ %2, %1 ]
%14 = add nuw nsw i64 %4, 2
%15 = icmp slt i32 %13, 11
br i1 %15, label %1, label %16
16: ; preds = %11
%17 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %12)
ret i32 0
}