ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码：

```asm
<RKMath_Distance>:
  endbr64
  test   %edx,%edx
  jle    L6
  push   %r13
  pxor   %xmm1,%xmm1
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  nopl   0x0(%rax)
L28:
  movss  0x0(%r13,%rbx,4),%xmm0
  subss  (%r12,%rbx,4),%xmm0
  add    $0x1,%rbx
  mov    $0x2,%edi
  movss  %xmm1,0xc(%rsp)
  call   <powf@plt>
  movss  0xc(%rsp),%xmm1
  addss  %xmm0,%xmm1
  cmp    %rbx,%rbp
  jne    L28
  pxor   %xmm2,%xmm2
  ucomiss %xmm1,%xmm2
  ja     L25
  sqrtss %xmm1,%xmm1
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  movaps %xmm1,%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L6:
  pxor   %xmm1,%xmm1
  sqrtss %xmm1,%xmm1
  movaps %xmm1,%xmm0
  ret
L25:
  add    $0x18,%rsp
  movaps %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <sqrtf@plt>
```

assistant: ```c
float RKMath_Distance(const float vec_a[], const float vec_b[], const int size) {
  int i = 0;
  float retval = 0;
  while (i < size) {
    retval = powf((vec_b[i] - vec_a[i]), 2) + retval;
    i++;
  }
  return sqrtf(retval);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<RKMath_Distance>:
  endbr64
  test   %edx,%edx
  jle    L7
  push   %r13
  pxor   %xmm1,%xmm1
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  nopl   0x0(%rax)
L29:
  movss  0x0(%r13,%rbx,4),%xmm0
  subss  (%r12,%rbx,4),%xmm0
  add    $0x1,%rbx
  mov    $0x2,%edi
  movss  %xmm1,0xc(%rsp)
  call   <powf@plt>
  movss  0xc(%rsp),%xmm1
  addss  %xmm0,%xmm1
  cmp    %rbx,%rbp
  jne    L29
  pxor   %xmm2,%xmm2
  ucomiss %xmm1,%xmm2
  ja     L10
  sqrtss %xmm1,%xmm1
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  movaps %xmm1,%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L7:
  pxor   %xmm1,%xmm1
  sqrtss %xmm1,%xmm1
  movaps %xmm1,%xmm0
  ret
L10:
  add    $0x18,%rsp
  movaps %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <sqrtf@plt>
```

assistant: ```c
float RKMath_Distance(const float vec_a[], const float vec_b[], const int size) {
  int i = 0;
  float retval = 0;
  while (i < size) {
    retval = powf((vec_b[i] - vec_a[i]), 2) + retval;
    i++;
  }
  return sqrtf(retval);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D40(%rip),%rsi
  lea    D77(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L50
  mov    0x8(%r12),%rdi
  lea    D28(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L49
  mov    %rbp,%rsi
  mov    $0x5b,%edi
  call   <fputc@plt>
  lea    0x7(%rsp),%r14
  lea    D85(%rip),%r13
  lea    D74(%rip),%r12
  jmp    L46
L50:
  lea    D59(%rip),%rdi
  call   <printf@plt>
  jmp    L63
L49:
  lea    D67(%rip),%rdi
  call   <printf@plt>
  jmp    L63
L39:
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <fscanf@plt>
  movsbl 0x7(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  D78(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
L46:
  mov    %rbx,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L39
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D14(%rip),%rdi
  call   <fwrite@plt>
L63:
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  mov    $0x0,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D40
datatype: string
name: extract_symbolic_data
arguments: label: D77
datatype: string
name: extract_symbolic_data
arguments: label: D28
datatype: string
name: extract_symbolic_data
arguments: label: D85
datatype: string
name: extract_symbolic_data
arguments: label: D74
datatype: string
name: extract_symbolic_data
arguments: label: D59
datatype: string
name: extract_symbolic_data
arguments: label: D67
datatype: string
name: extract_symbolic_data
arguments: label: D78
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D14
datatype: string

tool: D40: w

tool: D77: data.ts

tool: D28: r

tool: D85: %c

tool: D74: %f,

tool: D59: ERROR: cannot open output file


tool: D67: ERROR: cannot open input file


tool: {"D78": [0x00,0x00,0x00,0x3c]}

tool: D14: 0]

assistant: ```c
int main(int argc, char *argv[]) {
  char num;
  float scale = 1.0 / 128.f;
  FILE *pi, *po;
  if ((po = fopen("data.ts", "w")) == NULL) {
    printf("ERROR: cannot open output file\n");
  } else if ((pi = fopen(argv[1], "r")) == NULL) {
    printf("ERROR: cannot open input file\n");
  } else {
    fprintf(po, "[");
    while (!feof(pi)) {
      fscanf(pi, "%c", &num);
      fprintf(po, "%f,", num * scale);
    }
    fprintf(po, "0]");
  }
  fclose(pi);
  fclose(po);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r14
  lea    D55(%rip),%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    D67(%rip),%rsi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L63
  mov    0x8(%rbx),%rdi
  lea    D1(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L13
  mov    %r12,%rsi
  mov    $0x5b,%edi
  lea    0x7(%rsp),%r14
  call   <fputc@plt>
  lea    D73(%rip),%r13
  lea    D47(%rip),%rbx
  jmp    L8
L22:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %r14,%rdx
  call   <fscanf@plt>
  movsbl 0x7(%rsp),%eax
  mov    %rbx,%rsi
  mov    %r12,%rdi
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  D54(%rip),%xmm0
  mov    $0x1,%eax
  cvtss2sd %xmm0,%xmm0
  call   <fprintf@plt>
L8:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L22
  mov    %r12,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D39(%rip),%rdi
  call   <fwrite@plt>
L62:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L25
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L13:
  lea    D10(%rip),%rdi
  call   <printf@plt>
  jmp    L62
L63:
  lea    D81(%rip),%rdi
  call   <printf@plt>
  jmp    L62
L25:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D55
data_type: string
name: parse_data
arguments: tag: D67
data_type: string
name: parse_data
arguments: tag: D1
data_type: string
name: parse_data
arguments: tag: D73
data_type: string
name: parse_data
arguments: tag: D47
data_type: string
name: parse_data
arguments: tag: D54
data_type: byte[4]
name: parse_data
arguments: tag: D39
data_type: string
name: parse_data
arguments: tag: D10
data_type: string
name: parse_data
arguments: tag: D81
data_type: string

tool: D55: data.ts

tool: D67: w

tool: D1: r

tool: D73: %c

tool: D47: %f,

tool: {"D54": [0x00,0x00,0x00,0x3c]}

tool: D39: 0]

tool: D10: ERROR: cannot open input file


tool: D81: ERROR: cannot open output file


assistant: ```c
int main(int argc, char *argv[]) {
  char num;
  float scale = 1.0 / 128.f;
  FILE *pi, *po;
  if ((po = fopen("data.ts", "w")) == NULL) {
    printf("ERROR: cannot open output file\n");
  } else if ((pi = fopen(argv[1], "r")) == NULL) {
    printf("ERROR: cannot open input file\n");
  } else {
    fprintf(po, "[");
    while (!feof(pi)) {
      fscanf(pi, "%c", &num);
      fprintf(po, "%f,", num * scale);
    }
    fprintf(po, "0]");
  }
  fclose(pi);
  fclose(po);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r14
  lea    D58(%rip),%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    D69(%rip),%rsi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L65
  mov    0x8(%rbx),%rdi
  lea    D61(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L50
  mov    %r12,%rsi
  mov    $0x5b,%edi
  lea    0x7(%rsp),%r14
  call   <fputc@plt>
  lea    D12(%rip),%r13
  lea    D1(%rip),%rbx
  jmp    L4
L6:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %r14,%rdx
  call   <fscanf@plt>
  movsbl 0x7(%rsp),%eax
  mov    %rbx,%rsi
  mov    %r12,%rdi
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  D31(%rip),%xmm0
  mov    $0x1,%eax
  cvtss2sd %xmm0,%xmm0
  call   <fprintf@plt>
L4:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L6
  mov    %r12,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D80(%rip),%rdi
  call   <fwrite@plt>
L12:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L50:
  lea    D51(%rip),%rdi
  call   <printf@plt>
  jmp    L12
L65:
  lea    D53(%rip),%rdi
  call   <printf@plt>
  jmp    L12
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D58
type_guessed: string
name: parse_data
arguments: data_tag: D69
type_guessed: string
name: parse_data
arguments: data_tag: D61
type_guessed: string
name: parse_data
arguments: data_tag: D12
type_guessed: string
name: parse_data
arguments: data_tag: D1
type_guessed: string
name: parse_data
arguments: data_tag: D31
type_guessed: byte[4]
name: parse_data
arguments: data_tag: D80
type_guessed: string
name: parse_data
arguments: data_tag: D51
type_guessed: string
name: parse_data
arguments: data_tag: D53
type_guessed: string

tool: D58: data.ts

tool: D69: w

tool: D61: r

tool: D12: %c

tool: D1: %f,

tool: {"D31": [0x00,0x00,0x00,0x3c]}

tool: D80: 0]

tool: D51: ERROR: cannot open input file


tool: D53: ERROR: cannot open output file


assistant: ```c
int main(int argc, char *argv[]) {
  char num;
  float scale = 1.0 / 128.f;
  FILE *pi, *po;
  if ((po = fopen("data.ts", "w")) == NULL) {
    printf("ERROR: cannot open output file\n");
  } else if ((pi = fopen(argv[1], "r")) == NULL) {
    printf("ERROR: cannot open input file\n");
  } else {
    fprintf(po, "[");
    while (!feof(pi)) {
      fscanf(pi, "%c", &num);
      fprintf(po, "%f,", num * scale);
    }
    fprintf(po, "0]");
  }
  fclose(pi);
  fclose(po);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<catalan>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,-0x24(%rbp)
  movq   $0x0,-0x18(%rbp)
  cmpl   $0x1,-0x24(%rbp)
  jg     L17
  mov    $0x1,%eax
  jmp    L2
L17:
  movl   $0x0,-0x1c(%rbp)
  jmp    L25
L8:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <catalan>
  mov    %rax,%rbx
  mov    -0x24(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edi
  call   <catalan>
  imul   %rbx,%rax
  add    %rax,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L25:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L8
  mov    -0x18(%rbp),%rax
L2:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
long int catalan(int n) {
  int i;
  long int res = 0;
  if (n <= 1)
    return 1;
  for (i = 0; i < n; i++)
    res += catalan(i) * catalan(n - i - 1);
  return res;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<catalan>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x1,%r12d
  cmp    $0x1,%edi
  jle    L5
  lea    -0x1(%rdi),%ebp
  mov    $0x0,%r12d
  mov    %ebp,%r13d
L8:
  mov    %r13d,%edi
  sub    %ebp,%edi
  call   <catalan>
  mov    %rax,%rbx
  mov    %ebp,%edi
  call   <catalan>
  imul   %rax,%rbx
  add    %rbx,%r12
  sub    $0x1,%ebp
  cmp    $0xffffffff,%ebp
  jne    L8
L5:
  mov    %r12,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
long int catalan(int n) {
  int i;
  long int res = 0;
  if (n <= 1)
    return 1;
  for (i = 0; i < n; i++)
    res += catalan(i) * catalan(n - i - 1);
  return res;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<geom_dA_cyl_rpz>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L24
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L33
L24:
  cmpl   $0x1,-0x24(%rbp)
  jne    L13
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L33
L13:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L33:
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

assistant: ```c
double geom_dA_cyl_rpz(double xm[], double xp[], int dir) {
  double dA;
  if (dir == 0)
    dA = xm[0] * (xp[1] - xm[1]);
  else if (dir == 1)
    dA = xp[0] - xm[0];
  else
    dA = 0.0;
  return dA;
}
```
user: Translate the below assembly code into C programming language:

```asm
<geom_dA_cyl_rpz>:
  endbr64
  test   %edx,%edx
  jne    L15
  movsd  0x8(%rsi),%xmm0
  subsd  0x8(%rdi),%xmm0
  mulsd  (%rdi),%xmm0
  ret
L15:
  pxor   %xmm0,%xmm0
  cmp    $0x1,%edx
  je     L8
L12:
  ret
L8:
  movsd  (%rsi),%xmm0
  subsd  (%rdi),%xmm0
  jmp    L12
```

assistant: ```c
double geom_dA_cyl_rpz(double xm[], double xp[], int dir) {
  double dA;
  if (dir == 0)
    dA = xm[0] * (xp[1] - xm[1]);
  else if (dir == 1)
    dA = xp[0] - xm[0];
  else
    dA = 0.0;
  return dA;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<geom_dA_cyl_rpz>:
  endbr64
  test   %edx,%edx
  jne    L14
  movsd  0x8(%rsi),%xmm0
  subsd  0x8(%rdi),%xmm0
  mulsd  (%rdi),%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L14:
  pxor   %xmm0,%xmm0
  cmp    $0x1,%edx
  je     L3
  ret
  nopw   0x0(%rax,%rax,1)
L3:
  movsd  (%rsi),%xmm0
  subsd  (%rdi),%xmm0
  ret
```

assistant: ```c
double geom_dA_cyl_rpz(double xm[], double xp[], int dir) {
  double dA;
  if (dir == 0)
    dA = xm[0] * (xp[1] - xm[1]);
  else if (dir == 1)
    dA = xp[0] - xm[0];
  else
    dA = 0.0;
  return dA;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<geom_dA_cyl_rpz>:
  endbr64
  test   %edx,%edx
  jne    L19
  movsd  0x8(%rsi),%xmm0
  subsd  0x8(%rdi),%xmm0
  mulsd  (%rdi),%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L19:
  pxor   %xmm0,%xmm0
  cmp    $0x1,%edx
  je     L2
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  movsd  (%rsi),%xmm0
  subsd  (%rdi),%xmm0
  ret
```

assistant: ```c
double geom_dA_cyl_rpz(double xm[], double xp[], int dir) {
  double dA;
  if (dir == 0)
    dA = xm[0] * (xp[1] - xm[1]);
  else if (dir == 1)
    dA = xp[0] - xm[0];
  else
    dA = 0.0;
  return dA;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<dmstorad>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,%r14
  mov    %rdx,%rbx
  mov    %rcx,%r13
  mov    %r8,%rbp
  mov    %r9,%r12
  test   %edi,%edi
  jne    L34
  movsd  (%r9),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L0
  mulsd  D98(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    $0x2b,%eax
L22:
  mov    %al,(%r14)
  movsd  0x8(%rsp),%xmm0
  call   <floor@plt>
  mov    %eax,(%rbx)
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  0x8(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  D33(%rip),%xmm0
  call   <floor@plt>
  mov    %eax,0x0(%r13)
  pxor   %xmm1,%xmm1
  cvtsi2sdl (%rbx),%xmm1
  movsd  0x8(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  D33(%rip),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  mulsd  D33(%rip),%xmm0
  movsd  %xmm0,0x0(%rbp)
L47:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L34:
  movsd  (%r8),%xmm0
  andpd  D58(%rip),%xmm0
  divsd  D33(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    (%rcx),%edi
  call   <abs@plt>
  mov    %rax,%r15
  mov    (%rbx),%edi
  call   <abs@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %r15,%xmm0
  addsd  0x8(%rsp),%xmm0
  divsd  D33(%rip),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm0
  mulsd  D100(%rip),%xmm0
  movsd  %xmm0,(%r12)
  cmpl   $0x0,(%rbx)
  js     L71
  cmpl   $0x0,0x0(%r13)
  js     L71
  pxor   %xmm1,%xmm1
  comisd 0x0(%rbp),%xmm1
  ja     L71
  cmpb   $0x2d,(%r14)
  jne    L47
L71:
  xorpd  D61(%rip),%xmm0
  movsd  %xmm0,(%r12)
  jmp    L47
L0:
  xorpd  D61(%rip),%xmm0
  mulsd  D98(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    $0x2d,%eax
  jmp    L22
```

tool_calls: name: read_data
arguments: data_label: D98
type_guessed: f64
name: read_data
arguments: data_label: D33
type_guessed: f64
name: read_data
arguments: data_label: D58
type_guessed: qword[2]
name: read_data
arguments: data_label: D100
type_guessed: f64
name: read_data
arguments: data_label: D61
type_guessed: f32[4]

tool: D98: 57.29577951308232

tool: D33: 60

tool: {"D58": [0x7fffffffffffffff,0x0000000000000000]}

tool: D100: 0.0174532925199432

tool: {"D61": [0.0,-0.0,0.0,0.0]}

assistant: ```c
void dmstorad(int torad, char *sign, int *deg, int *min, double *sec, double *rad) {
  double absdeg;
  if (torad) {
    *rad = ((fabs(*sec) / 60.0 + (double)(abs(*min))) / 60.0 + (double)(abs(*deg))) * 0.0174532925199432;
    if (*deg < 0 || *min < 0 || *sec < 0.0 || *sign == '-')
      *rad *= -1;
  } else {
    if (*rad < 0) {
      absdeg = -(*rad) * 57.295779513082321;
      *sign = '-';
    } else {
      absdeg = (*rad) * 57.295779513082321;
      *sign = '+';
    }
    *deg = floor(absdeg);
    *min = floor(60.0 * (absdeg - (double)*deg));
    *sec = 60.0 * (60.0 * (absdeg - (double)*deg) - (double)*min);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<dmstorad>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %r9,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x18,%rsp
  test   %edi,%edi
  jne    L41
  movsd  (%r9),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  ja     L68
  mulsd  D30(%rip),%xmm1
  mov    $0x2b,%eax
L43:
  mov    %al,(%r14)
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <floor@plt>
  pxor   %xmm2,%xmm2
  movsd  0x8(%rsp),%xmm1
  cvtsi2sd %eax,%xmm2
  mov    %eax,(%rbx)
  movapd %xmm1,%xmm0
  subsd  %xmm2,%xmm0
  mulsd  D52(%rip),%xmm0
  call   <floor@plt>
  pxor   %xmm0,%xmm0
  movsd  0x8(%rsp),%xmm1
  mov    %eax,(%r12)
  cvtsi2sdl (%rbx),%xmm0
  subsd  %xmm0,%xmm1
  mulsd  D52(%rip),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  subsd  %xmm0,%xmm1
  mulsd  D52(%rip),%xmm1
  movsd  %xmm1,0x0(%r13)
L53:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L68:
  xorpd  D103(%rip),%xmm1
  mov    $0x2d,%eax
  mulsd  D30(%rip),%xmm1
  jmp    L43
  nopw   0x0(%rax,%rax,1)
L41:
  mov    (%rcx),%edi
  movsd  (%r8),%xmm0
  andpd  D107(%rip),%xmm0
  divsd  D52(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <abs@plt>
  mov    (%rbx),%edi
  mov    %rax,%r15
  call   <abs@plt>
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  mov    (%rbx),%edx
  cvtsi2sd %rax,%xmm1
  cvtsi2sd %r15,%xmm0
  addsd  0x8(%rsp),%xmm0
  divsd  D52(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  D33(%rip),%xmm0
  movsd  %xmm0,0x0(%rbp)
  test   %edx,%edx
  js     L11
  mov    (%r12),%eax
  test   %eax,%eax
  js     L11
  pxor   %xmm1,%xmm1
  comisd 0x0(%r13),%xmm1
  ja     L11
  cmpb   $0x2d,(%r14)
  jne    L53
L11:
  xorpd  D103(%rip),%xmm0
  movsd  %xmm0,0x0(%rbp)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D30
datatype: f64
name: read_data
arguments: tag: D52
datatype: f64
name: read_data
arguments: tag: D103
datatype: f32[4]
name: read_data
arguments: tag: D107
datatype: qword[2]
name: read_data
arguments: tag: D33
datatype: f64

tool: D30: 57.29577951308232

tool: D52: 60

tool: {"D103": [0.0,-0.0,0.0,0.0]}

tool: {"D107": [0x7fffffffffffffff,0x0000000000000000]}

tool: D33: 0.0174532925199432

assistant: ```c
void dmstorad(int torad, char *sign, int *deg, int *min, double *sec, double *rad) {
  double absdeg;
  if (torad) {
    *rad = ((fabs(*sec) / 60.0 + (double)(abs(*min))) / 60.0 + (double)(abs(*deg))) * 0.0174532925199432;
    if (*deg < 0 || *min < 0 || *sec < 0.0 || *sign == '-')
      *rad *= -1;
  } else {
    if (*rad < 0) {
      absdeg = -(*rad) * 57.295779513082321;
      *sign = '-';
    } else {
      absdeg = (*rad) * 57.295779513082321;
      *sign = '+';
    }
    *deg = floor(absdeg);
    *min = floor(60.0 * (absdeg - (double)*deg));
    *sec = 60.0 * (60.0 * (absdeg - (double)*deg) - (double)*min);
  }
}
```