user: Converte this assembly snippet into its equivalent C code:

```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    L84
  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     L122
  cmp    0x50(%rsp),%eax
  jg     L122
  lea    0x1(%rbx),%rdx
  cmp    $0x9,%eax
  jne    L80
  test   %cl,%cl
  je     L25
L80:
  mov    %rdx,%rsi
  movslq 0xc(%rsp),%rbp
  cltq
  sub    %r12,%rsi
  lea    (%rax,%rsi,1),%rcx
  add    %rbp,%rcx
  cmp    %rcx,%r14
  jl     L34
  add    %rbp,%rax
  lea    (%rdx,%rax,1),%r8
  cmp    %r8,%rdx
  jb     L106
  jmp    L25
  nopw   0x0(%rax,%rax,1)
L61:
  add    $0x1,%rdx
  cmp    %rdx,%r8
  je     L123
L106:
  movzbl (%rdx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  jbe    L61
  mov    0x60(%rsp),%rax
  mov    0x68(%rsp),%rdi
  lea    D11(%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    L123
  nopl   0x0(%rax)
L122:
  cmp    $0x9,%eax
  jne    L59
  lea    0x1(%rbx),%r8
  test   %cl,%cl
  jne    L59
L123:
  add    $0x18,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L25:
  mov    %rdx,%r8
  jmp    L123
  nopl   (%rax)
L84:
  mov    0x60(%rsp),%rax
  lea    0x1(%rbp),%edx
  mov    0x70(%rsp),%rdi
  lea    D0(%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    L123
  nopl   0x0(%rax,%rax,1)
L59:
  mov    0x60(%rsp),%rdi
  lea    0x1(%rbp),%edx
  test   %eax,%eax
  lea    D44(%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    L123
  nopl   0x0(%rax,%rax,1)
L34:
  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    D43(%rip),%rsi
  xor    %eax,%eax
  call   <sprintf@plt>
  xor    %r8d,%r8d
  jmp    L123
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D11
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D0
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D44
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D5
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D43
type_guessed: string

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

tool: D0: %s VLI missing

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

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

tool: D43: %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;
}
```