#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*/ foo(float *);
void joint_decode(float *mlt_buffer1, int t) {
  int i;
  float decode_buffer[1060];
  foo(decode_buffer);
  for (i = 0; i < 10; i++) {
    mlt_buffer1[i] = i * decode_buffer[t];
  }
}


x86 assembly (clang, -O0):
<joint_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10a0(%rbp),%rdi
call   1030 <foo@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    116c <joint_decode+0x5c>
cvtsi2ssl -0x10(%rbp),%xmm0
movslq -0xc(%rbp),%rax
mulss  -0x10a0(%rbp,%rax,4),%xmm0
ff ff
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <joint_decode+0x25>
add    $0x10a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<joint_decode>:
push   %rbp
push   %rbx
sub    $0x1098,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <foo@plt>
movslq %ebp,%rax
movss  (%rsp,%rax,4),%xmm0
xorps  %xmm1,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
movss  %xmm0,0x4(%rbx)
shufps $0x0,%xmm0,%xmm0
movaps 0xeb7(%rip),%xmm1
mulps  %xmm0,%xmm1
movups %xmm1,0x8(%rbx)
mulps  0xeb9(%rip),%xmm0
movups %xmm0,0x18(%rbx)
add    $0x1098,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @joint_decode(float* nocapture writeonly %0, i32 %1) {
%3 = alloca [1060 x float]
%4 = bitcast [1060 x float]* %3 to i8*
%5 = getelementptr inbounds [1060 x float], [1060 x float]* %3, i64 0, i64 0
%6 = call i32 @foo(float* %5)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds [1060 x float], [1060 x float]* %3, i64 0, i64 %7
%9 = load float, float* %8
%10 = fmul float %9, 0.000000e+00
store float %10, float* %0
%11 = getelementptr inbounds float, float* %0, i64 1
store float %9, float* %11
%12 = getelementptr inbounds float, float* %0, i64 2
%13 = insertelement <4 x float> poison, float %9, i64 0
%14 = shufflevector <4 x float> %13, <4 x float> poison, <4 x i32> zeroinitializer
%15 = fmul <4 x float> %14, <float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00>
%16 = bitcast float* %12 to <4 x float>*
store <4 x float> %15, <4 x float>* %16
%17 = getelementptr inbounds float, float* %0, i64 6
%18 = fmul <4 x float> %14, <float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 9.000000e+00>
%19 = bitcast float* %17 to <4 x float>*
store <4 x float> %18, <4 x float>* %19
ret void
}