#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 sin(double);
double snabova(double a, double b) {
  double c = a * b, csq;
  if ((csq = c * c) > .001) {
    return (sin(c)) / a;
  } else {
    return b * (1. - csq / 6. * (1. - csq / 20. * (1. - csq / 42.)));
  }
}


x86 assembly (clang, -O0):
<snabova>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116b <snabova+0x5b>
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1206 <snabova+0xf6>
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xea3(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xe8a(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  -0x28(%rbp),%xmm4
movsd  0xe71(%rip),%xmm3
divsd  %xmm3,%xmm4
movsd  0xe5d(%rip),%xmm3
subsd  %xmm4,%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xe36(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe0f(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snabova>:
push   %rax
movapd %xmm0,%xmm3
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
ucomisd 0xed3(%rip),%xmm0
jbe    1144 <snabova+0x34>
movapd %xmm2,%xmm0
movsd  %xmm3,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret
movapd %xmm0,%xmm2
divsd  0xeb8(%rip),%xmm2
movsd  0xeb8(%rip),%xmm3
movapd %xmm0,%xmm4
divsd  0xeb4(%rip),%xmm4
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm4
divsd  0xeac(%rip),%xmm0
addsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @snabova(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fmul double %8, %9
store double %10, double* %6
%11 = load double, double* %6
%12 = load double, double* %6
%13 = fmul double %11, %12
store double %13, double* %7
%14 = fcmp ogt double %13, 1.000000e-03
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load double, double* %6
%17 = call double @sin(double %16)
%18 = load double, double* %4
%19 = fdiv double %17, %18
store double %19, double* %3
br label %34
20: ; preds = %2
%21 = load double, double* %5
%22 = load double, double* %7
%23 = fdiv double %22, 6.000000e+00
%24 = load double, double* %7
%25 = fdiv double %24, 2.000000e+01
%26 = load double, double* %7
%27 = fdiv double %26, 4.200000e+01
%28 = fsub double 1.000000e+00, %27
%29 = fneg double %25
%30 = call double @llvm.fmuladd.f64(double %29, double %28, double 1.000000e+00)
%31 = fneg double %23
%32 = call double @llvm.fmuladd.f64(double %31, double %30, double 1.000000e+00)
%33 = fmul double %21, %32
store double %33, double* %3
br label %34
34: ; preds = %20, %15
%35 = load double, double* %3
ret double %35
}

LLVM IR (-O2):
define double @snabova(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fmul double %3, %3
%5 = fcmp ogt double %4, 1.000000e-03
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call double @sin(double %3)
%8 = fdiv double %7, %0
br label %17
9: ; preds = %2
%10 = fdiv double %4, 4.200000e+01
%11 = fsub double 1.000000e+00, %10
%12 = fdiv double %4, -2.000000e+01
%13 = tail call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = fdiv double %4, -6.000000e+00
%15 = tail call double @llvm.fmuladd.f64(double %14, double %13, double 1.000000e+00)
%16 = fmul double %15, %1
br label %17
17: ; preds = %9, %6
%18 = phi double [ %8, %6 ], [ %16, %9 ]
ret double %18
}