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

```asm
<decoder_delay>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %esi,%r13d
  mov    $0x1,%esi
  push   %r12
  mov    %edi,%r12d
  xor    %edi,%edi
  push   %rbp
  mov    %r8d,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    D199(%rip),%rdx
  mov    %r9d,0x10(%rsp)
  movq   %rdx,%xmm0
  mov    %ecx,0x18(%rsp)
  call   <draincap@plt>
  mov    $0x1,%esi
  mov    $0x1,%edi
  mov    D148(%rip),%rdx
  mov    %eax,%ebx
  mov    $0x1,%eax
  movq   %rdx,%xmm0
  call   <draincap@plt>
  movsd  D295(%rip),%xmm4
  pxor   %xmm1,%xmm1
  add    %eax,%ebx
  mov    $0x2,%eax
  movapd %xmm4,%xmm0
  call   <gatecap@plt>
  mov    $0x1,%esi
  mov    $0x1,%edi
  mov    D148(%rip),%rdx
  mov    %eax,%r15d
  mov    $0x1,%eax
  movq   %rdx,%xmm0
  add    %r15d,%ebx
  call   <transreson@plt>
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  xor    %edi,%edi
  cvtsi2sd %eax,%xmm0
  movsd  D322(%rip),%xmm2
  mov    $0x4,%eax
  cvtsi2sd %ebx,%xmm1
  movapd %xmm2,%xmm3
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  call   <horowitz@plt>
  mov    D199(%rip),%rcx
  xor    %edi,%edi
  mov    $0x1,%esi
  mov    %eax,%r15d
  mov    $0x1,%eax
  movq   %rcx,%xmm0
  call   <draincap@plt>
  mov    $0x1,%esi
  mov    $0x1,%edi
  mov    D148(%rip),%rdx
  mov    %eax,%ebx
  mov    $0x1,%eax
  movq   %rdx,%xmm0
  call   <draincap@plt>
  pxor   %xmm1,%xmm1
  lea    (%rbx,%rax,1),%ecx
  mov    $0x2,%eax
  mov    %ecx,0x8(%rsp)
  mov    D295(%rip),%rcx
  movq   %rcx,%xmm0
  call   <gatecap@plt>
  mov    $0x1,%esi
  mov    $0x1,%edi
  mov    D148(%rip),%rdx
  mov    %eax,%ebx
  mov    $0x1,%eax
  movq   %rdx,%xmm0
  call   <transreson@plt>
  pxor   %xmm0,%xmm0
  mov    D322(%rip),%rdx
  add    0x8(%rsp),%ebx
  cvtsi2sd %r15d,%xmm0
  pxor   %xmm4,%xmm4
  pxor   %xmm1,%xmm1
  mov    $0x1,%edi
  movq   %rdx,%xmm2
  cvtsi2sd %ebx,%xmm4
  movq   %rdx,%xmm3
  cvtsi2sd %eax,%xmm1
  mov    $0x4,%eax
  divsd  %xmm2,%xmm0
  mulsd  %xmm4,%xmm1
  call   <horowitz@plt>
  mov    %r13d,%r8d
  pxor   %xmm6,%xmm6
  xor    %edi,%edi
  imul   %r14d,%r8d
  mov    %eax,%ebx
  mov    %r12d,%eax
  mov    D199(%rip),%rcx
  cltd
  movq   %rcx,%xmm0
  imul   %ebp,%r8d
  imul   0x10(%rsp),%r8d
  lea    0x0(,%r8,8),%esi
  mov    %r8d,0x28(%rsp)
  idiv   %esi
  mov    $0x1,%esi
  cvtsi2sd %eax,%xmm6
  mov    $0x1,%eax
  movsd  %xmm6,0x8(%rsp)
  call   <draincap@plt>
  mov    $0x1,%esi
  mov    $0x1,%edi
  mov    D148(%rip),%rdx
  mov    %eax,%r15d
  mov    $0x1,%eax
  movq   %rdx,%xmm0
  call   <draincap@plt>
  movsd  D385(%rip),%xmm1
  movsd  D203(%rip),%xmm0
  add    %eax,%r15d
  mov    $0x2,%eax
  call   <gatecap@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm5,%xmm5
  xor    %edi,%edi
  pxor   %xmm4,%xmm4
  mov    0x18(%rsp),%ecx
  pxor   %xmm3,%xmm3
  pxor   %xmm6,%xmm6
  cvtsi2sd %r13d,%xmm0
  movsd  D91(%rip),%xmm1
  mov    $0x1,%esi
  cvtsi2sd %r14d,%xmm5
  cvtsi2sd %ebp,%xmm4
  imul   %ebp,%ecx
  mulsd  %xmm0,%xmm1
  cvtsi2sdl 0x10(%rsp),%xmm3
  mulsd  D221(%rip),%xmm0
  imul   %eax,%ecx
  mulsd  %xmm5,%xmm1
  lea    (%r15,%rcx,4),%eax
  mulsd  %xmm5,%xmm0
  cvtsi2sd %eax,%xmm6
  mov    D199(%rip),%rax
  mulsd  %xmm4,%xmm1
  mulsd  %xmm4,%xmm0
  mulsd  %xmm3,%xmm1
  mulsd  %xmm3,%xmm0
  addsd  %xmm1,%xmm6
  movsd  %xmm0,0x20(%rsp)
  movq   %rax,%xmm0
  mov    $0x1,%eax
  movsd  %xmm6,0x18(%rsp)
  call   <transreson@plt>
  pxor   %xmm1,%xmm1
  xor    %edi,%edi
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm1
  mov    D432(%rip),%rax
  addsd  0x20(%rsp),%xmm1
  mulsd  0x18(%rsp),%xmm1
  cvtsi2sd %ebx,%xmm0
  divsd  D57(%rip),%xmm0
  movq   %rax,%xmm3
  mov    D322(%rip),%rax
  movq   %rax,%xmm2
  mov    $0x4,%eax
  call   <horowitz@plt>
  pxor   %xmm0,%xmm0
  mov    0x28(%rsp),%r8d
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm0
  mov    0x88(%rsp),%rax
  cvtsi2sd %r8d,%xmm1
  movsd  %xmm0,(%rax)
  divsd  D432(%rip),%xmm0
  mov    $0x1,%eax
  movsd  %xmm0,0x20(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  divsd  %xmm1,%xmm0
  call   <logtwo@plt>
  pxor   %xmm0,%xmm0
  movsd  D427(%rip),%xmm2
  movsd  D288(%rip),%xmm3
  cvtsi2sd %eax,%xmm0
  mulsd  D49(%rip),%xmm0
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  ucomisd %xmm1,%xmm3
  jbe    L25
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  movapd %xmm0,%xmm3
  movsd  D106(%rip),%xmm7
  andnpd %xmm0,%xmm2
  cvtsi2sd %rax,%xmm1
  cmpnlesd %xmm1,%xmm3
  andpd  %xmm7,%xmm3
  addsd  %xmm3,%xmm1
  orpd   %xmm2,%xmm1
  movapd %xmm1,%xmm0
L25:
  cvttsd2si %xmm0,%r10d
  test   %r10d,%r10d
  je     L4
  mov    $0x5,%eax
  cmp    %eax,%r10d
  cmovle %r10d,%eax
  mov    %eax,%r15d
  lea    -0x1(%rax),%ebx
  lea    (%rax,%rax,4),%eax
  shl    $0x3,%eax
  mov    %eax,0x28(%rsp)
L14:
  mov    D148(%rip),%rax
  mov    $0x1,%esi
  xor    %edi,%edi
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <draincap@plt>
  mov    $0x3,%esi
  mov    $0x1,%edi
  movsd  D377(%rip),%xmm2
  mov    %eax,0x2c(%rsp)
  mov    $0x1,%eax
  movapd %xmm2,%xmm0
  call   <draincap@plt>
  pxor   %xmm1,%xmm1
  movsd  D27(%rip),%xmm0
  cvtsi2sdl 0x28(%rsp),%xmm1
  addsd  D154(%rip),%xmm1
  mov    %eax,0x18(%rsp)
  mov    $0x2,%eax
  call   <gatecap@plt>
  pxor   %xmm0,%xmm0
  movsd  0x8(%rsp),%xmm7
  mov    0x2c(%rsp),%edx
  mov    %eax,%r8d
  pxor   %xmm1,%xmm1
  mov    $0x3,%esi
  mov    $0x1,%edi
  cvtsi2sd %r8d,%xmm0
  lea    (%rdx,%rdx,2),%eax
  add    0x18(%rsp),%eax
  cvtsi2sd %eax,%xmm1
  mov    D377(%rip),%rax
  mulsd  %xmm7,%xmm0
  addsd  %xmm0,%xmm1
  movsd  D162(%rip),%xmm0
  mulsd  %xmm7,%xmm0
  mulsd  D219(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x1,%eax
  movsd  %xmm1,0x18(%rsp)
  call   <transreson@plt>
  movsd  0x8(%rsp),%xmm1
  pxor   %xmm0,%xmm0
  mulsd  D190(%rip),%xmm1
  cvtsi2sd %eax,%xmm0
  mulsd  D219(%rip),%xmm1
  mulsd  D59(%rip),%xmm1
  addsd  %xmm0,%xmm1
  mulsd  0x18(%rsp),%xmm1
  cmp    $0x4,%ebx
  ja     L32
  mov    %ebx,%ecx
  lea    D422(%rip),%rax
  movsd  (%rax,%rcx,8),%xmm4
L24:
  mov    D432(%rip),%rax
  movsd  0x20(%rsp),%xmm0
  movapd %xmm4,%xmm3
  mov    $0x1,%edi
  movsd  %xmm4,0x8(%rsp)
  movq   %rax,%xmm2
  mov    $0x4,%eax
  call   <horowitz@plt>
  movsd  0x8(%rsp),%xmm4
  mov    %r15d,%esi
  xor    %edi,%edi
  movsd  D106(%rip),%xmm1
  pxor   %xmm5,%xmm5
  movsd  D137(%rip),%xmm2
  cvtsi2sd %eax,%xmm5
  mov    0x90(%rsp),%rax
  movsd  %xmm4,0x10(%rsp)
  subsd  %xmm4,%xmm1
  movapd %xmm2,%xmm0
  movsd  %xmm5,(%rax)
  divsd  %xmm1,%xmm5
  mov    $0x1,%eax
  movsd  %xmm5,0x8(%rsp)
  call   <transreson@plt>
  movsd  D156(%rip),%xmm0
  mov    %eax,%r12d
  mov    D154(%rip),%rax
  movq   %rax,%xmm1
  mov    $0x2,%eax
  call   <gatecap@plt>
  mov    $0x1,%esi
  mov    $0x1,%edi
  movsd  D192(%rip),%xmm0
  mov    %eax,%ebx
  mov    $0x1,%eax
  call   <draincap@plt>
  mov    %r15d,%esi
  xor    %edi,%edi
  imul   %r15d,%eax
  add    %eax,%ebx
  mov    D137(%rip),%rax
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <draincap@plt>
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  xor    %edi,%edi
  add    %eax,%ebx
  cvtsi2sd %r12d,%xmm0
  mov    D135(%rip),%rax
  movsd  0x10(%rsp),%xmm4
  cvtsi2sd %ebx,%xmm1
  movsd  0x8(%rsp),%xmm5
  movq   %rax,%xmm3
  movapd %xmm4,%xmm2
  mov    $0x4,%eax
  mulsd  %xmm0,%xmm1
  movapd %xmm5,%xmm0
  call   <horowitz@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    0x98(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0xa0(%rsp),%rax
  divsd  D135(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    0x88(%rsp),%rax
  movsd  (%rax),%xmm0
  mov    0x90(%rsp),%rax
  addsd  (%rax),%xmm0
  mov    0x98(%rsp),%rax
  addsd  (%rax),%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L4:
  movl   $0x28,0x28(%rsp)
  xor    %ebx,%ebx
  mov    $0x1,%r15d
  jmp    L14
  nopl   (%rax)
L32:
  movsd  %xmm1,0x8(%rsp)
  sub    $0x8,%rsp
  mov    %r12d,%edx
  mov    %ebp,%r9d
  mov    0x18(%rsp),%eax
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %r15d,%esi
  lea    D247(%rip),%rdi
  push   %rax
  xor    %eax,%eax
  call   <printf@plt>
  pop    %rax
  pxor   %xmm4,%xmm4
  pop    %rdx
  movsd  0x8(%rsp),%xmm1
  jmp    L24
```

tool_calls: name: unpack_data
arguments: data_label: D199
type: f64
name: unpack_data
arguments: data_label: D148
type: f64
name: unpack_data
arguments: data_label: D295
type: f32[2]
name: unpack_data
arguments: data_label: D322
type: f64
name: unpack_data
arguments: data_label: D385
type: f64
name: unpack_data
arguments: data_label: D203
type: f32[2]
name: unpack_data
arguments: data_label: D91
type: byte[8]
name: unpack_data
arguments: data_label: D221
type: f64
name: unpack_data
arguments: data_label: D432
type: f64
name: unpack_data
arguments: data_label: D57
type: byte[8]
name: unpack_data
arguments: data_label: D427
type: byte[8]
name: unpack_data
arguments: data_label: D288
type: f32[2]
name: unpack_data
arguments: data_label: D49
type: byte[8]
name: unpack_data
arguments: data_label: D106
type: f64
name: unpack_data
arguments: data_label: D377
type: f64
name: unpack_data
arguments: data_label: D27
type: byte[8]
name: unpack_data
arguments: data_label: D154
type: f64
name: unpack_data
arguments: data_label: D162
type: byte[8]
name: unpack_data
arguments: data_label: D219
type: f32[2]
name: unpack_data
arguments: data_label: D190
type: f64
name: unpack_data
arguments: data_label: D59
type: f32[2]
name: unpack_data
arguments: data_label: D422
type: f64
name: unpack_data
arguments: data_label: D137
type: f64
name: unpack_data
arguments: data_label: D156
type: f32[2]
name: unpack_data
arguments: data_label: D192
type: f64
name: unpack_data
arguments: data_label: D135
type: f64
name: unpack_data
arguments: data_label: D247
type: string

tool: D199: 100

tool: D148: 60

tool: {"D295": [0.0,3.5625]}

tool: D322: 0.438

tool: D385: 10

tool: {"D203": [0.0,3.54296875]}

tool: {"D91": [0x7a,0xcd,0x69,0x75,0x84,0x36,0xf0,0x3c]}

tool: D221: 0.08

tool: D432: 0.561

tool: {"D57": [0x96,0x43,0x8b,0x6c,0xe7,0xfb,0xe1,0x3f]}

tool: {"D427": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D288": [0.0,176.0]}

tool: {"D49": [0x55,0x55,0x55,0x55,0x55,0x55,0xd5,0x3f]}

tool: D106: 1

tool: D377: 90

tool: {"D27": [0xcd,0xcc,0xcc,0xcc,0xcc,0xcc,0x2c,0x40]}

tool: D154: 20

tool: {"D162": [0xb1,0xde,0x64,0xc8,0xda,0xd0,0xf3,0x3c]}

tool: {"D219": [0.0,2.5]}

tool: D190: 0.32

tool: {"D59": [0.0,1.75]}

tool: D422: 0.503

tool: D137: 12

tool: {"D156": [0.0,2.71875]}

tool: D192: 2.4

tool: D135: 0.456

tool: D247: error:numstack=%d C[%d] B[%d] A[%d] ndbl[%d] nspd[%d]


assistant: ```c
double decoder_delay(C, B, A, Ndwl, Ndbl, Nspd, Ntwl, Ntbl, Ntspd, Tdecdrive, Tdecoder1, Tdecoder2, outrisetime)
int C, B, A, Ndwl, Ndbl, Nspd, Ntwl, Ntbl, Ntspd;
double *Tdecdrive, *Tdecoder1, *Tdecoder2, *outrisetime;
{
  double Ceq, Req, Rwire, rows, tf, nextinputtime, vth = 0.0, tstep, m, a, b, c;
  int numstack;
  Ceq = draincap(100.0, 0, 1) + draincap(60.0, 1, 1) + gatecap(100.0 + 60.0, 0.0);
  tf = Ceq * transreson(60.0, 1, 1);
  nextinputtime = horowitz(0.0, tf, 0.438, 0.438, 0) / (0.438);
  Ceq = draincap(100.0, 0, 1) + draincap(60.0, 1, 1) + gatecap(100.0 + 60.0, 0.0);
  tf = Ceq * transreson(60.0, 1, 1);
  nextinputtime = horowitz(nextinputtime, tf, 0.438, 0.438, 1) / (1.0 - 0.438);
  rows = C / (8 * B * A * Ndbl * Nspd);
  Ceq = draincap(100.0, 0, 1) + draincap(60.0, 1, 1) + 4 * gatecap(90.0 + 60.0, 10.0) * (Ndwl * Ndbl) + 1.8e-15 * 0.25 * 8 * B * A * Ndbl * Nspd;
  Rwire = 0.080 * 0.125 * 8 * B * A * Ndbl * Nspd;
  tf = (Rwire + transreson(100.0, 0, 1)) * Ceq;
  *Tdecdrive = horowitz(nextinputtime, tf, 0.438, 0.561, 0);
  nextinputtime = *Tdecdrive / 0.561;
  numstack = ceil((1.0 / 3.0) * logtwo((double)((double)C / (double)(B * A * Ndbl * Nspd))));
  if (numstack == 0)
    numstack = 1;
  if (numstack > 5)
    numstack = 5;
  Ceq = 3 * draincap(60.0, 0, 1) + draincap(90.0, 1, 3) + gatecap(2.4 + 12.0, ((numstack * 40) + 20.0)) * rows + 4.4e-15 * rows * 8;
  Rwire = 0.320 * rows * 8 / 2;
  tf = Ceq * (Rwire + transreson(90.0, 1, 3));
  switch (numstack) {
  case 1:
    vth = 0.503;
    break;
  case 2:
    vth = 0.452;
    break;
  case 3:
    vth = 0.417;
    break;
  case 4:
    vth = 0.390;
    break;
  case 5:
    vth = 0.390;
    break;
  default:
    printf("error:numstack=%d C[%d] B[%d] A[%d] ndbl[%d] nspd[%d]\n", numstack, C, B, A, Ndbl, Nspd);
  }
  *Tdecoder1 = horowitz(nextinputtime, tf, 0.561, vth, 1);
  nextinputtime = *Tdecoder1 / (1.0 - vth);
  Req = transreson(12.0, 0, numstack);
  Ceq = (gatecap(5.0 + 10.0, 20.0) + numstack * draincap(2.4, 1, 1) + draincap(12.0, 0, numstack));
  tf = Req * Ceq;
  *Tdecoder2 = horowitz(nextinputtime, tf, vth, 0.456, 0);
  *outrisetime = *Tdecoder2 / (0.456);
  return (*Tdecdrive + *Tdecoder1 + *Tdecoder2);
}
```