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

```asm
<check_set>:
  endbr64
  push   %r15
  lea    0x1(%rdi),%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x18,%rsp
  movl   $0x4,0xc(%rsp)
  movl   $0x3,0x8(%rsp)
  movl   $0x2,0x4(%rsp)
  nopl   0x0(%rax)
L110:
  mov    0x4(%rsp),%eax
  mov    %r15,%r12
  cmp    $0x7,%ebx
  je     L280
L239:
  movsbl (%r14),%edi
  cmp    $0x1,%ebx
  je     L105
  movsbl 0x1(%r14),%edx
  lea    (%rdi,%rdi,4),%esi
  lea    (%rdx,%rsi,2),%edi
  cmp    $0x2,%ebx
  je     L105
  movsbl 0x2(%r14),%edx
  lea    (%rdi,%rdi,4),%esi
  lea    (%rdx,%rsi,2),%edi
  cmp    $0x3,%ebx
  je     L105
  movsbl 0x3(%r14),%edx
  lea    (%rdi,%rdi,4),%esi
  lea    (%rdx,%rsi,2),%edi
  cmp    $0x4,%ebx
  je     L105
  movsbl 0x4(%r14),%edx
  lea    (%rdi,%rdi,4),%esi
  lea    (%rdx,%rsi,2),%edi
  cmp    $0x5,%ebx
  je     L105
  movsbl 0x5(%r14),%edx
  lea    (%rdi,%rdi,4),%esi
  lea    (%rdx,%rsi,2),%edi
  cmp    $0x7,%ebx
  jne    L105
  movsbl 0x6(%r14),%edx
  lea    (%rdi,%rdi,4),%esi
  lea    (%rdx,%rsi,2),%edi
L105:
  cmp    %eax,%ebx
  jge    L19
  movsbl (%r15),%esi
  cmp    0x4(%rsp),%eax
  jle    L15
  movsbl 0x1(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  cmp    0x8(%rsp),%eax
  jle    L15
  movsbl 0x2(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  cmp    0xc(%rsp),%eax
  jle    L15
  movsbl 0x3(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0x4(%rbx),%edx
  cmp    %edx,%eax
  jle    L15
  movsbl 0x4(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0x5(%rbx),%edx
  cmp    %edx,%eax
  jle    L15
  movsbl 0x5(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0x6(%rbx),%edx
  cmp    %edx,%eax
  jle    L15
  movsbl 0x6(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0x7(%rbx),%edx
  cmp    %edx,%eax
  jle    L15
  movsbl 0x7(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0x8(%rbx),%edx
  cmp    %edx,%eax
  jle    L68
  movsbl 0x8(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0x9(%rbx),%edx
  cmp    %edx,%eax
  jle    L68
  movsbl 0x9(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0xa(%rbx),%edx
  cmp    %edx,%eax
  jle    L68
  movsbl 0xa(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
  lea    0xb(%rbx),%edx
  cmp    %edx,%eax
  jle    L68
  movsbl 0xb(%r15),%edx
  lea    (%rsi,%rsi,4),%esi
  lea    (%rdx,%rsi,2),%esi
L68:
  xor    %edx,%edx
  lea    0x1(%rax),%ebp
L166:
  mov    %edx,(%rsp)
  call   <check@plt>
  mov    (%rsp),%edx
  add    %r13d,%edx
  test   %rax,%rax
  mov    %ebp,%eax
  cmovne %edx,%r13d
  add    $0x1,%r12
  cmp    $0x8,%ebp
  jne    L239
L280:
  add    $0x1,%ebx
  addl   $0x1,0x4(%rsp)
  add    $0x1,%r15
  addl   $0x1,0x8(%rsp)
  addl   $0x1,0xc(%rsp)
  cmp    $0x8,%ebx
  jne    L110
  add    $0x18,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L19:
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L15:
  cmp    $0x8,%eax
  jg     L68
  movsbl 0x1(%r12),%edx
  lea    0x1(%rax),%ebp
  je     L166
  lea    (%rdx,%rdx,4),%r10d
  movslq %ebp,%rdx
  movsbl (%r14,%rdx,1),%edx
  lea    (%rdx,%r10,2),%edx
  lea    0x2(%rax),%r10d
  cmp    $0x7,%eax
  je     L166
  movslq %r10d,%r10
  lea    (%rdx,%rdx,4),%edx
  movsbl (%r14,%r10,1),%r10d
  lea    (%r10,%rdx,2),%edx
  lea    0x3(%rax),%r10d
  cmp    $0x6,%eax
  je     L166
  movslq %r10d,%r10
  lea    (%rdx,%rdx,4),%edx
  movsbl (%r14,%r10,1),%r10d
  lea    (%r10,%rdx,2),%edx
  lea    0x4(%rax),%r10d
  cmp    $0x5,%eax
  je     L166
  movslq %r10d,%r10
  lea    (%rdx,%rdx,4),%edx
  movsbl (%r14,%r10,1),%r10d
  lea    (%r10,%rdx,2),%edx
  lea    0x5(%rax),%r10d
  cmp    $0x4,%eax
  je     L166
  movslq %r10d,%r10
  lea    (%rdx,%rdx,4),%edx
  movsbl (%r14,%r10,1),%r10d
  lea    (%r10,%rdx,2),%edx
  lea    0x6(%rax),%r10d
  cmp    $0x3,%eax
  je     L166
  movslq %r10d,%r10
  lea    (%rdx,%rdx,4),%edx
  movsbl (%r14,%r10,1),%eax
  lea    (%rax,%rdx,2),%edx
  jmp    L166
```

assistant: ```c
int check_set(char *array) {
  int i, j;
  int ret = 0;
  for (i = 1; i <= 7; i++) {
    for (j = 1; j < 8 - i; j++) {
      int a, b, c, k;
      a = b = c = 0;
      for (k = 0; k < i; k++) {
        a *= 10;
        a += array[k];
      }
      for (k = i; k < i + j; k++) {
        b *= 10;
        b += array[k];
      }
      for (k = i + j; k < 9; k++) {
        c *= 10;
        c += array[k];
      }
      if (check(a, b, c)) {
        ret += c;
      }
    }
  }
  return ret;
}
```