#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__ primeDigitsSum13(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i, c;
  c = 0;
  for (i = 1; i < 1000000; i++) {
    if (primeDigitsSum13(i)) {
      printf("%6d ", i);
      if (c++ == 10) {
        c = 0;
        printf("\n");
      }
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    11ae <main+0x8e>
mov    -0x8(%rbp),%edi
call   1030 <primeDigitsSum13@plt>
cmp    $0x0,%rax
je     119b <main+0x7b>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0xa,%eax
jne    1196 <main+0x76>
movl   $0x0,-0xc(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    119b <main+0x7b>
jmp    11a0 <main+0x80>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xec0(%rip),%r14
xor    %ebp,%ebp
jmp    1167 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
add    $0x1,%ebx
cmp    $0xf4240,%ebx
je     1189 <main+0x59>
mov    %ebx,%edi
call   1040 <primeDigitsSum13@plt>
test   %rax,%rax
je     115c <main+0x2c>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xa,%ebp
je     1150 <main+0x20>
add    $0x1,%ebp
jmp    115c <main+0x2c>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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