#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 fabs(float);
int get_nchan_from_depth(int);
float pow(double, float);
float get_diagonal_dm_simple(float nu1, float nu2, float dt, int depth,
                             float disp_ind) {
  float d1 = pow(1.0 / nu1, disp_ind);
  float d2 = pow(1.0 / nu2, disp_ind);
  int nchan = get_nchan_from_depth(depth);
  float dm_max = ((dt * nchan) / 4148.808) / (d2 - d1);
  return fabs(dm_max);
}


x86 assembly (clang, -O0):
<get_diagonal_dm_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
divsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
call   1040 <pow@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe84(%rip),%xmm0
divsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
call   1040 <pow@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <get_nchan_from_depth@plt>
mov    %eax,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe44(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x1c(%rbp),%xmm1
subss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
call   1030 <fabs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_diagonal_dm_simple>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm3,0x4(%rsp)
mov    %edi,%ebx
movss  %xmm2,0xc(%rsp)
movss  %xmm1,(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
divsd  %xmm1,%xmm0
movaps %xmm3,%xmm1
call   1030 <pow@plt>
movss  %xmm0,0x8(%rsp)
movss  (%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
divsd  %xmm1,%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <pow@plt>
movss  %xmm0,(%rsp)
mov    %ebx,%edi
call   1040 <get_nchan_from_depth@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xe67(%rip),%xmm0
movss  (%rsp),%xmm1
subss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
andps  0xe51(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @get_diagonal_dm_simple(float %0, float %1, float %2, i32 %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store i32 %3, i32* %9
store float %4, float* %10
%15 = load float, float* %6
%16 = fpext float %15 to double
%17 = fdiv double 1.000000e+00, %16
%18 = load float, float* %10
%19 = call float @pow(double %17, float %18)
store float %19, float* %11
%20 = load float, float* %7
%21 = fpext float %20 to double
%22 = fdiv double 1.000000e+00, %21
%23 = load float, float* %10
%24 = call float @pow(double %22, float %23)
store float %24, float* %12
%25 = load i32, i32* %9
%26 = call i32 @get_nchan_from_depth(i32 %25)
store i32 %26, i32* %13
%27 = load float, float* %8
%28 = load i32, i32* %13
%29 = sitofp i32 %28 to float
%30 = fmul float %27, %29
%31 = fpext float %30 to double
%32 = fdiv double %31, 0x40B034CED916872B
%33 = load float, float* %12
%34 = load float, float* %11
%35 = fsub float %33, %34
%36 = fpext float %35 to double
%37 = fdiv double %32, %36
%38 = fptrunc double %37 to float
store float %38, float* %14
%39 = load float, float* %14
%40 = call float @fabs(float %39)
ret float %40
}

LLVM IR (-O2):
define float @get_diagonal_dm_simple(float %0, float %1, float %2, i32 %3, float %4) {
%6 = fpext float %0 to double
%7 = fdiv double 1.000000e+00, %6
%8 = tail call float @pow(double %7, float %4)
%9 = fpext float %1 to double
%10 = fdiv double 1.000000e+00, %9
%11 = tail call float @pow(double %10, float %4)
%12 = tail call i32 @get_nchan_from_depth(i32 %3)
%13 = sitofp i32 %12 to float
%14 = fmul float %13, %2
%15 = fpext float %14 to double
%16 = fdiv double %15, 0x40B034CED916872B
%17 = fsub float %11, %8
%18 = fpext float %17 to double
%19 = fdiv double %16, %18
%20 = fptrunc double %19 to float
%21 = tail call float @llvm.fabs.f32(float %20)
ret float %21
}