#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 /*<<< orphan*/ minHeapKeys(float *, float *, int);
int /*<<< orphan*/ printf(char *, int);
void eikUpdateCPU(float *ttHeap, float *ttKeys, float *radius, float *ttime,
                  int sizeTheta, int sizePhi) {
  minHeapKeys(ttHeap, ttKeys, sizeTheta * sizePhi);
  int index = ttKeys[0];
  printf("index : %i\n", index);
  radius[index] += 1.0f;
  ttime[index] = ttHeap[0];
}


x86 assembly (clang, -O0):
<eikUpdateCPU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%edx
imul   -0x28(%rbp),%edx
call   1040 <minHeapKeys@plt>
mov    -0x10(%rbp),%rax
cvttss2si (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  0xe82(%rip),%xmm0
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eikUpdateCPU>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
imul   %r9d,%r8d
mov    %r8d,%edx
call   1040 <minHeapKeys@plt>
cvttss2si (%rbx),%ebx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movslq %ebx,%rax
movss  (%r15,%rax,4),%xmm0
addss  0xe9d(%rip),%xmm0
movss  %xmm0,(%r15,%rax,4)
movss  (%r12),%xmm0
movss  %xmm0,(%r14,%rax,4)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"index : %i\0A\00"
define void @eikUpdateCPU(float* %0, float* %1, float* %2, float* %3, i32 %4, i32 %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load float*, float** %7
%15 = load float*, float** %8
%16 = load i32, i32* %11
%17 = load i32, i32* %12
%18 = mul nsw i32 %16, %17
%19 = call i32 @minHeapKeys(float* %14, float* %15, i32 %18)
%20 = load float*, float** %8
%21 = getelementptr inbounds float, float* %20, i64 0
%22 = load float, float* %21
%23 = fptosi float %22 to i32
store i32 %23, i32* %13
%24 = load i32, i32* %13
%25 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = load float*, float** %9
%27 = load i32, i32* %13
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %26, i64 %28
%30 = load float, float* %29
%31 = fadd float %30, 1.000000e+00
store float %31, float* %29
%32 = load float*, float** %7
%33 = getelementptr inbounds float, float* %32, i64 0
%34 = load float, float* %33
%35 = load float*, float** %10
%36 = load i32, i32* %13
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds float, float* %35, i64 %37
store float %34, float* %38
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"index : %i\0A\00"
define void @eikUpdateCPU(float* %0, float* %1, float* nocapture %2, float* nocapture writeonly %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %5, %4
%8 = tail call i32 @minHeapKeys(float* %0, float* %1, i32 %7)
%9 = load float, float* %1
%10 = fptosi float %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds float, float* %2, i64 %12
%14 = load float, float* %13
%15 = fadd float %14, 1.000000e+00
store float %15, float* %13
%16 = load float, float* %0
%17 = getelementptr inbounds float, float* %3, i64 %12
store float %16, float* %17
ret void
}