ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<decrypt_byte>:
  endbr64
  movzwl 0x10(%rdi),%edx
  or     $0x2,%edx
  mov    %edx,%eax
  xor    $0x1,%eax
  imul   %edx,%eax
  movzbl %ah,%eax
  ret
```

assistant: ```c
int decrypt_byte(unsigned long *pkeys, const unsigned long *pcrc_32_tab) {
  unsigned temp;
  temp = ((unsigned)(*(pkeys + 2)) & 0xffff) | 2;
  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<decrypt_byte>:
  endbr64
  movzwl 0x10(%rdi),%edx
  or     $0x2,%edx
  mov    %edx,%eax
  xor    $0x1,%eax
  imul   %edx,%eax
  movzbl %ah,%eax
  ret
```

assistant: ```c
int decrypt_byte(unsigned long *pkeys, const unsigned long *pcrc_32_tab) {
  unsigned temp;
  temp = ((unsigned)(*(pkeys + 2)) & 0xffff) | 2;
  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mlMatrixTranslateTo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movss  D15(%rip),%xmm0
  movss  %xmm0,-0x50(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x4c(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x48(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x44(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x40(%rbp)
  movss  D15(%rip),%xmm0
  movss  %xmm0,-0x3c(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x34(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  movss  D15(%rip),%xmm0
  movss  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x24(%rbp)
  mov    -0x60(%rbp),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x20(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  D15(%rip),%xmm0
  movss  %xmm0,-0x14(%rbp)
  mov    -0x68(%rbp),%rdx
  lea    -0x50(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mlMatrixMultTo@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D15
datatype: byte[4]

tool: {"D15": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void mlMatrixTranslateTo(const float *a, const float *b, float *result) {
  const float c[16] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, b[0], b[1], b[2], 1.0f};
  mlMatrixMultTo(a, c, result);
}
```
user: Translate the below assembly code into C programming language:

```asm
<mlMatrixTranslateTo>:
  endbr64
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movss  D0(%rip),%xmm0
  movss  %xmm0,(%rsp)
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0x8(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x10(%rsp)
  movss  %xmm0,0x14(%rsp)
  movl   $0x0,0x18(%rsp)
  movl   $0x0,0x1c(%rsp)
  movl   $0x0,0x20(%rsp)
  movl   $0x0,0x24(%rsp)
  movss  %xmm0,0x28(%rsp)
  movl   $0x0,0x2c(%rsp)
  movss  (%rsi),%xmm1
  movss  %xmm1,0x30(%rsp)
  movss  0x4(%rsi),%xmm1
  movss  %xmm1,0x34(%rsp)
  movss  0x8(%rsi),%xmm1
  movss  %xmm1,0x38(%rsp)
  movss  %xmm0,0x3c(%rsp)
  mov    %rsp,%rsi
  call   <mlMatrixMultTo@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x58,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D0
type: byte[4]

tool: {"D0": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void mlMatrixTranslateTo(const float *a, const float *b, float *result) {
  const float c[16] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, b[0], b[1], b[2], 1.0f};
  mlMatrixMultTo(a, c, result);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mlMatrixTranslateTo>:
  endbr64
  sub    $0x58,%rsp
  movss  0x8(%rsi),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movq   $0x3f800000,(%rsp)
  movabs $0x3f80000000000000,%rax
  mov    %rax,0x10(%rsp)
  mov    (%rsi),%rax
  mov    %rsp,%rsi
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x3f800000,0x28(%rsp)
  mov    %rax,0x30(%rsp)
  movl   $0x3f800000,0x3c(%rsp)
  movss  %xmm0,0x38(%rsp)
  call   <mlMatrixMultTo@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x58,%rsp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void mlMatrixTranslateTo(const float *a, const float *b, float *result) {
  const float c[16] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, b[0], b[1], b[2], 1.0f};
  mlMatrixMultTo(a, c, result);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<mlMatrixTranslateTo>:
  endbr64
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movss  D12(%rip),%xmm0
  mov    (%rsi),%rax
  movl   $0x3f800000,0x3c(%rsp)
  movaps %xmm0,(%rsp)
  movaps D2(%rip),%xmm0
  mov    %rax,0x30(%rsp)
  movaps %xmm0,0x10(%rsp)
  movaps D27(%rip),%xmm0
  movaps %xmm0,0x20(%rsp)
  movss  0x8(%rsi),%xmm0
  mov    %rsp,%rsi
  movss  %xmm0,0x38(%rsp)
  call   <mlMatrixMultTo@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x58,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D12
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D2
datatype: byte[16]
name: extract_symbolic_data
arguments: label: D27
datatype: byte[16]

tool: {"D12": [0x00,0x00,0x80,0x3f]}

tool: {"D2": [0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D27": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x3f,0x00,0x00,0x00,0x00]}

assistant: ```c
void mlMatrixTranslateTo(const float *a, const float *b, float *result) {
  const float c[16] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, b[0], b[1], b[2], 1.0f};
  mlMatrixMultTo(a, c, result);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<bufread>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edx,%ebp
  test   %edx,%edx
  je     L48
  mov    %edi,%r12d
  mov    %rsi,%r13
  mov    $0x0,%ebx
  jmp    L21
L41:
  lea    D9(%rip),%rdi
  call   <perror@plt>
  jmp    L11
L16:
  mov    $0x3e8,%edi
  call   <usleep@plt>
L21:
  mov    %ebp,%edx
  sub    %ebx,%edx
  mov    %ebx,%esi
  add    %r13,%rsi
  mov    $0x0,%ecx
  mov    %r12d,%edi
  call   <recv@plt>
  test   %eax,%eax
  js     L41
  je     L11
  add    %eax,%ebx
  cmp    %ebx,%ebp
  ja     L16
L11:
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L48:
  mov    %edx,%ebx
  jmp    L11
```

tool_calls: name: parse_data
arguments: data_label: D9
datatype: string

tool: D9: bufread

assistant: ```c
unsigned int bufread(int s, void *buf, unsigned int numel) {
  unsigned int numcall = 0, numread = 0, verbose = 0;
  int numthis = 0;
  while (numread < numel) {
    numthis = recv(s, (char *)buf + numread, numel - numread, 0);
    if (numthis < 0) {
      perror("bufread");
      break;
    } else if (numthis == 0)
      break;
    if (verbose > 0)
      fprintf(stderr, "bufread: read %d bytes\n", numthis);
    numread += numthis;
    numcall++;
    if (numread < numel)
      usleep(1000);
  }
  if (verbose > 1)
    fprintf(stderr, "bufread: reading the complete buffer required %d calls\n", numcall);
  return numread;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<bufread>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %edx,%edx
  je     L7
  mov    %edi,%ebp
  mov    %rsi,%r13
  mov    %edx,%ebx
  xor    %r12d,%r12d
L24:
  mov    %ebx,%edx
  mov    %r12d,%esi
  xor    %ecx,%ecx
  mov    %ebp,%edi
  sub    %r12d,%edx
  add    %r13,%rsi
  call   <recv@plt>
  test   %eax,%eax
  js     L40
  je     L45
  add    %eax,%r12d
  cmp    %r12d,%ebx
  ja     L34
L45:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L34:
  mov    $0x3e8,%edi
  call   <usleep@plt>
  jmp    L24
  nopl   0x0(%rax)
L40:
  lea    D6(%rip),%rdi
  call   <perror@plt>
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L7:
  xor    %r12d,%r12d
  jmp    L45
```

tool_calls: name: disassemble_data
arguments: label: D6
type: string

tool: D6: bufread

assistant: ```c
unsigned int bufread(int s, void *buf, unsigned int numel) {
  unsigned int numcall = 0, numread = 0, verbose = 0;
  int numthis = 0;
  while (numread < numel) {
    numthis = recv(s, (char *)buf + numread, numel - numread, 0);
    if (numthis < 0) {
      perror("bufread");
      break;
    } else if (numthis == 0)
      break;
    if (verbose > 0)
      fprintf(stderr, "bufread: read %d bytes\n", numthis);
    numread += numthis;
    numcall++;
    if (numread < numel)
      usleep(1000);
  }
  if (verbose > 1)
    fprintf(stderr, "bufread: reading the complete buffer required %d calls\n", numcall);
  return numread;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<bufread>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %edx,%edx
  je     L10
  mov    %edi,%ebp
  mov    %rsi,%r13
  mov    %edx,%ebx
  xor    %r12d,%r12d
L16:
  mov    %ebx,%edx
  mov    %r12d,%esi
  xor    %ecx,%ecx
  mov    %ebp,%edi
  sub    %r12d,%edx
  add    %r13,%rsi
  call   <recv@plt>
  test   %eax,%eax
  js     L3
  je     L0
  add    %eax,%r12d
  cmp    %r12d,%ebx
  ja     L30
L0:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L30:
  mov    $0x3e8,%edi
  call   <usleep@plt>
  jmp    L16
  nopl   0x0(%rax)
L3:
  lea    D8(%rip),%rdi
  call   <perror@plt>
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L10:
  xor    %r12d,%r12d
  jmp    L0
```

tool_calls: name: unpack_data
arguments: data_label: D8
data_type: string

tool: D8: bufread

assistant: ```c
unsigned int bufread(int s, void *buf, unsigned int numel) {
  unsigned int numcall = 0, numread = 0, verbose = 0;
  int numthis = 0;
  while (numread < numel) {
    numthis = recv(s, (char *)buf + numread, numel - numread, 0);
    if (numthis < 0) {
      perror("bufread");
      break;
    } else if (numthis == 0)
      break;
    if (verbose > 0)
      fprintf(stderr, "bufread: read %d bytes\n", numthis);
    numread += numthis;
    numcall++;
    if (numread < numel)
      usleep(1000);
  }
  if (verbose > 1)
    fprintf(stderr, "bufread: reading the complete buffer required %d calls\n", numcall);
  return numread;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<_ensure_p>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L5
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <_fail_eno@plt>
L5:
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
void *_ensure_p(int line, void *p) {
  if (p == NULL)
    _fail_eno(line);
  return p;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<_ensure_p>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  test   %rsi,%rsi
  je     L2
L18:
  mov    %rbx,%rax
  pop    %rbx
  ret
L2:
  call   <_fail_eno@plt>
  jmp    L18
```

assistant: ```c
void *_ensure_p(int line, void *p) {
  if (p == NULL)
    _fail_eno(line);
  return p;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<_ensure_p>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  test   %rsi,%rsi
  je     L8
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax)
L8:
  call   <_fail_eno@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
void *_ensure_p(int line, void *p) {
  if (p == NULL)
    _fail_eno(line);
  return p;
}
```
user: What is the c source code of the assembly code below?

```asm
<_ensure_p>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  test   %rsi,%rsi
  je     L4
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax)
L4:
  call   <_fail_eno@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
void *_ensure_p(int line, void *p) {
  if (p == NULL)
    _fail_eno(line);
  return p;
}
```
user: What is the c source code of the assembly code below:

```asm
<alloc_workbuf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L38
  mov    $0x0,%eax
  jmp    L21
L38:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <mlock@plt>
  test   %rax,%rax
  je     L3
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L21
L3:
  mov    -0x8(%rbp),%rax
L21:
  leave
  ret
```

assistant: ```c
char *alloc_workbuf(size_t size) {
  char *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    return NULL;
  if (mlock(ptr, size)) {
    free(ptr);
    return NULL;
  }
  return ptr;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<alloc_workbuf>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  call   <malloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L12
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <mlock@plt>
  test   %rax,%rax
  jne    L17
L12:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L17:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0x0,%ebx
  jmp    L12
```

assistant: ```c
char *alloc_workbuf(size_t size) {
  char *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    return NULL;
  if (mlock(ptr, size)) {
    free(ptr);
    return NULL;
  }
  return ptr;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<alloc_workbuf>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L9
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <mlock@plt>
  test   %rax,%rax
  jne    L10
L9:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L10:
  mov    %r12,%rdi
  xor    %r12d,%r12d
  call   <free@plt>
  jmp    L9
```

assistant: ```c
char *alloc_workbuf(size_t size) {
  char *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    return NULL;
  if (mlock(ptr, size)) {
    free(ptr);
    return NULL;
  }
  return ptr;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<alloc_workbuf>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L1
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <mlock@plt>
  test   %rax,%rax
  jne    L20
L1:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L20:
  mov    %r12,%rdi
  xor    %r12d,%r12d
  call   <free@plt>
  jmp    L1
```

assistant: ```c
char *alloc_workbuf(size_t size) {
  char *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    return NULL;
  if (mlock(ptr, size)) {
    free(ptr);
    return NULL;
  }
  return ptr;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ellipse_normal_angle>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movsd  %xmm0,-0x28(%rbp)
  movsd  %xmm1,-0x30(%rbp)
  mov    %rdi,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L14
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <error@plt>
L14:
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  -0x28(%rbp),%xmm0
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  movsd  -0x30(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movapd %xmm2,%xmm1
  movq   %rax,%xmm0
  call   <atan2@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  movsd  -0x28(%rbp),%xmm0
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  mov    -0x38(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  movsd  -0x30(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movapd %xmm2,%xmm1
  movq   %rax,%xmm0
  call   <atan2@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  mov    -0x18(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <angle_diff_signed@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  D19(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  jmp    L12
L31:
  movsd  -0x20(%rbp),%xmm1
  movsd  D55(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L12:
  movsd  D16(%rip),%xmm0
  comisd -0x20(%rbp),%xmm0
  jae    L31
  jmp    L35
L7:
  movsd  -0x20(%rbp),%xmm0
  movsd  D55(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L35:
  movsd  -0x20(%rbp),%xmm0
  comisd D37(%rip),%xmm0
  ja     L7
  movsd  -0x20(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D28
type_infered: string
name: retrieve_data
arguments: data_label: D19
type_infered: f64
name: retrieve_data
arguments: data_label: D55
type_infered: f64
name: retrieve_data
arguments: data_label: D16
type_infered: byte[8]
name: retrieve_data
arguments: data_label: D37
type_infered: f64

tool: D28: ellipse_normal_angle: 'foci' must be non null

tool: D19: 2

tool: D55: 6.28318530718

tool: {"D16": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x09,0xc0]}

tool: D37: 3.141592653589793

assistant: ```c
double ellipse_normal_angle(double x, double y, double *foci) {
  double tmp1, tmp2, tmp3, theta;
  if (foci == NULL)
    error("ellipse_normal_angle: 'foci' must be non null");
  tmp1 = atan2(y - foci[1], x - foci[0]);
  tmp2 = atan2(y - foci[3], x - foci[2]);
  tmp3 = angle_diff_signed(tmp1, tmp2);
  theta = tmp1 - tmp3 / 2.0;
  while (theta <= -3.14159265358979323846)
    theta += 6.28318530718;
  while (theta > 3.14159265358979323846)
    theta -= 6.28318530718;
  return theta;
}
```
user: Translate the below assembly code into C programming language:

```asm
<ellipse_normal_angle>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movq   %xmm0,%r13
  movq   %xmm1,%r12
  mov    %rdi,%rbp
  test   %rdi,%rdi
  je     L51
L12:
  movq   %r12,%xmm0
  subsd  0x8(%rbp),%xmm0
  movq   %r13,%xmm1
  subsd  0x0(%rbp),%xmm1
  call   <atan2@plt>
  movq   %xmm0,%rbx
  movq   %r12,%xmm0
  subsd  0x18(%rbp),%xmm0
  movq   %r13,%xmm1
  subsd  0x10(%rbp),%xmm1
  call   <atan2@plt>
  movapd %xmm0,%xmm1
  movq   %rbx,%xmm0
  call   <angle_diff_signed@plt>
  movapd %xmm0,%xmm1
  mulsd  D2(%rip),%xmm1
  movq   %rbx,%xmm0
  subsd  %xmm1,%xmm0
  movsd  D57(%rip),%xmm2
  movsd  D35(%rip),%xmm1
  comisd %xmm0,%xmm1
  jb     L9
L55:
  addsd  %xmm2,%xmm0
  comisd %xmm0,%xmm1
  jae    L55
L9:
  movsd  D57(%rip),%xmm2
  movsd  D42(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L33
L32:
  subsd  %xmm2,%xmm0
  comisd %xmm1,%xmm0
  ja     L32
L33:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L51:
  lea    D9(%rip),%rdi
  call   <error@plt>
  jmp    L12
```

tool_calls: name: disassemble_data
arguments: data_label: D2
type: byte[8]
name: disassemble_data
arguments: data_label: D57
type: f64
name: disassemble_data
arguments: data_label: D35
type: byte[8]
name: disassemble_data
arguments: data_label: D42
type: f64
name: disassemble_data
arguments: data_label: D9
type: string

tool: {"D2": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: D57: 6.28318530718

tool: {"D35": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x09,0xc0]}

tool: D42: 3.141592653589793

tool: D9: ellipse_normal_angle: 'foci' must be non null

assistant: ```c
double ellipse_normal_angle(double x, double y, double *foci) {
  double tmp1, tmp2, tmp3, theta;
  if (foci == NULL)
    error("ellipse_normal_angle: 'foci' must be non null");
  tmp1 = atan2(y - foci[1], x - foci[0]);
  tmp2 = atan2(y - foci[3], x - foci[2]);
  tmp3 = angle_diff_signed(tmp1, tmp2);
  theta = tmp1 - tmp3 / 2.0;
  while (theta <= -3.14159265358979323846)
    theta += 6.28318530718;
  while (theta > 3.14159265358979323846)
    theta -= 6.28318530718;
  return theta;
}
```
user: What is the c source code of the assembly code below:

```asm
<ellipse_normal_angle>:
  endbr64
  push   %r14
  movapd %xmm0,%xmm3
  movapd %xmm1,%xmm2
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  test   %rdi,%rdi
  je     L55
L17:
  movapd %xmm2,%xmm0
  movapd %xmm3,%xmm1
  subsd  0x8(%rbx),%xmm0
  movsd  %xmm2,0x8(%rsp)
  subsd  (%rbx),%xmm1
  movsd  %xmm3,(%rsp)
  call   <atan2@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm3
  subsd  0x18(%rbx),%xmm2
  subsd  0x10(%rbx),%xmm3
  movq   %xmm0,%r14
  movapd %xmm3,%xmm1
  movapd %xmm2,%xmm0
  call   <atan2@plt>
  movapd %xmm0,%xmm1
  movq   %r14,%xmm0
  call   <angle_diff_signed@plt>
  movsd  D46(%rip),%xmm1
  movsd  D17(%rip),%xmm2
  mulsd  %xmm0,%xmm1
  movq   %r14,%xmm0
  subsd  %xmm1,%xmm0
  movsd  D38(%rip),%xmm1
  comisd %xmm0,%xmm2
  jb     L0
L45:
  addsd  %xmm1,%xmm0
  comisd %xmm0,%xmm2
  jae    L45
L0:
  movsd  D27(%rip),%xmm2
  movsd  D38(%rip),%xmm1
  comisd %xmm2,%xmm0
  jbe    L12
L50:
  subsd  %xmm1,%xmm0
  comisd %xmm2,%xmm0
  ja     L50
L12:
  add    $0x18,%rsp
  pop    %rbx
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L55:
  lea    D34(%rip),%rdi
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  call   <error@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm3
  jmp    L17
```

tool_calls: name: unpack_data
arguments: label: D46
data_type: byte[8]
name: unpack_data
arguments: label: D17
data_type: byte[8]
name: unpack_data
arguments: label: D38
data_type: f64
name: unpack_data
arguments: label: D27
data_type: f64
name: unpack_data
arguments: label: D34
data_type: string

tool: {"D46": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D17": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x09,0xc0]}

tool: D38: 6.28318530718

tool: D27: 3.141592653589793

tool: D34: ellipse_normal_angle: 'foci' must be non null

assistant: ```c
double ellipse_normal_angle(double x, double y, double *foci) {
  double tmp1, tmp2, tmp3, theta;
  if (foci == NULL)
    error("ellipse_normal_angle: 'foci' must be non null");
  tmp1 = atan2(y - foci[1], x - foci[0]);
  tmp2 = atan2(y - foci[3], x - foci[2]);
  tmp3 = angle_diff_signed(tmp1, tmp2);
  theta = tmp1 - tmp3 / 2.0;
  while (theta <= -3.14159265358979323846)
    theta += 6.28318530718;
  while (theta > 3.14159265358979323846)
    theta -= 6.28318530718;
  return theta;
}
```