user: What would the C source look like for the assembly code provided here?

```asm
<uncompress_location_positions>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r14
  mov    %esi,%r12d
  mov    %rcx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%rax
  mov    %rax,0x10(%rsp)
  test   %sil,%sil
  js     L225
  movzbl %sil,%r12d
  shl    $0x8,%r12d
  or     $0x1,%r12d
  mov    %r12d,(%rcx)
L31:
  mov    0x10(%rsp),%rax
  mov    %rax,(%r14)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L192
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L225:
  mov    %edx,%ebp
  mov    %esi,%edx
  and    $0x60,%edx
  je     L116
  cmp    $0x20,%dl
  je     L143
  cmp    $0x40,%dl
  je     L82
  lea    0x1(%rax),%rdx
  mov    %rdx,0x10(%rsp)
  movzbl (%rax),%r13d
  mov    $0x60,%r15d
  jmp    L179
L116:
  mov    $0x0,%r13d
  mov    $0x0,%r15d
L179:
  lea    0x10(%rsp),%rdi
  call   <uncompress2@plt>
  mov    %eax,(%rbx)
  test   $0x10,%r12b
  jne    L160
  cmp    $0x1,%ebp
  jle    L185
  lea    0x4(%rbx),%r12
  lea    -0x2(%rbp),%eax
  lea    0x8(%rbx,%rax,4),%rax
  mov    %rax,(%rsp)
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
L138:
  mov    0x8(%rsp),%rdi
  call   <uncompress2@plt>
  mov    %eax,(%r12)
  add    $0x4,%r12
  cmp    (%rsp),%r12
  jne    L138
  jmp    L88
L143:
  mov    $0x1,%r13d
  mov    $0x60,%r15d
  jmp    L179
L82:
  mov    $0x9,%r13d
  mov    $0x60,%r15d
  jmp    L179
L160:
  cmp    $0x1,%ebp
  jle    L185
  mov    0x10(%rsp),%rsi
  lea    -0x1(%rbp),%ecx
  mov    $0x0,%eax
  jmp    L215
L211:
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  sar    %edx
  movslq %edx,%rdx
  movzbl (%rsi,%rdx,1),%edx
  shr    $0x4,%dl
  movzbl %dl,%edx
  mov    %edx,0x4(%rbx,%rax,4)
L180:
  add    $0x1,%rax
  cmp    %rax,%rcx
  je     L102
L215:
  test   $0x1,%al
  je     L211
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  sar    %edx
  movslq %edx,%rdx
  movzbl (%rsi,%rdx,1),%edx
  and    $0xf,%edx
  mov    %edx,0x4(%rbx,%rax,4)
  jmp    L180
L102:
  mov    %ebp,%eax
  shr    $0x1f,%eax
  add    %ebp,%eax
  sar    %eax
  cltq
  add    %rax,0x10(%rsp)
L88:
  mov    $0x1,%eax
L36:
  mov    -0x4(%rbx,%rax,4),%edx
  add    %edx,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L36
L17:
  mov    $0x0,%edx
  jmp    L104
L185:
  test   %ebp,%ebp
  jle    L31
  jmp    L17
L50:
  mov    (%rbx,%rdx,4),%eax
  shl    $0x8,%eax
  or     %r13d,%eax
  mov    %eax,(%rbx,%rdx,4)
  add    $0x1,%rdx
  cmp    %edx,%ebp
  jle    L31
L104:
  test   %r15d,%r15d
  jne    L50
  mov    0x10(%rsp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,0x10(%rsp)
  movzbl (%rax),%r13d
  jmp    L50
L192:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void uncompress_location_positions(unsigned char **buf, unsigned char flag, int frequency, unsigned int *posdata) {
  int i, j, tmp;
  unsigned char *p = *buf;
  int common_structure = 0;
  int structure = 0;
  if (!(flag & 0x80)) {
    structure = (1 << 0);
    posdata[0] = ((unsigned int)((unsigned int)((int)(flag)) << (unsigned int)8 | (unsigned int)(structure)));
  } else {
    if ((tmp = (flag & 0x60))) {
      common_structure = 0x60;
      switch (tmp) {
      case 0x20:
        structure = (1 << 0);
        break;
      case 0x40:
        structure = (1 << 0) | (1 << 3);
        break;
      default:
        structure = (int)((unsigned char)*p++);
        break;
      }
    }
    posdata[0] = (unsigned int)uncompress2(&p);
    if (flag & 0x10) {
      for (i = 1, j = 0; i < frequency; i++, j++) {
        if (j % 2)
          posdata[i] = (unsigned int)((unsigned int)p[j / 2] & (unsigned int)0x0F);
        else
          posdata[i] = (unsigned int)((unsigned int)p[j / 2] >> (unsigned int)4);
      }
      p += ((j + 1) / 2);
    } else {
      for (i = 1; i < frequency; i++) {
        tmp = uncompress2(&p);
        posdata[i] = (unsigned int)tmp;
      }
    }
    for (i = 1; i < frequency; i++)
      posdata[i] += posdata[i - 1];
    for (i = 0; i < frequency; i++) {
      if (!common_structure)
        structure = (int)((unsigned char)*p++);
      posdata[i] = ((unsigned int)((unsigned int)(posdata[i]) << (unsigned int)8 | (unsigned int)(structure)));
    }
  }
  *buf = p;
}
```