#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 powf(float, float);
float sinf(float);
int ax2hof(float *ax, float *ho, int p) {
  float f;
  int i;
  float epsijk;
  epsijk = (float)p;
  f = 0.75f * (ax[3] - sinf(ax[3]));
  f = powf(f, 1.0f / 3.0f);
  for (i = 0; i < 3; i++) {
    ho[i] = f * ax[i];
  }
  return 1;
}


x86 assembly (clang, -O0):
<ax2hof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
call   1030 <sinf@plt>
movss  -0x24(%rbp),%xmm1
subss  %xmm0,%xmm1
movss  0xe9a(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xe80(%rip),%xmm1
call   1040 <powf@plt>
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    11c8 <ax2hof+0xa8>
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1191 <ax2hof+0x71>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ax2hof>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  0xc(%rdi),%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <sinf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
mulss  0xeb4(%rip),%xmm1
movaps %xmm1,%xmm0
movss  0xead(%rip),%xmm1
call   1040 <powf@plt>
movss  (%rbx),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%r14)
movss  0x4(%rbx),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%r14)
mulss  0x8(%rbx),%xmm0
movss  %xmm0,0x8(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ax2hof(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
%9 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = sitofp i32 %10 to float
store float %11, float* %9
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 3
%14 = load float, float* %13
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 3
%17 = load float, float* %16
%18 = call float @sinf(float %17)
%19 = fsub float %14, %18
%20 = fmul float 7.500000e-01, %19
store float %20, float* %7
%21 = load float, float* %7
%22 = call float @powf(float %21, float 0x3FD5555560000000)
store float %22, float* %7
store i32 0, i32* %8
br label %23
23: ; preds = %38, %3
%24 = load i32, i32* %8
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %41
26: ; preds = %23
%27 = load float, float* %7
%28 = load float*, float** %4
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds float, float* %28, i64 %30
%32 = load float, float* %31
%33 = fmul float %27, %32
%34 = load float*, float** %5
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %34, i64 %36
store float %33, float* %37
br label %38
38: ; preds = %26
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
br label %23
41: ; preds = %23
ret i32 1
}

LLVM IR (-O2):
define i32 @ax2hof(float* nocapture %0, float* nocapture writeonly %1, i32 %2) {
%4 = getelementptr inbounds float, float* %0, i64 3
%5 = load float, float* %4
%6 = tail call float @sinf(float %5)
%7 = fsub float %5, %6
%8 = fmul float %7, 7.500000e-01
%9 = tail call float @powf(float %8, float 0x3FD5555560000000)
%10 = load float, float* %0
%11 = fmul float %9, %10
store float %11, float* %1
%12 = getelementptr inbounds float, float* %0, i64 1
%13 = load float, float* %12
%14 = fmul float %9, %13
%15 = getelementptr inbounds float, float* %1, i64 1
store float %14, float* %15
%16 = getelementptr inbounds float, float* %0, i64 2
%17 = load float, float* %16
%18 = fmul float %9, %17
%19 = getelementptr inbounds float, float* %1, i64 2
store float %18, float* %19
ret i32 1
}