user: 请将以下的汇编代码转换成C语言代码：

```asm
<uncompress_location_positions>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,%eax
  mov    %edx,-0x40(%rbp)
  mov    %rcx,-0x48(%rbp)
  mov    %al,-0x3c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movzbl -0x3c(%rbp),%eax
  test   %al,%al
  js     L93
  movl   $0x1,-0x18(%rbp)
  movzbl -0x3c(%rbp),%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  or     %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L17
L93:
  movzbl -0x3c(%rbp),%eax
  and    $0x60,%eax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L91
  movl   $0x60,-0x1c(%rbp)
  cmpl   $0x20,-0x14(%rbp)
  je     L211
  cmpl   $0x40,-0x14(%rbp)
  je     L121
  jmp    L101
L211:
  movl   $0x1,-0x18(%rbp)
  jmp    L91
L121:
  movl   $0x9,-0x18(%rbp)
  jmp    L91
L101:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x18(%rbp)
  nop
L91:
  lea    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <uncompress2@plt>
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  movzbl -0x3c(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L59
  movl   $0x1,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L194
L117:
  mov    -0x20(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L30
  mov    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  and    $0xf,%edx
  mov    %edx,(%rax)
  jmp    L41
L30:
  mov    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  shr    $0x4,%al
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  movzbl %cl,%eax
  mov    %eax,(%rdx)
L41:
  addl   $0x1,-0x24(%rbp)
  addl   $0x1,-0x20(%rbp)
L194:
  mov    -0x24(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L117
  mov    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L57
L59:
  movl   $0x1,-0x24(%rbp)
  jmp    L144
L103:
  lea    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <uncompress2@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
L144:
  mov    -0x24(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L103
L57:
  movl   $0x1,-0x24(%rbp)
  jmp    L155
L134:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x48(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x24(%rbp)
L155:
  mov    -0x24(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L134
  movl   $0x0,-0x24(%rbp)
  jmp    L44
L94:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L120
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x18(%rbp)
L120:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x48(%rbp),%rax
  add    %rsi,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x24(%rbp)
L44:
  mov    -0x24(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L94
L17:
  mov    -0x10(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  leave
  ret
```

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