ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  D15(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x18(%rbp),%edx
  mov    -0x18(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    %edx,%esi
  movq   %rax,%xmm0
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D15
type_infered: f64
name: read_data
arguments: tag: D16
type_infered: string
name: read_data
arguments: tag: D9
type_infered: string

tool: D15: 3.1415926535898

tool: D16: %d

tool: D9: %.7f
%d


assistant: ```c
int main() {
  double pi = 3.1415926535898;
  int radius, radiusSq;
  scanf("%d", &radius);
  radiusSq = radius * radius;
  printf("%.7f\n%d\n", pi * radiusSq, radiusSq << 1);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  lea    D16(%rip),%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  imul   %eax,%eax
  lea    (%rax,%rax,1),%esi
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  D3(%rip),%xmm0
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  mov    $0x0,%eax
  add    $0x18,%rsp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D16
type: string
name: extract_symbolic_data
arguments: data_tag: D3
type: f64
name: extract_symbolic_data
arguments: data_tag: D2
type: string

tool: D16: %d

tool: D3: 3.1415926535898

tool: D2: %.7f
%d


assistant: ```c
int main() {
  double pi = 3.1415926535898;
  int radius, radiusSq;
  scanf("%d", &radius);
  radiusSq = radius * radius;
  printf("%.7f\n%d\n", pi * radiusSq, radiusSq << 1);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  lea    D3(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  pxor   %xmm0,%xmm0
  lea    D16(%rip),%rdi
  imul   %eax,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  D4(%rip),%xmm0
  lea    (%rax,%rax,1),%esi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D3
type_infered: string
name: read_data
arguments: tag: D16
type_infered: string
name: read_data
arguments: tag: D4
type_infered: f64

tool: D3: %d

tool: D16: %.7f
%d


tool: D4: 3.1415926535898

assistant: ```c
int main() {
  double pi = 3.1415926535898;
  int radius, radiusSq;
  scanf("%d", &radius);
  radiusSq = radius * radius;
  printf("%.7f\n%d\n", pi * radiusSq, radiusSq << 1);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  lea    D14(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  pxor   %xmm0,%xmm0
  lea    D19(%rip),%rdi
  imul   %eax,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  D22(%rip),%xmm0
  lea    (%rax,%rax,1),%esi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D14
type: string
name: retrieve_data
arguments: tag: D19
type: string
name: retrieve_data
arguments: tag: D22
type: f64

tool: D14: %d

tool: D19: %.7f
%d


tool: D22: 3.1415926535898

assistant: ```c
int main() {
  double pi = 3.1415926535898;
  int radius, radiusSq;
  scanf("%d", &radius);
  radiusSq = radius * radius;
  printf("%.7f\n%d\n", pi * radiusSq, radiusSq << 1);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<benchmark>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <tic@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L108
L103:
  mov    $0x0,%eax
  call   <rand_double@plt>
  movsd  D2(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  D25(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  lea    -0x28(%rbp),%rcx
  lea    -0x30(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <fresnl@plt>
  movsd  -0x30(%rbp),%xmm0
  movsd  -0x30(%rbp),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L20
  ucomisd %xmm1,%xmm0
  jne    L20
  movsd  -0x28(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L20
  ucomisd %xmm1,%xmm0
  je     L72
L20:
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L11
L72:
  addl   $0x1,-0x34(%rbp)
L108:
  cmpl   $0xf423f,-0x34(%rbp)
  jle    L103
L11:
  mov    $0x0,%eax
  call   <tic@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  subsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  -0x30(%rbp),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L69
  ucomisd %xmm1,%xmm0
  jne    L69
  movsd  -0x28(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L69
  ucomisd %xmm1,%xmm0
  je     L76
L69:
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L76:
  movsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D2
data_type: f64
name: read_data
arguments: data_tag: D25
data_type: f64
name: read_data
arguments: data_tag: D1
data_type: string

tool: D2: 20

tool: D25: 10

tool: D1: should not return NaN


assistant: ```c
double benchmark() {
  double elapsed;
  double x;
  double S;
  double C;
  double t;
  int i;
  t = tic();
  for (i = 0; i < 1000000; i++) {
    x = (20.0 * rand_double()) - 10.0;
    fresnl(x, &S, &C);
    if (S != S || C != C) {
      printf("should not return NaN\n");
      break;
    }
  }
  elapsed = tic() - t;
  if (S != S || C != C) {
    printf("should not return NaN\n");
  }
  return elapsed;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<benchmark>:
  endbr64
  push   %r14
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <tic@plt>
  movq   %xmm0,%r14
  mov    $0xf4240,%ebx
  lea    0x10(%rsp),%r12
  lea    0x8(%rsp),%rbp
L15:
  mov    $0x0,%eax
  call   <rand_double@plt>
  mulsd  D18(%rip),%xmm0
  subsd  D12(%rip),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fresnl@plt>
  movsd  0x8(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L50
  movsd  0x10(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L50
  sub    $0x1,%ebx
  jne    L15
  jmp    L23
L50:
  lea    D27(%rip),%rdi
  call   <printf@plt>
L23:
  mov    $0x0,%eax
  call   <tic@plt>
  movq   %r14,%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rbx
  movsd  0x8(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L62
  movsd  0x10(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jnp    L38
L62:
  lea    D27(%rip),%rdi
  call   <printf@plt>
L38:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  movq   %rbx,%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r14
  ret
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D18
type: f64
name: extract_symbolic_data
arguments: data_tag: D12
type: f64
name: extract_symbolic_data
arguments: data_tag: D27
type: string

tool: D18: 20

tool: D12: 10

tool: D27: should not return NaN


assistant: ```c
double benchmark() {
  double elapsed;
  double x;
  double S;
  double C;
  double t;
  int i;
  t = tic();
  for (i = 0; i < 1000000; i++) {
    x = (20.0 * rand_double()) - 10.0;
    fresnl(x, &S, &C);
    if (S != S || C != C) {
      printf("should not return NaN\n");
      break;
    }
  }
  elapsed = tic() - t;
  if (S != S || C != C) {
    printf("should not return NaN\n");
  }
  return elapsed;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<benchmark>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0xf4240,%ebx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%r12
  lea    0x18(%rsp),%rbp
  call   <tic@plt>
  movsd  %xmm0,0x8(%rsp)
  jmp    L11
  nopl   0x0(%rax,%rax,1)
L33:
  movsd  0x20(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L74
  sub    $0x1,%ebx
  je     L29
L11:
  xor    %eax,%eax
  call   <rand_double@plt>
  mulsd  D25(%rip),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  subsd  D17(%rip),%xmm0
  call   <fresnl@plt>
  movsd  0x18(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jnp    L33
L74:
  lea    D13(%rip),%rdi
  call   <printf@plt>
L29:
  xor    %eax,%eax
  call   <tic@plt>
  movsd  0x18(%rsp),%xmm1
  subsd  0x8(%rsp),%xmm0
  ucomisd %xmm1,%xmm1
  jp     L44
  movsd  0x20(%rsp),%xmm1
  ucomisd %xmm1,%xmm1
  jp     L44
L64:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L65
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L44:
  lea    D13(%rip),%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm0
  jmp    L64
L65:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D25
data_type: f64
name: extract_symbolic_data
arguments: tag: D17
data_type: f64
name: extract_symbolic_data
arguments: tag: D13
data_type: string

tool: D25: 20

tool: D17: 10

tool: D13: should not return NaN


assistant: ```c
double benchmark() {
  double elapsed;
  double x;
  double S;
  double C;
  double t;
  int i;
  t = tic();
  for (i = 0; i < 1000000; i++) {
    x = (20.0 * rand_double()) - 10.0;
    fresnl(x, &S, &C);
    if (S != S || C != C) {
      printf("should not return NaN\n");
      break;
    }
  }
  elapsed = tic() - t;
  if (S != S || C != C) {
    printf("should not return NaN\n");
  }
  return elapsed;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<benchmark>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0xf4240,%ebx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%r12
  lea    0x18(%rsp),%rbp
  call   <tic@plt>
  movsd  %xmm0,0x8(%rsp)
  jmp    L60
  nopl   0x0(%rax,%rax,1)
L56:
  movsd  0x20(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L22
  sub    $0x1,%ebx
  je     L31
L60:
  xor    %eax,%eax
  call   <rand_double@plt>
  mulsd  D9(%rip),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  subsd  D16(%rip),%xmm0
  call   <fresnl@plt>
  movsd  0x18(%rsp),%xmm0
  ucomisd %xmm0,%xmm0
  jnp    L56
L22:
  lea    D0(%rip),%rdi
  call   <printf@plt>
L31:
  xor    %eax,%eax
  call   <tic@plt>
  movsd  0x18(%rsp),%xmm1
  subsd  0x8(%rsp),%xmm0
  ucomisd %xmm1,%xmm1
  jp     L38
  movsd  0x20(%rsp),%xmm1
  ucomisd %xmm1,%xmm1
  jp     L38
L47:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L38:
  lea    D0(%rip),%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm0
  jmp    L47
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D9
type_infered: f64
name: unpack_data
arguments: data_tag: D16
type_infered: f64
name: unpack_data
arguments: data_tag: D0
type_infered: string

tool: D9: 20

tool: D16: 10

tool: D0: should not return NaN


assistant: ```c
double benchmark() {
  double elapsed;
  double x;
  double S;
  double C;
  double t;
  int i;
  t = tic();
  for (i = 0; i < 1000000; i++) {
    x = (20.0 * rand_double()) - 10.0;
    fresnl(x, &S, &C);
    if (S != S || C != C) {
      printf("should not return NaN\n");
      break;
    }
  }
  elapsed = tic() - t;
  if (S != S || C != C) {
    printf("should not return NaN\n");
  }
  return elapsed;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<wg_time_to_hms>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x5d34edef,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x11,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  imul   $0xfffa81c0,%eax,%eax
  add    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x57619f1,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x7,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  imul   $0xffffe890,%eax,%eax
  add    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   $0xffffff9c,%eax,%eax
  add    %eax,-0x4(%rbp)
  mov    -0x40(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void wg_time_to_hms(void *db, int time, int *hr, int *min, int *sec, int *prt) {
  int t = time;
  *hr = t / (60 * 60 * 100);
  t = t - (*hr * (60 * 60 * 100));
  *min = t / (60 * 100);
  t = t - (*min * (60 * 100));
  *sec = t / 100;
  t = t - (*sec * (100));
  *prt = t;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<wg_time_to_hms>:
  endbr64
  movslq %esi,%rax
  imul   $0x5d34edef,%rax,%rax
  sar    $0x31,%rax
  mov    %esi,%edi
  sar    $0x1f,%edi
  sub    %edi,%eax
  mov    %eax,(%rdx)
  imul   $0xfffa81c0,%eax,%eax
  add    %eax,%esi
  movslq %esi,%rax
  imul   $0x57619f1,%rax,%rax
  sar    $0x27,%rax
  mov    %esi,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,(%rcx)
  imul   $0xffffe890,%eax,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x25,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,(%r8)
  imul   $0xffffff9c,%edx,%edx
  add    %eax,%edx
  mov    %edx,(%r9)
  ret
```

assistant: ```c
void wg_time_to_hms(void *db, int time, int *hr, int *min, int *sec, int *prt) {
  int t = time;
  *hr = t / (60 * 60 * 100);
  t = t - (*hr * (60 * 60 * 100));
  *min = t / (60 * 100);
  t = t - (*min * (60 * 100));
  *sec = t / 100;
  t = t - (*sec * (100));
  *prt = t;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<wg_time_to_hms>:
  endbr64
  movslq %esi,%rax
  mov    %esi,%edi
  imul   $0x5d34edef,%rax,%rax
  sar    $0x1f,%edi
  sar    $0x31,%rax
  sub    %edi,%eax
  mov    %eax,(%rdx)
  imul   $0xfffa81c0,%eax,%eax
  add    %eax,%esi
  movslq %esi,%rax
  mov    %esi,%edx
  imul   $0x57619f1,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x27,%rax
  sub    %edx,%eax
  mov    %eax,(%rcx)
  imul   $0xffffe890,%eax,%eax
  add    %esi,%eax
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x1f,%ecx
  sar    $0x25,%rdx
  sub    %ecx,%edx
  mov    %edx,(%r8)
  imul   $0xffffff9c,%edx,%edx
  add    %eax,%edx
  mov    %edx,(%r9)
  ret
```

assistant: ```c
void wg_time_to_hms(void *db, int time, int *hr, int *min, int *sec, int *prt) {
  int t = time;
  *hr = t / (60 * 60 * 100);
  t = t - (*hr * (60 * 60 * 100));
  *min = t / (60 * 100);
  t = t - (*min * (60 * 100));
  *sec = t / 100;
  t = t - (*sec * (100));
  *prt = t;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<emyg_dtoa>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movsd  %xmm0,-0x18(%rbp)
  mov    %rdi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  -0x18(%rbp),%xmm0
  ucomisd -0x18(%rbp),%xmm0
  setnp  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movsd  -0x18(%rbp),%xmm0
  movq   D7(%rip),%xmm1
  andpd  %xmm1,%xmm0
  ucomisd D11(%rip),%xmm0
  setbe  %al
  xor    $0x1,%eax
  movzbl %al,%eax
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jp     L41
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jne    L41
  mov    -0x20(%rbp),%rax
  movb   $0x30,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movb   $0x2e,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movb   $0x30,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  movb   $0x0,(%rax)
  jmp    L7
L41:
  pxor   %xmm0,%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L34
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x2d,(%rax)
  movsd  -0x18(%rbp),%xmm0
  movq   D26(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
L34:
  lea    -0xc(%rbp),%rdx
  lea    -0x10(%rbp),%rsi
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rdi
  movq   %rax,%xmm0
  call   <Grisu2@plt>
  mov    -0xc(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <Prettify@plt>
L7:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L10
  call   <__stack_chk_fail@plt>
L10:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D7
data_type: byte[8]
name: disassemble_data
arguments: data_label: D11
data_type: byte[8]
name: disassemble_data
arguments: data_label: D26
data_type: byte[8]

tool: {"D7": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D11": [0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x7f]}

tool: {"D26": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
void emyg_dtoa(double value, char *buffer) {
  assert(!isnan(value));
  assert(!isinf(value));
  if (value == 0) {
    buffer[0] = '0';
    buffer[1] = '.';
    buffer[2] = '0';
    buffer[3] = '\0';
  } else {
    if (value < 0) {
      *buffer++ = '-';
      value = -value;
    }
    int length, K;
    Grisu2(value, buffer, &length, &K);
    Prettify(buffer, length, K);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<emyg_dtoa>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  ucomisd %xmm0,%xmm0
  setnp  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movsd  0x8(%rsp),%xmm0
  andpd  D24(%rip),%xmm0
  ucomisd D11(%rip),%xmm0
  setbe  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movsd  0x8(%rsp),%xmm0
  ucomisd D34(%rip),%xmm0
  jp     L49
  jne    L49
  movb   $0x30,(%rbx)
  movb   $0x2e,0x1(%rbx)
  movb   $0x30,0x2(%rbx)
  movb   $0x0,0x3(%rbx)
L36:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  add    $0x20,%rsp
  pop    %rbx
  ret
L49:
  pxor   %xmm0,%xmm0
  movsd  0x8(%rsp),%xmm1
  comisd %xmm1,%xmm0
  ja     L55
L21:
  lea    0x14(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  movsd  0x8(%rsp),%xmm0
  call   <Grisu2@plt>
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    %rbx,%rdi
  call   <Prettify@plt>
  jmp    L36
L55:
  movb   $0x2d,(%rbx)
  xorpd  D13(%rip),%xmm1
  movsd  %xmm1,0x8(%rsp)
  lea    0x1(%rbx),%rbx
  jmp    L21
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D24
type_guessed: byte[16]
name: retrieve_data
arguments: label: D11
type_guessed: byte[8]
name: retrieve_data
arguments: label: D34
type_guessed: byte[8]
name: retrieve_data
arguments: label: D13
type_guessed: byte[16]

tool: {"D24": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D11": [0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x7f]}

tool: {"D34": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D13": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void emyg_dtoa(double value, char *buffer) {
  assert(!isnan(value));
  assert(!isinf(value));
  if (value == 0) {
    buffer[0] = '0';
    buffer[1] = '.';
    buffer[2] = '0';
    buffer[3] = '\0';
  } else {
    if (value < 0) {
      *buffer++ = '-';
      value = -value;
    }
    int length, K;
    Grisu2(value, buffer, &length, &K);
    Prettify(buffer, length, K);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<emyg_dtoa>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  ucomisd %xmm0,%xmm0
  movsd  %xmm0,0x8(%rsp)
  setnp  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movsd  0x8(%rsp),%xmm0
  xor    %edi,%edi
  movapd %xmm0,%xmm1
  andpd  D19(%rip),%xmm1
  ucomisd D22(%rip),%xmm1
  setbe  %dil
  call   <assert@plt>
  movsd  0x8(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L42
  jne    L42
  movl   $0x302e30,0x0(%rbp)
L11:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x20,%rsp
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L42:
  comisd %xmm0,%xmm1
  ja     L48
L59:
  lea    0x14(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <Grisu2@plt>
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    %rbp,%rdi
  call   <Prettify@plt>
  jmp    L11
  nopw   0x0(%rax,%rax,1)
L48:
  movb   $0x2d,0x0(%rbp)
  xorpd  D0(%rip),%xmm0
  add    $0x1,%rbp
  jmp    L59
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D19
data_type: byte[16]
name: disassemble_data
arguments: data_tag: D22
data_type: byte[8]
name: disassemble_data
arguments: data_tag: D0
data_type: byte[16]

tool: {"D19": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D22": [0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x7f]}

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

assistant: ```c
void emyg_dtoa(double value, char *buffer) {
  assert(!isnan(value));
  assert(!isinf(value));
  if (value == 0) {
    buffer[0] = '0';
    buffer[1] = '.';
    buffer[2] = '0';
    buffer[3] = '\0';
  } else {
    if (value < 0) {
      *buffer++ = '-';
      value = -value;
    }
    int length, K;
    Grisu2(value, buffer, &length, &K);
    Prettify(buffer, length, K);
  }
}
```