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

```asm
<curious_fraction>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rcx
  mov    %rcx,0x18(%rsp)
  xor    %ecx,%ecx
  movl   $0x0,0x8(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x10(%rsp)
  movl   $0x0,0x14(%rsp)
  cmp    %esi,%edi
  jge    L95
  mov    %edi,%edx
  mov    %esi,%eax
  test   %edi,%edi
  jle    L12
  movslq %edi,%rcx
  imul   $0x66666667,%rcx,%rcx
  sar    $0x22,%rcx
  mov    %edi,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  lea    (%rcx,%rcx,4),%esi
  add    %esi,%esi
  sub    %esi,%edi
  mov    %edi,0x8(%rsp)
  cmp    $0x9,%edx
  jle    L12
  movslq %ecx,%rsi
  imul   $0x66666667,%rsi,%rsi
  sar    $0x22,%rsi
  mov    %ecx,%edi
  sar    $0x1f,%edi
  sub    %edi,%esi
  lea    (%rsi,%rsi,4),%esi
  add    %esi,%esi
  sub    %esi,%ecx
  mov    %ecx,0xc(%rsp)
L12:
  test   %eax,%eax
  jle    L5
  movslq %eax,%rcx
  imul   $0x66666667,%rcx,%rcx
  sar    $0x22,%rcx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  lea    (%rcx,%rcx,4),%esi
  add    %esi,%esi
  mov    %eax,%edi
  sub    %esi,%edi
  mov    %edi,0x10(%rsp)
  cmp    $0x9,%eax
  jle    L5
  movslq %ecx,%rsi
  imul   $0x66666667,%rsi,%rsi
  sar    $0x22,%rsi
  mov    %ecx,%edi
  sar    $0x1f,%edi
  sub    %edi,%esi
  lea    (%rsi,%rsi,4),%esi
  add    %esi,%esi
  sub    %esi,%ecx
  mov    %ecx,0x14(%rsp)
L5:
  mov    0x8(%rsp),%ecx
  mov    $0xffffffff,%edi
  mov    $0xffffffff,%esi
  test   %ecx,%ecx
  jne    L48
L23:
  mov    0xc(%rsp),%ecx
  test   %ecx,%ecx
  jne    L22
L50:
  mov    $0x0,%ecx
  cmp    $0xffffffff,%esi
  je     L95
  movslq %esi,%rsi
  pxor   %xmm1,%xmm1
  cvtsi2ssl 0x8(%rsp,%rsi,4),%xmm1
  movslq %edi,%rdi
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x10(%rsp,%rdi,4),%xmm0
  divss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  divss  %xmm2,%xmm0
  ucomiss %xmm0,%xmm1
  setnp  %cl
  movzbl %cl,%ecx
  mov    $0x0,%eax
  cmovne %eax,%ecx
L95:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L101
  mov    %ecx,%eax
  add    $0x28,%rsp
  ret
L48:
  cmp    0x14(%rsp),%ecx
  sete   %dil
  movzbl %dil,%edi
  sub    $0x1,%edi
  cmp    0x14(%rsp),%ecx
  sete   %sil
  movzbl %sil,%esi
  lea    -0x1(%rsi,%rsi,1),%esi
  jmp    L23
L22:
  cmp    0x10(%rsp),%ecx
  mov    $0x1,%r8d
  cmove  %r8d,%edi
  mov    $0x0,%ecx
  cmove  %ecx,%esi
  jmp    L50
L101:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int curious_fraction(int num, int den) {
  int i, j, p, curious_num = -1, curious_den = -1;
  int digits_of_num[2] = {0, 0};
  int digits_of_den[2] = {0, 0};
  float fraction, check;
  if (num == den || num >= den)
    return 0;
  i = num;
  p = 0;
  while (i > 0) {
    digits_of_num[p++] = i % 10;
    i = i / 10;
  }
  i = den;
  p = 0;
  while (i > 0) {
    digits_of_den[p++] = i % 10;
    i = i / 10;
  }
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
      if (digits_of_num[i] != 0 && i != j && digits_of_num[i] == digits_of_den[j]) {
        curious_num = (i == 0) ? 1 : 0;
        curious_den = (j == 0) ? 1 : 0;
      }
    }
  }
  if (curious_num == -1)
    return 0;
  fraction = (float)num / den;
  check = (float)digits_of_num[curious_num] / digits_of_den[curious_den];
  return (fraction == check);
}
```