user: Converte this assembly snippet into its equivalent C code:

```asm
<update2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8d,-0x44(%rbp)
  mov    %r9d,-0x48(%rbp)
  movss  %xmm0,-0x4c(%rbp)
  movq   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movl   $0x0,(%rax)
  movl   $0x1,-0x14(%rbp)
  jmp    L416
L96:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  sar    $0x10,%edx
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x40(%rbp),%rdx
  add    %rcx,%rdx
  movzwl %ax,%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x14(%rbp)
L416:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L96
  movl   $0x1,-0x10(%rbp)
  jmp    L432
L262:
  movl   $0x0,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L218
  jmp    L210
L420:
  movl   $0x40,-0x14(%rbp)
  jmp    L27
L22:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
L27:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  test   %eax,%eax
  jne    L22
  addq   $0x100,-0x28(%rbp)
  addq   $0x100,-0x30(%rbp)
  addq   $0x100,-0x38(%rbp)
  addl   $0x1,-0x10(%rbp)
L210:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L432
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  jne    L420
  jmp    L432
L218:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L130
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x80,%eax
  test   %eax,%eax
  je     L12
  movl   $0x0,-0x14(%rbp)
  jmp    L348
L314:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1d,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L348:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L314
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1b,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L268
L12:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L466
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x16c,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L209
L140:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1d,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L209:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L140
  jmp    L268
L466:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x16c,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L490
L346:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1c,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L490:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L346
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1b,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
L268:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%esi
  mov    -0xc(%rbp),%eax
  cltd
  idiv   %esi
  mov    %eax,-0xc(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0xc(%rbp),%xmm0
  mulss  -0x4c(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L190
L399:
  movl   $0x40,-0x14(%rbp)
  jmp    L487
L290:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
L487:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  test   %eax,%eax
  jne    L290
  mov    -0x38(%rbp),%rax
  add    $0x5c,%rax
  movss  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0xc(%rbp),%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x5c,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  movl   $0x20,-0x14(%rbp)
  jmp    L277
L240:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0xc(%rbp),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L277:
  cmpl   $0x36,-0x14(%rbp)
  jle    L240
  addq   $0x100,-0x30(%rbp)
  addq   $0x100,-0x38(%rbp)
  addl   $0x1,-0x10(%rbp)
L190:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L432
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  jne    L399
  jmp    L432
L130:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L432
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x80,%eax
  test   %eax,%eax
  je     L86
  movl   $0x0,-0x14(%rbp)
  jmp    L9
L185:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1d,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L9:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L185
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1b,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L406
L86:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L368
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x16c,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L32
L266:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1d,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L32:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L266
  jmp    L406
L368:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x16c,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L395
L158:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1c,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L395:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L158
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  add    $0x1b,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
L406:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%esi
  mov    -0xc(%rbp),%eax
  cltd
  idiv   %esi
  mov    %eax,-0xc(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0xc(%rbp),%xmm0
  mulss  -0x4c(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L115
L456:
  movl   $0x40,-0x14(%rbp)
  jmp    L228
L369:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
L228:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  test   %eax,%eax
  jne    L369
  mov    -0x38(%rbp),%rax
  add    $0x5c,%rax
  movss  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0xc(%rbp),%xmm0
  mov    -0x38(%rbp),%rax
  add    $0x5c,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  movl   $0x20,-0x14(%rbp)
  jmp    L335
L404:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0xc(%rbp),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L335:
  cmpl   $0x36,-0x14(%rbp)
  jle    L404
  addq   $0x100,-0x28(%rbp)
  addq   $0x100,-0x38(%rbp)
  addl   $0x1,-0x10(%rbp)
L115:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L432
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  jne    L456
L432:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  jne    L262
  movl   $0x40,-0x14(%rbp)
  jmp    L31
L136:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
L31:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  test   %eax,%eax
  jne    L136
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  shl    $0x6,%eax
  cltq
  shl    $0x2,%rax
  neg    %rax
  add    %rax,-0x38(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  leave
  ret
```

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;
}
```