#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 sqrt(float);
void xr_pow34_calculate(float *mdct_line, float mdct_line_num, float *xr_pow) {
  int i;
  float tmp;
  for (i = 0; i < mdct_line_num; i++) {
    tmp = ((mdct_line[i]) > 0 ? (mdct_line[i]) : (-(mdct_line[i])));
    xr_pow[i] = (sqrt(tmp * (sqrt(tmp))));
    if (mdct_line[i] < 0)
      xr_pow[i] = -xr_pow[i];
  }
}


x86 assembly (clang, -O0):
<xr_pow34_calculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cvtsi2ssl -0x1c(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1219 <xr_pow34_calculate+0x109>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    116f <xr_pow34_calculate+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    118e <xr_pow34_calculate+0x7e>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sqrt@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
ucomiss (%rax,%rcx,4),%xmm0
jbe    1206 <xr_pow34_calculate+0xf6>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    120b <xr_pow34_calculate+0xfb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112c <xr_pow34_calculate+0x1c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xr_pow34_calculate>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
xorps  %xmm2,%xmm2
movss  %xmm0,0xc(%rsp)
ucomiss %xmm2,%xmm0
jbe    11eb <xr_pow34_calculate+0xdb>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
jmp    115a <xr_pow34_calculate+0x4a>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  0xc(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    11eb <xr_pow34_calculate+0xdb>
movss  (%r15,%rbx,4),%xmm0
movaps %xmm0,%xmm1
xorps  0xe96(%rip),%xmm1
xorps  %xmm3,%xmm3
cmpltss %xmm0,%xmm3
andps  %xmm3,%xmm0
andnps %xmm1,%xmm3
orps   %xmm0,%xmm3
ucomiss %xmm2,%xmm3
jb     1190 <xr_pow34_calculate+0x80>
xorps  %xmm0,%xmm0
sqrtss %xmm3,%xmm0
jmp    11a5 <xr_pow34_calculate+0x95>
nopl   0x0(%rax)
movaps %xmm3,%xmm0
movaps %xmm3,0x10(%rsp)
call   1030 <sqrt@plt>
movaps 0x10(%rsp),%xmm3
xorps  %xmm2,%xmm2
mulss  %xmm3,%xmm0
ucomiss %xmm2,%xmm0
jb     11c0 <xr_pow34_calculate+0xb0>
sqrtss %xmm0,%xmm0
jmp    11c8 <xr_pow34_calculate+0xb8>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <sqrt@plt>
xorps  %xmm2,%xmm2
movss  %xmm0,(%r14,%rbx,4)
ucomiss (%r15,%rbx,4),%xmm2
jbe    1140 <xr_pow34_calculate+0x30>
xorps  0xe20(%rip),%xmm0
movss  %xmm0,(%r14,%rbx,4)
jmp    1140 <xr_pow34_calculate+0x30>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @xr_pow34_calculate(float* %0, float %1, float* %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float*
%7 = alloca i32
%8 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float* %2, float** %6
store i32 0, i32* %7
br label %9
9: ; preds = %63, %3
%10 = load i32, i32* %7
%11 = sitofp i32 %10 to float
%12 = load float, float* %5
%13 = fcmp olt float %11, %12
br i1 %13, label %14, label %66
14: ; preds = %9
%15 = load float*, float** %4
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %15, i64 %17
%19 = load float, float* %18
%20 = fcmp ogt float %19, 0.000000e+00
br i1 %20, label %21, label %27
21: ; preds = %14
%22 = load float*, float** %4
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
%26 = load float, float* %25
br label %34
27: ; preds = %14
%28 = load float*, float** %4
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds float, float* %28, i64 %30
%32 = load float, float* %31
%33 = fneg float %32
br label %34
34: ; preds = %27, %21
%35 = phi float [ %26, %21 ], [ %33, %27 ]
store float %35, float* %8
%36 = load float, float* %8
%37 = load float, float* %8
%38 = call float @sqrt(float %37)
%39 = fmul float %36, %38
%40 = call float @sqrt(float %39)
%41 = load float*, float** %6
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds float, float* %41, i64 %43
store float %40, float* %44
%45 = load float*, float** %4
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds float, float* %45, i64 %47
%49 = load float, float* %48
%50 = fcmp olt float %49, 0.000000e+00
br i1 %50, label %51, label %62
51: ; preds = %34
%52 = load float*, float** %6
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds float, float* %52, i64 %54
%56 = load float, float* %55
%57 = fneg float %56
%58 = load float*, float** %6
%59 = load i32, i32* %7
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds float, float* %58, i64 %60
store float %57, float* %61
br label %62
62: ; preds = %51, %34
br label %63
63: ; preds = %62
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
br label %9
66: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @xr_pow34_calculate(float* nocapture %0, float %1, float* nocapture writeonly %2) {
%4 = fcmp ogt float %1, 0.000000e+00
br i1 %4, label %5, label %25
5: ; preds = %3, %20
%6 = phi i64 [ %21, %20 ], [ 0, %3 ]
%7 = getelementptr inbounds float, float* %0, i64 %6
%8 = load float, float* %7
%9 = fcmp ogt float %8, 0.000000e+00
%10 = fneg float %8
%11 = select i1 %9, float %8, float %10
%12 = tail call float @sqrt(float %11)
%13 = fmul float %12, %11
%14 = tail call float @sqrt(float %13)
%15 = getelementptr inbounds float, float* %2, i64 %6
store float %14, float* %15
%16 = load float, float* %7
%17 = fcmp olt float %16, 0.000000e+00
br i1 %17, label %18, label %20
18: ; preds = %5
%19 = fneg float %14
store float %19, float* %15
br label %20
20: ; preds = %5, %18
%21 = add nuw i64 %6, 1
%22 = trunc i64 %21 to i32
%23 = sitofp i32 %22 to float
%24 = fcmp olt float %23, %1
br i1 %24, label %5, label %25
25: ; preds = %20, %3
ret void
}