#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 */
float exp(double);
float sqrt(int);
float hermite(int n, float x) {
  if (n < 0)
    return 0;
  if (n == 0)
    return exp(-.5 * x * x) / sqrt(2 * 3.141592653589793238462643);
  return x * hermite(n - 1, x) - (n - 1) * hermite(n - 2, x);
}


x86 assembly (clang, -O0):
<hermite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1157 <hermite+0x27>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    121b <hermite+0xeb>
cmpl   $0x0,-0x8(%rbp)
jne    11ad <hermite+0x7d>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movss  %xmm0,-0x10(%rbp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    121b <hermite+0xeb>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
movss  -0xc(%rbp),%xmm0
call   1030 <hermite@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
movss  -0xc(%rbp),%xmm0
call   1030 <hermite@plt>
movss  -0x1c(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x14(%rbp),%xmm0
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hermite>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
js     1189 <hermite+0x59>
je     118e <hermite+0x5e>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
mov    %ebp,%edi
movss  %xmm0,0xc(%rsp)
call   1030 <hermite@plt>
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x10(%rsp)
add    $0xfffffffe,%ebx
mov    %ebx,%edi
movss  0xc(%rsp),%xmm0
call   1030 <hermite@plt>
mulss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
mulss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
jmp    11c1 <hermite+0x91>
xorps  %xmm0,%xmm0
jmp    11c4 <hermite+0x94>
cvtss2sd %xmm0,%xmm1
movsd  0xe66(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movss  %xmm0,0xc(%rsp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @hermite(i32 %0, float %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store float 0.000000e+00, float* %3
br label %38
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load float, float* %5
%14 = fpext float %13 to double
%15 = fmul double -5.000000e-01, %14
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = fmul double %15, %17
%19 = call float @exp(double %18)
%20 = call float @sqrt(i32 6)
%21 = fdiv float %19, %20
store float %21, float* %3
br label %38
22: ; preds = %9
%23 = load float, float* %5
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
%26 = load float, float* %5
%27 = call float @hermite(i32 %25, float %26)
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, 1
%30 = sitofp i32 %29 to float
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 2
%33 = load float, float* %5
%34 = call float @hermite(i32 %32, float %33)
%35 = fmul float %30, %34
%36 = fneg float %35
%37 = call float @llvm.fmuladd.f32(float %23, float %27, float %36)
store float %37, float* %3
br label %38
38: ; preds = %22, %12, %8
%39 = load float, float* %3
ret float %39
}

LLVM IR (-O2):
define float @hermite(i32 %0, float %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = fpext float %1 to double
%8 = fmul double %7, -5.000000e-01
%9 = fmul double %8, %7
%10 = tail call float @exp(double %9)
%11 = tail call float @sqrt(i32 6)
%12 = fdiv float %10, %11
br label %13
13: ; preds = %6, %2, %15
%14 = phi float [ %23, %15 ], [ %12, %6 ], [ 0.000000e+00, %2 ]
ret float %14
15: ; preds = %4
%16 = add nsw i32 %0, -1
%17 = tail call float @hermite(i32 %16, float %1)
%18 = sitofp i32 %16 to float
%19 = add nsw i32 %0, -2
%20 = tail call float @hermite(i32 %19, float %1)
%21 = fneg float %20
%22 = fmul float %18, %21
%23 = tail call float @llvm.fmuladd.f32(float %1, float %17, float %22)
br label %13
}