#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 pow(double, double);
double calcWeight(double factor, int x, int y) {
  double euler = 2.71828182846;
  double pi = 3.14;
  double luh = 2 * pi * (factor * factor);
  double lh = 1 / luh;
  double ruh = (x * x) + (y * y);
  double rlh = 2 * (factor * factor);
  double rh = ruh / rlh;
  double mr = pow(euler, rh);
  double ret = lh * mr;
  return ret;
}


x86 assembly (clang, -O0):
<calcWeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xebb(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea3(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe66(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcWeight>:
push   %rax
mulsd  %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @calcWeight(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store double 0x4005BF0A8B145FCF, double* %7
store double 3.140000e+00, double* %8
%16 = load double, double* %8
%17 = fmul double 2.000000e+00, %16
%18 = load double, double* %4
%19 = load double, double* %4
%20 = fmul double %18, %19
%21 = fmul double %17, %20
store double %21, double* %9
%22 = load double, double* %9
%23 = fdiv double 1.000000e+00, %22
store double %23, double* %10
%24 = load i32, i32* %5
%25 = load i32, i32* %5
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %6
%29 = mul nsw i32 %27, %28
%30 = add nsw i32 %26, %29
%31 = sitofp i32 %30 to double
store double %31, double* %11
%32 = load double, double* %4
%33 = load double, double* %4
%34 = fmul double %32, %33
%35 = fmul double 2.000000e+00, %34
store double %35, double* %12
%36 = load double, double* %11
%37 = load double, double* %12
%38 = fdiv double %36, %37
store double %38, double* %13
%39 = load double, double* %7
%40 = load double, double* %13
%41 = call double @pow(double %39, double %40)
store double %41, double* %14
%42 = load double, double* %10
%43 = load double, double* %14
%44 = fmul double %42, %43
store double %44, double* %15
%45 = load double, double* %15
ret double %45
}

LLVM IR (-O2):
define double @calcWeight(double %0, i32 %1, i32 %2) {
%4 = fmul double %0, %0
%5 = fmul double %4, 6.280000e+00
%6 = fdiv double 1.000000e+00, %5
%7 = mul nsw i32 %1, %1
%8 = mul nsw i32 %2, %2
%9 = add nuw nsw i32 %8, %7
%10 = sitofp i32 %9 to double
%11 = fmul double %4, 2.000000e+00
%12 = fdiv double %10, %11
%13 = tail call double @pow(double 0x4005BF0A8B145FCF, double %12)
%14 = fmul double %6, %13
ret double %14
}