#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 factorial(int);
float cos(int ang) {
  float angrad =
      3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989 /
      180 * ang;
  int angf2 = factorial(2);
  int angf4 = factorial(4);
  int angf6 = factorial(6);
  int angf8 = factorial(8);
  int angf10 = factorial(10);
  int angf12 = factorial(12);
  int angf14 = factorial(14);
  float ang2 = angrad * angrad;
  float ang4 = ang2 * angrad * angrad;
  float ang6 = ang4 * angrad * angrad;
  float ang8 = ang6 * angrad * angrad;
  float ang10 = ang8 * angrad * angrad;
  float ang12 = ang10 * angrad * angrad;
  float ang14 = ang12 * angrad * angrad;
  float ang22 = ang2 / angf2;
  float ang44 = ang4 / angf4;
  float ang66 = ang6 / angf6;
  float ang88 = ang8 / angf8;
  float ang101 = ang10 / angf10;
  float ang122 = ang12 / angf12;
  float ang144 = ang14 / angf14;
  float cos = 1 - ang22 + ang44 - ang66 + ang88 - ang101 + ang122 - ang144;
  return cos;
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
call   1030 <factorial@plt>
mov    %eax,-0x10(%rbp)
mov    $0x6,%edi
call   1030 <factorial@plt>
mov    %eax,-0x14(%rbp)
mov    $0x8,%edi
call   1030 <factorial@plt>
mov    %eax,-0x18(%rbp)
mov    $0xa,%edi
call   1030 <factorial@plt>
mov    %eax,-0x1c(%rbp)
mov    $0xc,%edi
call   1030 <factorial@plt>
mov    %eax,-0x20(%rbp)
mov    $0xe,%edi
call   1030 <factorial@plt>
mov    %eax,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x28(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x30(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x34(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x38(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x3c(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x40(%rbp),%xmm0
cvtsi2ssl -0x24(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  0xd5c(%rip),%xmm0
subss  -0x44(%rbp),%xmm0
addss  -0x48(%rbp),%xmm0
subss  -0x4c(%rbp),%xmm0
addss  -0x50(%rbp),%xmm0
subss  -0x54(%rbp),%xmm0
addss  -0x58(%rbp),%xmm0
subss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x60(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xed9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <factorial@plt>
mov    %eax,%r14d
mov    $0x4,%edi
call   1030 <factorial@plt>
mov    %eax,%r15d
mov    $0x6,%edi
call   1030 <factorial@plt>
mov    %eax,%r12d
mov    $0x8,%edi
call   1030 <factorial@plt>
mov    %eax,%r13d
mov    $0xa,%edi
call   1030 <factorial@plt>
mov    %eax,%ebx
mov    $0xc,%edi
call   1030 <factorial@plt>
mov    %eax,%ebp
mov    $0xe,%edi
call   1030 <factorial@plt>
movss  0x4(%rsp),%xmm5
movaps %xmm5,%xmm2
mulss  %xmm5,%xmm2
movaps %xmm2,%xmm1
mulss  %xmm5,%xmm1
mulss  %xmm5,%xmm1
movaps %xmm1,%xmm3
mulss  %xmm5,%xmm3
mulss  %xmm5,%xmm3
unpcklps %xmm3,%xmm1
mulss  %xmm5,%xmm3
mulss  %xmm5,%xmm3
movaps %xmm3,%xmm0
mulss  %xmm5,%xmm0
mulss  %xmm5,%xmm0
unpcklps %xmm0,%xmm3
movaps %xmm0,%xmm4
mulss  %xmm5,%xmm4
mulss  %xmm5,%xmm4
movaps %xmm4,%xmm0
mulss  %xmm5,%xmm0
mulss  %xmm5,%xmm0
xorps  %xmm5,%xmm5
cvtsi2ss %r14d,%xmm5
divss  %xmm5,%xmm2
movd   %r15d,%xmm5
movd   %r12d,%xmm6
punpckldq %xmm6,%xmm5
cvtdq2ps %xmm5,%xmm5
divps  %xmm5,%xmm1
movd   %r13d,%xmm5
movd   %ebx,%xmm6
punpckldq %xmm6,%xmm5
cvtdq2ps %xmm5,%xmm5
divps  %xmm5,%xmm3
movd   %ebp,%xmm5
movd   %eax,%xmm6
punpckldq %xmm6,%xmm5
cvtdq2ps %xmm5,%xmm5
unpcklps %xmm0,%xmm4
divps  %xmm5,%xmm4
movss  0xddf(%rip),%xmm0
subss  %xmm2,%xmm0
addss  %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm1
subss  %xmm1,%xmm0
addss  %xmm3,%xmm0
shufps $0x55,%xmm3,%xmm3
subss  %xmm3,%xmm0
addss  %xmm4,%xmm0
shufps $0x55,%xmm4,%xmm4
subss  %xmm4,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @cos(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
store i32 %0, i32* %2
%26 = load i32, i32* %2
%27 = sitofp i32 %26 to double
%28 = fmul double 0x3F91DF46A2529D39, %27
%29 = fptrunc double %28 to float
store float %29, float* %3
%30 = call i32 @factorial(i32 2)
store i32 %30, i32* %4
%31 = call i32 @factorial(i32 4)
store i32 %31, i32* %5
%32 = call i32 @factorial(i32 6)
store i32 %32, i32* %6
%33 = call i32 @factorial(i32 8)
store i32 %33, i32* %7
%34 = call i32 @factorial(i32 10)
store i32 %34, i32* %8
%35 = call i32 @factorial(i32 12)
store i32 %35, i32* %9
%36 = call i32 @factorial(i32 14)
store i32 %36, i32* %10
%37 = load float, float* %3
%38 = load float, float* %3
%39 = fmul float %37, %38
store float %39, float* %11
%40 = load float, float* %11
%41 = load float, float* %3
%42 = fmul float %40, %41
%43 = load float, float* %3
%44 = fmul float %42, %43
store float %44, float* %12
%45 = load float, float* %12
%46 = load float, float* %3
%47 = fmul float %45, %46
%48 = load float, float* %3
%49 = fmul float %47, %48
store float %49, float* %13
%50 = load float, float* %13
%51 = load float, float* %3
%52 = fmul float %50, %51
%53 = load float, float* %3
%54 = fmul float %52, %53
store float %54, float* %14
%55 = load float, float* %14
%56 = load float, float* %3
%57 = fmul float %55, %56
%58 = load float, float* %3
%59 = fmul float %57, %58
store float %59, float* %15
%60 = load float, float* %15
%61 = load float, float* %3
%62 = fmul float %60, %61
%63 = load float, float* %3
%64 = fmul float %62, %63
store float %64, float* %16
%65 = load float, float* %16
%66 = load float, float* %3
%67 = fmul float %65, %66
%68 = load float, float* %3
%69 = fmul float %67, %68
store float %69, float* %17
%70 = load float, float* %11
%71 = load i32, i32* %4
%72 = sitofp i32 %71 to float
%73 = fdiv float %70, %72
store float %73, float* %18
%74 = load float, float* %12
%75 = load i32, i32* %5
%76 = sitofp i32 %75 to float
%77 = fdiv float %74, %76
store float %77, float* %19
%78 = load float, float* %13
%79 = load i32, i32* %6
%80 = sitofp i32 %79 to float
%81 = fdiv float %78, %80
store float %81, float* %20
%82 = load float, float* %14
%83 = load i32, i32* %7
%84 = sitofp i32 %83 to float
%85 = fdiv float %82, %84
store float %85, float* %21
%86 = load float, float* %15
%87 = load i32, i32* %8
%88 = sitofp i32 %87 to float
%89 = fdiv float %86, %88
store float %89, float* %22
%90 = load float, float* %16
%91 = load i32, i32* %9
%92 = sitofp i32 %91 to float
%93 = fdiv float %90, %92
store float %93, float* %23
%94 = load float, float* %17
%95 = load i32, i32* %10
%96 = sitofp i32 %95 to float
%97 = fdiv float %94, %96
store float %97, float* %24
%98 = load float, float* %18
%99 = fsub float 1.000000e+00, %98
%100 = load float, float* %19
%101 = fadd float %99, %100
%102 = load float, float* %20
%103 = fsub float %101, %102
%104 = load float, float* %21
%105 = fadd float %103, %104
%106 = load float, float* %22
%107 = fsub float %105, %106
%108 = load float, float* %23
%109 = fadd float %107, %108
%110 = load float, float* %24
%111 = fsub float %109, %110
store float %111, float* %25
%112 = load float, float* %25
ret float %112
}

LLVM IR (-O2):
define float @cos(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3F91DF46A2529D39
%4 = fptrunc double %3 to float
%5 = tail call i32 @factorial(i32 2)
%6 = tail call i32 @factorial(i32 4)
%7 = tail call i32 @factorial(i32 6)
%8 = tail call i32 @factorial(i32 8)
%9 = tail call i32 @factorial(i32 10)
%10 = tail call i32 @factorial(i32 12)
%11 = tail call i32 @factorial(i32 14)
%12 = fmul float %4, %4
%13 = fmul float %12, %4
%14 = fmul float %13, %4
%15 = fmul float %14, %4
%16 = fmul float %15, %4
%17 = fmul float %16, %4
%18 = fmul float %17, %4
%19 = fmul float %18, %4
%20 = fmul float %19, %4
%21 = fmul float %20, %4
%22 = fmul float %21, %4
%23 = fmul float %22, %4
%24 = fmul float %23, %4
%25 = sitofp i32 %5 to float
%26 = fdiv float %12, %25
%27 = insertelement <2 x i32> poison, i32 %6, i64 0
%28 = insertelement <2 x i32> %27, i32 %7, i64 1
%29 = sitofp <2 x i32> %28 to <2 x float>
%30 = insertelement <2 x float> poison, float %14, i64 0
%31 = insertelement <2 x float> %30, float %16, i64 1
%32 = fdiv <2 x float> %31, %29
%33 = insertelement <2 x i32> poison, i32 %8, i64 0
%34 = insertelement <2 x i32> %33, i32 %9, i64 1
%35 = sitofp <2 x i32> %34 to <2 x float>
%36 = insertelement <2 x float> poison, float %18, i64 0
%37 = insertelement <2 x float> %36, float %20, i64 1
%38 = fdiv <2 x float> %37, %35
%39 = insertelement <2 x i32> poison, i32 %10, i64 0
%40 = insertelement <2 x i32> %39, i32 %11, i64 1
%41 = sitofp <2 x i32> %40 to <2 x float>
%42 = insertelement <2 x float> poison, float %22, i64 0
%43 = insertelement <2 x float> %42, float %24, i64 1
%44 = fdiv <2 x float> %43, %41
%45 = fsub float 1.000000e+00, %26
%46 = extractelement <2 x float> %32, i64 0
%47 = fadd float %45, %46
%48 = extractelement <2 x float> %32, i64 1
%49 = fsub float %47, %48
%50 = extractelement <2 x float> %38, i64 0
%51 = fadd float %49, %50
%52 = extractelement <2 x float> %38, i64 1
%53 = fsub float %51, %52
%54 = extractelement <2 x float> %44, i64 0
%55 = fadd float %53, %54
%56 = extractelement <2 x float> %44, i64 1
%57 = fsub float %55, %56
ret float %57
}