#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(float);
double gasdev(long *);
double log(int);
int pow(float, int);
double sqrt(float);
double uuvel(float vmed, float vvar) {
  static long idum = 3;
  float umed, uvar, u, v;
  double y;
  uvar = log(1 + pow((vvar / vmed), 2));
  umed = 0.5 * log(pow(vmed, 2) / (1 + pow((vvar / vmed), 2)));
  y = gasdev(&idum);
  u = umed + y * sqrt(uvar);
  v = exp(u);
  return v;
}


x86 assembly (clang, -O0):
<uuvel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1040 <log@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,-0x34(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe34(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0x2e68(%rip),%rdi
call   1070 <gasdev@plt>
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x10(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <exp@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uuvel>:
push   %rbx
sub    $0x20,%rsp
movss  %xmm0,0x10(%rsp)
divss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
movaps %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
lea    0x1(%rax),%edi
call   1040 <log@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <log@plt>
mulsd  0xe41(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
lea    0x2e78(%rip),%rdi
call   1070 <gasdev@plt>
movsd  %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x1c(%rsp),%xmm0
call   1060 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <exp@plt>
cvtss2sd %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@uuvel.idum = internal global i64 3
define double @uuvel(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca double
store float %0, float* %3
store float %1, float* %4
%10 = load float, float* %4
%11 = load float, float* %3
%12 = fdiv float %10, %11
%13 = call i32 @pow(float %12, i32 2)
%14 = add nsw i32 1, %13
%15 = call double @log(i32 %14)
%16 = fptrunc double %15 to float
store float %16, float* %6
%17 = load float, float* %3
%18 = call i32 @pow(float %17, i32 2)
%19 = load float, float* %4
%20 = load float, float* %3
%21 = fdiv float %19, %20
%22 = call i32 @pow(float %21, i32 2)
%23 = add nsw i32 1, %22
%24 = sdiv i32 %18, %23
%25 = call double @log(i32 %24)
%26 = fmul double 5.000000e-01, %25
%27 = fptrunc double %26 to float
store float %27, float* %5
%28 = call double @gasdev(i64* @uuvel.idum)
store double %28, double* %9
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = load double, double* %9
%32 = load float, float* %6
%33 = call double @sqrt(float %32)
%34 = call double @llvm.fmuladd.f64(double %31, double %33, double %30)
%35 = fptrunc double %34 to float
store float %35, float* %7
%36 = load float, float* %7
%37 = call float @exp(float %36)
store float %37, float* %8
%38 = load float, float* %8
%39 = fpext float %38 to double
ret double %39
}

LLVM IR (-O2):
@uuvel.idum = internal global i64 3
define double @uuvel(float %0, float %1) {
%3 = fdiv float %1, %0
%4 = tail call i32 @pow(float %3, i32 2)
%5 = add nsw i32 %4, 1
%6 = tail call double @log(i32 %5)
%7 = fptrunc double %6 to float
%8 = tail call i32 @pow(float %0, i32 2)
%9 = tail call i32 @pow(float %3, i32 2)
%10 = add nsw i32 %9, 1
%11 = sdiv i32 %8, %10
%12 = tail call double @log(i32 %11)
%13 = fmul double %12, 5.000000e-01
%14 = fptrunc double %13 to float
%15 = tail call double @gasdev(i64* @uuvel.idum)
%16 = fpext float %14 to double
%17 = tail call double @sqrt(float %7)
%18 = tail call double @llvm.fmuladd.f64(double %15, double %17, double %16)
%19 = fptrunc double %18 to float
%20 = tail call float @exp(float %19)
%21 = fpext float %20 to double
ret double %21
}