void vectorMultiply(float constant, float *vector) {
  float constant2 = 0;
  if (constant > -.01 && constant < 1.01) {
    constant2 = constant;
  }
  vector[0] = vector[0] * constant2;
  vector[1] = vector[1] * constant2;
  vector[2] = vector[2] * constant2;
}


x86 assembly (clang, -O0):
<vectorMultiply>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1155 <vectorMultiply+0x55>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <vectorMultiply+0x55>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorMultiply>:
cvtss2sd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1115 <vectorMultiply+0x15>
xorps  %xmm0,%xmm0
ucomisd 0xeeb(%rip),%xmm1
ja     1122 <vectorMultiply+0x22>
xorps  %xmm0,%xmm0
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vectorMultiply(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca float
store float %0, float* %3
store float* %1, float** %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fcmp ogt double %7, -1.000000e-02
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 1.010000e+00
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load float, float* %3
store float %14, float* %5
br label %15
15: ; preds = %13, %9, %2
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 0
%18 = load float, float* %17
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = load float*, float** %4
%22 = getelementptr inbounds float, float* %21, i64 0
store float %20, float* %22
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
%25 = load float, float* %24
%26 = load float, float* %5
%27 = fmul float %25, %26
%28 = load float*, float** %4
%29 = getelementptr inbounds float, float* %28, i64 1
store float %27, float* %29
%30 = load float*, float** %4
%31 = getelementptr inbounds float, float* %30, i64 2
%32 = load float, float* %31
%33 = load float, float* %5
%34 = fmul float %32, %33
%35 = load float*, float** %4
%36 = getelementptr inbounds float, float* %35, i64 2
store float %34, float* %36
ret void
}

LLVM IR (-O2):
define void @vectorMultiply(float %0, float* nocapture %1) {
%3 = fpext float %0 to double
%4 = fcmp ogt double %3, -1.000000e-02
%5 = fcmp olt double %3, 1.010000e+00
%6 = and i1 %4, %5
%7 = select i1 %6, float %0, float 0.000000e+00
%8 = load float, float* %1
%9 = fmul float %7, %8
store float %9, float* %1
%10 = getelementptr inbounds float, float* %1, i64 1
%11 = load float, float* %10
%12 = fmul float %7, %11
store float %12, float* %10
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = fmul float %7, %14
store float %15, float* %13
ret void
}