#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 atan(double);
double log(double);
int pow(double, int);
double u_star(double t0_dem, double h, double ustar, double roh_air, double zom,
              double u2m) {
  double result;
  double n5_temp;
  double n10_mem;
  double n31_mem;
  double hv = 1.0;
  double bh = 200;
  if (h != 0.0) {
    n5_temp = (-1004 * roh_air * pow(ustar, 3) * t0_dem) / (0.41 * 9.81 * h);
  } else {
    n5_temp = -1000.0;
  }
  if (n5_temp < 0.0) {
    n31_mem = pow((1 - 16 * (200 / n5_temp)), 0.25);
    n10_mem = (2 * log((1 + n31_mem) / 2) + log((1 + pow(n31_mem, 2)) / 2) -
               2 * atan(n31_mem) + 0.5 * 3.1415927);
  } else {
    n10_mem = -5 * 2 / n5_temp;
  }
  result =
      ((u2m * 0.41 / log(2 / (hv / 7))) / 0.41 * log(bh / (hv / 7)) * 0.41) /
      (log(bh / zom) - n10_mem);
  return result;
}


x86 assembly (clang, -O0):
<u_star>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1190 <u_star+0x60>
jp     1190 <u_star+0x60>
jmp    11de <u_star+0xae>
movsd  0xe88(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x3,%edi
call   1050 <pow@plt>
movsd  -0x68(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe4d(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11eb <u_star+0xbb>
movsd  0xe2a(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    12b9 <u_star+0x189>
movsd  0xdff(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdee(%rip),%xmm1
addsd  %xmm1,%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xdd2(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  0xdf5(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1030 <atan@plt>
movsd  -0x70(%rbp),%xmm0
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xd85(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    12cb <u_star+0x19b>
movsd  0xd67(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd75(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  0xd63(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd3f(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  0xd2f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xd19(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xced(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_star>:
sub    $0x28,%rsp
movsd  %xmm5,0x10(%rsp)
movapd %xmm0,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movsd  %xmm4,0x20(%rsp)
jne    1150 <u_star+0x20>
jnp    11ba <u_star+0x8a>
mulsd  0xeb0(%rip),%xmm3
movsd  %xmm3,0x18(%rsp)
movaps %xmm2,%xmm0
mov    $0x3,%edi
movsd  %xmm1,0x8(%rsp)
movsd  %xmm5,(%rsp)
call   1050 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xe7f(%rip),%xmm0
mulsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     11c2 <u_star+0x92>
movsd  0xe6c(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
jmp    127b <u_star+0x14b>
movsd  0xe3e(%rip),%xmm1
movsd  0xe56(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  0xe52(%rip),%xmm0
addsd  0xe52(%rip),%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe36(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xe32(%rip),%xmm1
movapd %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1040 <log@plt>
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <atan@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0xdca(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xdc5(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xdbb(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xdb7(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xd6d(%rip),%xmm0
divsd  0x20(%rsp),%xmm0
call   1040 <log@plt>
subsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @u_star(double %0, double %1, double %2, double %3, double %4, double %5) {
%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
%16 = alloca double
%17 = alloca double
%18 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
store double 1.000000e+00, double* %17
store double 2.000000e+02, double* %18
%19 = load double, double* %8
%20 = fcmp une double %19, 0.000000e+00
br i1 %20, label %21, label %33
21: ; preds = %6
%22 = load double, double* %10
%23 = fmul double -1.004000e+03, %22
%24 = load double, double* %9
%25 = call i32 @pow(double %24, i32 3)
%26 = sitofp i32 %25 to double
%27 = fmul double %23, %26
%28 = load double, double* %7
%29 = fmul double %27, %28
%30 = load double, double* %8
%31 = fmul double 4.022100e+00, %30
%32 = fdiv double %29, %31
store double %32, double* %14
br label %34
33: ; preds = %6
store double -1.000000e+03, double* %14
br label %34
34: ; preds = %33, %21
%35 = load double, double* %14
%36 = fcmp olt double %35, 0.000000e+00
br i1 %36, label %37, label %60
37: ; preds = %34
%38 = load double, double* %14
%39 = fdiv double 2.000000e+02, %38
%40 = call double @llvm.fmuladd.f64(double -1.600000e+01, double %39, double 1.000000e+00)
%41 = call i32 @pow(double %40, i32 0)
%42 = sitofp i32 %41 to double
store double %42, double* %16
%43 = load double, double* %16
%44 = fadd double 1.000000e+00, %43
%45 = fdiv double %44, 2.000000e+00
%46 = call double @log(double %45)
%47 = load double, double* %16
%48 = call i32 @pow(double %47, i32 2)
%49 = add nsw i32 1, %48
%50 = sdiv i32 %49, 2
%51 = sitofp i32 %50 to double
%52 = call double @log(double %51)
%53 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %46, double %52)
%54 = load double, double* %16
%55 = call i32 @atan(double %54)
%56 = mul nsw i32 2, %55
%57 = sitofp i32 %56 to double
%58 = fsub double %53, %57
%59 = fadd double %58, 0x3FF921FB5A7ED197
store double %59, double* %15
br label %63
60: ; preds = %34
%61 = load double, double* %14
%62 = fdiv double -1.000000e+01, %61
store double %62, double* %15
br label %63
63: ; preds = %60, %37
%64 = load double, double* %12
%65 = fmul double %64, 4.100000e-01
%66 = load double, double* %17
%67 = fdiv double %66, 7.000000e+00
%68 = fdiv double 2.000000e+00, %67
%69 = call double @log(double %68)
%70 = fdiv double %65, %69
%71 = fdiv double %70, 4.100000e-01
%72 = load double, double* %18
%73 = load double, double* %17
%74 = fdiv double %73, 7.000000e+00
%75 = fdiv double %72, %74
%76 = call double @log(double %75)
%77 = fmul double %71, %76
%78 = fmul double %77, 4.100000e-01
%79 = load double, double* %18
%80 = load double, double* %11
%81 = fdiv double %79, %80
%82 = call double @log(double %81)
%83 = load double, double* %15
%84 = fsub double %82, %83
%85 = fdiv double %78, %84
store double %85, double* %13
%86 = load double, double* %13
ret double %86
}

LLVM IR (-O2):
define double @u_star(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fcmp une double %1, 0.000000e+00
br i1 %7, label %8, label %17
8: ; preds = %6
%9 = fmul double %3, -1.004000e+03
%10 = tail call i32 @pow(double %2, i32 3)
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = fmul double %12, %0
%14 = fmul double %1, 4.022100e+00
%15 = fdiv double %13, %14
%16 = fcmp olt double %15, 0.000000e+00
br i1 %16, label %17, label %37
17: ; preds = %6, %8
%18 = phi double [ %15, %8 ], [ -1.000000e+03, %6 ]
%19 = fdiv double 2.000000e+02, %18
%20 = tail call double @llvm.fmuladd.f64(double %19, double -1.600000e+01, double 1.000000e+00)
%21 = tail call i32 @pow(double %20, i32 0)
%22 = sitofp i32 %21 to double
%23 = fadd double %22, 1.000000e+00
%24 = fmul double %23, 5.000000e-01
%25 = tail call double @log(double %24)
%26 = tail call i32 @pow(double %22, i32 2)
%27 = add nsw i32 %26, 1
%28 = sdiv i32 %27, 2
%29 = sitofp i32 %28 to double
%30 = tail call double @log(double %29)
%31 = tail call double @llvm.fmuladd.f64(double %25, double 2.000000e+00, double %30)
%32 = tail call i32 @atan(double %22)
%33 = shl nsw i32 %32, 1
%34 = sitofp i32 %33 to double
%35 = fsub double %31, %34
%36 = fadd double %35, 0x3FF921FB5A7ED197
br label %39
37: ; preds = %8
%38 = fdiv double -1.000000e+01, %15
br label %39
39: ; preds = %37, %17
%40 = phi double [ %36, %17 ], [ %38, %37 ]
%41 = fmul double %5, 4.100000e-01
%42 = fdiv double %41, 0x40051CCA16D7BBA7
%43 = fdiv double %42, 4.100000e-01
%44 = fmul double %43, 0x401CFA16C72132E9
%45 = fmul double %44, 4.100000e-01
%46 = fdiv double 2.000000e+02, %4
%47 = tail call double @log(double %46)
%48 = fsub double %47, %40
%49 = fdiv double %45, %48
ret double %49
}