user: Converte this assembly snippet into its equivalent C code:

```asm
<find_mantissa>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x100,%rsp
  mov    %rdi,-0xf8(%rbp)
  mov    %esi,-0xfc(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x1,-0xd8(%rbp)
  movl   $0x0,-0xe4(%rbp)
  jmp    L170
L164:
  mov    -0xd8(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,-0xd8(%rbp)
  addl   $0x1,-0xe4(%rbp)
L170:
  mov    -0xfc(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xe4(%rbp)
  jl     L164
  mov    -0xf8(%rbp),%rax
  cmp    -0xd8(%rbp),%rax
  jbe    L105
  mov    -0xd8(%rbp),%rax
  sub    %rax,-0xf8(%rbp)
L105:
  mov    $0x2e,%edi
  call   <malloc@plt>
  mov    %rax,-0xc8(%rbp)
  movw   $0x0,-0xe8(%rbp)
  movl   $0x0,-0xe0(%rbp)
  mov    -0xf8(%rbp),%rax
  mov    %rax,-0xd0(%rbp)
  movw   $0x0,-0xe6(%rbp)
  movl   $0x0,-0xdc(%rbp)
  jmp    L197
L22:
  shlq   -0xd0(%rbp)
  mov    -0xd0(%rbp),%rax
  cmp    -0xd8(%rbp),%rax
  jb     L219
  movswq -0xe8(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  movw   $0x1,(%rax)
  jmp    L247
L219:
  movswq -0xe8(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  movw   $0x0,(%rax)
L247:
  movzwl -0xe8(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xe8(%rbp)
  mov    -0xd0(%rbp),%rax
  cmp    -0xd8(%rbp),%rax
  jb     L151
  mov    -0xd8(%rbp),%rax
  sub    %rax,-0xd0(%rbp)
L151:
  cmpq   $0xa,-0xd0(%rbp)
  jbe    L144
  mov    -0xd0(%rbp),%rax
  movabs $0xcccccccccccccccd,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x3,%rax
  mov    %rax,-0xd0(%rbp)
  mov    -0xd8(%rbp),%rax
  movabs $0xcccccccccccccccd,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x3,%rax
  mov    %rax,-0xd8(%rbp)
L144:
  movl   $0x0,-0xe4(%rbp)
  jmp    L190
L23:
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0xc0(%rbp,%rax,8),%rax
  cmp    %rax,-0xd0(%rbp)
  jne    L33
  mov    -0xe4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xdc(%rbp)
  movw   $0x1,-0xe6(%rbp)
  jmp    L37
L33:
  addl   $0x1,-0xe4(%rbp)
L190:
  mov    -0xe4(%rbp),%eax
  cmp    -0xe0(%rbp),%eax
  jl     L23
L37:
  cmpw   $0x0,-0xe6(%rbp)
  jne    L197
  mov    -0xe0(%rbp),%eax
  cltq
  mov    -0xd0(%rbp),%rdx
  mov    %rdx,-0xc0(%rbp,%rax,8)
  addl   $0x1,-0xe0(%rbp)
L197:
  cmpw   $0x17,-0xe8(%rbp)
  jg     L120
  cmpq   $0x0,-0xd0(%rbp)
  je     L120
  cmpw   $0x0,-0xe6(%rbp)
  je     L22
L120:
  cmpq   $0x0,-0xd0(%rbp)
  je     L70
  cmpw   $0x1,-0xe6(%rbp)
  jne    L70
  mov    -0xdc(%rbp),%eax
  mov    %eax,-0xe4(%rbp)
  jmp    L167
L204:
  mov    -0xe4(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  movswq -0xe8(%rbp),%rdx
  lea    (%rdx,%rdx,1),%rcx
  mov    -0xc8(%rbp),%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  movzwl -0xe8(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xe8(%rbp)
  addl   $0x1,-0xe4(%rbp)
L167:
  cmpl   $0x17,-0xe4(%rbp)
  jle    L204
L70:
  cmpq   $0x0,-0xd0(%rbp)
  jne    L0
  cmpw   $0x0,-0xe6(%rbp)
  jne    L0
  movswl -0xe8(%rbp),%eax
  mov    %eax,-0xe4(%rbp)
  jmp    L134
L109:
  mov    -0xe4(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  movw   $0x0,(%rax)
  addl   $0x1,-0xe4(%rbp)
L134:
  cmpl   $0x16,-0xe4(%rbp)
  jle    L109
L0:
  mov    -0xc8(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L182
  call   <__stack_chk_fail@plt>
L182:
  leave
  ret
```

assistant: ```c
short *find_mantissa(unsigned long number_in_scientific, int count_digits) {
  unsigned long one = 1ul;
  int i;
  for (i = 0; i < count_digits - 1; i++) {
    one *= 10;
  }
  if (number_in_scientific > one) {
    number_in_scientific -= one;
  }
  short *mantissa;
  mantissa = (short *)malloc(23 * sizeof(short));
  short mantissa_index = 0;
  unsigned long results[23];
  int res_index = 0;
  unsigned long res = number_in_scientific;
  short result_repeating = 0;
  int result_repeat_start = 0;
  while (mantissa_index <= 23 && res != 0 && result_repeating == 0) {
    res *= 2;
    if (res >= one) {
      mantissa[mantissa_index] = 1;
    } else {
      mantissa[mantissa_index] = 0;
    }
    mantissa_index++;
    if (res >= one) {
      res -= one;
    }
    if (res > 10) {
      res /= 10;
      one /= 10;
    }
    for (i = 0; i < res_index; i++) {
      if (results[i] == res) {
        result_repeat_start = i + 1;
        result_repeating = 1;
        break;
      }
    }
    if (result_repeating == 0) {
      results[res_index] = res;
      res_index++;
    }
  }
  if (res != 0 && result_repeating == 1) {
    for (i = result_repeat_start; i <= 23; i++) {
      mantissa[mantissa_index] = mantissa[i];
      mantissa_index++;
    }
  }
  if (res == 0 && result_repeating == 0) {
    for (i = mantissa_index; i < 23; i++) {
      mantissa[i] = 0;
    }
  }
  return mantissa;
}
```