user: 请从给定的汇编指令推导出C源代码:

```asm
<coupon_vli>:
  endbr64
  push   %r15
  push   %r14
  movslq %esi,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    %rdi,%rbp
  sub    $0x18,%rsp
  mov    %r8d,0xc(%rsp)
  cmp    %r14,%rbp
  jge    L72
  mov    %rdi,%r12
  mov    $0x1,%esi
  mov    %rdx,%rdi
  mov    %rdx,%rbx
  mov    %r9d,%r15d
  call   <to_int@plt>
  mov    0x58(%rsp),%edx
  test   %edx,%edx
  sete   %cl
  cmp    %r15d,%eax
  jl     L138
  cmp    0x50(%rsp),%eax
  jg     L138
  lea    0x1(%rbx),%rdx
  cmp    $0x9,%eax
  jne    L147
  test   %cl,%cl
  je     L43
L147:
  mov    %rdx,%rsi
  movslq 0xc(%rsp),%rbp
  cltq
  sub    %r12,%rsi
  lea    (%rax,%rsi,1),%rcx
  add    %rbp,%rcx
  cmp    %rcx,%r14
  jl     L126
  add    %rbp,%rax
  lea    (%rdx,%rax,1),%r8
  cmp    %r8,%rdx
  jb     L85
  jmp    L43
  nopw   0x0(%rax,%rax,1)
L130:
  add    $0x1,%rdx
  cmp    %rdx,%r8
  je     L61
L85:
  movzbl (%rdx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  jbe    L130
  mov    0x60(%rsp),%rax
  mov    0x68(%rsp),%rdi
  lea    D41(%rip),%rsi
  movl   $0x3,(%rax)
  mov    %rdx,%rax
  sub    %r12,%rax
  add    $0x1,%eax
  mov    %eax,(%rdi)
  mov    0x70(%rsp),%rdi
  xor    %eax,%eax
  movzbl (%rdx),%ecx
  mov    %r13,%rdx
  call   <sprintf@plt>
  xor    %r8d,%r8d
  jmp    L61
  nopl   0x0(%rax)
L138:
  cmp    $0x9,%eax
  jne    L76
  lea    0x1(%rbx),%r8
  test   %cl,%cl
  jne    L76
L61:
  add    $0x18,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L43:
  mov    %rdx,%r8
  jmp    L61
  nopl   (%rax)
L72:
  mov    0x60(%rsp),%rax
  lea    0x1(%rbp),%edx
  mov    0x70(%rsp),%rdi
  lea    D26(%rip),%rsi
  movl   $0x3,(%rax)
  mov    0x68(%rsp),%rax
  mov    %edx,(%rax)
  mov    %rcx,%rdx
  xor    %eax,%eax
  call   <sprintf@plt>
  xor    %r8d,%r8d
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L76:
  mov    0x60(%rsp),%rdi
  lea    0x1(%rbp),%edx
  test   %eax,%eax
  lea    D45(%rip),%rsi
  lea    D5(%rip),%rax
  movl   $0x3,(%rdi)
  mov    0x68(%rsp),%rdi
  cmovns %rax,%rsi
  xor    %eax,%eax
  mov    %edx,(%rdi)
  mov    0x70(%rsp),%rdi
  mov    %r13,%rdx
  movzbl (%rbx),%ecx
  call   <sprintf@plt>
  xor    %r8d,%r8d
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L126:
  mov    0x60(%rsp),%rax
  add    $0x1,%esi
  mov    0x70(%rsp),%rdi
  mov    %r13,%rdx
  movl   $0x3,(%rax)
  mov    0x68(%rsp),%rax
  mov    %esi,(%rax)
  lea    D39(%rip),%rsi
  xor    %eax,%eax
  call   <sprintf@plt>
  xor    %r8d,%r8d
  jmp    L61
```

tool_calls: name: retrieve_data
arguments: label: D41
data_type: string
name: retrieve_data
arguments: label: D26
data_type: string
name: retrieve_data
arguments: label: D45
data_type: string
name: retrieve_data
arguments: label: D5
data_type: string
name: retrieve_data
arguments: label: D39
data_type: string

tool: D41: Non-numeric %s '%c'

tool: D26: %s VLI missing

tool: D45: Non-numeric %s VLI '%c'

tool: D5: Invalid %s VLI '%c'

tool: D39: %s incomplete

assistant: ```c
const unsigned char *coupon_vli(const unsigned char *data, const int data_len, const unsigned char *d, const char *name, const int vli_offset, const int vli_min, const int vli_max, const int vli_nine, int *p_err_no, int *p_err_posn, char err_msg[50]) {
  const unsigned char *de;
  int vli;
  if (d - data + 1 > data_len) {
    *p_err_no = 3;
    *p_err_posn = d - data + 1;
    sprintf(err_msg, "%s VLI missing", name);
    return NULL;
  }
  vli = to_int(d, 1);
  if ((vli < vli_min || vli > vli_max) && (vli != 9 || !vli_nine)) {
    *p_err_no = 3;
    *p_err_posn = d - data + 1;
    sprintf(err_msg, vli < 0 ? "Non-numeric %s VLI '%c'" : "Invalid %s VLI '%c'", name, *d);
    return NULL;
  }
  d++;
  if (vli != 9 || !vli_nine) {
    if (d - data + vli + vli_offset > data_len) {
      *p_err_no = 3;
      *p_err_posn = d - data + 1;
      sprintf(err_msg, "%s incomplete", name);
      return NULL;
    }
    de = d + vli + vli_offset;
    for (; d < de; d++) {
      if (*d < '0' || *d > '9') {
        *p_err_no = 3;
        *p_err_posn = d - data + 1;
        sprintf(err_msg, "Non-numeric %s '%c'", name, *d);
        return NULL;
      }
    }
  }
  return d;
}
```