#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*/ printf(char *);
double atanTyl(double x, int precision) {
  double atangent;
  double xsquared = x * x;
  double aux;
  if (precision < 0) {
    printf("Warning: Function sinTyl from bmc/core/filter_functions.h: "
           "Precision must be a positive integer. Assuming 0 precision\n");
    precision = 0;
  }
  if (precision >= 0) {
    aux = 0;
    atangent = aux;
    if (precision >= 1) {
      aux = x;
      atangent = aux;
      if (precision >= 2) {
        aux = xsquared;
        atangent -= aux / 3;
        if (precision >= 3) {
          aux = aux * xsquared;
          atangent += aux / 5;
          if (precision >= 4) {
            aux = aux * xsquared;
            atangent -= aux / 7;
            if (precision >= 7) {
              printf(
                  "Warning: Function sinTyl from bmc/core/filter_functions.h: "
                  "Precision representation exceeded. "
                  "Assuming maximum precision of 4\n");
            }
          }
        }
      }
    }
  }
  return atangent;
}


x86 assembly (clang, -O0):
<atanTyl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <atanTyl+0x3c>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1254 <atanTyl+0x144>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     124f <atanTyl+0x13f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jl     124a <atanTyl+0x13a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xe59(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x3,-0xc(%rbp)
jl     1245 <atanTyl+0x135>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x4,-0xc(%rbp)
jl     1240 <atanTyl+0x130>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xdfd(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x7,-0xc(%rbp)
jl     123b <atanTyl+0x12b>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
jmp    1240 <atanTyl+0x130>
jmp    1245 <atanTyl+0x135>
jmp    124a <atanTyl+0x13a>
jmp    124f <atanTyl+0x13f>
jmp    1254 <atanTyl+0x144>
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanTyl>:
push   %rax
test   %edi,%edi
js     1122 <atanTyl+0x12>
je     112e <atanTyl+0x1e>
cmp    $0x1,%edi
jne    1138 <atanTyl+0x28>
movapd %xmm0,%xmm3
jmp    1132 <atanTyl+0x22>
lea    0xf6d(%rip),%rdi
call   1030 <puts@plt>
xorpd  %xmm3,%xmm3
movapd %xmm3,%xmm0
pop    %rax
ret
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm3
divsd  0xeb4(%rip),%xmm3
addsd  %xmm0,%xmm3
cmp    $0x3,%edi
jb     1132 <atanTyl+0x22>
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
divsd  0xe9f(%rip),%xmm2
addsd  %xmm2,%xmm3
je     1132 <atanTyl+0x22>
mulsd  %xmm0,%xmm1
divsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm3
cmp    $0x7,%edi
jb     1132 <atanTyl+0x22>
lea    0xe8d(%rip),%rdi
movsd  %xmm3,(%rsp)
call   1030 <puts@plt>
movsd  (%rsp),%xmm3
jmp    1132 <atanTyl+0x22>

LLVM IR (-O0):
@.str = [119 x i8] c"Warning: Function sinTyl from bmc/core/filter_functions.h: Precision must be a positive integer. Assuming 0 precision\0A\00"
@.str.1 = [127 x i8] c"Warning: Function sinTyl from bmc/core/filter_functions.h: Precision representation exceeded. Assuming maximum precision of 4\0A\00"
define double @atanTyl(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %4
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %62
18: ; preds = %15
store double 0.000000e+00, double* %7
%19 = load double, double* %7
store double %19, double* %5
%20 = load i32, i32* %4
%21 = icmp sge i32 %20, 1
br i1 %21, label %22, label %61
22: ; preds = %18
%23 = load double, double* %3
store double %23, double* %7
%24 = load double, double* %7
store double %24, double* %5
%25 = load i32, i32* %4
%26 = icmp sge i32 %25, 2
br i1 %26, label %27, label %60
27: ; preds = %22
%28 = load double, double* %6
store double %28, double* %7
%29 = load double, double* %7
%30 = fdiv double %29, 3.000000e+00
%31 = load double, double* %5
%32 = fsub double %31, %30
store double %32, double* %5
%33 = load i32, i32* %4
%34 = icmp sge i32 %33, 3
br i1 %34, label %35, label %59
35: ; preds = %27
%36 = load double, double* %7
%37 = load double, double* %6
%38 = fmul double %36, %37
store double %38, double* %7
%39 = load double, double* %7
%40 = fdiv double %39, 5.000000e+00
%41 = load double, double* %5
%42 = fadd double %41, %40
store double %42, double* %5
%43 = load i32, i32* %4
%44 = icmp sge i32 %43, 4
br i1 %44, label %45, label %58
45: ; preds = %35
%46 = load double, double* %7
%47 = load double, double* %6
%48 = fmul double %46, %47
store double %48, double* %7
%49 = load double, double* %7
%50 = fdiv double %49, 7.000000e+00
%51 = load double, double* %5
%52 = fsub double %51, %50
store double %52, double* %5
%53 = load i32, i32* %4
%54 = icmp sge i32 %53, 7
br i1 %54, label %55, label %57
55: ; preds = %45
%56 = call i32 @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0))
br label %57
57: ; preds = %55, %45
br label %58
58: ; preds = %57, %35
br label %59
59: ; preds = %58, %27
br label %60
60: ; preds = %59, %22
br label %61
61: ; preds = %60, %18
br label %62
62: ; preds = %61, %15
%63 = load double, double* %5
ret double %63
}

LLVM IR (-O2):
@str = [126 x i8] c"Warning: Function sinTyl from bmc/core/filter_functions.h: Precision representation exceeded. Assuming maximum precision of 4\00"
@str.2 = [118 x i8] c"Warning: Function sinTyl from bmc/core/filter_functions.h: Precision must be a positive integer. Assuming 0 precision\00"
define double @atanTyl(double %0, i32 %1) {
%3 = fmul double %0, %0
%4 = icmp slt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([118 x i8], [118 x i8]* @str.2, i64 0, i64 0))
br label %25
7: ; preds = %2
switch i32 %1, label %8 [
i32 0, label %25
i32 1, label %24
]
8: ; preds = %7
%9 = fdiv double %3, 3.000000e+00
%10 = fsub double %0, %9
%11 = icmp ugt i32 %1, 2
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = fmul double %3, %3
%14 = fdiv double %13, 5.000000e+00
%15 = fadd double %10, %14
%16 = icmp eq i32 %1, 3
br i1 %16, label %25, label %17
17: ; preds = %12
%18 = fmul double %3, %13
%19 = fdiv double %18, 7.000000e+00
%20 = fsub double %15, %19
%21 = icmp ugt i32 %1, 6
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @str, i64 0, i64 0))
br label %25
24: ; preds = %7
br label %25
25: ; preds = %7, %24, %5, %8, %17, %22, %12
%26 = phi double [ %20, %22 ], [ %20, %17 ], [ %15, %12 ], [ %10, %8 ], [ 0.000000e+00, %7 ], [ 0.000000e+00, %5 ], [ %0, %24 ]
ret double %26
}