#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 const sqrt(float const);
void vect_fpow34(const float x[], float y[], int n) {
  int i;
  for (i = 0; i < n; i++)
    y[i] = (float)sqrt(x[i] * sqrt(x[i]));
}


x86 assembly (clang, -O0):
<vect_fpow34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1186 <vect_fpow34+0x76>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sqrt@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <vect_fpow34+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vect_fpow34>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
test   %edx,%edx
jle    1267 <vect_fpow34+0x157>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
cmp    $0x1,%edx
jne    115d <vect_fpow34+0x4d>
xor    %ebx,%ebx
test   $0x1,%r12b
je     1267 <vect_fpow34+0x157>
movss  (%r15,%rbx,4),%xmm1
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jb     1230 <vect_fpow34+0x120>
xorps  %xmm0,%xmm0
sqrtss %xmm1,%xmm0
jmp    1247 <vect_fpow34+0x137>
mov    %r12d,%r13d
and    $0xfffffffe,%r13d
xor    %ebx,%ebx
xorps  %xmm1,%xmm1
jmp    118b <vect_fpow34+0x7b>
nopl   0x0(%rax,%rax,1)
movaps %xmm2,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm1,%xmm1
movss  %xmm0,0x4(%r14,%rbx,4)
add    $0x2,%rbx
cmp    %rbx,%r13
je     1135 <vect_fpow34+0x25>
movss  (%r15,%rbx,4),%xmm2
ucomiss %xmm1,%xmm2
jb     11a0 <vect_fpow34+0x90>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
jmp    11b7 <vect_fpow34+0xa7>
nop
movaps %xmm2,%xmm0
movss  %xmm2,0xc(%rsp)
call   1030 <sqrt@plt>
movss  0xc(%rsp),%xmm2
xorps  %xmm1,%xmm1
mulss  %xmm0,%xmm2
ucomiss %xmm1,%xmm2
jb     11d0 <vect_fpow34+0xc0>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
jmp    11db <vect_fpow34+0xcb>
nopl   0x0(%rax)
movaps %xmm2,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm1,%xmm1
movss  %xmm0,(%r14,%rbx,4)
movss  0x4(%r15,%rbx,4),%xmm2
ucomiss %xmm1,%xmm2
jb     1200 <vect_fpow34+0xf0>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
jmp    1217 <vect_fpow34+0x107>
cs nopw 0x0(%rax,%rax,1)
movaps %xmm2,%xmm0
movss  %xmm2,0xc(%rsp)
call   1030 <sqrt@plt>
movss  0xc(%rsp),%xmm2
xorps  %xmm1,%xmm1
mulss  %xmm0,%xmm2
ucomiss %xmm1,%xmm2
jb     1170 <vect_fpow34+0x60>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
jmp    117b <vect_fpow34+0x6b>
movaps %xmm1,%xmm0
movss  %xmm1,0xc(%rsp)
call   1030 <sqrt@plt>
xorps  %xmm2,%xmm2
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
ucomiss %xmm2,%xmm1
jb     1259 <vect_fpow34+0x149>
xorps  %xmm0,%xmm0
sqrtss %xmm1,%xmm0
jmp    1261 <vect_fpow34+0x151>
movaps %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,(%r14,%rbx,4)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vect_fpow34(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %30, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %33
12: ; preds = %8
%13 = load float*, float** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
%22 = load float, float* %21
%23 = call float @sqrt(float %22)
%24 = fmul float %17, %23
%25 = call float @sqrt(float %24)
%26 = load float*, float** %5
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %26, i64 %28
store float %25, float* %29
br label %30
30: ; preds = %12
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %8
33: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @vect_fpow34(float* nocapture %0, float* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %40
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = and i64 %6, 1
%8 = icmp eq i32 %2, 1
br i1 %8, label %30, label %9
9: ; preds = %5
%10 = and i64 %6, 4294967294
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 0, %9 ], [ %27, %11 ]
%13 = phi i64 [ 0, %9 ], [ %28, %11 ]
%14 = getelementptr inbounds float, float* %0, i64 %12
%15 = load float, float* %14
%16 = tail call float @sqrt(float %15)
%17 = fmul float %15, %16
%18 = tail call float @sqrt(float %17)
%19 = getelementptr inbounds float, float* %1, i64 %12
store float %18, float* %19
%20 = or i64 %12, 1
%21 = getelementptr inbounds float, float* %0, i64 %20
%22 = load float, float* %21
%23 = tail call float @sqrt(float %22)
%24 = fmul float %22, %23
%25 = tail call float @sqrt(float %24)
%26 = getelementptr inbounds float, float* %1, i64 %20
store float %25, float* %26
%27 = add nuw nsw i64 %12, 2
%28 = add i64 %13, 2
%29 = icmp eq i64 %28, %10
br i1 %29, label %30, label %11
30: ; preds = %11, %5
%31 = phi i64 [ 0, %5 ], [ %27, %11 ]
%32 = icmp eq i64 %7, 0
br i1 %32, label %40, label %33
33: ; preds = %30
%34 = getelementptr inbounds float, float* %0, i64 %31
%35 = load float, float* %34
%36 = tail call float @sqrt(float %35)
%37 = fmul float %35, %36
%38 = tail call float @sqrt(float %37)
%39 = getelementptr inbounds float, float* %1, i64 %31
store float %38, float* %39
br label %40
40: ; preds = %33, %30, %3
ret void
}