#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 */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
double atan(double);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ elapsed_time_hr(struct timespec, struct timespec, char *);
double fabs(double);
double piapprox(int, unsigned int);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ sleep(int);
int function_calls(unsigned int N) {
  double pi, exactpi;
  int i;
  double idx, nn;
  struct timespec start, end;
  pi = 0.0;
  nn = (double)N;
  for (i = 1; i <= 1000; i++) {
    idx = (double)i;
    pi = pi + 1.0 / (1.0 + (idx - 0.5) / (1000.0) * (idx - 0.5) / (1000.0));
  }
  clock_gettime(CLOCK_MONOTONIC, &start);
  for (i = N; i >= 1; i--) {
    idx = (double)i;
    pi = pi + 1.0 / (1.0 + (idx - 0.5) / nn * (idx - 0.5) / nn);
  }
  clock_gettime(CLOCK_MONOTONIC, &end);
  elapsed_time_hr(start, end, "No Function Calls");
  pi = pi * 4.0 / nn;
  exactpi = 4.0 * atan(1.0);
  printf("pi = %f, %% error = %f\n", pi,
         fabs(100.0 * (pi - exactpi) / exactpi));
  sleep(5);
  pi = 0.0;
  for (i = 1; i <= 1000; i++) {
    pi = pi + piapprox(i, 1000);
  }
  clock_gettime(CLOCK_MONOTONIC, &start);
  for (i = N; i >= 1; i--) {
    pi = pi + piapprox(i, N);
  }
  clock_gettime(CLOCK_MONOTONIC, &end);
  elapsed_time_hr(start, end, "Function Calls");
  pi = pi * 4.0 / nn;
  exactpi = 4.0 * atan(1.0);
  printf("pi = %f, %% error = %f\n", pi,
         fabs(100.0 * (pi - exactpi) / exactpi));
  return 0;
}


x86 assembly (clang, -O0):
<function_calls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x3e8,-0x1c(%rbp)
jg     1210 <function_calls+0xb0>
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe78(%rip),%xmm2
subsd  %xmm2,%xmm1
movsd  0xe74(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xe5b(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe53(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xe37(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xe2b(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1187 <function_calls+0x27>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jl     12a0 <function_calls+0x140>
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xdda(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xdc4(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xda7(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xd9b(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1228 <function_calls+0xc8>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x38(%rbp),%edi
mov    -0x40(%rbp),%esi
lea    0xd79(%rip),%rdx
call   1030 <elapsed_time_hr@plt>
movsd  0xd4c(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xd3d(%rip),%xmm0
call   1070 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xd25(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  0xcfd(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  -0x18(%rbp),%xmm1
movaps 0xcdd(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xd1c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x5,%edi
call   1080 <sleep@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x3e8,-0x1c(%rbp)
jg     138f <function_calls+0x22f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x3e8,%esi
call   1060 <piapprox@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    134c <function_calls+0x1ec>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jl     13e5 <function_calls+0x285>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <piapprox@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    13a7 <function_calls+0x247>
mov    0x2bfc(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x38(%rbp),%edi
mov    -0x40(%rbp),%esi
lea    0xc37(%rip),%rdx
call   1030 <elapsed_time_hr@plt>
movsd  0xc07(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xbf8(%rip),%xmm0
call   1070 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xbe0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  0xbb8(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  -0x18(%rbp),%xmm1
movaps 0xb98(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xbd7(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_calls>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movsd  0xe8e(%rip),%xmm0
xorpd  %xmm5,%xmm5
mov    $0x3e8,%eax
movsd  0xe8d(%rip),%xmm1
movapd %xmm0,%xmm2
nopw   0x0(%rax,%rax,1)
movapd %xmm2,%xmm3
addsd  0xe6c(%rip),%xmm3
movapd %xmm3,%xmm4
divsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm4
divsd  %xmm1,%xmm4
addsd  %xmm0,%xmm4
movapd %xmm0,%xmm3
divsd  %xmm4,%xmm3
addsd  %xmm3,%xmm5
addsd  %xmm0,%xmm2
add    $0xffffffff,%eax
jne    1190 <function_calls+0x30>
movsd  %xmm5,(%rsp)
mov    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x2e07(%rip),%r14
mov    (%r14),%edi
lea    0x10(%rsp),%rsi
call   1040 <clock_gettime@plt>
test   %ebx,%ebx
jle    1247 <function_calls+0xe7>
movsd  0xe06(%rip),%xmm0
mov    %ebx,%eax
movsd  0x18(%rsp),%xmm3
movsd  (%rsp),%xmm4
movsd  0xdf9(%rip),%xmm5
nop
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm5,%xmm1
movapd %xmm1,%xmm2
divsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm4
lea    -0x1(%rax),%ecx
cmp    $0x1,%eax
mov    %ecx,%eax
ja     1210 <function_calls+0xb0>
jmp    124c <function_calls+0xec>
movsd  (%rsp),%xmm4
movsd  %xmm4,(%rsp)
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
lea    0xde3(%rip),%rdx
call   1030 <elapsed_time_hr@plt>
movsd  (%rsp),%xmm0
mulsd  0xd99(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd6e(%rip),%xmm0
call   1070 <atan@plt>
movsd  0xd81(%rip),%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm1
mulsd  0xd78(%rip),%xmm1
divsd  0xd78(%rip),%xmm1
andpd  0xd80(%rip),%xmm1
lea    0xd9b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x5,%edi
call   1080 <sleep@plt>
mov    $0x1,%ebp
xorpd  %xmm0,%xmm0
nop
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
mov    $0x3e8,%esi
call   1060 <piapprox@plt>
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
add    $0x1,%ebp
cmp    $0x3e9,%ebp
jne    12e0 <function_calls+0x180>
mov    (%r14),%edi
lea    0x10(%rsp),%rsi
call   1040 <clock_gettime@plt>
test   %ebx,%ebx
jle    1351 <function_calls+0x1f1>
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1060 <piapprox@plt>
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
lea    -0x1(%rbp),%eax
cmp    $0x1,%ebp
mov    %eax,%ebp
ja     1330 <function_calls+0x1d0>
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
lea    0xce6(%rip),%rdx
call   1030 <elapsed_time_hr@plt>
movsd  (%rsp),%xmm0
mulsd  0xc99(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xc6e(%rip),%xmm0
call   1070 <atan@plt>
movsd  0xc81(%rip),%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm1
mulsd  0xc78(%rip),%xmm1
divsd  0xc78(%rip),%xmm1
andpd  0xc80(%rip),%xmm1
lea    0xc9b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [18 x i8] c"No Function Calls\00"
@.str.1 = [24 x i8] c"pi = %f, %% error = %f\0A\00"
@.str.2 = [15 x i8] c"Function Calls\00"
define i32 @function_calls(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca %struct.timespec
%9 = alloca %struct.timespec
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%10 = load i32, i32* %2
%11 = uitofp i32 %10 to double
store double %11, double* %7
store i32 1, i32* %5
br label %12
12: ; preds = %29, %1
%13 = load i32, i32* %5
%14 = icmp sle i32 %13, 1000
br i1 %14, label %15, label %32
15: ; preds = %12
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to double
store double %17, double* %6
%18 = load double, double* %3
%19 = load double, double* %6
%20 = fsub double %19, 5.000000e-01
%21 = fdiv double %20, 1.000000e+03
%22 = load double, double* %6
%23 = fsub double %22, 5.000000e-01
%24 = fmul double %21, %23
%25 = fdiv double %24, 1.000000e+03
%26 = fadd double 1.000000e+00, %25
%27 = fdiv double 1.000000e+00, %26
%28 = fadd double %18, %27
store double %28, double* %3
br label %29
29: ; preds = %15
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %12
32: ; preds = %12
%33 = load i32, i32* @CLOCK_MONOTONIC
%34 = call i32 @clock_gettime(i32 %33, %struct.timespec* %8)
%35 = load i32, i32* %2
store i32 %35, i32* %5
br label %36
36: ; preds = %55, %32
%37 = load i32, i32* %5
%38 = icmp sge i32 %37, 1
br i1 %38, label %39, label %58
39: ; preds = %36
%40 = load i32, i32* %5
%41 = sitofp i32 %40 to double
store double %41, double* %6
%42 = load double, double* %3
%43 = load double, double* %6
%44 = fsub double %43, 5.000000e-01
%45 = load double, double* %7
%46 = fdiv double %44, %45
%47 = load double, double* %6
%48 = fsub double %47, 5.000000e-01
%49 = fmul double %46, %48
%50 = load double, double* %7
%51 = fdiv double %49, %50
%52 = fadd double 1.000000e+00, %51
%53 = fdiv double 1.000000e+00, %52
%54 = fadd double %42, %53
store double %54, double* %3
br label %55
55: ; preds = %39
%56 = load i32, i32* %5
%57 = add nsw i32 %56, -1
store i32 %57, i32* %5
br label %36
58: ; preds = %36
%59 = load i32, i32* @CLOCK_MONOTONIC
%60 = call i32 @clock_gettime(i32 %59, %struct.timespec* %9)
%61 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%62 = load i32, i32* %61
%63 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%64 = load i32, i32* %63
%65 = call i32 @elapsed_time_hr(i32 %62, i32 %64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%66 = load double, double* %3
%67 = fmul double %66, 4.000000e+00
%68 = load double, double* %7
%69 = fdiv double %67, %68
store double %69, double* %3
%70 = call double @atan(double 1.000000e+00)
%71 = fmul double 4.000000e+00, %70
store double %71, double* %4
%72 = load double, double* %3
%73 = load double, double* %3
%74 = load double, double* %4
%75 = fsub double %73, %74
%76 = fmul double 1.000000e+02, %75
%77 = load double, double* %4
%78 = fdiv double %76, %77
%79 = call double @llvm.fabs.f64(double %78)
%80 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %72, double %79)
%81 = call i32 @sleep(i32 5)
store double 0.000000e+00, double* %3
store i32 1, i32* %5
br label %82
82: ; preds = %90, %58
%83 = load i32, i32* %5
%84 = icmp sle i32 %83, 1000
br i1 %84, label %85, label %93
85: ; preds = %82
%86 = load double, double* %3
%87 = load i32, i32* %5
%88 = call double @piapprox(i32 %87, i32 1000)
%89 = fadd double %86, %88
store double %89, double* %3
br label %90
90: ; preds = %85
%91 = load i32, i32* %5
%92 = add nsw i32 %91, 1
store i32 %92, i32* %5
br label %82
93: ; preds = %82
%94 = load i32, i32* @CLOCK_MONOTONIC
%95 = call i32 @clock_gettime(i32 %94, %struct.timespec* %8)
%96 = load i32, i32* %2
store i32 %96, i32* %5
br label %97
97: ; preds = %106, %93
%98 = load i32, i32* %5
%99 = icmp sge i32 %98, 1
br i1 %99, label %100, label %109
100: ; preds = %97
%101 = load double, double* %3
%102 = load i32, i32* %5
%103 = load i32, i32* %2
%104 = call double @piapprox(i32 %102, i32 %103)
%105 = fadd double %101, %104
store double %105, double* %3
br label %106
106: ; preds = %100
%107 = load i32, i32* %5
%108 = add nsw i32 %107, -1
store i32 %108, i32* %5
br label %97
109: ; preds = %97
%110 = load i32, i32* @CLOCK_MONOTONIC
%111 = call i32 @clock_gettime(i32 %110, %struct.timespec* %9)
%112 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%113 = load i32, i32* %112
%114 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%115 = load i32, i32* %114
%116 = call i32 @elapsed_time_hr(i32 %113, i32 %115, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%117 = load double, double* %3
%118 = fmul double %117, 4.000000e+00
%119 = load double, double* %7
%120 = fdiv double %118, %119
store double %120, double* %3
%121 = call double @atan(double 1.000000e+00)
%122 = fmul double 4.000000e+00, %121
store double %122, double* %4
%123 = load double, double* %3
%124 = load double, double* %3
%125 = load double, double* %4
%126 = fsub double %124, %125
%127 = fmul double 1.000000e+02, %126
%128 = load double, double* %4
%129 = fdiv double %127, %128
%130 = call double @llvm.fabs.f64(double %129)
%131 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %123, double %130)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [18 x i8] c"No Function Calls\00"
@.str.1 = [24 x i8] c"pi = %f, %% error = %f\0A\00"
@.str.2 = [15 x i8] c"Function Calls\00"
define i32 @function_calls(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
br label %6
6: ; preds = %1, %6
%7 = phi double [ 0.000000e+00, %1 ], [ %16, %6 ]
%8 = phi i32 [ 1, %1 ], [ %17, %6 ]
%9 = sitofp i32 %8 to double
%10 = fadd double %9, -5.000000e-01
%11 = fdiv double %10, 1.000000e+03
%12 = fmul double %10, %11
%13 = fdiv double %12, 1.000000e+03
%14 = fadd double %13, 1.000000e+00
%15 = fdiv double 1.000000e+00, %14
%16 = fadd double %7, %15
%17 = add nuw nsw i32 %8, 1
%18 = icmp eq i32 %17, 1001
br i1 %18, label %19, label %6
19: ; preds = %6
%20 = uitofp i32 %0 to double
%21 = load i32, i32* @CLOCK_MONOTONIC
%22 = call i32 @clock_gettime(i32 %21, %struct.timespec* %2)
%23 = icmp sgt i32 %0, 0
br i1 %23, label %24, label %37
24: ; preds = %19, %24
%25 = phi double [ %34, %24 ], [ %16, %19 ]
%26 = phi i32 [ %35, %24 ], [ %0, %19 ]
%27 = sitofp i32 %26 to double
%28 = fadd double %27, -5.000000e-01
%29 = fdiv double %28, %20
%30 = fmul double %28, %29
%31 = fdiv double %30, %20
%32 = fadd double %31, 1.000000e+00
%33 = fdiv double 1.000000e+00, %32
%34 = fadd double %25, %33
%35 = add nsw i32 %26, -1
%36 = icmp ugt i32 %26, 1
br i1 %36, label %24, label %37
37: ; preds = %24, %19
%38 = phi double [ %16, %19 ], [ %34, %24 ]
%39 = load i32, i32* @CLOCK_MONOTONIC
%40 = call i32 @clock_gettime(i32 %39, %struct.timespec* %3)
%41 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%42 = load i32, i32* %41
%43 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%44 = load i32, i32* %43
%45 = call i32 @elapsed_time_hr(i32 %42, i32 %44, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%46 = fmul double %38, 4.000000e+00
%47 = fdiv double %46, %20
%48 = call double @atan(double 1.000000e+00)
%49 = fadd double %47, 0xC00921FB54442D18
%50 = fmul double %49, 1.000000e+02
%51 = fdiv double %50, 0x400921FB54442D18
%52 = call double @llvm.fabs.f64(double %51)
%53 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %47, double %52)
%54 = call i32 @sleep(i32 5)
br label %55
55: ; preds = %37, %55
%56 = phi double [ 0.000000e+00, %37 ], [ %59, %55 ]
%57 = phi i32 [ 1, %37 ], [ %60, %55 ]
%58 = call double @piapprox(i32 %57, i32 1000)
%59 = fadd double %56, %58
%60 = add nuw nsw i32 %57, 1
%61 = icmp eq i32 %60, 1001
br i1 %61, label %62, label %55
62: ; preds = %55
%63 = load i32, i32* @CLOCK_MONOTONIC
%64 = call i32 @clock_gettime(i32 %63, %struct.timespec* %2)
br i1 %23, label %65, label %72
65: ; preds = %62, %65
%66 = phi double [ %69, %65 ], [ %59, %62 ]
%67 = phi i32 [ %70, %65 ], [ %0, %62 ]
%68 = call double @piapprox(i32 %67, i32 %0)
%69 = fadd double %66, %68
%70 = add nsw i32 %67, -1
%71 = icmp ugt i32 %67, 1
br i1 %71, label %65, label %72
72: ; preds = %65, %62
%73 = phi double [ %59, %62 ], [ %69, %65 ]
%74 = load i32, i32* @CLOCK_MONOTONIC
%75 = call i32 @clock_gettime(i32 %74, %struct.timespec* %3)
%76 = load i32, i32* %41
%77 = load i32, i32* %43
%78 = call i32 @elapsed_time_hr(i32 %76, i32 %77, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%79 = fmul double %73, 4.000000e+00
%80 = fdiv double %79, %20
%81 = call double @atan(double 1.000000e+00)
%82 = fadd double %80, 0xC00921FB54442D18
%83 = fmul double %82, 1.000000e+02
%84 = fdiv double %83, 0x400921FB54442D18
%85 = call double @llvm.fabs.f64(double %84)
%86 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %80, double %85)
ret i32 0
}