#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 erf(double const);
int exp(int);
int pow(double const, int);
int sqrt(double);
double Gfunct(const double y) {
  double Gfunct;
  Gfunct = 1e0 / (2e0 * pow(y, 2e0)) *
           (erf(y) - 2e0 / sqrt(3.1415926536) * y * exp(-pow(y, 2e0)));
  return Gfunct;
}


x86 assembly (clang, -O0):
<Gfunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe98(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe9c(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <erf@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe70(%rip),%xmm0
call   1050 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe57(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1030 <exp@plt>
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gfunct>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <erf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xe77(%rip),%xmm0
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
neg    %eax
mov    %eax,%edi
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xe45(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x18(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Gfunct(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @pow(double %4, i32 2)
%6 = sitofp i32 %5 to double
%7 = fmul double 2.000000e+00, %6
%8 = fdiv double 1.000000e+00, %7
%9 = load double, double* %2
%10 = call i32 @erf(double %9)
%11 = sitofp i32 %10 to double
%12 = call i32 @sqrt(double 0x400921FB544486E0)
%13 = sitofp i32 %12 to double
%14 = fdiv double 2.000000e+00, %13
%15 = load double, double* %2
%16 = fmul double %14, %15
%17 = load double, double* %2
%18 = call i32 @pow(double %17, i32 2)
%19 = sub nsw i32 0, %18
%20 = call i32 @exp(i32 %19)
%21 = sitofp i32 %20 to double
%22 = fneg double %16
%23 = call double @llvm.fmuladd.f64(double %22, double %21, double %11)
%24 = fmul double %8, %23
store double %24, double* %3
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @Gfunct(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 2.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = tail call i32 @erf(double %0)
%7 = sitofp i32 %6 to double
%8 = tail call i32 @sqrt(double 0x400921FB544486E0)
%9 = sitofp i32 %8 to double
%10 = tail call i32 @pow(double %0, i32 2)
%11 = sub nsw i32 0, %10
%12 = tail call i32 @exp(i32 %11)
%13 = sitofp i32 %12 to double
%14 = fdiv double -2.000000e+00, %9
%15 = fmul double %14, %0
%16 = tail call double @llvm.fmuladd.f64(double %15, double %13, double %7)
%17 = fmul double %5, %16
ret double %17
}