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

```asm
<dwt_decode_53>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L288
  cmpl   $0x0,-0x1c(%rbp)
  jg     L387
  cmpl   $0x1,-0x20(%rbp)
  jle    L420
L387:
  movl   $0x0,-0x4(%rbp)
  jmp    L59
L391:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  cmpl   $0x0,-0x4(%rbp)
  jg     L227
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%edx
  jmp    L190
L227:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L398
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  jmp    L190
L398:
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
L190:
  cmpl   $0x0,-0x4(%rbp)
  jns    L234
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%eax
  jmp    L345
L234:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L431
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  jmp    L345
L431:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
L345:
  add    %edx,%eax
  add    $0x2,%eax
  sar    $0x2,%eax
  mov    %eax,%esi
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  sub    %esi,%ecx
  mov    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L59:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L391
  movl   $0x0,-0x4(%rbp)
  jmp    L111
L176:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  cmpl   $0x0,-0x4(%rbp)
  jns    L108
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  jmp    L185
L108:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L55
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  jmp    L185
L55:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
L185:
  cmpl   $0xffffffff,-0x4(%rbp)
  jge    L119
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  jmp    L90
L119:
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x20(%rbp)
  jg     L366
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  jmp    L90
L366:
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
L90:
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L111:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L176
  jmp    L420
L288:
  cmpl   $0x0,-0x20(%rbp)
  jne    L109
  cmpl   $0x1,-0x1c(%rbp)
  jne    L109
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L420
L109:
  movl   $0x0,-0x4(%rbp)
  jmp    L376
L294:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  cmpl   $0x0,-0x4(%rbp)
  jns    L171
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  jmp    L3
L171:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L442
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  jmp    L3
L442:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
L3:
  cmpl   $0xffffffff,-0x4(%rbp)
  jge    L313
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  jmp    L402
L313:
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x1c(%rbp)
  jg     L390
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  jmp    L402
L390:
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
L402:
  add    %edx,%eax
  add    $0x2,%eax
  sar    $0x2,%eax
  mov    %eax,%esi
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  sub    %esi,%ecx
  mov    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L376:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L294
  movl   $0x0,-0x4(%rbp)
  jmp    L436
L306:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  cmpl   $0x0,-0x4(%rbp)
  jns    L20
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%edx
  jmp    L362
L20:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L393
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  jmp    L362
L393:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
L362:
  cmpl   $0x0,-0x4(%rbp)
  jg     L228
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%eax
  jmp    L72
L228:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jle    L311
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  jmp    L72
L311:
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
L72:
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L436:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L306
L420:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void dwt_decode_53(int *a, int dn, int sn, int cas) {
  int i;
  if (!cas) {
    if ((dn > 0) || (sn > 1)) {
      for (i = 0; i < sn; i++) {
        a[(i)*2] -= (((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)])) + 2) >> 2;
      }
      for (i = 0; i < dn; i++) {
        a[(1 + (i)*2)] += (((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]))) >> 1;
      }
    }
  } else {
    if (!sn && dn == 1) {
      a[(0) * 2] /= 2;
    } else {
      for (i = 0; i < sn; i++) {
        a[(1 + (i)*2)] -= (((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])) + 2) >> 2;
      }
      for (i = 0; i < dn; i++) {
        a[(i)*2] += (((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)]))) >> 1;
      }
    }
  }
}
```