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

```asm
<GetModulationValue>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    %r9,-0x38(%rbp)
  mov    -0x18(%rbp),%eax
  and    $0x3,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  not    %eax
  add    %eax,%eax
  and    $0x4,%eax
  or     %edx,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L12
  mov    -0x14(%rbp),%eax
  and    $0x7,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  not    %eax
  add    %eax,%eax
  and    $0x8,%eax
  or     %edx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L98
L12:
  mov    -0x14(%rbp),%eax
  and    $0x3,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  not    %eax
  add    %eax,%eax
  and    $0x4,%eax
  or     %edx,%eax
  mov    %eax,-0x14(%rbp)
L98:
  mov    0x10(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  test   %eax,%eax
  jne    L22
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L30
L22:
  cmpl   $0x0,-0x1c(%rbp)
  je     L118
  mov    -0x14(%rbp),%eax
  xor    -0x18(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L58
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L30
L58:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cmp    $0x1,%eax
  jne    L77
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  lea    -0x40(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%ecx
  mov    -0x18(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  add    %eax,%ecx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  add    %eax,%ecx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  add    %ecx,%eax
  add    $0x2,%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L30
L77:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cmp    $0x2,%eax
  jne    L100
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%ecx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  add    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x4(%rbp)
  jmp    L30
L100:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  lea    -0x40(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%ecx
  mov    -0x18(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D54(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  add    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x4(%rbp)
  jmp    L30
L118:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D15(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x6,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cmp    $0x2,%eax
  sete   %al
  movzbl %al,%edx
  mov    0x10(%rbp),%rax
  mov    %edx,(%rax)
L30:
  mov    -0x38(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  nop
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D54
type: string
name: disassemble_data
arguments: data_label: D15
type: string

tool: 

tool: 

assistant: ```c
void GetModulationValue(int x, int y, const int Do2bitMode, const int ModulationVals[8][16], const int ModulationModes[8][16], int *Mod, int *DoPT) {
  static const int RepVals0[4] = {0, 3, 5, 8};
  static const int RepVals1[4] = {0, 4, 4, 8};
  int ModVal;
  y = (y & 0x3) | ((~y & 0x2) << 1);
  if (Do2bitMode)
    x = (x & 0x7) | ((~x & 0x4) << 1);
  else
    x = (x & 0x3) | ((~x & 0x2) << 1);
  *DoPT = 0;
  if (ModulationModes[y][x] == 0) {
    ModVal = RepVals0[ModulationVals[y][x]];
  } else if (Do2bitMode) {
    if (((x ^ y) & 1) == 0)
      ModVal = RepVals0[ModulationVals[y][x]];
    else if (ModulationModes[y][x] == 1) {
      ModVal = (RepVals0[ModulationVals[y - 1][x]] + RepVals0[ModulationVals[y + 1][x]] + RepVals0[ModulationVals[y][x - 1]] + RepVals0[ModulationVals[y][x + 1]] + 2) / 4;
    } else if (ModulationModes[y][x] == 2) {
      ModVal = (RepVals0[ModulationVals[y][x - 1]] + RepVals0[ModulationVals[y][x + 1]] + 1) / 2;
    } else {
      ModVal = (RepVals0[ModulationVals[y - 1][x]] + RepVals0[ModulationVals[y + 1][x]] + 1) / 2;
    }
  } else {
    ModVal = RepVals1[ModulationVals[y][x]];
    *DoPT = ModulationVals[y][x] == (2);
  }
  *Mod = ModVal;
}
```