#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 */
int /*<<< orphan*/ EvaluateRS(size_t, int, int);
scalar_t__ atol(char *);
int main(int argc, char *argv[]) {
  size_t block_size = 1 << 20;
  if (argc > 1) {
    block_size = (size_t)atol(argv[1]);
  }
  EvaluateRS(block_size, 10, 4);
  EvaluateRS(block_size, 6, 3);
  EvaluateRS(block_size, 8, 4);
  EvaluateRS(block_size, 10, 5);
  EvaluateRS(block_size, 9, 3);
  EvaluateRS(block_size, 4, 2);
  EvaluateRS(block_size, 8, 3);
  EvaluateRS(block_size, 6, 4);
  EvaluateRS(block_size, 9, 6);
  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)
movq   $0x100000,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1159 <main+0x39>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0x6,%esi
mov    $0x3,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0x9,%esi
mov    $0x3,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
mov    $0x3,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0x6,%esi
mov    $0x4,%edx
call   1030 <EvaluateRS@plt>
mov    -0x18(%rbp),%rdi
mov    $0x9,%esi
mov    $0x6,%edx
call   1030 <EvaluateRS@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x100000,%ebx
cmp    $0x2,%edi
jl     1137 <main+0x17>
mov    0x8(%rsi),%rdi
call   1040 <atol@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x4,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x3,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x3,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x3,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x4,%edx
call   1030 <EvaluateRS@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x6,%edx
call   1030 <EvaluateRS@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1048576, i64* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @atol(i8* %12)
store i64 %13, i64* %6
br label %14
14: ; preds = %9, %2
%15 = load i64, i64* %6
%16 = call i32 @EvaluateRS(i64 %15, i32 10, i32 4)
%17 = load i64, i64* %6
%18 = call i32 @EvaluateRS(i64 %17, i32 6, i32 3)
%19 = load i64, i64* %6
%20 = call i32 @EvaluateRS(i64 %19, i32 8, i32 4)
%21 = load i64, i64* %6
%22 = call i32 @EvaluateRS(i64 %21, i32 10, i32 5)
%23 = load i64, i64* %6
%24 = call i32 @EvaluateRS(i64 %23, i32 9, i32 3)
%25 = load i64, i64* %6
%26 = call i32 @EvaluateRS(i64 %25, i32 4, i32 2)
%27 = load i64, i64* %6
%28 = call i32 @EvaluateRS(i64 %27, i32 8, i32 3)
%29 = load i64, i64* %6
%30 = call i32 @EvaluateRS(i64 %29, i32 6, i32 4)
%31 = load i64, i64* %6
%32 = call i32 @EvaluateRS(i64 %31, i32 9, i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @atol(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i64 [ %7, %4 ], [ 1048576, %2 ]
%10 = tail call i32 @EvaluateRS(i64 %9, i32 10, i32 4)
%11 = tail call i32 @EvaluateRS(i64 %9, i32 6, i32 3)
%12 = tail call i32 @EvaluateRS(i64 %9, i32 8, i32 4)
%13 = tail call i32 @EvaluateRS(i64 %9, i32 10, i32 5)
%14 = tail call i32 @EvaluateRS(i64 %9, i32 9, i32 3)
%15 = tail call i32 @EvaluateRS(i64 %9, i32 4, i32 2)
%16 = tail call i32 @EvaluateRS(i64 %9, i32 8, i32 3)
%17 = tail call i32 @EvaluateRS(i64 %9, i32 6, i32 4)
%18 = tail call i32 @EvaluateRS(i64 %9, i32 9, i32 6)
ret i32 0
}