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

```asm
<main>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  push   %r13
  mov    $0xb78dcab0,%r13d
  push   %r12
  movabs $0xf3b724a1b01c22ef,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  movq   $0x0,(%rsp)
L139:
  mov    $0x1,%r14d
  jmp    L205
  nopl   0x0(%rax)
L49:
  add    $0x1,%ebp
L57:
  imul   $0x58e96,%rbx,%rcx
  add    %r13,%rcx
  mov    %rcx,%rax
  mul    %r12
  shr    $0x13,%rdx
  imul   $0x8673b,%rdx,%rax
  sub    %rax,%rcx
  add    %rcx,%r14
  mov    %rcx,%rbx
  mov    %r14,%rax
  shr    $0x18,%rax
  cmp    $0xfe,%eax
  jg     L80
L205:
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <Chk@plt>
  cmp    $0x1,%al
  je     L51
  test   %r15,%r15
  je     L49
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <Chk@plt>
  cmp    $0x1,%al
  je     L51
  add    $0x2,%ebp
  jmp    L57
  nopl   (%rax)
L80:
  mov    %r15,%rax
  sub    (%rsp),%rax
  cmp    $0x3d08f,%rax
  ja     L156
L55:
  movabs $0xdfb23b0979b4b02f,%rdx
  mov    %rbx,%rax
  mul    %rdx
  mov    %rbx,%rax
  shr    $0x11,%rdx
  imul   $0x249f0,%rdx,%rdx
  sub    %rdx,%rax
  add    %rax,%r15
  mov    %r15,%rax
  shr    $0x18,%rax
  cmp    $0xfe,%eax
  jle    L139
  movq   $0xf0,(%rsp)
  xor    %r13d,%r13d
  mov    $0xb78dcab0,%ebp
  movabs $0xf3b724a1b01c22ef,%r12
L67:
  lea    0x1f4(%r13),%r14
L77:
  mov    $0x1,%r15d
  jmp    L182
  nopw   0x0(%rax,%rax,1)
L103:
  imul   $0x58e96,%rbx,%rcx
  add    %rbp,%rcx
  mov    %rcx,%rax
  mul    %r12
  mov    %rdx,%rbx
  shr    $0x13,%rbx
  imul   $0x8673b,%rbx,%rax
  mov    %rcx,%rbx
  sub    %rax,%rbx
  add    %rbx,%r15
  mov    %r15,%rax
  shr    $0x18,%rax
  cmp    $0xfe,%eax
  jg     L122
L182:
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <Chk@plt>
  cmp    $0x1,%al
  je     L51
  test   %r13,%r13
  je     L103
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <Chk@plt>
  sub    $0x1,%al
  jne    L103
L51:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L156:
  mov    $0x3d090,%ecx
  mov    %r15,%rax
  xor    %edx,%edx
  mov    $0x2e,%edi
  div    %rcx
  imul   $0x3d090,%rax,%rax
  mov    %rax,%r14
  mov    %rax,(%rsp)
  call   <putchar@plt>
  mov    $0x989680,%ecx
  mov    %r14,%rax
  xor    %edx,%edx
  div    %rcx
  test   %rdx,%rdx
  jne    L55
  mov    $0x2710,%esi
  mov    %r15,%rax
  xor    %edx,%edx
  div    %rsi
  lea    D2(%rip),%rdi
  mov    %rdx,%r8
  xor    %edx,%edx
  div    %rsi
  mov    $0x5f5e100,%esi
  mov    %r15,%rax
  mov    %edx,%ecx
  xor    %edx,%edx
  div    %rsi
  mov    %ebp,%esi
  xor    %ebp,%ebp
  mov    %eax,%edx
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L55
L122:
  mov    $0xa,%ecx
  mov    %r13,%rax
  xor    %edx,%edx
  div    %rcx
  test   %rdx,%rdx
  je     L143
L147:
  add    $0x1,%r13
  cmp    %r13,%r14
  ja     L77
  mov    $0x2710,%ecx
  mov    %r13,%rax
  xor    %edx,%edx
  mov    $0x5f5e100,%edi
  div    %rcx
  mov    %rdx,%rsi
  xor    %edx,%edx
  div    %rcx
  mov    %r13,%rax
  mov    %esi,%ecx
  mov    %rdx,0x8(%rsp)
  xor    %edx,%edx
  div    %rdi
  mov    0x8(%rsp),%rdx
  lea    D13(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    (%rsp),%rax
  cmp    $0x1fffffff,%rax
  ja     L12
  add    $0x8,%rax
  lea    (%rax,%rax,1),%r13
L62:
  mov    %r13,(%rsp)
  jmp    L67
L143:
  mov    $0x2e,%edi
  call   <putchar@plt>
  jmp    L147
L12:
  mov    (%rsp),%r13
  mov    $0xdfffffff,%eax
  add    $0x20000000,%r13
  cmp    %rax,%r13
  jbe    L62
  add    $0x18,%rsp
  lea    D0(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <puts@plt>
```

tool_calls: name: read_data
arguments: tag: D2
type_infered: string
name: read_data
arguments: tag: D13
type_infered: string
name: read_data
arguments: tag: D0
type_infered: string

tool: D2: # %d %2d%04d%04d


tool: D13: #%2d%04d%04d


tool: D0: OK!

assistant: ```c
void main() {
  unsigned char X;
  unsigned long A, B, LA, Rndm, Sh, Sk;
  int Cnt;
  char Chk(unsigned long, unsigned long);
  Rndm = 0;
  LA = 0;
  Cnt = 0;
  for (A = 0; (int)(A / 16777216) < 255; A += Rndm % 150000) {
    for (B = 1; (int)(B / 16777216) < 255; B += Rndm) {
      X = Chk(A, B);
      if (X == (char)1)
        return;
      Cnt++;
      if (A != 0) {
        X = Chk(B, A);
        if (X == (char)1)
          return;
        Cnt++;
      }
      Rndm = ((Rndm + 8456) * 364182) % 550715;
    }
    if ((A - LA) >= 250000) {
      LA = (A / 250000) * 250000;
      printf(".");
      if (LA % 10000000 == 0) {
        printf("# %d %2d%04d%04d\n", Cnt, (int)(A / 100000000), (int)(A / 10000 % 10000), (int)(A % 10000));
        Cnt = 0;
      }
    }
  }
  Sh = 0xf0;
  for (A = 0; A < 0xe0000000; A = Sh) {
    for (Sk = A + 500; A < Sk; A++) {
      for (B = 1; (int)(B / 16777216) < 255; B += Rndm) {
        X = Chk(A, B);
        if (X == (char)1)
          return;
        if (A != 0) {
          X = Chk(B, A);
          if (X == (char)1)
            return;
        }
        Rndm = ((Rndm + 8456) * 364182) % 550715;
      }
      if (A % 10 == 0)
        printf(".");
    }
    printf("#%2d%04d%04d\n", (int)(A / 100000000), (int)(A / 10000 % 10000), (int)(A % 10000));
    if (Sh < 0x20000000)
      Sh = Sh * 2 + 16;
    else
      Sh += 0x20000000;
  }
  printf("OK!\n");
}
```