user: Please show me the C implementation that matches the assembly code listed below:

```asm
<add>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %edx,0xa8(%rsp)
  mov    %ecx,0x24(%rsp)
  cmp    %r8d,%ecx
  je     L40
  test   %edx,%edx
  jle    L127
  movslq %ecx,%rax
  mov    %rsi,%r14
  mov    %r8d,%r13d
  lea    0x2(%rax),%edx
  lea    0x5(%rax),%ecx
  mov    %r14,0x88(%rsp)
  mov    %edx,0x90(%rsp)
  lea    0x3(%rax),%edx
  lea    0x1(%rax),%esi
  mov    %edx,0x94(%rsp)
  lea    0x4(%rax),%edx
  mov    %ecx,0x44(%rsp)
  lea    0x7(%rax),%ecx
  mov    %edx,0x6c(%rsp)
  lea    0x6(%rax),%edx
  mov    %ecx,0x20(%rsp)
  lea    0x8(%rax),%ecx
  add    %rdi,%rax
  mov    %rax,0xb0(%rsp)
  mov    0xa8(%rsp),%eax
  mov    %esi,0xac(%rsp)
  sub    $0x1,%eax
  mov    %edx,0x68(%rsp)
  lea    0x1(%r14,%rax,1),%rax
  mov    %ecx,0x40(%rsp)
  mov    %rax,0x10(%rsp)
  movslq %esi,%rax
  mov    %rax,0xa0(%rsp)
  movslq %ecx,%rax
  add    %rdi,%rax
  mov    %rax,(%rsp)
  mov    %r14,%rax
  mov    %rdi,%r14
  mov    %rax,%r15
L82:
  mov    0x88(%rsp),%rax
  mov    0xb0(%rsp),%rsi
  movzbl (%rax),%eax
  mov    %al,(%rsi)
  mov    0xa0(%rsp),%rax
  cmp    %r13d,0xac(%rsp)
  je     L211
  add    %r14,%rax
  mov    %r15,0x80(%rsp)
  mov    %rax,0xb8(%rsp)
  movslq 0x90(%rsp),%rax
  add    %r14,%rax
  mov    %rax,0x98(%rsp)
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %rax,%r14
L308:
  mov    0x80(%rsp),%rax
  mov    0xb8(%rsp),%rsi
  movzbl (%rax),%eax
  mov    %al,(%rsi)
  cmp    0x90(%rsp),%r13d
  je     L9
  movslq 0x94(%rsp),%rax
  mov    %r14,0x78(%rsp)
  add    %r15,%rax
  mov    %rax,0x70(%rsp)
  mov    %r14,%rax
  mov    %r15,%r14
  mov    %rax,%r15
L86:
  mov    0x78(%rsp),%rax
  mov    0x98(%rsp),%rsi
  movzbl (%rax),%eax
  mov    %al,(%rsi)
  cmp    0x94(%rsp),%r13d
  je     L35
  movslq 0x6c(%rsp),%rax
  mov    %r15,0x38(%rsp)
  add    %r14,%rax
  mov    %rax,0x58(%rsp)
  mov    %r13d,%eax
  mov    %r15,%r13
  mov    %eax,%r15d
L213:
  mov    0x38(%rsp),%rax
  mov    0x70(%rsp),%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  cmp    0x6c(%rsp),%r15d
  je     L81
  movslq 0x44(%rsp),%rax
  mov    %r13,0x8(%rsp)
  add    %r14,%rax
  mov    %rax,0x60(%rsp)
L222:
  mov    0x8(%rsp),%rax
  mov    0x58(%rsp),%rsi
  movzbl (%rax),%eax
  mov    %al,(%rsi)
  cmp    0x44(%rsp),%r15d
  je     L37
  movslq 0x68(%rsp),%rax
  mov    %r13,0x28(%rsp)
  add    %r14,%rax
  mov    %rax,0x30(%rsp)
L92:
  mov    0x28(%rsp),%rax
  mov    0x60(%rsp),%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  cmp    0x68(%rsp),%r15d
  je     L47
  mov    0x24(%rsp),%eax
  movslq 0x20(%rsp),%rbx
  mov    %r13,0x18(%rsp)
  lea    0x9(%rax),%r12d
  add    %r14,%rbx
  mov    %r12d,%eax
  mov    %rbx,%r12
  mov    %r14,%rbx
  mov    %eax,%r14d
L65:
  mov    0x18(%rsp),%rax
  mov    0x30(%rsp),%rsi
  mov    %r13,%rbp
  movzbl (%rax),%eax
  mov    %al,(%rsi)
  cmp    0x20(%rsp),%r15d
  je     L301
  mov    %rbx,%r13
  mov    %rbp,%rbx
L161:
  movzbl 0x0(%rbp),%eax
  mov    %al,(%r12)
  xor    %eax,%eax
  cmp    0x40(%rsp),%r15d
  je     L20
  mov    %rbp,0x48(%rsp)
  mov    %rbx,%rbp
  mov    %rax,%rbx
  mov    %r14d,%eax
  mov    %r12,0x50(%rsp)
  mov    0xa8(%rsp),%r12d
  mov    %r15d,%r14d
  mov    %eax,%r15d
L36:
  movzbl 0x0(%rbp,%rbx,1),%eax
  mov    (%rsp),%rdx
  mov    %r14d,%r8d
  mov    %r15d,%ecx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  add    $0x1,%rbx
  mov    %al,(%rdx)
  mov    %r12d,%edx
  call   <add>
  cmp    %ebx,%r12d
  jg     L36
  mov    %r15d,%eax
  mov    %rbp,%rbx
  mov    0x50(%rsp),%r12
  mov    0x48(%rsp),%rbp
  mov    %r14d,%r15d
  mov    %eax,%r14d
L39:
  add    $0x1,%rbp
  cmp    %rbp,0x10(%rsp)
  jne    L161
  mov    %rbx,%rax
  mov    %r13,%rbx
  mov    %rax,%r13
L163:
  addq   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  jne    L65
  mov    %rbx,%r14
L329:
  addq   $0x1,0x28(%rsp)
  mov    0x28(%rsp),%rax
  cmp    0x10(%rsp),%rax
  jne    L92
L272:
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    0x10(%rsp),%rax
  jne    L222
L199:
  addq   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  jne    L213
  mov    %r15d,%eax
  mov    %r13,%r15
  mov    %eax,%r13d
L250:
  addq   $0x1,0x78(%rsp)
  mov    0x78(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  jne    L86
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %rax,%r14
L325:
  addq   $0x1,0x80(%rsp)
  mov    0x80(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  jne    L308
  mov    %r14,%rax
  mov    %r15,%r14
  mov    %rax,%r15
L178:
  addq   $0x1,0x88(%rsp)
  mov    0x88(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  jne    L82
L127:
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L20:
  mov    (%rsp),%rax
  mov    %r13,%rdi
  movb   $0x0,(%rax)
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L39
  mov    %r13,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L39
  nopl   0x0(%rax)
L301:
  movb   $0x0,(%r12)
  mov    %rbx,%rdi
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L163
  mov    %rbx,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L163
L47:
  mov    0x30(%rsp),%rax
  mov    %r14,%rdi
  movb   $0x0,(%rax)
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L329
  mov    %r14,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L329
L37:
  mov    0x60(%rsp),%rax
  mov    %r14,%rdi
  movb   $0x0,(%rax)
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L272
  mov    %r14,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L272
L81:
  mov    0x58(%rsp),%rax
  mov    %r14,%rdi
  movb   $0x0,(%rax)
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L199
  mov    %r14,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L199
L35:
  mov    0x70(%rsp),%rax
  mov    %r14,%rdi
  movb   $0x0,(%rax)
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L250
  mov    %r14,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L250
L9:
  mov    0x98(%rsp),%rax
  mov    %r15,%rdi
  movb   $0x0,(%rax)
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L325
  mov    %r15,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L325
L211:
  movb   $0x0,(%r14,%rax,1)
  mov    %r14,%rdi
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L178
  mov    %r14,%rsi
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L178
L40:
  movslq 0x24(%rsp),%rax
  movb   $0x0,(%rdi,%rax,1)
  call   <atoi@plt>
  imul   $0xb6db6db7,%eax,%eax
  add    $0x12492492,%eax
  cmp    $0x24924924,%eax
  ja     L127
  add    $0xc8,%rsp
  mov    %r15,%rsi
  lea    D54(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <printf@plt>
```

tool_calls: name: unpack_data
arguments: label: D54
datatype: string

tool: D54: %s


assistant: ```c
void add(char *v, char *digits, int n_digits, int position, int max) {
  if (position == max) {
    v[position] = '\0';
    if (atoi(v) % 7 == 0)
      printf("%s\n", v);
  } else {
    int i;
    for (i = 0; i < n_digits; i++) {
      v[position] = digits[i];
      add(v, digits, n_digits, position + 1, max);
    }
  }
}
```