#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 */
double precalc_tan(double, unsigned int *, double *);
int /*<<< orphan*/ printf(char *, ...);
void print_it_table() {
  double rs, re;
  double delta;
  double tan;
  re = 3.1415926536 / 2;
  printf("RADS, TAN, MIN_ITERS, DELTA_IT \n");
  unsigned int x = 1;
  unsigned int ox = 0;
  for (rs = 0; rs <= re; rs += 2e-3) {
    tan = precalc_tan(rs, &x, &delta);
    if (x > ox) {
      printf("%e, %.10e, %d, %e \n", rs, tan, x, delta);
      ox = x;
    }
  }
  printf("%e, %.10e, %d, %e \n", rs, tan, x, delta);
  return;
}


x86 assembly (clang, -O0):
<print_it_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11d2 <print_it_table+0xb2>
movsd  -0x8(%rbp),%xmm0
lea    -0x24(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <precalc_tan@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jbe    11b6 <print_it_table+0x96>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%esi
movsd  -0x18(%rbp),%xmm2
lea    0xe88(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11bb <print_it_table+0x9b>
movsd  0xe45(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <print_it_table+0x39>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%esi
movsd  -0x18(%rbp),%xmm2
lea    0xe46(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_it_table>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,0xc(%rsp)
xorpd  %xmm0,%xmm0
xor    %ebp,%ebp
lea    0xc(%rsp),%r14
lea    0x18(%rsp),%rbx
lea    0xeab(%rip),%r15
jmp    118c <print_it_table+0x5c>
nopw   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm0
addsd  0xe82(%rip),%xmm0
movsd  0xe82(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     11cd <print_it_table+0x9d>
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <precalc_tan@plt>
mov    0xc(%rsp),%esi
cmp    %ebp,%esi
movsd  %xmm0,0x20(%rsp)
jbe    1170 <print_it_table+0x40>
movapd %xmm0,%xmm1
movsd  0x18(%rsp),%xmm2
mov    %r15,%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x3,%al
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %esi,%ebp
jmp    1170 <print_it_table+0x40>
movsd  0x18(%rsp),%xmm2
lea    0xe36(%rip),%rdi
movsd  0x20(%rsp),%xmm1
mov    $0x3,%al
call   1040 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"RADS, TAN, MIN_ITERS, DELTA_IT \0A\00"
@.str.1 = [20 x i8] c"%e, %.10e, %d, %e \0A\00"
define void @print_it_table() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double 0x3FF921FB544486E0, double* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %5
store i32 0, i32* %6
store double 0.000000e+00, double* %1
br label %8
8: ; preds = %26, %0
%9 = load double, double* %1
%10 = load double, double* %2
%11 = fcmp ole double %9, %10
br i1 %11, label %12, label %29
12: ; preds = %8
%13 = load double, double* %1
%14 = call double @precalc_tan(double %13, i32* %5, double* %3)
store double %14, double* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp ugt i32 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load double, double* %1
%20 = load double, double* %4
%21 = load i32, i32* %5
%22 = load double, double* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %19, double %20, i32 %21, double %22)
%24 = load i32, i32* %5
store i32 %24, i32* %6
br label %25
25: ; preds = %18, %12
br label %26
26: ; preds = %25
%27 = load double, double* %1
%28 = fadd double %27, 2.000000e-03
store double %28, double* %1
br label %8
29: ; preds = %8
%30 = load double, double* %1
%31 = load double, double* %4
%32 = load i32, i32* %5
%33 = load double, double* %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %30, double %31, i32 %32, double %33)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"%e, %.10e, %d, %e \0A\00"
@str = [32 x i8] c"RADS, TAN, MIN_ITERS, DELTA_IT \00"
define void @print_it_table() {
%1 = alloca double
%2 = alloca i32
%3 = bitcast double* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%5 = bitcast i32* %2 to i8*
store i32 1, i32* %2
br label %6
6: ; preds = %0, %16
%7 = phi i32 [ 0, %0 ], [ %18, %16 ]
%8 = phi double [ 0.000000e+00, %0 ], [ %19, %16 ]
%9 = call double @precalc_tan(double %8, i32* %2, double* %1)
%10 = load i32, i32* %2
%11 = icmp ugt i32 %10, %7
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load double, double* %1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %8, double %9, i32 %10, double %13)
%15 = load i32, i32* %2
br label %16
16: ; preds = %6, %12
%17 = phi i32 [ %15, %12 ], [ %10, %6 ]
%18 = phi i32 [ %15, %12 ], [ %7, %6 ]
%19 = fadd double %8, 2.000000e-03
%20 = fcmp ugt double %19, 0x3FF921FB544486E0
br i1 %20, label %21, label %6
21: ; preds = %16
%22 = load double, double* %1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %19, double %9, i32 %17, double %22)
ret void
}