user: Translate the below assembly code into C programming language:

```asm
<dwt_encode_97>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r12d
  mov    %edx,%ebp
  test   %ecx,%ecx
  jne    L115
  test   %esi,%esi
  jg     L609
  cmp    $0x1,%edx
  jg     L609
L492:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L609:
  test   %r12d,%r12d
  jle    L214
  lea    -0x2(%rbp,%rbp,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    $0x1,%r14d
  mov    $0x1,%r13d
  jmp    L852
L910:
  mov    (%rbx),%eax
  cmp    $0xffffffff,%edx
  jge    L51
  lea    (%rax,%rax,1),%edi
  mov    $0x32c1,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  sub    %edx,(%rbx,%rax,4)
  jmp    L342
L901:
  lea    -0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%eax
  jmp    L51
L907:
  lea    0x0(%r13,%r13,1),%edx
  movslq %edx,%rdx
  mov    (%rbx,%rdx,4),%edi
L391:
  add    %eax,%edi
  mov    $0x32c1,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  sub    %edx,(%rbx,%rax,4)
  cmp    0xc(%rsp),%r12d
  jle    L214
L342:
  add    $0x1,%r13d
  add    $0x2,%r14d
L852:
  mov    %r13d,%edx
  sub    $0x1,%edx
  js     L910
  cmp    %edx,%ebp
  jg     L901
  mov    (%r15),%eax
L51:
  mov    %r13d,0xc(%rsp)
  cmp    %r13d,%ebp
  jg     L907
  mov    (%r15),%edi
  jmp    L391
L214:
  test   %ebp,%ebp
  jle    L221
  lea    -0x1(%r12,%r12,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  jmp    L322
L138:
  mov    0x4(%rbx),%edi
  jns    L401
  add    %edi,%edi
  mov    $0x1b2,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  sub    %edx,(%rbx,%rax,4)
  jmp    L202
L579:
  lea    -0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%edi
L401:
  cmp    %edx,%r12d
  jle    L267
  lea    0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%eax
L984:
  add    %eax,%edi
  mov    $0x1b2,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  sub    %edx,(%rbx,%rax,4)
  lea    0x1(%r13),%eax
  cmp    %eax,%ebp
  jle    L950
L202:
  add    $0x1,%r13d
  add    $0x2,%r14d
L322:
  mov    %r13d,%edx
  test   %r13d,%r13d
  jle    L138
  cmp    %r13d,%r12d
  jge    L579
  mov    (%r15),%edi
L267:
  mov    (%r15),%eax
  jmp    L984
L221:
  test   %r12d,%r12d
  jg     L183
L879:
  test   %ebp,%ebp
  jle    L410
L903:
  lea    -0x1(%r12,%r12,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  jmp    L682
L42:
  mov    (%rbx),%eax
  cmp    $0xffffffff,%edx
  jge    L134
  lea    (%rax,%rax,1),%edi
  mov    $0x1c41,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  add    %edx,(%rbx,%rax,4)
  jmp    L50
L719:
  lea    -0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%eax
  jmp    L134
L30:
  lea    0x0(%r13,%r13,1),%edx
  movslq %edx,%rdx
  mov    (%rbx,%rdx,4),%edi
L663:
  add    %eax,%edi
  mov    $0x1c41,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  add    %edx,(%rbx,%rax,4)
  cmp    0xc(%rsp),%r12d
  jle    L879
L50:
  add    $0x1,%r13d
  add    $0x2,%r14d
L415:
  mov    %r13d,%edx
  sub    $0x1,%edx
  js     L42
  cmp    %edx,%ebp
  jg     L719
  mov    (%r15),%eax
L134:
  mov    %r13d,0xc(%rsp)
  cmp    %r13d,%ebp
  jg     L30
  mov    (%r15),%edi
  jmp    L663
L669:
  mov    0x4(%rbx),%edi
  jns    L384
  add    %edi,%edi
  mov    $0xe31,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  add    %edx,(%rbx,%rax,4)
  jmp    L207
L125:
  lea    -0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%edi
L384:
  cmp    %edx,%r12d
  jle    L881
  lea    0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%eax
L114:
  add    %eax,%edi
  mov    $0xe31,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  add    %edx,(%rbx,%rax,4)
  lea    0x1(%r13),%eax
  cmp    %eax,%ebp
  jle    L288
L207:
  add    $0x1,%r13d
  add    $0x2,%r14d
L682:
  mov    %r13d,%edx
  test   %r13d,%r13d
  jle    L669
  cmp    %r13d,%r12d
  jge    L125
  mov    (%r15),%edi
L881:
  mov    (%r15),%eax
  jmp    L114
L115:
  test   %edx,%edx
  jg     L565
  cmp    $0x1,%esi
  jle    L492
L565:
  test   %r12d,%r12d
  jle    L152
  lea    -0x1(%rbp,%rbp,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    %r12d,%r14d
  mov    $0x0,%r13d
  jmp    L742
L181:
  mov    0x4(%rbx),%edx
L843:
  mov    0x4(%rbx),%edi
  jmp    L560
L802:
  lea    0x1(%r13,%r13,1),%edx
  movslq %edx,%rdx
  mov    (%rbx,%rdx,4),%edx
  jmp    L848
L254:
  lea    -0x1(%r13,%r13,1),%eax
  cltq
  mov    (%rbx,%rax,4),%edi
L560:
  add    %edx,%edi
  mov    $0x32c1,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  sub    %eax,(%rbx,%r13,8)
  add    $0x1,%r13
  cmp    %r14,%r13
  je     L112
L742:
  mov    %r13d,%eax
  test   %r13d,%r13d
  js     L181
  cmp    %r13d,%ebp
  jg     L802
  mov    (%r15),%edx
L848:
  test   %eax,%eax
  je     L843
  cmp    %eax,%ebp
  jge    L254
  mov    (%r15),%edi
  jmp    L560
L642:
  mov    (%rbx),%eax
  cmp    $0xffffffff,%edx
  jge    L280
  lea    (%rax,%rax,1),%edi
  mov    $0x1b2,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  sub    %edx,(%rbx,%rax,4)
  jmp    L914
L159:
  lea    -0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%eax
  jmp    L280
L301:
  lea    0x0(%r13,%r13,1),%edx
  movslq %edx,%rdx
  mov    (%rbx,%rdx,4),%edi
L649:
  add    %eax,%edi
  mov    $0x1b2,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  sub    %edx,(%rbx,%rax,4)
  cmp    0xc(%rsp),%ebp
  jle    L350
L914:
  add    $0x1,%r13d
  add    $0x2,%r14d
L364:
  mov    %r13d,%edx
  sub    $0x1,%edx
  js     L642
  cmp    %edx,%r12d
  jg     L159
  mov    (%r15),%eax
L280:
  mov    %r13d,0xc(%rsp)
  cmp    %r13d,%r12d
  jg     L301
  mov    (%r15),%edi
  jmp    L649
L350:
  test   %r12d,%r12d
  jle    L12
L333:
  lea    -0x1(%rbp,%rbp,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    %r12d,%r14d
  mov    $0x0,%r13d
  jmp    L92
L397:
  mov    0x4(%rbx),%edx
L22:
  mov    0x4(%rbx),%edi
  jmp    L607
L738:
  lea    0x1(%r13,%r13,1),%edx
  movslq %edx,%rdx
  mov    (%rbx,%rdx,4),%edx
  jmp    L980
L311:
  lea    -0x1(%r13,%r13,1),%eax
  cltq
  mov    (%rbx,%rax,4),%edi
L607:
  add    %edx,%edi
  mov    $0x1c41,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  add    %eax,(%rbx,%r13,8)
  add    $0x1,%r13
  cmp    %r14,%r13
  je     L12
L92:
  mov    %r13d,%eax
  test   %r13d,%r13d
  js     L397
  cmp    %r13d,%ebp
  jg     L738
  mov    (%r15),%edx
L980:
  test   %eax,%eax
  je     L22
  cmp    %eax,%ebp
  jge    L311
  mov    (%r15),%edi
  jmp    L607
L247:
  mov    (%rbx),%eax
  cmp    $0xffffffff,%edx
  jge    L894
  lea    (%rax,%rax,1),%edi
  mov    $0xe31,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  add    %edx,(%rbx,%rax,4)
  jmp    L483
L349:
  lea    -0x1(%r14),%eax
  cltq
  mov    (%rbx,%rax,4),%eax
  jmp    L894
L918:
  lea    0x0(%r13,%r13,1),%edx
  movslq %edx,%rdx
  mov    (%rbx,%rdx,4),%edi
L751:
  add    %eax,%edi
  mov    $0xe31,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,%edx
  movslq %r14d,%rax
  add    %edx,(%rbx,%rax,4)
  cmp    0xc(%rsp),%ebp
  jle    L487
L483:
  add    $0x1,%r13d
  add    $0x2,%r14d
L360:
  mov    %r13d,%edx
  sub    $0x1,%edx
  js     L247
  cmp    %edx,%r12d
  jg     L349
  mov    (%r15),%eax
L894:
  mov    %r13d,0xc(%rsp)
  cmp    %r13d,%r12d
  jg     L918
  mov    (%r15),%edi
  jmp    L751
L908:
  test   %r12d,%r12d
  jg     L464
  jmp    L492
L487:
  test   %r12d,%r12d
  jle    L139
L464:
  mov    $0x0,%r13d
L71:
  mov    (%rbx,%r13,8),%edi
  mov    $0x13ae,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,(%rbx,%r13,8)
  add    $0x1,%r13
  cmp    %r13d,%r12d
  jg     L71
  test   %ebp,%ebp
  jle    L492
L139:
  mov    $0x0,%r12d
L859:
  mov    0x4(%rbx,%r12,8),%edi
  mov    $0x1a03,%esi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,0x4(%rbx,%r12,8)
  add    $0x1,%r12
  cmp    %r12d,%ebp
  jg     L859
  jmp    L492
L410:
  test   %r12d,%r12d
  jg     L365
  jmp    L492
L288:
  test   %r12d,%r12d
  jle    L404
L365:
  lea    0x4(%rbx),%r13
  lea    -0x1(%r12),%eax
  lea    0xc(%rbx,%rax,8),%r12
L142:
  mov    $0x13ae,%esi
  mov    0x0(%r13),%edi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,0x0(%r13)
  add    $0x8,%r13
  cmp    %r12,%r13
  jne    L142
  test   %ebp,%ebp
  jle    L492
L404:
  mov    %rbx,%r12
  lea    -0x1(%rbp),%eax
  lea    0x8(%rbx,%rax,8),%rbx
L841:
  mov    $0x1a03,%esi
  mov    (%r12),%edi
  mov    $0x0,%eax
  call   <fix_mul@plt>
  mov    %eax,(%r12)
  add    $0x8,%r12
  cmp    %rbx,%r12
  jne    L841
  jmp    L492
L950:
  test   %r12d,%r12d
  jle    L903
L183:
  lea    -0x2(%rbp,%rbp,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    $0x1,%r14d
  mov    $0x1,%r13d
  jmp    L415
L152:
  test   %ebp,%ebp
  jg     L840
L12:
  test   %ebp,%ebp
  jle    L908
  lea    -0x2(%r12,%r12,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    $0x1,%r14d
  mov    $0x1,%r13d
  jmp    L360
L112:
  test   %ebp,%ebp
  jle    L333
L840:
  lea    -0x2(%r12,%r12,1),%eax
  cltq
  lea    (%rbx,%rax,4),%r15
  mov    $0x1,%r14d
  mov    $0x1,%r13d
  jmp    L364
```

assistant: ```c
void dwt_encode_97(int *a, int dn, int sn, int cas) {
  int i;
  if (!cas) {
    if ((dn > 0) || (sn > 1)) {
      for (i = 0; i < dn; i++)
        a[(1 + (i)*2)] -= fix_mul(((i) < 0 ? a[(0) * 2] : ((i) >= sn ? a[(sn - 1) * 2] : a[(i)*2])) + ((i + 1) < 0 ? a[(0) * 2] : ((i + 1) >= sn ? a[(sn - 1) * 2] : a[(i + 1) * 2])), 12993);
      for (i = 0; i < sn; i++)
        a[(i)*2] -= fix_mul(((i - 1) < 0 ? a[(1 + (0) * 2)] : ((i - 1) >= dn ? a[(1 + (dn - 1) * 2)] : a[(1 + (i - 1) * 2)])) + ((i) < 0 ? a[(1 + (0) * 2)] : ((i) >= dn ? a[(1 + (dn - 1) * 2)] : a[(1 + (i)*2)])), 434);
      for (i = 0; i < dn; i++)
        a[(1 + (i)*2)] += fix_mul(((i) < 0 ? a[(0) * 2] : ((i) >= sn ? a[(sn - 1) * 2] : a[(i)*2])) + ((i + 1) < 0 ? a[(0) * 2] : ((i + 1) >= sn ? a[(sn - 1) * 2] : a[(i + 1) * 2])), 7233);
      for (i = 0; i < sn; i++)
        a[(i)*2] += fix_mul(((i - 1) < 0 ? a[(1 + (0) * 2)] : ((i - 1) >= dn ? a[(1 + (dn - 1) * 2)] : a[(1 + (i - 1) * 2)])) + ((i) < 0 ? a[(1 + (0) * 2)] : ((i) >= dn ? a[(1 + (dn - 1) * 2)] : a[(1 + (i)*2)])), 3633);
      for (i = 0; i < dn; i++)
        a[(1 + (i)*2)] = fix_mul(a[(1 + (i)*2)], 5038);
      for (i = 0; i < sn; i++)
        a[(i)*2] = fix_mul(a[(i)*2], 6659);
    }
  } else {
    if ((sn > 0) || (dn > 1)) {
      for (i = 0; i < dn; i++)
        a[(i)*2] -= fix_mul(((i) < 0 ? a[(1 + (0) * 2)] : ((i) >= sn ? a[(1 + (sn - 1) * 2)] : a[(1 + (i)*2)])) + ((i - 1) < 0 ? a[(1 + (0) * 2)] : ((i - 1) >= sn ? a[(1 + (sn - 1) * 2)] : a[(1 + (i - 1) * 2)])), 12993);
      for (i = 0; i < sn; i++)
        a[(1 + (i)*2)] -= fix_mul(((i) < 0 ? a[(0) * 2] : ((i) >= dn ? a[(dn - 1) * 2] : a[(i)*2])) + ((i + 1) < 0 ? a[(0) * 2] : ((i + 1) >= dn ? a[(dn - 1) * 2] : a[(i + 1) * 2])), 434);
      for (i = 0; i < dn; i++)
        a[(i)*2] += fix_mul(((i) < 0 ? a[(1 + (0) * 2)] : ((i) >= sn ? a[(1 + (sn - 1) * 2)] : a[(1 + (i)*2)])) + ((i - 1) < 0 ? a[(1 + (0) * 2)] : ((i - 1) >= sn ? a[(1 + (sn - 1) * 2)] : a[(1 + (i - 1) * 2)])), 7233);
      for (i = 0; i < sn; i++)
        a[(1 + (i)*2)] += fix_mul(((i) < 0 ? a[(0) * 2] : ((i) >= dn ? a[(dn - 1) * 2] : a[(i)*2])) + ((i + 1) < 0 ? a[(0) * 2] : ((i + 1) >= dn ? a[(dn - 1) * 2] : a[(i + 1) * 2])), 3633);
      for (i = 0; i < dn; i++)
        a[(i)*2] = fix_mul(a[(i)*2], 5038);
      for (i = 0; i < sn; i++)
        a[(1 + (i)*2)] = fix_mul(a[(1 + (i)*2)], 6659);
    }
  }
}
```