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

```asm
<parse_spll_sample>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x840,%rsp
  mov    %rdi,-0x828(%rbp)
  mov    %rsi,-0x830(%rbp)
  mov    %edx,-0x834(%rbp)
  mov    %ecx,-0x838(%rbp)
  mov    %r8d,-0x83c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x834(%rbp),%eax
  sar    $0x1c,%eax
  and    $0x6,%eax
  mov    %eax,-0x81c(%rbp)
  mov    -0x834(%rbp),%eax
  sar    $0x18,%eax
  and    $0xf,%eax
  mov    %eax,-0x818(%rbp)
  mov    -0x834(%rbp),%eax
  and    $0xffffff,%eax
  mov    %eax,-0x814(%rbp)
  mov    -0x83c(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L103
  mov    -0x814(%rbp),%esi
  mov    -0x81c(%rbp),%ecx
  mov    -0x838(%rbp),%edx
  mov    -0x830(%rbp),%rax
  mov    %esi,%r8d
  lea    D221(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    -0x818(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x828(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x830(%rbp),%rdx
  lea    D155(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  jmp    L72
L103:
  mov    -0x830(%rbp),%rax
  lea    D242(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x838(%rbp),%edx
  lea    -0x810(%rbp),%rax
  lea    D7(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x810(%rbp),%rdx
  mov    -0x830(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x830(%rbp),%rax
  lea    D257(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x834(%rbp),%edx
  lea    -0x810(%rbp),%rax
  lea    D230(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x810(%rbp),%rdx
  mov    -0x830(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  cmpl   $0x4,-0x81c(%rbp)
  je     L100
  cmpl   $0x4,-0x81c(%rbp)
  jg     L139
  cmpl   $0x0,-0x81c(%rbp)
  je     L122
  cmpl   $0x2,-0x81c(%rbp)
  je     L163
  jmp    L139
L100:
  mov    -0x830(%rbp),%rax
  lea    D141(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L198
L163:
  mov    -0x830(%rbp),%rax
  lea    D153(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L198
L122:
  mov    -0x830(%rbp),%rax
  lea    D81(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L198
L139:
  mov    -0x830(%rbp),%rax
  lea    D171(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L198:
  mov    -0x81c(%rbp),%edx
  lea    -0x810(%rbp),%rax
  lea    D64(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x810(%rbp),%rdx
  mov    -0x830(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  cmpl   $0x6,-0x818(%rbp)
  ja     L182
  mov    -0x818(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D38(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D38(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x830(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L51
  mov    -0x830(%rbp),%rax
  lea    D4(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L51
  mov    -0x830(%rbp),%rax
  lea    D68(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L51
  mov    -0x830(%rbp),%rax
  lea    D71(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L51
  mov    -0x830(%rbp),%rax
  lea    D187(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L51
  mov    -0x830(%rbp),%rax
  lea    D144(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L51
  mov    -0x830(%rbp),%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L51
L182:
  mov    -0x830(%rbp),%rax
  lea    D128(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L51:
  mov    -0x818(%rbp),%edx
  lea    -0x810(%rbp),%rax
  lea    D203(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x810(%rbp),%rdx
  mov    -0x830(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x830(%rbp),%rax
  lea    D58(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x814(%rbp),%edx
  movslq %edx,%rax
  imul   $0xffffffff80000081,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x17,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  shl    $0x18,%ecx
  sub    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  lea    -0x810(%rbp),%rcx
  mov    %eax,%edx
  lea    D131(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x810(%rbp),%rdx
  mov    -0x830(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  cmpl   $0x0,-0x834(%rbp)
  jns    L112
  mov    -0x830(%rbp),%rax
  lea    D60(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L112:
  mov    -0x828(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x830(%rbp),%rdx
  lea    D155(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
L72:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D221
type_guessed: string
name: parse_data
arguments: tag: D155
type_guessed: string
name: parse_data
arguments: tag: D242
type_guessed: string
name: parse_data
arguments: tag: D7
type_guessed: string
name: parse_data
arguments: tag: D257
type_guessed: string
name: parse_data
arguments: tag: D230
type_guessed: string
name: parse_data
arguments: tag: D141
type_guessed: string
name: parse_data
arguments: tag: D153
type_guessed: string
name: parse_data
arguments: tag: D81
type_guessed: string
name: parse_data
arguments: tag: D171
type_guessed: string
name: parse_data
arguments: tag: D64
type_guessed: string
name: parse_data
arguments: tag: D6
type_guessed: string
name: parse_data
arguments: tag: D4
type_guessed: string
name: parse_data
arguments: tag: D68
type_guessed: string
name: parse_data
arguments: tag: D71
type_guessed: string
name: parse_data
arguments: tag: D187
type_guessed: string
name: parse_data
arguments: tag: D144
type_guessed: string
name: parse_data
arguments: tag: D22
type_guessed: string
name: parse_data
arguments: tag: D128
type_guessed: string
name: parse_data
arguments: tag: D203
type_guessed: string
name: parse_data
arguments: tag: D58
type_guessed: string
name: parse_data
arguments: tag: D131
type_guessed: string
name: parse_data
arguments: tag: D60
type_guessed: string

tool: D221: %05d,%d,%d


tool: D155: %s

tool: D242:  ID 

tool: D7: %05d

tool: D257:  | RAW:

tool: D230: 0x%08X | 

tool: D141: ePLL [0x

tool: D153: hPLL [0x

tool: D81: mPLL [0x

tool: D171: UKNWN: [0x

tool: D64: %d] 

tool: D6: | Y  	    : [0x

tool: D4: | ERROR	    : [0x

tool: D68: | TAG LOCAL : [0x

tool: D71: | PERIOD 	  : [0x

tool: D187: | EVENT 	  : [0x

tool: D144: | TAG REF   : [0x

tool: D22: | SAMPLE ID : [0x

tool: D128: | UNKNOWN! : [0x

tool: D203: %x] |  

tool: 

tool: D131: %d


tool: D60: --------------------------------------------------------------------------------


assistant: ```c
int parse_spll_sample(FILE **fds, char *dst, uint32_t value, uint16_t seq_id, uint32_t options) {
  char temp[2048];
  uint32_t source = 0x6 & (value >> 28);
  uint32_t type = 0xF & (value >> 24);
  uint32_t sample_value = 0xFFFFFF & value;
  if ((options & 0x8)) {
    sprintf(dst, "%05d,%d,%d\n", seq_id, source, sample_value);
    fprintf(fds[type], "%s", dst);
  } else {
    strcpy(dst, " ID ");
    sprintf(temp, "%05d", seq_id);
    strcat(dst, temp);
    strcat(dst, " | RAW:");
    sprintf(temp, "0x%08X | ", value);
    strcat(dst, temp);
    switch (source) {
    case 4:
      strcat(dst, "ePLL [0x");
      break;
    case 2:
      strcat(dst, "hPLL [0x");
      break;
    case 0:
      strcat(dst, "mPLL [0x");
      break;
    default:
      strcat(dst, "UKNWN: [0x");
    }
    sprintf(temp, "%d] ", source);
    strcat(dst, temp);
    switch (type) {
    case 0:
      strcat(dst, "| Y  \t    : [0x");
      break;
    case 1:
      strcat(dst, "| ERROR\t    : [0x");
      break;
    case 2:
      strcat(dst, "| TAG LOCAL : [0x");
      break;
    case 3:
      strcat(dst, "| PERIOD \t  : [0x");
      break;
    case 4:
      strcat(dst, "| EVENT \t  : [0x");
      break;
    case 5:
      strcat(dst, "| TAG REF   : [0x");
      break;
    case 6:
      strcat(dst, "| SAMPLE ID : [0x");
      break;
    default:
      strcat(dst, "| UNKNOWN! : [0x");
    }
    sprintf(temp, "%x] |  ", type);
    strcat(dst, temp);
    strcat(dst, "");
    sprintf(temp, "%d\n", (int32_t)(sample_value % 0xFFFFFF));
    strcat(dst, temp);
    if ((0x80000000 & value))
      strcat(dst, "--------------------------------------------------------------------------------\n");
    fprintf(fds[0], "%s", dst);
  }
  return 0;
}
```