int c_update_feature(int *train_points, int num_points, float *users,
                     float *user_offsets, int num_users, float *movies,
                     float *movie_averages, int num_movies, float *residuals,
                     float learn_rate, int feature, int num_features,
                     float k_factor) {
  int p, f;
  float prediction, feature_product;
  float *user_features, *movie_features;
  float *user_features_cursor, *movie_features_cursor;
  float error, user_change, movie_change;
  int *user, *movie, *time, *rating;
  int *train_cursor = train_points;
  for (p = 0; p < num_points; p++) {
    user = train_cursor++;
    movie = train_cursor++;
    time = train_cursor++;
    rating = train_cursor++;
    user_features = users + (*user * num_features);
    movie_features = movies + (*movie * num_features);
    user_features_cursor = user_features;
    movie_features_cursor = movie_features;
    prediction = user_offsets[*user] + movie_averages[*movie];
    feature_product = user_features[feature] * movie_features[feature];
    if (feature == 0) {
      for (f = 0; f < num_features; f++) {
        prediction += *user_features_cursor * *movie_features_cursor;
        if (prediction > 5) {
          prediction = 5;
        } else if (prediction < 1) {
          prediction = 1;
        }
        user_features_cursor++;
        movie_features_cursor++;
      }
    } else {
      prediction = residuals[p];
      prediction += user_features[feature - 1] * movie_features[feature - 1];
      if (prediction > 5) {
        prediction = 5;
      } else if (prediction < 1) {
        prediction = 1;
      }
      prediction += feature_product;
      if (prediction > 5) {
        prediction = 5;
      } else if (prediction < 1) {
        prediction = 1;
      }
    }
    error = ((float)*rating) - prediction;
    user_features_cursor = &user_features[feature];
    movie_features_cursor = &movie_features[feature];
    user_change = learn_rate * (error * *movie_features_cursor -
                                k_factor * *user_features_cursor);
    movie_change = learn_rate * (error * *user_features_cursor -
                                 k_factor * *movie_features_cursor);
    *user_features_cursor += user_change;
    *movie_features_cursor += movie_change;
    user_features_cursor++;
    movie_features_cursor++;
    if (feature < num_features - 1) {
      residuals[p] = prediction - feature_product;
      residuals[p] -= (*(user_features_cursor) * *(movie_features_cursor));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<c_update_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movss  %xmm0,-0x34(%rbp)
movss  %xmm1,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1563 <c_update_feature+0x463>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rax,-0x80(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rax,-0x88(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rax,-0x90(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rax,-0x98(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x80(%rbp),%rcx
mov    (%rcx),%ecx
imul   0x30(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rcx),%ecx
imul   0x30(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x80(%rbp),%rcx
movslq (%rcx),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    0x10(%rbp),%rax
mov    -0x88(%rbp),%rcx
movslq (%rcx),%rcx
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x50(%rbp),%rax
movslq 0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x58(%rbp),%rax
movslq 0x28(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x48(%rbp)
cmpl   $0x0,0x28(%rbp)
jne    130d <c_update_feature+0x20d>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    0x30(%rbp),%eax
jge    1308 <c_update_feature+0x208>
mov    -0x60(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x68(%rbp),%rax
movss  (%rax),%xmm2
movss  -0x44(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm0
movss  0xd5d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    12be <c_update_feature+0x1be>
movss  0xd4c(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    12e2 <c_update_feature+0x1e2>
movss  0xd3e(%rip),%xmm0
ucomiss -0x44(%rbp),%xmm0
jbe    12dd <c_update_feature+0x1dd>
movss  0xd2c(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    12e2 <c_update_feature+0x1e2>
mov    -0x60(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x60(%rbp)
mov    -0x68(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1268 <c_update_feature+0x168>
jmp    1401 <c_update_feature+0x301>
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x50(%rbp),%rax
mov    0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x58(%rbp),%rax
mov    0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x44(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm0
movss  0xc9e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    137d <c_update_feature+0x27d>
movss  0xc8d(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    13a1 <c_update_feature+0x2a1>
movss  0xc7f(%rip),%xmm0
ucomiss -0x44(%rbp),%xmm0
jbe    139c <c_update_feature+0x29c>
movss  0xc6d(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    13a1 <c_update_feature+0x2a1>
movss  -0x48(%rbp),%xmm0
addss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm0
movss  0xc43(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    13d8 <c_update_feature+0x2d8>
movss  0xc32(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    13fc <c_update_feature+0x2fc>
movss  0xc24(%rip),%xmm0
ucomiss -0x44(%rbp),%xmm0
jbe    13f7 <c_update_feature+0x2f7>
movss  0xc12(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    13fc <c_update_feature+0x2fc>
jmp    1401 <c_update_feature+0x301>
mov    -0x98(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
subss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
mov    -0x50(%rbp),%rax
movslq 0x28(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
movslq 0x28(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
movss  -0x34(%rbp),%xmm0
movss  -0x6c(%rbp),%xmm1
mov    -0x68(%rbp),%rax
movss  (%rax),%xmm3
movss  -0x38(%rbp),%xmm2
mov    -0x60(%rbp),%rax
mulss  (%rax),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x34(%rbp),%xmm0
movss  -0x6c(%rbp),%xmm1
mov    -0x60(%rbp),%rax
movss  (%rax),%xmm3
movss  -0x38(%rbp),%xmm2
mov    -0x68(%rbp),%rax
mulss  (%rax),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x70(%rbp),%xmm0
mov    -0x60(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x74(%rbp),%xmm0
mov    -0x68(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x60(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x60(%rbp)
mov    -0x68(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x68(%rbp)
mov    0x28(%rbp),%eax
mov    0x30(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1550 <c_update_feature+0x450>
movss  -0x44(%rbp),%xmm0
subss  -0x48(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x60(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x68(%rbp),%rax
movss  (%rax),%xmm2
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movd   %xmm0,%edx
xor    $0x80000000,%edx
movd   %edx,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    1555 <c_update_feature+0x455>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    114c <c_update_feature+0x4c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_update_feature>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    1365 <c_update_feature+0x265>
mov    0x58(%rsp),%ebp
mov    0x50(%rsp),%eax
movslq %eax,%r15
lea    -0x1(%r15),%eax
cltq
mov    %rax,-0x10(%rsp)
lea    -0x1(%rbp),%eax
mov    %eax,-0x14(%rsp)
mov    %esi,%eax
mov    %rax,-0x8(%rsp)
mov    %ebp,%r14d
and    $0xfffffffe,%r14d
xor    %r12d,%r12d
movslq %ebp,%r13
movss  0xeb5(%rip),%xmm3
movss  0xeb0(%rip),%xmm8
jmp    1173 <c_update_feature+0x73>
cs nopw 0x0(%rax,%rax,1)
add    $0x10,%rdi
add    $0x1,%r12
cmp    -0x8(%rsp),%r12
je     1365 <c_update_feature+0x265>
movslq (%rdi),%r8
mov    %r8,%rax
imul   %r13,%rax
movslq 0x4(%rdi),%rsi
mov    %rsi,%rbp
imul   %r13,%rbp
lea    (%rdx,%rax,4),%r10
lea    (%r9,%rbp,4),%rbx
movss  (%r10,%r15,4),%xmm10
movss  (%rbx,%r15,4),%xmm6
movaps %xmm10,%xmm9
mulss  %xmm6,%xmm9
test   %r15d,%r15d
je     1210 <c_update_feature+0x110>
mov    -0x10(%rsp),%rax
movss  (%r10,%rax,4),%xmm7
mulss  (%rbx,%rax,4),%xmm7
mov    0x48(%rsp),%rax
addss  (%rax,%r12,4),%xmm7
ucomiss %xmm3,%xmm7
movaps %xmm3,%xmm2
ja     11da <c_update_feature+0xda>
ucomiss %xmm7,%xmm8
movaps %xmm7,%xmm2
jbe    11da <c_update_feature+0xda>
movaps %xmm8,%xmm2
addss  %xmm9,%xmm2
ucomiss %xmm3,%xmm2
movaps %xmm3,%xmm7
ja     12d0 <c_update_feature+0x1d0>
ucomiss %xmm2,%xmm8
movaps %xmm2,%xmm7
jbe    12d0 <c_update_feature+0x1d0>
movaps %xmm8,%xmm7
jmp    12d0 <c_update_feature+0x1d0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  (%rcx,%r8,4),%xmm7
mov    0x38(%rsp),%rax
addss  (%rax,%rsi,4),%xmm7
mov    0x58(%rsp),%eax
test   %eax,%eax
jle    12d0 <c_update_feature+0x1d0>
cmp    $0x1,%eax
jne    123c <c_update_feature+0x13c>
mov    %r10,%rax
mov    %rbx,%r11
jmp    12bb <c_update_feature+0x1bb>
mov    %rdx,%rsi
mov    %rcx,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    125d <c_update_feature+0x15d>
nopl   0x0(%rax)
add    $0xfffffffffffffff8,%r8
add    $0x2,%rcx
cmp    %ecx,%r14d
je     12a9 <c_update_feature+0x1a9>
movss  (%r10,%rcx,4),%xmm2
mulss  (%rbx,%rcx,4),%xmm2
addss  %xmm7,%xmm2
ucomiss %xmm3,%xmm2
movaps %xmm3,%xmm7
ja     1281 <c_update_feature+0x181>
ucomiss %xmm2,%xmm8
movaps %xmm2,%xmm7
jbe    1281 <c_update_feature+0x181>
movaps %xmm8,%xmm7
movss  0x4(%r10,%rcx,4),%xmm2
mulss  0x4(%rbx,%rcx,4),%xmm2
addss  %xmm7,%xmm2
ucomiss %xmm3,%xmm2
movaps %xmm3,%xmm7
ja     1250 <c_update_feature+0x150>
ucomiss %xmm2,%xmm8
movaps %xmm2,%xmm7
jbe    1250 <c_update_feature+0x150>
movaps %xmm8,%xmm7
jmp    1250 <c_update_feature+0x150>
mov    %r10,%rax
sub    %r8,%rax
mov    %rbx,%r11
sub    %r8,%r11
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x58(%rsp),%esi
test   $0x1,%sil
jne    1353 <c_update_feature+0x253>
nopl   0x0(%rax)
xorps  %xmm2,%xmm2
cvtsi2ssl 0xc(%rdi),%xmm2
subss  %xmm7,%xmm2
movaps %xmm10,%xmm5
mulss  %xmm1,%xmm5
movaps %xmm2,%xmm4
mulss  %xmm6,%xmm4
subss  %xmm5,%xmm4
mulss  %xmm0,%xmm4
mulss  %xmm1,%xmm6
mulss  %xmm10,%xmm2
subss  %xmm6,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm10,%xmm4
movss  %xmm4,(%r10,%r15,4)
addss  (%rbx,%r15,4),%xmm2
movss  %xmm2,(%rbx,%r15,4)
cmp    %r15d,-0x14(%rsp)
jle    1160 <c_update_feature+0x60>
subss  %xmm9,%xmm7
mov    0x48(%rsp),%rax
movss  %xmm7,(%rax,%r12,4)
movss  0x4(%r10,%r15,4),%xmm2
mulss  0x4(%rbx,%r15,4),%xmm2
subss  %xmm2,%xmm7
movss  %xmm7,(%rax,%r12,4)
jmp    1160 <c_update_feature+0x60>
movss  (%rax),%xmm2
mulss  (%r11),%xmm2
addss  %xmm7,%xmm2
jmp    11df <c_update_feature+0xdf>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @c_update_feature(i32* %0, i32 %1, float* %2, float* %3, i32 %4, float* %5, float* %6, i32 %7, float* %8, float %9, i32 %10, i32 %11, float %12) {
%14 = alloca i32*
%15 = alloca i32
%16 = alloca float*
%17 = alloca float*
%18 = alloca i32
%19 = alloca float*
%20 = alloca float*
%21 = alloca i32
%22 = alloca float*
%23 = alloca float
%24 = alloca i32
%25 = alloca i32
%26 = alloca float
%27 = alloca i32
%28 = alloca i32
%29 = alloca float
%30 = alloca float
%31 = alloca float*
%32 = alloca float*
%33 = alloca float*
%34 = alloca float*
%35 = alloca float
%36 = alloca float
%37 = alloca float
%38 = alloca i32*
%39 = alloca i32*
%40 = alloca i32*
%41 = alloca i32*
%42 = alloca i32*
store i32* %0, i32** %14
store i32 %1, i32* %15
store float* %2, float** %16
store float* %3, float** %17
store i32 %4, i32* %18
store float* %5, float** %19
store float* %6, float** %20
store i32 %7, i32* %21
store float* %8, float** %22
store float %9, float* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store float %12, float* %26
%43 = load i32*, i32** %14
store i32* %43, i32** %42
store i32 0, i32* %27
br label %44
44: ; preds = %241, %13
%45 = load i32, i32* %27
%46 = load i32, i32* %15
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %244
48: ; preds = %44
%49 = load i32*, i32** %42
%50 = getelementptr inbounds i32, i32* %49, i32 1
store i32* %50, i32** %42
store i32* %49, i32** %38
%51 = load i32*, i32** %42
%52 = getelementptr inbounds i32, i32* %51, i32 1
store i32* %52, i32** %42
store i32* %51, i32** %39
%53 = load i32*, i32** %42
%54 = getelementptr inbounds i32, i32* %53, i32 1
store i32* %54, i32** %42
store i32* %53, i32** %40
%55 = load i32*, i32** %42
%56 = getelementptr inbounds i32, i32* %55, i32 1
store i32* %56, i32** %42
store i32* %55, i32** %41
%57 = load float*, float** %16
%58 = load i32*, i32** %38
%59 = load i32, i32* %58
%60 = load i32, i32* %25
%61 = mul nsw i32 %59, %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds float, float* %57, i64 %62
store float* %63, float** %31
%64 = load float*, float** %19
%65 = load i32*, i32** %39
%66 = load i32, i32* %65
%67 = load i32, i32* %25
%68 = mul nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds float, float* %64, i64 %69
store float* %70, float** %32
%71 = load float*, float** %31
store float* %71, float** %33
%72 = load float*, float** %32
store float* %72, float** %34
%73 = load float*, float** %17
%74 = load i32*, i32** %38
%75 = load i32, i32* %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds float, float* %73, i64 %76
%78 = load float, float* %77
%79 = load float*, float** %20
%80 = load i32*, i32** %39
%81 = load i32, i32* %80
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds float, float* %79, i64 %82
%84 = load float, float* %83
%85 = fadd float %78, %84
store float %85, float* %29
%86 = load float*, float** %31
%87 = load i32, i32* %24
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds float, float* %86, i64 %88
%90 = load float, float* %89
%91 = load float*, float** %32
%92 = load i32, i32* %24
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds float, float* %91, i64 %93
%95 = load float, float* %94
%96 = fmul float %90, %95
store float %96, float* %30
%97 = load i32, i32* %24
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %128
99: ; preds = %48
store i32 0, i32* %28
br label %100
100: ; preds = %124, %99
%101 = load i32, i32* %28
%102 = load i32, i32* %25
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %127
104: ; preds = %100
%105 = load float*, float** %33
%106 = load float, float* %105
%107 = load float*, float** %34
%108 = load float, float* %107
%109 = load float, float* %29
%110 = call float @llvm.fmuladd.f32(float %106, float %108, float %109)
store float %110, float* %29
%111 = load float, float* %29
%112 = fcmp ogt float %111, 5.000000e+00
br i1 %112, label %113, label %114
113: ; preds = %104
store float 5.000000e+00, float* %29
br label %119
114: ; preds = %104
%115 = load float, float* %29
%116 = fcmp olt float %115, 1.000000e+00
br i1 %116, label %117, label %118
117: ; preds = %114
store float 1.000000e+00, float* %29
br label %118
118: ; preds = %117, %114
br label %119
119: ; preds = %118, %113
%120 = load float*, float** %33
%121 = getelementptr inbounds float, float* %120, i32 1
store float* %121, float** %33
%122 = load float*, float** %34
%123 = getelementptr inbounds float, float* %122, i32 1
store float* %123, float** %34
br label %124
124: ; preds = %119
%125 = load i32, i32* %28
%126 = add nsw i32 %125, 1
store i32 %126, i32* %28
br label %100
127: ; preds = %100
br label %169
128: ; preds = %48
%129 = load float*, float** %22
%130 = load i32, i32* %27
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds float, float* %129, i64 %131
%133 = load float, float* %132
store float %133, float* %29
%134 = load float*, float** %31
%135 = load i32, i32* %24
%136 = sub nsw i32 %135, 1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds float, float* %134, i64 %137
%139 = load float, float* %138
%140 = load float*, float** %32
%141 = load i32, i32* %24
%142 = sub nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds float, float* %140, i64 %143
%145 = load float, float* %144
%146 = load float, float* %29
%147 = call float @llvm.fmuladd.f32(float %139, float %145, float %146)
store float %147, float* %29
%148 = load float, float* %29
%149 = fcmp ogt float %148, 5.000000e+00
br i1 %149, label %150, label %151
150: ; preds = %128
store float 5.000000e+00, float* %29
br label %156
151: ; preds = %128
%152 = load float, float* %29
%153 = fcmp olt float %152, 1.000000e+00
br i1 %153, label %154, label %155
154: ; preds = %151
store float 1.000000e+00, float* %29
br label %155
155: ; preds = %154, %151
br label %156
156: ; preds = %155, %150
%157 = load float, float* %30
%158 = load float, float* %29
%159 = fadd float %158, %157
store float %159, float* %29
%160 = load float, float* %29
%161 = fcmp ogt float %160, 5.000000e+00
br i1 %161, label %162, label %163
162: ; preds = %156
store float 5.000000e+00, float* %29
br label %168
163: ; preds = %156
%164 = load float, float* %29
%165 = fcmp olt float %164, 1.000000e+00
br i1 %165, label %166, label %167
166: ; preds = %163
store float 1.000000e+00, float* %29
br label %167
167: ; preds = %166, %163
br label %168
168: ; preds = %167, %162
br label %169
169: ; preds = %168, %127
%170 = load i32*, i32** %41
%171 = load i32, i32* %170
%172 = sitofp i32 %171 to float
%173 = load float, float* %29
%174 = fsub float %172, %173
store float %174, float* %35
%175 = load float*, float** %31
%176 = load i32, i32* %24
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds float, float* %175, i64 %177
store float* %178, float** %33
%179 = load float*, float** %32
%180 = load i32, i32* %24
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds float, float* %179, i64 %181
store float* %182, float** %34
%183 = load float, float* %23
%184 = load float, float* %35
%185 = load float*, float** %34
%186 = load float, float* %185
%187 = load float, float* %26
%188 = load float*, float** %33
%189 = load float, float* %188
%190 = fmul float %187, %189
%191 = fneg float %190
%192 = call float @llvm.fmuladd.f32(float %184, float %186, float %191)
%193 = fmul float %183, %192
store float %193, float* %36
%194 = load float, float* %23
%195 = load float, float* %35
%196 = load float*, float** %33
%197 = load float, float* %196
%198 = load float, float* %26
%199 = load float*, float** %34
%200 = load float, float* %199
%201 = fmul float %198, %200
%202 = fneg float %201
%203 = call float @llvm.fmuladd.f32(float %195, float %197, float %202)
%204 = fmul float %194, %203
store float %204, float* %37
%205 = load float, float* %36
%206 = load float*, float** %33
%207 = load float, float* %206
%208 = fadd float %207, %205
store float %208, float* %206
%209 = load float, float* %37
%210 = load float*, float** %34
%211 = load float, float* %210
%212 = fadd float %211, %209
store float %212, float* %210
%213 = load float*, float** %33
%214 = getelementptr inbounds float, float* %213, i32 1
store float* %214, float** %33
%215 = load float*, float** %34
%216 = getelementptr inbounds float, float* %215, i32 1
store float* %216, float** %34
%217 = load i32, i32* %24
%218 = load i32, i32* %25
%219 = sub nsw i32 %218, 1
%220 = icmp slt i32 %217, %219
br i1 %220, label %221, label %240
221: ; preds = %169
%222 = load float, float* %29
%223 = load float, float* %30
%224 = fsub float %222, %223
%225 = load float*, float** %22
%226 = load i32, i32* %27
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds float, float* %225, i64 %227
store float %224, float* %228
%229 = load float*, float** %33
%230 = load float, float* %229
%231 = load float*, float** %34
%232 = load float, float* %231
%233 = load float*, float** %22
%234 = load i32, i32* %27
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds float, float* %233, i64 %235
%237 = load float, float* %236
%238 = fneg float %230
%239 = call float @llvm.fmuladd.f32(float %238, float %232, float %237)
store float %239, float* %236
br label %240
240: ; preds = %221, %169
br label %241
241: ; preds = %240
%242 = load i32, i32* %27
%243 = add nsw i32 %242, 1
store i32 %243, i32* %27
br label %44
244: ; preds = %44
ret i32 0
}

LLVM IR (-O2):
define i32 @c_update_feature(i32* nocapture %0, i32 %1, float* nocapture %2, float* nocapture %3, i32 %4, float* nocapture %5, float* nocapture %6, i32 %7, float* nocapture %8, float %9, i32 %10, i32 %11, float %12) {
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %145
15: ; preds = %13
%16 = sext i32 %10 to i64
%17 = icmp eq i32 %10, 0
%18 = add nsw i32 %10, -1
%19 = sext i32 %18 to i64
%20 = icmp sgt i32 %11, 0
%21 = add nsw i32 %11, -1
%22 = icmp sgt i32 %21, %10
%23 = zext i32 %1 to i64
%24 = and i32 %11, 1
%25 = icmp eq i32 %11, 1
%26 = and i32 %11, -2
%27 = icmp eq i32 %24, 0
br label %28
28: ; preds = %15, %142
%29 = phi i64 [ 0, %15 ], [ %143, %142 ]
%30 = phi i32* [ %0, %15 ], [ %33, %142 ]
%31 = getelementptr inbounds i32, i32* %30, i64 1
%32 = getelementptr inbounds i32, i32* %30, i64 3
%33 = getelementptr inbounds i32, i32* %30, i64 4
%34 = load i32, i32* %30
%35 = mul nsw i32 %34, %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %2, i64 %36
%38 = load i32, i32* %31
%39 = mul nsw i32 %38, %11
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds float, float* %5, i64 %40
%42 = getelementptr inbounds float, float* %37, i64 %16
%43 = load float, float* %42
%44 = getelementptr inbounds float, float* %41, i64 %16
%45 = load float, float* %44
%46 = fmul float %43, %45
br i1 %17, label %47, label %85
47: ; preds = %28
%48 = sext i32 %34 to i64
%49 = getelementptr inbounds float, float* %3, i64 %48
%50 = load float, float* %49
%51 = sext i32 %38 to i64
%52 = getelementptr inbounds float, float* %6, i64 %51
%53 = load float, float* %52
%54 = fadd float %50, %53
br i1 %20, label %55, label %117
55: ; preds = %47
br i1 %25, label %104, label %56
56: ; preds = %55, %79
%57 = phi float [ %80, %79 ], [ %54, %55 ]
%58 = phi float* [ %81, %79 ], [ %37, %55 ]
%59 = phi float* [ %82, %79 ], [ %41, %55 ]
%60 = phi i32 [ %83, %79 ], [ 0, %55 ]
%61 = load float, float* %58
%62 = load float, float* %59
%63 = tail call float @llvm.fmuladd.f32(float %61, float %62, float %57)
%64 = fcmp ogt float %63, 5.000000e+00
br i1 %64, label %68, label %65
65: ; preds = %56
%66 = fcmp olt float %63, 1.000000e+00
br i1 %66, label %67, label %68
67: ; preds = %65
br label %68
68: ; preds = %56, %65, %67
%69 = phi float [ 1.000000e+00, %67 ], [ %63, %65 ], [ 5.000000e+00, %56 ]
%70 = getelementptr inbounds float, float* %58, i64 1
%71 = getelementptr inbounds float, float* %59, i64 1
%72 = load float, float* %70
%73 = load float, float* %71
%74 = tail call float @llvm.fmuladd.f32(float %72, float %73, float %69)
%75 = fcmp ogt float %74, 5.000000e+00
br i1 %75, label %79, label %76
76: ; preds = %68
%77 = fcmp olt float %74, 1.000000e+00
br i1 %77, label %78, label %79
78: ; preds = %76
br label %79
79: ; preds = %78, %76, %68
%80 = phi float [ 1.000000e+00, %78 ], [ %74, %76 ], [ 5.000000e+00, %68 ]
%81 = getelementptr inbounds float, float* %58, i64 2
%82 = getelementptr inbounds float, float* %59, i64 2
%83 = add i32 %60, 2
%84 = icmp eq i32 %83, %26
br i1 %84, label %104, label %56
85: ; preds = %28
%86 = getelementptr inbounds float, float* %8, i64 %29
%87 = load float, float* %86
%88 = getelementptr inbounds float, float* %37, i64 %19
%89 = load float, float* %88
%90 = getelementptr inbounds float, float* %41, i64 %19
%91 = load float, float* %90
%92 = tail call float @llvm.fmuladd.f32(float %89, float %91, float %87)
%93 = fcmp ogt float %92, 5.000000e+00
br i1 %93, label %97, label %94
94: ; preds = %85
%95 = fcmp olt float %92, 1.000000e+00
br i1 %95, label %96, label %97
96: ; preds = %94
br label %97
97: ; preds = %85, %94, %96
%98 = phi float [ 1.000000e+00, %96 ], [ %92, %94 ], [ 5.000000e+00, %85 ]
%99 = fadd float %46, %98
%100 = fcmp ogt float %99, 5.000000e+00
br i1 %100, label %117, label %101
101: ; preds = %97
%102 = fcmp olt float %99, 1.000000e+00
br i1 %102, label %103, label %117
103: ; preds = %101
br label %117
104: ; preds = %79, %55
%105 = phi float [ undef, %55 ], [ %80, %79 ]
%106 = phi float [ %54, %55 ], [ %80, %79 ]
%107 = phi float* [ %37, %55 ], [ %81, %79 ]
%108 = phi float* [ %41, %55 ], [ %82, %79 ]
br i1 %27, label %117, label %109
109: ; preds = %104
%110 = load float, float* %107
%111 = load float, float* %108
%112 = tail call float @llvm.fmuladd.f32(float %110, float %111, float %106)
%113 = fcmp ogt float %112, 5.000000e+00
br i1 %113, label %117, label %114
114: ; preds = %109
%115 = fcmp olt float %112, 1.000000e+00
br i1 %115, label %116, label %117
116: ; preds = %114
br label %117
117: ; preds = %104, %116, %114, %109, %47, %97, %103, %101
%118 = phi float [ 1.000000e+00, %103 ], [ %99, %101 ], [ 5.000000e+00, %97 ], [ %54, %47 ], [ %105, %104 ], [ 1.000000e+00, %116 ], [ %112, %114 ], [ 5.000000e+00, %109 ]
%119 = load i32, i32* %32
%120 = sitofp i32 %119 to float
%121 = fsub float %120, %118
%122 = fneg float %43
%123 = fmul float %122, %12
%124 = tail call float @llvm.fmuladd.f32(float %121, float %45, float %123)
%125 = fmul float %124, %9
%126 = fneg float %45
%127 = fmul float %126, %12
%128 = tail call float @llvm.fmuladd.f32(float %121, float %43, float %127)
%129 = fmul float %128, %9
%130 = fadd float %43, %125
store float %130, float* %42
%131 = load float, float* %44
%132 = fadd float %131, %129
store float %132, float* %44
br i1 %22, label %133, label %142
133: ; preds = %117
%134 = getelementptr inbounds float, float* %44, i64 1
%135 = getelementptr inbounds float, float* %42, i64 1
%136 = fsub float %118, %46
%137 = getelementptr inbounds float, float* %8, i64 %29
store float %136, float* %137
%138 = load float, float* %135
%139 = load float, float* %134
%140 = fneg float %138
%141 = tail call float @llvm.fmuladd.f32(float %140, float %139, float %136)
store float %141, float* %137
br label %142
142: ; preds = %117, %133
%143 = add nuw nsw i64 %29, 1
%144 = icmp eq i64 %143, %23
br i1 %144, label %145, label %28
145: ; preds = %142, %13
ret i32 0
}