#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*/ assert(float *);
void vectorf_multiply_inplace(float *self, size_t size, float value) {
  assert(self);
  for (size_t i = 0; i < size; i++)
    self[i] *= value;
}


x86 assembly (clang, -O0):
<vectorf_multiply_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116c <vectorf_multiply_inplace+0x5c>
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1136 <vectorf_multiply_inplace+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorf_multiply_inplace>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
movaps (%rsp),%xmm5
test   %r14,%r14
je     11e7 <vectorf_multiply_inplace+0xd7>
cmp    $0x8,%r14
jae    1140 <vectorf_multiply_inplace+0x30>
xor    %eax,%eax
jmp    11d0 <vectorf_multiply_inplace+0xc0>
mov    %r14,%rax
and    $0xfffffffffffffff8,%rax
movaps %xmm5,%xmm0
shufps $0x0,%xmm5,%xmm0
lea    -0x8(%rax),%rcx
mov    %rcx,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     11ef <vectorf_multiply_inplace+0xdf>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
nop
movups (%rbx,%rcx,4),%xmm1
movups 0x10(%rbx,%rcx,4),%xmm2
movups 0x20(%rbx,%rcx,4),%xmm3
movups 0x30(%rbx,%rcx,4),%xmm4
mulps  %xmm0,%xmm1
mulps  %xmm0,%xmm2
movups %xmm1,(%rbx,%rcx,4)
movups %xmm2,0x10(%rbx,%rcx,4)
mulps  %xmm0,%xmm3
mulps  %xmm0,%xmm4
movups %xmm3,0x20(%rbx,%rcx,4)
movups %xmm4,0x30(%rbx,%rcx,4)
add    $0x10,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1170 <vectorf_multiply_inplace+0x60>
test   $0x1,%dl
je     11c9 <vectorf_multiply_inplace+0xb9>
movups (%rbx,%rcx,4),%xmm1
movups 0x10(%rbx,%rcx,4),%xmm2
mulps  %xmm0,%xmm1
mulps  %xmm0,%xmm2
movups %xmm1,(%rbx,%rcx,4)
movups %xmm2,0x10(%rbx,%rcx,4)
cmp    %r14,%rax
je     11e7 <vectorf_multiply_inplace+0xd7>
xchg   %ax,%ax
movss  (%rbx,%rax,4),%xmm0
mulss  %xmm5,%xmm0
movss  %xmm0,(%rbx,%rax,4)
add    $0x1,%rax
cmp    %rax,%r14
jne    11d0 <vectorf_multiply_inplace+0xc0>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
xor    %ecx,%ecx
test   $0x1,%dl
jne    11b1 <vectorf_multiply_inplace+0xa1>
jmp    11c9 <vectorf_multiply_inplace+0xb9>

LLVM IR (-O0):
define void @vectorf_multiply_inplace(float* %0, i64 %1, float %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca float
%7 = alloca i64
store float* %0, float** %4
store i64 %1, i64* %5
store float %2, float* %6
%8 = load float*, float** %4
%9 = call i32 @assert(float* %8)
store i64 0, i64* %7
br label %10
10: ; preds = %21, %3
%11 = load i64, i64* %7
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load float, float* %6
%16 = load float*, float** %4
%17 = load i64, i64* %7
%18 = getelementptr inbounds float, float* %16, i64 %17
%19 = load float, float* %18
%20 = fmul float %19, %15
store float %20, float* %18
br label %21
21: ; preds = %14
%22 = load i64, i64* %7
%23 = add i64 %22, 1
store i64 %23, i64* %7
br label %10
24: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @vectorf_multiply_inplace(float* %0, i64 %1, float %2) {
%4 = tail call i32 @assert(float* %0)
%5 = icmp eq i64 %1, 0
br i1 %5, label %66, label %6
6: ; preds = %3
%7 = icmp ult i64 %1, 8
br i1 %7, label %64, label %8
8: ; preds = %6
%9 = and i64 %1, -8
%10 = insertelement <4 x float> poison, float %2, i64 0
%11 = shufflevector <4 x float> %10, <4 x float> poison, <4 x i32> zeroinitializer
%12 = insertelement <4 x float> poison, float %2, i64 0
%13 = shufflevector <4 x float> %12, <4 x float> poison, <4 x i32> zeroinitializer
%14 = add i64 %9, -8
%15 = lshr exact i64 %14, 3
%16 = add nuw nsw i64 %15, 1
%17 = and i64 %16, 1
%18 = icmp eq i64 %14, 0
br i1 %18, label %48, label %19
19: ; preds = %8
%20 = and i64 %16, 4611686018427387902
br label %21
21: ; preds = %21, %19
%22 = phi i64 [ 0, %19 ], [ %45, %21 ]
%23 = phi i64 [ 0, %19 ], [ %46, %21 ]
%24 = getelementptr inbounds float, float* %0, i64 %22
%25 = bitcast float* %24 to <4 x float>*
%26 = load <4 x float>, <4 x float>* %25
%27 = getelementptr inbounds float, float* %24, i64 4
%28 = bitcast float* %27 to <4 x float>*
%29 = load <4 x float>, <4 x float>* %28
%30 = fmul <4 x float> %26, %11
%31 = fmul <4 x float> %29, %13
%32 = bitcast float* %24 to <4 x float>*
store <4 x float> %30, <4 x float>* %32
%33 = bitcast float* %27 to <4 x float>*
store <4 x float> %31, <4 x float>* %33
%34 = or i64 %22, 8
%35 = getelementptr inbounds float, float* %0, i64 %34
%36 = bitcast float* %35 to <4 x float>*
%37 = load <4 x float>, <4 x float>* %36
%38 = getelementptr inbounds float, float* %35, i64 4
%39 = bitcast float* %38 to <4 x float>*
%40 = load <4 x float>, <4 x float>* %39
%41 = fmul <4 x float> %37, %11
%42 = fmul <4 x float> %40, %13
%43 = bitcast float* %35 to <4 x float>*
store <4 x float> %41, <4 x float>* %43
%44 = bitcast float* %38 to <4 x float>*
store <4 x float> %42, <4 x float>* %44
%45 = add nuw i64 %22, 16
%46 = add i64 %23, 2
%47 = icmp eq i64 %46, %20
br i1 %47, label %48, label %21
48: ; preds = %21, %8
%49 = phi i64 [ 0, %8 ], [ %45, %21 ]
%50 = icmp eq i64 %17, 0
br i1 %50, label %62, label %51
51: ; preds = %48
%52 = getelementptr inbounds float, float* %0, i64 %49
%53 = bitcast float* %52 to <4 x float>*
%54 = load <4 x float>, <4 x float>* %53
%55 = getelementptr inbounds float, float* %52, i64 4
%56 = bitcast float* %55 to <4 x float>*
%57 = load <4 x float>, <4 x float>* %56
%58 = fmul <4 x float> %54, %11
%59 = fmul <4 x float> %57, %13
%60 = bitcast float* %52 to <4 x float>*
store <4 x float> %58, <4 x float>* %60
%61 = bitcast float* %55 to <4 x float>*
store <4 x float> %59, <4 x float>* %61
br label %62
62: ; preds = %48, %51
%63 = icmp eq i64 %9, %1
br i1 %63, label %66, label %64
64: ; preds = %6, %62
%65 = phi i64 [ 0, %6 ], [ %9, %62 ]
br label %67
66: ; preds = %67, %62, %3
ret void
67: ; preds = %64, %67
%68 = phi i64 [ %72, %67 ], [ %65, %64 ]
%69 = getelementptr inbounds float, float* %0, i64 %68
%70 = load float, float* %69
%71 = fmul float %70, %2
store float %71, float* %69
%72 = add nuw i64 %68, 1
%73 = icmp eq i64 %72, %1
br i1 %73, label %66, label %67
}