user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<update2>:
  endbr64
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x18,%rsp
  mov    (%rcx),%eax
  movss  %xmm0,0xc(%rsp)
  lea    0x4(,%rax,4),%edi
  call   <malloc@plt>
  movss  0xc(%rsp),%xmm2
  movl   $0x0,(%rax)
  mov    0x0(%r13),%ecx
  mov    %rax,%rdi
  test   %ecx,%ecx
  jle    L274
  mov    $0x1,%eax
L95:
  movswl 0x2(%r13,%rax,4),%edx
  mov    %edx,(%rdi,%rax,4)
  andl   $0xffff,0x0(%r13,%rax,4)
  mov    0x0(%r13),%ecx
  add    $0x1,%rax
  cmp    %eax,%ecx
  jge    L95
L274:
  mov    0x4(%r13),%r8d
  cmp    $0x3,%r8d
  je     L316
  mov    $0x1,%esi
  mov    $0x4,%r9d
  mov    $0x1,%eax
  pxor   %xmm3,%xmm3
L435:
  lea    0x0(,%rax,4),%rdx
  test   %r8d,%r8d
  je     L355
L376:
  mov    %r8d,%r10d
  and    $0x1,%r10d
  jne    L430
  test   $0x2,%r8b
  jne    L127
  mov    %rdx,%r9
  lea    0x0(,%rax,4),%rdx
  test   %r8d,%r8d
  jne    L376
L355:
  lea    0x4(%rdx),%r9
  xchg   %ax,%ax
L64:
  mov    $0xfc,%eax
  nopl   (%rax)
L44:
  movss  (%r12,%rax,1),%xmm0
  addss  0x0(%rbp,%rax,1),%xmm0
  movss  %xmm0,(%rbx,%rax,1)
  sub    $0x4,%rax
  cmp    $0xfffffffffffffffc,%rax
  jne    L44
  mov    0x0(%r13,%r9,1),%r8d
  add    $0x1,%esi
  lea    0x4(%r9),%rax
  add    $0x100,%r12
  add    $0x100,%rbp
  add    $0x100,%rbx
  test   %r8d,%r8d
  jne    L438
  mov    %rax,%r9
  jmp    L64
L430:
  mov    (%rdi,%r9,1),%r9d
  test   $0x80,%r8b
  jne    L401
  movss  0x16c(%rbp),%xmm0
  and    $0x40,%r8d
  addss  %xmm3,%xmm0
  cvttss2si %xmm0,%eax
  je     L290
  cmp    $0x1,%r9d
  jle    L97
  lea    -0x2(%r9),%r8d
  lea    0x174(%rbp),%rdx
  shl    $0x8,%r8
  lea    0x274(%rbp,%r8,1),%r8
L142:
  pxor   %xmm0,%xmm0
  add    $0x100,%rdx
  cvtsi2ss %eax,%xmm0
  addss  -0x100(%rdx),%xmm0
  cvttss2si %xmm0,%eax
  cmp    %rdx,%r8
  jne    L142
L97:
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  lea    0x1(%rsi),%r10d
  cltd
  idiv   %r9d
  movslq %r10d,%r10
  lea    0xdc(%rbx),%rdx
  cvtsi2ss %eax,%xmm0
  mulss  %xmm2,%xmm0
  cvttss2si %xmm0,%eax
  cvtsi2ss %eax,%xmm1
  nopl   0x0(%rax)
L116:
  mov    $0xfc,%eax
  nopl   (%rax)
L148:
  movss  0x0(%rbp,%rax,1),%xmm0
  movss  %xmm0,(%rbx,%rax,1)
  sub    $0x4,%rax
  cmp    $0xfffffffffffffffc,%rax
  jne    L148
  movss  0x5c(%rbx),%xmm0
  lea    0x80(%rbx),%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,0x5c(%rbx)
  nopw   0x0(%rax,%rax,1)
L248:
  movss  (%rax),%xmm0
  add    $0x4,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rax)
  cmp    %rax,%rdx
  jne    L248
  mov    0x0(%r13,%r10,4),%r8d
  mov    %r10d,%esi
  lea    0x0(,%r10,4),%r9
  add    $0x100,%rbp
  add    $0x100,%rbx
  add    $0x1,%r10
  add    $0x100,%rdx
  cmp    $0x3,%r8d
  je     L316
  test   $0x1,%r8b
  jne    L116
L438:
  cmp    $0x3,%r8d
  je     L316
  movslq %esi,%rax
  jmp    L435
L127:
  mov    (%rdi,%r9,1),%r9d
  test   $0x80,%r8b
  jne    L41
  movss  0x16c(%r12),%xmm0
  and    $0x40,%r8d
  addss  %xmm3,%xmm0
  cvttss2si %xmm0,%eax
  je     L184
  cmp    $0x1,%r9d
  jle    L86
  lea    -0x2(%r9),%r8d
  lea    0x174(%r12),%rdx
  shl    $0x8,%r8
  lea    0x274(%r12,%r8,1),%r8
L171:
  pxor   %xmm0,%xmm0
  add    $0x100,%rdx
  cvtsi2ss %eax,%xmm0
  addss  -0x100(%rdx),%xmm0
  cvttss2si %xmm0,%eax
  cmp    %rdx,%r8
  jne    L171
L86:
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  lea    0x1(%rsi),%r10d
  cltd
  idiv   %r9d
  movslq %r10d,%r10
  lea    0xdc(%rbx),%rdx
  cvtsi2ss %eax,%xmm0
  mulss  %xmm2,%xmm0
  cvttss2si %xmm0,%eax
  cvtsi2ss %eax,%xmm1
L143:
  mov    $0xfc,%eax
  nopl   0x0(%rax)
L232:
  movss  (%r12,%rax,1),%xmm0
  movss  %xmm0,(%rbx,%rax,1)
  sub    $0x4,%rax
  cmp    $0xfffffffffffffffc,%rax
  jne    L232
  movss  0x5c(%rbx),%xmm0
  lea    0x80(%rbx),%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,0x5c(%rbx)
  nopw   0x0(%rax,%rax,1)
L307:
  movss  (%rax),%xmm0
  add    $0x4,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rax)
  cmp    %rax,%rdx
  jne    L307
  mov    0x0(%r13,%r10,4),%r8d
  mov    %r10d,%esi
  lea    0x0(,%r10,4),%r9
  add    $0x100,%r12
  add    $0x100,%rbx
  add    $0x1,%r10
  add    $0x100,%rdx
  test   $0x2,%r8b
  je     L438
  cmp    $0x3,%r8d
  jne    L143
L316:
  mov    $0xfc,%eax
  nopl   0x0(%rax,%rax,1)
L226:
  movss  (%r12,%rax,1),%xmm0
  addss  0x0(%rbp,%rax,1),%xmm0
  movss  %xmm0,(%rbx,%rax,1)
  sub    $0x4,%rax
  cmp    $0xfffffffffffffffc,%rax
  jne    L226
  mov    %ecx,%eax
  shl    $0x6,%eax
  cltq
  shl    $0x2,%rax
  sub    %rax,%rbx
  call   <free@plt>
  add    $0x18,%rsp
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L290:
  lea    -0x1(%r9),%r8d
  cmp    $0x1,%r8d
  jle    L369
  lea    -0x3(%r9),%r10d
  lea    0x170(%rbp),%rdx
  shl    $0x8,%r10
  lea    0x270(%rbp,%r10,1),%r10
L31:
  pxor   %xmm0,%xmm0
  add    $0x100,%rdx
  cvtsi2ss %eax,%xmm0
  addss  -0x100(%rdx),%xmm0
  cvttss2si %xmm0,%eax
  cmp    %rdx,%r10
  jne    L31
  mov    %r8d,%edx
  shl    $0x6,%edx
  add    $0x1b,%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
L330:
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  addss  0x0(%rbp,%rdx,1),%xmm0
  cvttss2si %xmm0,%eax
  jmp    L97
L184:
  lea    -0x1(%r9),%r8d
  cmp    $0x1,%r8d
  jle    L174
  lea    -0x3(%r9),%r10d
  lea    0x170(%r12),%rdx
  shl    $0x8,%r10
  lea    0x270(%r12,%r10,1),%r10
L73:
  pxor   %xmm0,%xmm0
  add    $0x100,%rdx
  cvtsi2ss %eax,%xmm0
  addss  -0x100(%rdx),%xmm0
  cvttss2si %xmm0,%eax
  cmp    %rdx,%r10
  jne    L73
  mov    %r8d,%edx
  shl    $0x6,%edx
  add    $0x1b,%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
L434:
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  addss  (%r12,%rdx,1),%xmm0
  cvttss2si %xmm0,%eax
  jmp    L86
L401:
  lea    -0x1(%r9),%edx
  test   %edx,%edx
  jle    L112
  lea    -0x2(%r9),%r8d
  lea    0x74(%rbp),%rax
  shl    $0x8,%r8
  lea    0x174(%rbp,%r8,1),%r10
  xor    %r8d,%r8d
L384:
  pxor   %xmm0,%xmm0
  add    $0x100,%rax
  cvtsi2ss %r8d,%xmm0
  addss  -0x100(%rax),%xmm0
  cvttss2si %xmm0,%r8d
  cmp    %rax,%r10
  jne    L384
  pxor   %xmm0,%xmm0
  mov    %edx,%eax
  shl    $0x6,%eax
  cvtsi2ss %r8d,%xmm0
  add    $0x1b,%eax
  cltq
  shl    $0x2,%rax
L8:
  addss  0x0(%rbp,%rax,1),%xmm0
  cvttss2si %xmm0,%eax
  jmp    L97
L41:
  lea    -0x1(%r9),%eax
  test   %eax,%eax
  jle    L82
  lea    -0x2(%r9),%r8d
  lea    0x74(%r12),%rdx
  shl    $0x8,%r8
  lea    0x174(%r12,%r8,1),%r8
L177:
  pxor   %xmm0,%xmm0
  add    $0x100,%rdx
  cvtsi2ss %r10d,%xmm0
  addss  -0x100(%rdx),%xmm0
  cvttss2si %xmm0,%r10d
  cmp    %rdx,%r8
  jne    L177
  pxor   %xmm0,%xmm0
  shl    $0x6,%eax
  cvtsi2ss %r10d,%xmm0
  add    $0x1b,%eax
  cltq
  shl    $0x2,%rax
L197:
  addss  (%r12,%rax,1),%xmm0
  cvttss2si %xmm0,%eax
  jmp    L86
L369:
  mov    $0x16c,%edx
  jmp    L330
L82:
  mov    $0x6c,%eax
  movaps %xmm3,%xmm0
  jmp    L197
L174:
  mov    $0x16c,%edx
  jmp    L434
L112:
  mov    $0x6c,%eax
  movaps %xmm3,%xmm0
  jmp    L8
```

assistant: ```c
float *update2(const float *profa, const float *profb, float *newp, int *path, int sipa, int sipb, float internal_gap_weight) {
  int i, c;
  int *gap_len = 0;
  int gap_cost = 0;
  gap_len = malloc(sizeof(int) * (path[0] + 1));
  gap_len[0] = 0;
  for (i = 1; i <= path[0]; i++) {
    gap_len[i] = (path[i] >> 16);
    path[i] = path[i] & 0x0000ffff;
  }
  c = 1;
  while (path[c] != 3) {
    gap_cost = 0;
    if (!path[c]) {
      while (!path[c] && path[c] != 3) {
        for (i = 64; i--;) {
          newp[i] = profa[i] + profb[i];
        }
        profa += 64;
        profb += 64;
        newp += 64;
        c++;
      }
    } else if (path[c] & 1) {
      if (path[c] & 128) {
        for (i = 0; i < gap_len[c] - 1; i++) {
          gap_cost += profb[29 + 64 * i];
        }
        gap_cost += profb[27 + 64 * i];
      } else if (path[c] & 64) {
        gap_cost += profb[27 + 64];
        for (i = 1; i < gap_len[c]; i++) {
          gap_cost += profb[29 + 64 * i];
        }
      } else {
        gap_cost += profb[27 + 64];
        for (i = 1; i < gap_len[c] - 1; i++) {
          gap_cost += profb[28 + 64 * i];
        }
        gap_cost += profb[27 + 64 * i];
      }
      gap_cost /= gap_len[c];
      gap_cost *= internal_gap_weight;
      while (path[c] & 1 && path[c] != 3) {
        for (i = 64; i--;) {
          newp[i] = profb[i];
        }
        newp[23] += gap_cost;
        for (i = 32; i < 55; i++) {
          newp[i] += gap_cost;
        }
        profb += 64;
        newp += 64;
        c++;
      }
    } else if (path[c] & 2) {
      if (path[c] & 128) {
        for (i = 0; i < gap_len[c] - 1; i++) {
          gap_cost += profa[29 + 64 * i];
        }
        gap_cost += profa[27 + 64 * i];
      } else if (path[c] & 64) {
        gap_cost += profa[27 + 64];
        for (i = 1; i < gap_len[c]; i++) {
          gap_cost += profa[29 + 64 * i];
        }
      } else {
        gap_cost += profa[27 + 64];
        for (i = 1; i < gap_len[c] - 1; i++) {
          gap_cost += profa[28 + 64 * i];
        }
        gap_cost += profa[27 + 64 * i];
      }
      gap_cost /= gap_len[c];
      gap_cost *= internal_gap_weight;
      while (path[c] & 2 && path[c] != 3) {
        for (i = 64; i--;) {
          newp[i] = profa[i];
        }
        newp[23] += gap_cost;
        for (i = 32; i < 55; i++) {
          newp[i] += gap_cost;
        }
        profa += 64;
        newp += 64;
        c++;
      }
    }
  }
  for (i = 64; i--;) {
    newp[i] = profa[i] + profb[i];
  }
  newp -= path[0] * 64;
  free(gap_len);
  return newp;
}
```