#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 mySqrt(int);
int /*<<< orphan*/ printf(char *, int);
void mySqrtMain(void) {
  printf("%d\n", mySqrt(0));
  printf("%d\n", mySqrt(1));
  printf("%d\n", mySqrt(2));
  printf("%d\n", mySqrt(3));
  printf("%d\n", mySqrt(4));
  printf("%d\n", mySqrt(5));
  printf("%d\n", mySqrt(6));
  printf("%d\n", mySqrt(7));
  printf("%d\n", mySqrt(8));
  printf("%d\n", mySqrt(9));
  printf("%d\n", mySqrt(10));
  printf("%d\n", mySqrt(2147395599));
  printf("\n%d\n", mySqrt(-1));
}


x86 assembly (clang, -O0):
<mySqrtMain>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
mov    $0x6,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x7,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xe25(%rip),%rdi
call   1040 <printf@plt>
mov    $0x8,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xe0d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xdf5(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xddd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x7ffea80f,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xdc5(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xdac(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mySqrtMain>:
push   %rbx
xor    %edi,%edi
call   1030 <mySqrt@plt>
lea    0xed2(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x6,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x7,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x8,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x7ffea80f,%edi
call   1030 <mySqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <mySqrt@plt>
lea    0xdda(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
define void @mySqrtMain() {
%1 = call i32 @mySqrt(i32 0)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @mySqrt(i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @mySqrt(i32 2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @mySqrt(i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @mySqrt(i32 4)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @mySqrt(i32 5)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @mySqrt(i32 6)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @mySqrt(i32 7)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @mySqrt(i32 8)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32 @mySqrt(i32 9)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = call i32 @mySqrt(i32 10)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = call i32 @mySqrt(i32 2147395599)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = call i32 @mySqrt(i32 -1)
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
define void @mySqrtMain() {
%1 = tail call i32 @mySqrt(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @mySqrt(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @mySqrt(i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @mySqrt(i32 3)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @mySqrt(i32 4)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i32 @mySqrt(i32 5)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = tail call i32 @mySqrt(i32 6)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = tail call i32 @mySqrt(i32 7)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = tail call i32 @mySqrt(i32 8)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = tail call i32 @mySqrt(i32 9)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = tail call i32 @mySqrt(i32 10)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = tail call i32 @mySqrt(i32 2147395599)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = tail call i32 @mySqrt(i32 -1)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret void
}