ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<cdrift_kepu>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movsd  %xmm0,(%rsp)
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movq   %xmm3,%r12
  movq   %xmm4,%r13
  mov    %rdi,%r14
  mov    %rsi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x20(%rsp)
  pxor   %xmm5,%xmm5
  call   <cdrift_kepu_guess@plt>
  movq   %xmm0,%rbx
  movsd  %xmm0,0x20(%rsp)
  lea    0x20(%rsp),%rdi
  mov    %r15,%rdx
  mov    %r14,%rsi
  movq   %r13,%xmm4
  movq   %r12,%xmm3
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  call   <cdrift_kepu_new@plt>
  test   %eax,%eax
  jne    L35
L20:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  movq   %rbx,%xmm5
  movq   %r13,%xmm4
  movq   %r12,%xmm3
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  call   <cdrift_kepu_fchk@plt>
  movq   %xmm0,%rbp
  movsd  0x20(%rsp),%xmm5
  movq   %r13,%xmm4
  movq   %r12,%xmm3
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  call   <cdrift_kepu_fchk@plt>
  movsd  %xmm0,0x18(%rsp)
  movq   %rbp,%xmm0
  call   <fabs@plt>
  mov    %rax,%rbp
  movsd  0x18(%rsp),%xmm0
  call   <fabs@plt>
  cmp    %rax,%rbp
  jge    L30
  mov    %rbx,0x20(%rsp)
L30:
  lea    0x20(%rsp),%rdi
  mov    %r15,%rdx
  mov    %r14,%rsi
  movq   %r13,%xmm4
  movq   %r12,%xmm3
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  call   <cdrift_kepu_lag@plt>
  jmp    L20
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int cdrift_kepu(const double dt, const double r0, const double mu, const double alpha, const double u, double *fp, struct cvals *cvals) {
  int iflg = 0;
  double s = 0.0;
  s = cdrift_kepu_guess(dt, r0, mu, alpha, u, s);
  const double st = s;
  iflg = cdrift_kepu_new(&s, dt, r0, mu, alpha, u, fp, cvals);
  if (iflg) {
    const double fo = cdrift_kepu_fchk(dt, r0, mu, alpha, u, st);
    const double fn = cdrift_kepu_fchk(dt, r0, mu, alpha, u, s);
    if (fabs(fo) < fabs(fn)) {
      s = st;
    }
    iflg = cdrift_kepu_lag(&s, dt, r0, mu, alpha, u, fp, cvals);
  }
  return iflg;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<cdrift_kepu>:
  endbr64
  push   %r13
  pxor   %xmm5,%xmm5
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movsd  %xmm4,0x20(%rsp)
  lea    0x40(%rsp),%r13
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  movq   $0x0,0x40(%rsp)
  movsd  %xmm0,(%rsp)
  call   <cdrift_kepu_guess@plt>
  movsd  (%rsp),%xmm6
  mov    %r12,%rdx
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  mov    %rbp,%rsi
  movsd  %xmm0,0x40(%rsp)
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,0x28(%rsp)
  mov    %r13,%rdi
  movapd %xmm6,%xmm0
  call   <cdrift_kepu_new@plt>
  movsd  (%rsp),%xmm6
  movsd  0x8(%rsp),%xmm1
  test   %eax,%eax
  movsd  0x10(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm3
  movsd  0x20(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm7
  jne    L27
L0:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L24
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L27:
  movapd %xmm7,%xmm5
  movapd %xmm6,%xmm0
  movsd  %xmm7,0x38(%rsp)
  call   <cdrift_kepu_fchk@plt>
  movsd  (%rsp),%xmm6
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  movsd  %xmm0,0x30(%rsp)
  movsd  0x8(%rsp),%xmm1
  movsd  0x40(%rsp),%xmm5
  movapd %xmm6,%xmm0
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm6,0x8(%rsp)
  call   <cdrift_kepu_fchk@plt>
  movsd  0x30(%rsp),%xmm8
  movsd  %xmm0,(%rsp)
  movapd %xmm8,%xmm0
  call   <fabs@plt>
  movsd  (%rsp),%xmm5
  mov    %rax,%rbx
  movapd %xmm5,%xmm0
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm6
  movsd  0x10(%rsp),%xmm1
  cmp    %rax,%rbx
  movsd  0x18(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm4
  jge    L34
  movsd  0x38(%rsp),%xmm7
  movsd  %xmm7,0x40(%rsp)
L34:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  movapd %xmm6,%xmm0
  mov    %r13,%rdi
  call   <cdrift_kepu_lag@plt>
  jmp    L0
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int cdrift_kepu(const double dt, const double r0, const double mu, const double alpha, const double u, double *fp, struct cvals *cvals) {
  int iflg = 0;
  double s = 0.0;
  s = cdrift_kepu_guess(dt, r0, mu, alpha, u, s);
  const double st = s;
  iflg = cdrift_kepu_new(&s, dt, r0, mu, alpha, u, fp, cvals);
  if (iflg) {
    const double fo = cdrift_kepu_fchk(dt, r0, mu, alpha, u, st);
    const double fn = cdrift_kepu_fchk(dt, r0, mu, alpha, u, s);
    if (fabs(fo) < fabs(fn)) {
      s = st;
    }
    iflg = cdrift_kepu_lag(&s, dt, r0, mu, alpha, u, fp, cvals);
  }
  return iflg;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<cdrift_kepu>:
  endbr64
  push   %r13
  pxor   %xmm5,%xmm5
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movsd  %xmm4,0x20(%rsp)
  lea    0x40(%rsp),%r13
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  movq   $0x0,0x40(%rsp)
  movsd  %xmm0,(%rsp)
  call   <cdrift_kepu_guess@plt>
  movsd  (%rsp),%xmm6
  mov    %r12,%rdx
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  mov    %rbp,%rsi
  movsd  %xmm0,0x40(%rsp)
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,0x28(%rsp)
  mov    %r13,%rdi
  movapd %xmm6,%xmm0
  call   <cdrift_kepu_new@plt>
  movsd  (%rsp),%xmm6
  movsd  0x8(%rsp),%xmm1
  test   %eax,%eax
  movsd  0x10(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm3
  movsd  0x20(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm7
  jne    L17
L1:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L17:
  movapd %xmm7,%xmm5
  movapd %xmm6,%xmm0
  movsd  %xmm7,0x38(%rsp)
  call   <cdrift_kepu_fchk@plt>
  movsd  (%rsp),%xmm6
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  movsd  %xmm0,0x30(%rsp)
  movsd  0x8(%rsp),%xmm1
  movsd  0x40(%rsp),%xmm5
  movapd %xmm6,%xmm0
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm6,0x8(%rsp)
  call   <cdrift_kepu_fchk@plt>
  movsd  0x30(%rsp),%xmm8
  movsd  %xmm0,(%rsp)
  movapd %xmm8,%xmm0
  call   <fabs@plt>
  movsd  (%rsp),%xmm5
  mov    %rax,%rbx
  movapd %xmm5,%xmm0
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm6
  movsd  0x10(%rsp),%xmm1
  cmp    %rax,%rbx
  movsd  0x18(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm4
  jge    L31
  movsd  0x38(%rsp),%xmm7
  movsd  %xmm7,0x40(%rsp)
L31:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  movapd %xmm6,%xmm0
  mov    %r13,%rdi
  call   <cdrift_kepu_lag@plt>
  jmp    L1
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int cdrift_kepu(const double dt, const double r0, const double mu, const double alpha, const double u, double *fp, struct cvals *cvals) {
  int iflg = 0;
  double s = 0.0;
  s = cdrift_kepu_guess(dt, r0, mu, alpha, u, s);
  const double st = s;
  iflg = cdrift_kepu_new(&s, dt, r0, mu, alpha, u, fp, cvals);
  if (iflg) {
    const double fo = cdrift_kepu_fchk(dt, r0, mu, alpha, u, st);
    const double fn = cdrift_kepu_fchk(dt, r0, mu, alpha, u, s);
    if (fabs(fo) < fabs(fn)) {
      s = st;
    }
    iflg = cdrift_kepu_lag(&s, dt, r0, mu, alpha, u, fp, cvals);
  }
  return iflg;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<expand>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r15
  mov    %esi,%r13d
  mov    (%r15),%r14
  mov    %r14,%rbx
  jmp    L92
L122:
  add    $0x1,%rbx
L92:
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L122
  sub    $0x1,%rbx
  jmp    L120
L155:
  lea    -0x1(%rbx),%rax
  movzbl (%rax),%eax
  cmp    $0x24,%al
  je     L5
  movzbl (%rbx),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <putback@plt>
  jmp    L186
L5:
  movzbl (%rbx),%eax
  movsbl %al,%eax
  cmp    $0x39,%eax
  jg     L123
  cmp    $0x30,%eax
  jge    L25
  cmp    $0x23,%eax
  je     L32
  cmp    $0x2a,%eax
  je     L157
  jmp    L123
L32:
  lea    -0x2(%r13),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <pbnum@plt>
  jmp    L40
L25:
  movzbl (%rbx),%eax
  movsbl %al,%eax
  lea    -0x30(%rax),%r12d
  lea    -0x1(%r13),%eax
  cmp    %eax,%r12d
  jge    L108
  movslq %r12d,%rax
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %r15,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <pbstr@plt>
  jmp    L108
L157:
  lea    -0x1(%r13),%r12d
  jmp    L23
L169:
  movslq %r12d,%rax
  shl    $0x3,%rax
  add    %r15,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <pbstr@plt>
  mov    $0x2c,%edi
  mov    $0x0,%eax
  call   <putback@plt>
  sub    $0x1,%r12d
L23:
  cmp    $0x2,%r12d
  jg     L169
  lea    0x10(%r15),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <pbstr@plt>
  jmp    L40
L123:
  movzbl (%rbx),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <putback@plt>
  mov    $0x24,%edi
  mov    $0x0,%eax
  call   <putback@plt>
  jmp    L40
L108:
  nop
L40:
  sub    $0x1,%rbx
L186:
  sub    $0x1,%rbx
L120:
  cmp    %r14,%rbx
  ja     L155
  cmp    %r14,%rbx
  jne    L53
  movzbl (%rbx),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <putback@plt>
L53:
  nop
  add    $0x8,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void expand(argv, argc) register char *argv[];
register int argc;
{
  register char *t;
  register char *p;
  register int n;
  register int argno;
  t = argv[0];
  p = t;
  while (*p)
    p++;
  p--;
  while (p > t) {
    if (*(p - 1) != '$')
      putback(*p);
    else {
      switch (*p) {
      case '#':
        pbnum(argc - 2);
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        if ((argno = *p - '0') < argc - 1)
          pbstr(argv[argno + 1]);
        break;
      case '*':
        for (n = argc - 1; n > 2; n--) {
          pbstr(argv[n]);
          putback(',');
        }
        pbstr(argv[2]);
        break;
      default:
        putback(*p);
        putback('$');
        break;
      }
      p--;
    }
    p--;
  }
  if (p == t)
    putback(*p);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<expand>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %esi,%r14d
  mov    (%rdi),%r13
  cmpb   $0x0,0x0(%r13)
  je     L38
  mov    %r13,%rbx
L14:
  add    $0x1,%rbx
  cmpb   $0x0,(%rbx)
  jne    L14
L77:
  sub    $0x1,%rbx
  cmp    %rbx,%r13
  jae    L121
  lea    -0x1(%r14),%r15d
  jmp    L24
L38:
  mov    %r13,%rbx
  jmp    L77
L41:
  movsbl (%rbx),%edi
  mov    $0x0,%eax
  call   <putback@plt>
  jmp    L178
L166:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L198
  lea    -0x30(%rdi),%eax
  cmp    %eax,%r15d
  jle    L145
  sub    $0x2f,%edi
  movslq %edi,%rdi
  mov    (%r12,%rdi,8),%rdi
  mov    $0x0,%eax
  call   <pbstr@plt>
  jmp    L145
L97:
  cmp    $0x2,%r15d
  jle    L56
  movslq %r15d,%rbp
L62:
  mov    (%r12,%rbp,8),%rdi
  mov    $0x0,%eax
  call   <pbstr@plt>
  mov    $0x2c,%edi
  mov    $0x0,%eax
  call   <putback@plt>
  sub    $0x1,%rbp
  cmp    $0x2,%ebp
  jg     L62
L56:
  mov    0x10(%r12),%rdi
  mov    $0x0,%eax
  call   <pbstr@plt>
L145:
  sub    $0x1,%rbx
L178:
  sub    $0x1,%rbx
  cmp    %rbx,%r13
  jae    L121
L24:
  cmpb   $0x24,-0x1(%rbx)
  jne    L41
  movzbl (%rbx),%eax
  movsbl %al,%edi
  cmp    $0x2a,%al
  je     L97
  jg     L166
  cmp    $0x23,%al
  jne    L198
  lea    -0x2(%r14),%edi
  mov    $0x0,%eax
  call   <pbnum@plt>
  jmp    L145
L198:
  mov    $0x0,%eax
  call   <putback@plt>
  mov    $0x24,%edi
  mov    $0x0,%eax
  call   <putback@plt>
  jmp    L145
L121:
  cmp    %rbx,%r13
  je     L180
L5:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L180:
  movsbl (%rbx),%edi
  mov    $0x0,%eax
  call   <putback@plt>
  jmp    L5
```

assistant: ```c
void expand(argv, argc) register char *argv[];
register int argc;
{
  register char *t;
  register char *p;
  register int n;
  register int argno;
  t = argv[0];
  p = t;
  while (*p)
    p++;
  p--;
  while (p > t) {
    if (*(p - 1) != '$')
      putback(*p);
    else {
      switch (*p) {
      case '#':
        pbnum(argc - 2);
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        if ((argno = *p - '0') < argc - 1)
          pbstr(argv[argno + 1]);
        break;
      case '*':
        for (n = argc - 1; n > 2; n--) {
          pbstr(argv[n]);
          putback(',');
        }
        pbstr(argv[2]);
        break;
      default:
        putback(*p);
        putback('$');
        break;
      }
      p--;
    }
    p--;
  }
  if (p == t)
    putback(*p);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<expand>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rdi),%r12
  cmpb   $0x0,(%r12)
  je     L121
  mov    %r12,%rax
  nopl   0x0(%rax)
L4:
  mov    %rax,%rbx
  add    $0x1,%rax
  cmpb   $0x0,(%rax)
  jne    L4
L54:
  cmp    %rbx,%r12
  jae    L100
  lea    -0x1(%r13),%r14d
  jmp    L158
  nopw   0x0(%rax,%rax,1)
L23:
  xor    %eax,%eax
  sub    $0x1,%rbx
  call   <putback@plt>
  cmp    %rbx,%r12
  jae    L100
L158:
  movsbl (%rbx),%edi
  cmpb   $0x24,-0x1(%rbx)
  mov    %edi,%eax
  jne    L23
  cmp    $0x2a,%dil
  je     L90
  jg     L71
  cmp    $0x23,%dil
  jne    L48
  lea    -0x2(%r13),%edi
  xor    %eax,%eax
  call   <pbnum@plt>
L143:
  sub    $0x1,%rbx
  sub    $0x1,%rbx
  cmp    %rbx,%r12
  jb     L158
L100:
  cmp    %rbx,%r12
  je     L41
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L71:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L48
  lea    -0x30(%rdi),%eax
  cmp    %eax,%r14d
  jle    L143
  sub    $0x2f,%edi
  xor    %eax,%eax
  movslq %edi,%rdi
  mov    0x0(%rbp,%rdi,8),%rdi
  call   <pbstr@plt>
  jmp    L143
  nopl   0x0(%rax,%rax,1)
L90:
  movslq %r14d,%r15
  cmp    $0x2,%r14d
  jle    L91
  nopl   0x0(%rax)
L153:
  mov    0x0(%rbp,%r15,8),%rdi
  xor    %eax,%eax
  sub    $0x1,%r15
  call   <pbstr@plt>
  mov    $0x2c,%edi
  xor    %eax,%eax
  call   <putback@plt>
  cmp    $0x2,%r15d
  jg     L153
L91:
  mov    0x10(%rbp),%rdi
  xor    %eax,%eax
  call   <pbstr@plt>
  jmp    L143
  nopw   0x0(%rax,%rax,1)
L48:
  xor    %eax,%eax
  call   <putback@plt>
  mov    $0x24,%edi
  xor    %eax,%eax
  call   <putback@plt>
  jmp    L143
  nopl   0x0(%rax,%rax,1)
L41:
  movsbl (%r12),%edi
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <putback@plt>
  nopw   0x0(%rax,%rax,1)
L121:
  lea    -0x1(%r12),%rbx
  jmp    L54
```

assistant: ```c
void expand(argv, argc) register char *argv[];
register int argc;
{
  register char *t;
  register char *p;
  register int n;
  register int argno;
  t = argv[0];
  p = t;
  while (*p)
    p++;
  p--;
  while (p > t) {
    if (*(p - 1) != '$')
      putback(*p);
    else {
      switch (*p) {
      case '#':
        pbnum(argc - 2);
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        if ((argno = *p - '0') < argc - 1)
          pbstr(argv[argno + 1]);
        break;
      case '*':
        for (n = argc - 1; n > 2; n--) {
          pbstr(argv[n]);
          putback(',');
        }
        pbstr(argv[2]);
        break;
      default:
        putback(*p);
        putback('$');
        break;
      }
      p--;
    }
    p--;
  }
  if (p == t)
    putback(*p);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<expand>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rdi),%r12
  cmpb   $0x0,(%r12)
  je     L18
  mov    %r12,%rax
  cs nopw 0x0(%rax,%rax,1)
L13:
  mov    %rax,%rbx
  add    $0x1,%rax
  cmpb   $0x0,(%rax)
  jne    L13
L90:
  cmp    %rbx,%r12
  jae    L83
  lea    -0x1(%rsi),%r14d
  lea    -0x2(%rsi),%r13d
  jmp    L125
  nopl   0x0(%rax,%rax,1)
L67:
  xor    %eax,%eax
  sub    $0x1,%rbx
  call   <putback@plt>
  cmp    %rbx,%r12
  jae    L83
L125:
  movsbl (%rbx),%edi
  cmpb   $0x24,-0x1(%rbx)
  mov    %edi,%eax
  jne    L67
  cmp    $0x2a,%dil
  je     L174
  jg     L29
  cmp    $0x23,%dil
  jne    L114
  mov    %r13d,%edi
  xor    %eax,%eax
  call   <pbnum@plt>
L58:
  sub    $0x1,%rbx
  sub    $0x1,%rbx
  cmp    %rbx,%r12
  jb     L125
L83:
  cmp    %rbx,%r12
  je     L143
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L29:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L114
  lea    -0x30(%rdi),%eax
  cmp    %eax,%r14d
  jle    L58
  sub    $0x2f,%edi
  xor    %eax,%eax
  movslq %edi,%rdi
  mov    0x0(%rbp,%rdi,8),%rdi
  call   <pbstr@plt>
  jmp    L58
  nopl   0x0(%rax,%rax,1)
L174:
  movslq %r14d,%r15
  cmp    $0x2,%r14d
  jle    L32
  nopl   0x0(%rax)
L160:
  mov    0x0(%rbp,%r15,8),%rdi
  xor    %eax,%eax
  sub    $0x1,%r15
  call   <pbstr@plt>
  mov    $0x2c,%edi
  xor    %eax,%eax
  call   <putback@plt>
  cmp    $0x2,%r15d
  jg     L160
L32:
  mov    0x10(%rbp),%rdi
  xor    %eax,%eax
  call   <pbstr@plt>
  jmp    L58
  nopw   0x0(%rax,%rax,1)
L114:
  xor    %eax,%eax
  call   <putback@plt>
  mov    $0x24,%edi
  xor    %eax,%eax
  call   <putback@plt>
  jmp    L58
  nopl   0x0(%rax,%rax,1)
L143:
  movsbl (%r12),%edi
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <putback@plt>
  nopw   0x0(%rax,%rax,1)
L18:
  lea    -0x1(%r12),%rbx
  jmp    L90
```

assistant: ```c
void expand(argv, argc) register char *argv[];
register int argc;
{
  register char *t;
  register char *p;
  register int n;
  register int argno;
  t = argv[0];
  p = t;
  while (*p)
    p++;
  p--;
  while (p > t) {
    if (*(p - 1) != '$')
      putback(*p);
    else {
      switch (*p) {
      case '#':
        pbnum(argc - 2);
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        if ((argno = *p - '0') < argc - 1)
          pbstr(argv[argno + 1]);
        break;
      case '*':
        for (n = argc - 1; n > 2; n--) {
          pbstr(argv[n]);
          putback(',');
        }
        pbstr(argv[2]);
        break;
      default:
        putback(*p);
        putback('$');
        break;
      }
      p--;
    }
    p--;
  }
  if (p == t)
    putback(*p);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<convert>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L43
L3:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L36
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L10
L36:
  cmpl   $0x0,-0x14(%rbp)
  jns    L24
  mov    -0x10(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L10
L24:
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0xc(%rbp)
L10:
  addl   $0x1,-0x8(%rbp)
L43:
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L3
  mov    -0x10(%rbp),%eax
  imul   $0x3c,%eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  leave
  ret
```

assistant: ```c
int convert(char *time) {
  int idx = -1;
  int hour = 0;
  int mins = 0;
  int size = strlen(time);
  for (int i = 0; i < size; i++) {
    if (time[i] == ':') {
      idx = i;
    } else if (idx < 0) {
      hour = hour * 10 + time[i] - '0';
    } else {
      mins = mins * 10 + time[i] - '0';
    }
  }
  return 60 * hour + mins;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<convert>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L5
  mov    %eax,%eax
  mov    $0x0,%edx
  mov    $0x0,%edi
  mov    $0x0,%esi
  mov    $0xffffffff,%r8d
  jmp    L69
L36:
  lea    (%rsi,%rsi,4),%esi
  movsbl %cl,%ecx
  lea    -0x30(%rcx,%rsi,2),%esi
  jmp    L48
L67:
  mov    %edx,%r8d
L48:
  add    $0x1,%rdx
  cmp    %rax,%rdx
  je     L58
L69:
  movzbl (%rbx,%rdx,1),%ecx
  cmp    $0x3a,%cl
  je     L67
  test   %r8d,%r8d
  js     L36
  lea    (%rdi,%rdi,4),%edi
  movsbl %cl,%ecx
  lea    -0x30(%rcx,%rdi,2),%edi
  jmp    L48
L5:
  mov    $0x0,%edi
  mov    $0x0,%esi
L58:
  imul   $0x3c,%esi,%eax
  add    %edi,%eax
  pop    %rbx
  ret
```

assistant: ```c
int convert(char *time) {
  int idx = -1;
  int hour = 0;
  int mins = 0;
  int size = strlen(time);
  for (int i = 0; i < size; i++) {
    if (time[i] == ':') {
      idx = i;
    } else if (idx < 0) {
      hour = hour * 10 + time[i] - '0';
    } else {
      mins = mins * 10 + time[i] - '0';
    }
  }
  return 60 * hour + mins;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<convert>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L8
  cltq
  xor    %edx,%edx
  xor    %edi,%edi
  xor    %esi,%esi
  mov    $0xffffffff,%r8d
  jmp    L59
  nopl   0x0(%rax)
L34:
  cmp    $0xffffffff,%r8d
  je     L23
  lea    (%rdi,%rdi,4),%edi
  lea    -0x30(%rcx,%rdi,2),%edi
L12:
  add    $0x1,%rdx
  cmp    %rdx,%rax
  je     L47
L59:
  movsbl (%rbx,%rdx,1),%ecx
  cmp    $0x3a,%cl
  jne    L34
  mov    %edx,%r8d
  add    $0x1,%rdx
  cmp    %rdx,%rax
  jne    L59
L47:
  imul   $0x3c,%esi,%eax
  pop    %rbx
  add    %edi,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L23:
  lea    (%rsi,%rsi,4),%esi
  lea    -0x30(%rcx,%rsi,2),%esi
  jmp    L12
  nopl   0x0(%rax)
L8:
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int convert(char *time) {
  int idx = -1;
  int hour = 0;
  int mins = 0;
  int size = strlen(time);
  for (int i = 0; i < size; i++) {
    if (time[i] == ':') {
      idx = i;
    } else if (idx < 0) {
      hour = hour * 10 + time[i] - '0';
    } else {
      mins = mins * 10 + time[i] - '0';
    }
  }
  return 60 * hour + mins;
}
```