user: 请从给定的汇编指令推导出C源代码：

```asm
<fxpt_atan2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    -0x50(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jne    L89
  cmpq   $0x0,-0x48(%rbp)
  jle    L45
  mov    $0x2000,%eax
  jmp    L119
L45:
  cmpq   $0x0,-0x48(%rbp)
  jns    L4
  mov    $0xa000,%eax
  jmp    L119
L4:
  mov    $0x0,%eax
  jmp    L119
L89:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <abs@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <abs@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jle    L116
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <q15_div@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <abs@plt>
  mov    %rax,%rdx
  mov    D31(%rip),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <q15_mul@plt>
  mov    %rax,-0x10(%rbp)
  mov    D3(%rip),%rax
  sub    -0x10(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <q15_mul@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  jle    L95
  mov    -0x8(%rbp),%rax
  jmp    L119
L95:
  mov    -0x8(%rbp),%rax
  add    $0x8000,%eax
  jmp    L119
L116:
  mov    -0x48(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <q15_div@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <abs@plt>
  mov    %rax,%rdx
  mov    D31(%rip),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <q15_mul@plt>
  mov    %rax,-0x28(%rbp)
  mov    D3(%rip),%rax
  sub    -0x28(%rbp),%rax
  mov    -0x30(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <q15_mul@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jle    L63
  mov    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    $0x4000,%eax
  sub    %edx,%eax
  jmp    L119
L63:
  mov    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    $0xc000,%eax
  sub    %edx,%eax
L119:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D31
datatype: byte[8]
name: read_data
arguments: data_label: D3
datatype: byte[8]

tool: {"D31": [0x1f,0x0b,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D3": [0x1f,0x2b,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
int16_t fxpt_atan2(const int32_t y, const int32_t x) {
  static const int32_t k1 = 2847;
  static const int32_t k2 = 11039;
  if (x == y) {
    if (y > 0) {
      return 8192;
    } else if (y < 0) {
      return 40960;
    } else {
      return 0;
    }
  }
  const int32_t abs_y = abs(y), abs_x = abs(x);
  if (abs_x > abs_y) {
    const int32_t y_over_x = q15_div(y, x);
    const int32_t correction = q15_mul(k1, abs(y_over_x));
    const int32_t unrotated = q15_mul(k2 - correction, y_over_x);
    if (x > 0) {
      return unrotated;
    } else {
      return 32768 + unrotated;
    }
  } else {
    const int32_t x_over_y = q15_div(x, y);
    const int32_t correction = q15_mul(k1, abs(x_over_y));
    const int32_t unrotated = q15_mul(k2 - correction, x_over_y);
    if (y > 0) {
      return 16384 - unrotated;
    } else {
      return 49152 - unrotated;
    }
  }
}
```