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

```asm
<parse_spll_sample>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  mov    %ecx,%edx
  mov    %ebx,%r13d
  mov    %ebx,%ecx
  mov    %ebx,%r15d
  sar    $0x1c,%ecx
  sar    $0x18,%r13d
  and    $0xffffff,%r15d
  sub    $0x828,%rsp
  and    $0x6,%ecx
  and    $0xf,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  and    $0x8,%r8d
  je     L161
  lea    D85(%rip),%rsi
  mov    %r12,%rdi
  mov    %r15d,%r8d
  movslq %r13d,%r13
  call   <sprintf@plt>
  mov    (%r14,%r13,8),%rdi
  mov    %r12,%rdx
  lea    D124(%rip),%rsi
  call   <fprintf@plt>
L137:
  mov    0x818(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L109
  add    $0x828,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L161:
  lea    D33(%rip),%rsi
  mov    %r12,%rdi
  mov    %ecx,0x8(%rsp)
  lea    0x10(%rsp),%rbp
  mov    %edx,0xc(%rsp)
  call   <strcpy@plt>
  mov    0xc(%rsp),%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D226(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D14(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %ebx,%edx
  lea    D88(%rip),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    0x8(%rsp),%ecx
  cmp    $0x2,%ecx
  je     L24
  cmp    $0x4,%ecx
  je     L159
  test   %ecx,%ecx
  je     L89
  lea    D184(%rip),%rsi
  mov    %r12,%rdi
  mov    %ecx,0x8(%rsp)
  call   <strcat@plt>
  mov    0x8(%rsp),%ecx
L87:
  lea    D242(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %ecx,%edx
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  cmp    $0x6,%r13d
  ja     L77
  lea    D223(%rip),%rdx
  mov    %r13d,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
L89:
  lea    D140(%rip),%rsi
  mov    %r12,%rdi
  mov    %ecx,0x8(%rsp)
  call   <strcat@plt>
  mov    0x8(%rsp),%ecx
  jmp    L87
  nopl   0x0(%rax)
L159:
  lea    D175(%rip),%rsi
  mov    %r12,%rdi
  mov    %ecx,0x8(%rsp)
  call   <strcat@plt>
  mov    0x8(%rsp),%ecx
  jmp    L87
  nopl   0x0(%rax)
L24:
  lea    D2(%rip),%rsi
  mov    %r12,%rdi
  mov    %ecx,0x8(%rsp)
  call   <strcat@plt>
  mov    0x8(%rsp),%ecx
  jmp    L87
  nopl   0x0(%rax)
  lea    D214(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  nopw   0x0(%rax,%rax,1)
L156:
  mov    %r13d,%edx
  lea    D118(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D156(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r15d,%eax
  lea    D43(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%rdx
  shl    $0x8,%rdx
  add    %rax,%rdx
  mov    %r15d,%eax
  shr    $0x20,%rdx
  sub    %edx,%eax
  shr    %eax
  add    %edx,%eax
  mov    %r15d,%edx
  shr    $0x17,%eax
  mov    %eax,%ecx
  shl    $0x18,%ecx
  sub    %eax,%ecx
  xor    %eax,%eax
  sub    %ecx,%edx
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  test   %ebx,%ebx
  js     L187
L82:
  mov    (%r14),%rdi
  mov    %r12,%rdx
  lea    D124(%rip),%rsi
  call   <fprintf@plt>
  jmp    L137
  nopw   0x0(%rax,%rax,1)
  lea    D176(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L156
  nopl   0x0(%rax)
  lea    D180(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L156
  nopl   0x0(%rax)
  lea    D75(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L156
  nopl   0x0(%rax)
  lea    D169(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L156
  nopl   0x0(%rax)
  lea    D89(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L156
  nopl   0x0(%rax)
  lea    D243(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L156
  nopl   0x0(%rax)
L187:
  lea    D142(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L82
L77:
  lea    D100(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L156
L109:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D85
datatype: string
name: retrieve_data
arguments: label: D124
datatype: string
name: retrieve_data
arguments: label: D33
datatype: string
name: retrieve_data
arguments: label: D226
datatype: string
name: retrieve_data
arguments: label: D14
datatype: string
name: retrieve_data
arguments: label: D88
datatype: string
name: retrieve_data
arguments: label: D184
datatype: string
name: retrieve_data
arguments: label: D242
datatype: string
name: retrieve_data
arguments: label: D140
datatype: string
name: retrieve_data
arguments: label: D175
datatype: string
name: retrieve_data
arguments: label: D2
datatype: string
name: retrieve_data
arguments: label: D214
datatype: string
name: retrieve_data
arguments: label: D118
datatype: string
name: retrieve_data
arguments: label: D156
datatype: string
name: retrieve_data
arguments: label: D43
datatype: string
name: retrieve_data
arguments: label: D176
datatype: string
name: retrieve_data
arguments: label: D180
datatype: string
name: retrieve_data
arguments: label: D75
datatype: string
name: retrieve_data
arguments: label: D169
datatype: string
name: retrieve_data
arguments: label: D89
datatype: string
name: retrieve_data
arguments: label: D243
datatype: string
name: retrieve_data
arguments: label: D142
datatype: string
name: retrieve_data
arguments: label: D100
datatype: string

tool: D85: %05d,%d,%d


tool: D124: %s

tool: D33:  ID 

tool: D226: %05d

tool: D14:  | RAW:

tool: D88: 0x%08X | 

tool: D184: UKNWN: [0x

tool: D242: %d] 

tool: D140: mPLL [0x

tool: D175: ePLL [0x

tool: D2: hPLL [0x

tool: D214: | TAG REF   : [0x

tool: D118: %x] |  

tool: 

tool: D43: %d


tool: D176: | EVENT 	  : [0x

tool: D180: | ERROR	    : [0x

tool: D75: | Y  	    : [0x

tool: D169: | SAMPLE ID : [0x

tool: D89: | PERIOD 	  : [0x

tool: D243: | TAG LOCAL : [0x

tool: D142: --------------------------------------------------------------------------------


tool: D100: | UNKNOWN! : [0x

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;
}
```