#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 powf(float const, float const);
float pprz_isa_height_of_pressure_full(float pressure, float ref_p) {
  if (ref_p > 0.) {
    const float prel = pressure / ref_p;
    const float inv_expo = 8.31447 * 0.0065 / 9.80665 / 0.0289644;
    return (1 - powf(prel, inv_expo)) * 288.15 / 0.0065;
  } else {
    return 0.;
  }
}


x86 assembly (clang, -O0):
<pprz_isa_height_of_pressure_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1199 <pprz_isa_height_of_pressure_full+0x89>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec1(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xeaf(%rip),%xmm1
call   1030 <powf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a1 <pprz_isa_height_of_pressure_full+0x91>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pprz_isa_height_of_pressure_full>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    1153 <pprz_isa_height_of_pressure_full+0x43>
push   %rax
divss  %xmm1,%xmm0
movss  0xedb(%rip),%xmm1
call   1030 <powf@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xec8(%rip),%xmm0
divsd  0xec8(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
add    $0x8,%rsp
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @pprz_isa_height_of_pressure_full(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load float, float* %4
%13 = load float, float* %5
%14 = fdiv float %12, %13
store float %14, float* %6
store float 0x3FC85AA880000000, float* %7
%15 = load float, float* %6
%16 = call i32 @powf(float %15, float 0x3FC85AA880000000)
%17 = sub nsw i32 1, %16
%18 = sitofp i32 %17 to double
%19 = fmul double %18, 2.881500e+02
%20 = fdiv double %19, 0x3F7A9FBE76C8B439
%21 = fptrunc double %20 to float
store float %21, float* %3
br label %23
22: ; preds = %2
store float 0.000000e+00, float* %3
br label %23
23: ; preds = %22, %11
%24 = load float, float* %3
ret float %24
}

LLVM IR (-O2):
define float @pprz_isa_height_of_pressure_full(float %0, float %1) {
%3 = fcmp ogt float %1, 0.000000e+00
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = fdiv float %0, %1
%6 = tail call i32 @powf(float %5, float 0x3FC85AA880000000)
%7 = sub nsw i32 1, %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 2.881500e+02
%10 = fdiv double %9, 0x3F7A9FBE76C8B439
%11 = fptrunc double %10 to float
br label %12
12: ; preds = %2, %4
%13 = phi float [ %11, %4 ], [ 0.000000e+00, %2 ]
ret float %13
}