#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 log(int);
double ustar0(double u, double z, double h) {
  double ustar = 0.41 * u / (log(z / (0.12 * h)));
  double u200 = ustar * log(200 / (0.12 * h)) / 0.41;
  return (0.41 * u200 / log(200 / (0.12 * h)));
}


x86 assembly (clang, -O0):
<ustar0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe8d(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe78(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe67(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe56(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe3c(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe27(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustar0>:
push   %rbx
sub    $0x10,%rsp
mulsd  0xeeb(%rip),%xmm2
movsd  %xmm2,0x8(%rsp)
mulsd  0xed5(%rip),%xmm0
movsd  %xmm0,(%rsp)
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xebd(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   1030 <log@plt>
movapd %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movsd  0xe8b(%rip),%xmm0
divsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %ebx,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ustar0(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = fmul double 4.100000e-01, %9
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fmul double 1.200000e-01, %12
%14 = fdiv double %11, %13
%15 = fptosi double %14 to i32
%16 = call double @log(i32 %15)
%17 = fdiv double %10, %16
store double %17, double* %7
%18 = load double, double* %7
%19 = load double, double* %6
%20 = fmul double 1.200000e-01, %19
%21 = fdiv double 2.000000e+02, %20
%22 = fptosi double %21 to i32
%23 = call double @log(i32 %22)
%24 = fmul double %18, %23
%25 = fdiv double %24, 4.100000e-01
store double %25, double* %8
%26 = load double, double* %8
%27 = fmul double 4.100000e-01, %26
%28 = load double, double* %6
%29 = fmul double 1.200000e-01, %28
%30 = fdiv double 2.000000e+02, %29
%31 = fptosi double %30 to i32
%32 = call double @log(i32 %31)
%33 = fdiv double %27, %32
ret double %33
}

LLVM IR (-O2):
define double @ustar0(double %0, double %1, double %2) {
%4 = fmul double %0, 4.100000e-01
%5 = fmul double %2, 1.200000e-01
%6 = fdiv double %1, %5
%7 = fptosi double %6 to i32
%8 = tail call double @log(i32 %7)
%9 = fdiv double %4, %8
%10 = fdiv double 2.000000e+02, %5
%11 = fptosi double %10 to i32
%12 = tail call double @log(i32 %11)
%13 = fmul double %9, %12
%14 = fdiv double %13, 4.100000e-01
%15 = fmul double %14, 4.100000e-01
%16 = tail call double @log(i32 %11)
%17 = fdiv double %15, %16
ret double %17
}