#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__ isRuthAaronNumber(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("This program lists out the first 25 Ruth-Aaron number pairs.\n");
  printf("Here they are:\n");
  printf("-------------\n");
  int numFound = 0;
  int numToConsider = 1;
  while (numFound < 25) {
    if (isRuthAaronNumber(numToConsider)) {
      numFound++;
      printf("  %2d.) %d and %d\n", numFound, numToConsider, numToConsider + 1);
    }
    numToConsider++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x19,-0x14(%rbp)
jge    11bb <main+0x9b>
mov    -0x18(%rbp),%edi
call   1030 <isRuthAaronNumber@plt>
cmp    $0x0,%rax
je     11ad <main+0x8d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116e <main+0x4e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
lea    0xf06(%rip),%rdi
call   1040 <puts@plt>
lea    0xf09(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
lea    0xe99(%rip),%r14
xor    %r15d,%r15d
jmp    1190 <main+0x60>
nopl   0x0(%rax)
add    $0x1,%r15d
lea    0x1(%rbx),%ebp
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%ebx
cmp    $0x19,%r15d
jge    11a5 <main+0x75>
mov    %ebx,%edi
call   1030 <isRuthAaronNumber@plt>
test   %rax,%rax
jne    1170 <main+0x40>
add    $0x1,%ebx
cmp    $0x19,%r15d
jl     1190 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [62 x i8] c"This program lists out the first 25 Ruth-Aaron number pairs.\0A\00"
@.str.1 = [16 x i8] c"Here they are:\0A\00"
@.str.2 = [15 x i8] c"-------------\0A\00"
@.str.3 = [19 x i8] c" %2d.) %d and %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
store i32 1, i32* %7
br label %11
11: ; preds = %26, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 25
br i1 %13, label %14, label %29
14: ; preds = %11
%15 = load i32, i32* %7
%16 = call i64 @isRuthAaronNumber(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %22, i32 %24)
br label %26
26: ; preds = %18, %14
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %11
29: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [19 x i8] c" %2d.) %d and %d\0A\00"
@str = [61 x i8] c"This program lists out the first 25 Ruth-Aaron number pairs.\00"
@str.4 = [15 x i8] c"Here they are:\00"
@str.5 = [14 x i8] c"-------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
br label %6
6: ; preds = %2, %17
%7 = phi i32 [ 1, %2 ], [ %18, %17 ]
%8 = phi i32 [ 0, %2 ], [ %19, %17 ]
%9 = tail call i64 @isRuthAaronNumber(i32 %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = add nuw nsw i32 %7, 1
br label %17
13: ; preds = %6
%14 = add nsw i32 %8, 1
%15 = add nuw nsw i32 %7, 1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %7, i32 %15)
br label %17
17: ; preds = %11, %13
%18 = phi i32 [ %12, %11 ], [ %15, %13 ]
%19 = phi i32 [ %8, %11 ], [ %14, %13 ]
%20 = icmp slt i32 %19, 25
br i1 %20, label %6, label %21
21: ; preds = %17
ret i32 0
}