#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 */
size_t atoi(char *);
int get_least_squares_0(size_t);
int /*<<< orphan*/ printf(char *, size_t, int);
int /*<<< orphan*/ test(int (*)(size_t));
int main(int argc, char **argv) {
  int cnt;
  size_t num = 99;
  if (argc > 1) {
    num = atoi(argv[1]);
  }
  cnt = get_least_squares_0(num);
  test(get_least_squares_0);
  printf("number: %d, cnt: %d\n", num, cnt);
  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   $0x63,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1169 <main+0x39>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <get_least_squares_0@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e64(%rip),%rdi
call   1050 <test@plt>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x63,%ebx
cmp    $0x2,%edi
jl     1149 <main+0x19>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1060 <get_least_squares_0@plt>
mov    %eax,%ebp
mov    0x2e86(%rip),%rdi
call   1050 <test@plt>
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"number: %d, cnt: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 99, i64* %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @atoi(i8* %13)
store i64 %14, i64* %7
br label %15
15: ; preds = %10, %2
%16 = load i64, i64* %7
%17 = call i32 @get_least_squares_0(i64 %16)
store i32 %17, i32* %6
%18 = call i32 @test(i32 (i64)* @get_least_squares_0)
%19 = load i64, i64* %7
%20 = load i32, i32* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"number: %d, cnt: %d\0A\00"
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 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i64 [ %7, %4 ], [ 99, %2 ]
%10 = tail call i32 @get_least_squares_0(i64 %9)
%11 = tail call i32 @test(i32 (i64)* @get_least_squares_0)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %9, i32 %10)
ret i32 0
}