user: What would the C source look like for the assembly code provided here:

```asm
<couponposoffer>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    %edx,%ebx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    0x40(%rsp),%r13
  mov    0x48(%rsp),%r12
  cmp    %ecx,%ebx
  jl     L119
  test   %ebx,%ebx
  lea    -0x15(%rbx),%esi
  mov    %rdi,%r14
  mov    %r9,%rbp
  setne  %cl
  cmp    $0xf,%esi
  jbe    L51
  test   %cl,%cl
  je     L51
  movl   $0x4,(%r9)
L119:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L69
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L51:
  mov    0x50(%rsp),%eax
  test   %eax,%eax
  jne    L83
  test   %cl,%cl
  jne    L5
L83:
  mov    $0x1,%eax
  jmp    L119
  nopl   0x0(%rax,%rax,1)
L5:
  sub    $0x8,%rsp
  movslq %edx,%rdx
  mov    $0x1,%r8d
  mov    %ebx,%esi
  push   %r12
  add    %r14,%rdx
  lea    D35(%rip),%rcx
  mov    %r14,%rdi
  push   %r13
  push   %rbp
  lea    0x24(%rsp),%r9
  call   <coupon_val@plt>
  add    $0x20,%rsp
  mov    %rax,%rdx
  test   %rax,%rax
  je     L6
  cmpl   $0x1,0x4(%rsp)
  ja     L67
  sub    $0x8,%rsp
  xor    %r9d,%r9d
  mov    $0x6,%r8d
  mov    %ebx,%esi
  push   %r12
  lea    D55(%rip),%rcx
  mov    %r14,%rdi
  push   %r13
  push   %rbp
  push   $0x0
  push   $0x6
  call   <coupon_vli@plt>
  add    $0x30,%rsp
  mov    %rax,%rdx
  test   %rax,%rax
  je     L6
  sub    $0x8,%rsp
  xor    %r9d,%r9d
  mov    $0x6,%r8d
  mov    %ebx,%esi
  push   %r12
  lea    D59(%rip),%rcx
  mov    %r14,%rdi
  push   %r13
  push   %rbp
  call   <coupon_val@plt>
  add    $0x20,%rsp
  mov    %rax,%rdx
  test   %rax,%rax
  je     L6
  sub    $0x8,%rsp
  xor    %r9d,%r9d
  mov    $0x6,%r8d
  mov    %ebx,%esi
  push   %r12
  lea    D7(%rip),%rcx
  mov    %r14,%rdi
  push   %r13
  push   %rbp
  push   $0x0
  push   $0x9
  call   <coupon_vli@plt>
  add    $0x30,%rsp
  test   %rax,%rax
  je     L6
  sub    %r14,%rax
  movslq %ebx,%rbx
  mov    %rax,%rdx
  mov    $0x1,%eax
  cmp    %rbx,%rdx
  je     L119
  lea    0x1(%rdx),%eax
  movl   $0x3,0x0(%rbp)
  lea    D43(%rip),%rsi
  mov    %r12,%rdi
  mov    %eax,0x0(%r13)
  call   <strcpy@plt>
L6:
  xor    %eax,%eax
  jmp    L119
  nopw   0x0(%rax,%rax,1)
L67:
  sub    %r14d,%edx
  movl   $0x3,0x0(%rbp)
  lea    D44(%rip),%rsi
  mov    %r12,%rdi
  mov    %edx,0x0(%r13)
  call   <strcpy@plt>
  xor    %eax,%eax
  jmp    L119
L69:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D35
type: string
name: retrieve_data
arguments: data_tag: D55
type: string
name: retrieve_data
arguments: data_tag: D59
type: string
name: retrieve_data
arguments: data_tag: D7
type: string
name: retrieve_data
arguments: data_tag: D43
type: string
name: retrieve_data
arguments: data_tag: D44
type: string

tool: D35: Coupon Format

tool: D55: Coupon Funder ID

tool: D59: Offer Code

tool: D7: Serial Number

tool: D43: Reserved trailing characters

tool: D44: Coupon Format must be 0 or 1

assistant: ```c
int couponposoffer(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no, int *p_err_posn, char err_msg[50], const int length_only) {
  const int min_len = 1 + 1 + 6 + 6 + 1 + 6;
  const int max_len = 36;
  (void)max;
  data_len -= offset;
  if (data_len < min) {
    return 0;
  }
  if (data_len && (data_len < min_len || data_len > max_len)) {
    *p_err_no = 4;
    return 0;
  }
  if (!length_only && data_len) {
    const unsigned char *d = data + offset;
    int val;
    d = coupon_val(data, data_len, d, "Coupon Format", 1, &val, p_err_no, p_err_posn, err_msg);
    if (d == NULL) {
      return 0;
    }
    if (val != 0 && val != 1) {
      *p_err_no = 3;
      *p_err_posn = d - 1 - data + 1;
      strcpy(err_msg, "Coupon Format must be 0 or 1");
      return 0;
    }
    d = coupon_vli(data, data_len, d, "Coupon Funder ID", 6, 0, 6, 0, p_err_no, p_err_posn, err_msg);
    if (d == NULL) {
      return 0;
    }
    d = coupon_val(data, data_len, d, "Offer Code", 6, NULL, p_err_no, p_err_posn, err_msg);
    if (d == NULL) {
      return 0;
    }
    d = coupon_vli(data, data_len, d, "Serial Number", 6, 0, 9, 0, p_err_no, p_err_posn, err_msg);
    if (d == NULL) {
      return 0;
    }
    if (d - data != data_len) {
      *p_err_no = 3;
      *p_err_posn = d - data + 1;
      strcpy(err_msg, "Reserved trailing characters");
      return 0;
    }
  }
  return 1;
}
```