ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %r13
  movslq %edi,%r13
  push   %r12
  lea    D27(%rip),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jle    L18
  nopl   0x0(%rax)
L22:
  mov    0x0(%rbp,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %r12,%rdi
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %r13,%rbx
  jne    L22
L18:
  lea    D33(%rip),%rax
  xor    %ebx,%ebx
  lea    D20(%rip),%rdx
  movq   $0x0,0x18(%rsp)
  mov    %rax,0x8(%rsp)
  lea    D44(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D34(%rip),%rax
  mov    %rax,0x10(%rsp)
  mov    %rax,0x0(%rbp)
  lea    D42(%rip),%rbp
L29:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    $0x4,%rbx
  je     L40
  mov    (%rsp,%rbx,8),%rdx
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L40:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D27
type_guessed: string
name: read_data
arguments: tag: D33
type_guessed: string
name: read_data
arguments: tag: D20
type_guessed: string
name: read_data
arguments: tag: D44
type_guessed: string
name: read_data
arguments: tag: D34
type_guessed: string
name: read_data
arguments: tag: D42
type_guessed: string

tool: D27: arg %d: %s


tool: D33: Oregon

tool: D20: California

tool: D44: Texas

tool: D34: Hi

tool: D42: state %d: %s


assistant: ```c
int main(int argc, char *argv[]) {
  int i = 0;
  for (i = 0; i < argc; i++) {
    printf("arg %d: %s\n", i, argv[i]);
  }
  char *states[] = {
      "California", "Oregon", "Washington", NULL, "Texas",
  };
  int num_states = 4;
  argv[0] = "Hi";
  states[2] = argv[0];
  for (i = 0; i < num_states; i++) {
    printf("state %d: %s\n", i, states[i]);
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jle    L18
  movslq %edi,%rbp
  xor    %ebx,%ebx
  lea    D28(%rip),%r13
  nopl   0x0(%rax)
L14:
  mov    (%r12,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L14
L18:
  lea    D24(%rip),%rax
  lea    D41(%rip),%rcx
  xor    %ebx,%ebx
  movq   $0x0,0x18(%rsp)
  movq   %rax,%xmm1
  lea    D6(%rip),%rax
  movq   %rcx,%xmm0
  mov    %rax,0x20(%rsp)
  lea    D46(%rip),%rax
  punpcklqdq %xmm1,%xmm0
  lea    D53(%rip),%rbp
  mov    %rax,0x10(%rsp)
  mov    %rax,(%r12)
  mov    %rsp,%r12
  movaps %xmm0,(%rsp)
L13:
  mov    (%r12,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    $0x4,%rbx
  jne    L13
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L21:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D28
datatype: string
name: read_data
arguments: label: D24
datatype: string
name: read_data
arguments: label: D41
datatype: string
name: read_data
arguments: label: D6
datatype: string
name: read_data
arguments: label: D46
datatype: string
name: read_data
arguments: label: D53
datatype: string

tool: D28: arg %d: %s


tool: D24: Oregon

tool: D41: California

tool: D6: Texas

tool: D46: Hi

tool: D53: state %d: %s


assistant: ```c
int main(int argc, char *argv[]) {
  int i = 0;
  for (i = 0; i < argc; i++) {
    printf("arg %d: %s\n", i, argv[i]);
  }
  char *states[] = {
      "California", "Oregon", "Washington", NULL, "Texas",
  };
  int num_states = 4;
  argv[0] = "Hi";
  states[2] = argv[0];
  for (i = 0; i < num_states; i++) {
    printf("state %d: %s\n", i, states[i]);
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<lookup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dlsym@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
void *lookup(void *handle, const char *functionName) {
  void *rv = 0;
  rv = dlsym(handle, functionName);
  return rv;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<lookup>:
  endbr64
  sub    $0x8,%rsp
  call   <dlsym@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void *lookup(void *handle, const char *functionName) {
  void *rv = 0;
  rv = dlsym(handle, functionName);
  return rv;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<lookup>:
  endbr64
  jmp    1050 <dlsym@plt>
```

assistant: ```c
void *lookup(void *handle, const char *functionName) {
  void *rv = 0;
  rv = dlsym(handle, functionName);
  return rv;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<lookup>:
  endbr64
  jmp    1050 <dlsym@plt>
```

assistant: ```c
void *lookup(void *handle, const char *functionName) {
  void *rv = 0;
  rv = dlsym(handle, functionName);
  return rv;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<bridge_switch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <send_upgrade_cmd@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L25
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <errlog@plt>
  mov    $0xfffffffe,%eax
  jmp    L17
L25:
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <goodlog@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <is_switch_ok@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L28
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <errlog@plt>
  mov    $0xfffffffd,%eax
  jmp    L17
L28:
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <goodlog@plt>
  mov    -0x4(%rbp),%eax
L17:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D3
type_guessed: string
name: disassemble_data
arguments: tag: D0
type_guessed: string
name: disassemble_data
arguments: tag: D1
type_guessed: string
name: disassemble_data
arguments: tag: D15
type_guessed: string

tool: D3: 
>>> send_upgrade_cmd failed



tool: D0: 
>>> 2. send upgrade command to bridge success.



tool: D1: 
>>> switch check failed.



tool: D15: 
>>> 3. switch check success



assistant: ```c
int bridge_switch(int fd) {
  int ret = 0;
  ret = send_upgrade_cmd(fd);
  if (ret) {
    errlog("\n>>> send_upgrade_cmd failed\n\n");
    return -2;
  }
  goodlog("\n>>> 2. send upgrade command to bridge success.\n\n");
  ret = is_switch_ok(fd);
  if (ret) {
    errlog("\n>>> switch check failed.\n\n");
    return -3;
  }
  goodlog("\n>>> 3. switch check success\n\n");
  return ret;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<bridge_switch>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  call   <send_upgrade_cmd@plt>
  test   %eax,%eax
  jne    L1
  lea    D3(%rip),%rdi
  call   <goodlog@plt>
  mov    %ebx,%edi
  call   <is_switch_ok@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jne    L36
  lea    D30(%rip),%rdi
  call   <goodlog@plt>
L11:
  mov    %ebx,%eax
  pop    %rbx
  ret
L1:
  lea    D8(%rip),%rdi
  call   <errlog@plt>
  mov    $0xfffffffe,%ebx
  jmp    L11
L36:
  lea    D16(%rip),%rdi
  call   <errlog@plt>
  mov    $0xfffffffd,%ebx
  jmp    L11
```

tool_calls: name: unpack_data
arguments: data_tag: D3
data_type: string
name: unpack_data
arguments: data_tag: D30
data_type: string
name: unpack_data
arguments: data_tag: D8
data_type: string
name: unpack_data
arguments: data_tag: D16
data_type: string

tool: D3: 
>>> 2. send upgrade command to bridge success.



tool: D30: 
>>> 3. switch check success



tool: D8: 
>>> send_upgrade_cmd failed



tool: D16: 
>>> switch check failed.



assistant: ```c
int bridge_switch(int fd) {
  int ret = 0;
  ret = send_upgrade_cmd(fd);
  if (ret) {
    errlog("\n>>> send_upgrade_cmd failed\n\n");
    return -2;
  }
  goodlog("\n>>> 2. send upgrade command to bridge success.\n\n");
  ret = is_switch_ok(fd);
  if (ret) {
    errlog("\n>>> switch check failed.\n\n");
    return -3;
  }
  goodlog("\n>>> 3. switch check success\n\n");
  return ret;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<bridge_switch>:
  endbr64
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  call   <send_upgrade_cmd@plt>
  test   %eax,%eax
  jne    L12
  lea    D26(%rip),%rdi
  call   <goodlog@plt>
  mov    %ebp,%edi
  call   <is_switch_ok@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L26
  lea    D11(%rip),%rdi
  call   <goodlog@plt>
L6:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L12:
  lea    D15(%rip),%rdi
  mov    $0xfffffffe,%r12d
  call   <errlog@plt>
  jmp    L6
  nopl   0x0(%rax)
L26:
  lea    D37(%rip),%rdi
  mov    $0xfffffffd,%r12d
  call   <errlog@plt>
  jmp    L6
```

tool_calls: name: read_data
arguments: tag: D26
data_type: string
name: read_data
arguments: tag: D11
data_type: string
name: read_data
arguments: tag: D15
data_type: string
name: read_data
arguments: tag: D37
data_type: string

tool: D26: 
>>> 2. send upgrade command to bridge success.



tool: D11: 
>>> 3. switch check success



tool: D15: 
>>> send_upgrade_cmd failed



tool: D37: 
>>> switch check failed.



assistant: ```c
int bridge_switch(int fd) {
  int ret = 0;
  ret = send_upgrade_cmd(fd);
  if (ret) {
    errlog("\n>>> send_upgrade_cmd failed\n\n");
    return -2;
  }
  goodlog("\n>>> 2. send upgrade command to bridge success.\n\n");
  ret = is_switch_ok(fd);
  if (ret) {
    errlog("\n>>> switch check failed.\n\n");
    return -3;
  }
  goodlog("\n>>> 3. switch check success\n\n");
  return ret;
}
```
user: What is the c source code of the assembly code below:

```asm
<bridge_switch>:
  endbr64
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  call   <send_upgrade_cmd@plt>
  test   %eax,%eax
  jne    L36
  lea    D25(%rip),%rdi
  call   <goodlog@plt>
  mov    %ebp,%edi
  call   <is_switch_ok@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L38
  lea    D27(%rip),%rdi
  call   <goodlog@plt>
L2:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L36:
  lea    D24(%rip),%rdi
  mov    $0xfffffffe,%r12d
  call   <errlog@plt>
  jmp    L2
  nopl   0x0(%rax)
L38:
  lea    D9(%rip),%rdi
  mov    $0xfffffffd,%r12d
  call   <errlog@plt>
  jmp    L2
```

tool_calls: name: read_data
arguments: data_tag: D25
type: string
name: read_data
arguments: data_tag: D27
type: string
name: read_data
arguments: data_tag: D24
type: string
name: read_data
arguments: data_tag: D9
type: string

tool: D25: 
>>> 2. send upgrade command to bridge success.



tool: D27: 
>>> 3. switch check success



tool: D24: 
>>> send_upgrade_cmd failed



tool: D9: 
>>> switch check failed.



assistant: ```c
int bridge_switch(int fd) {
  int ret = 0;
  ret = send_upgrade_cmd(fd);
  if (ret) {
    errlog("\n>>> send_upgrade_cmd failed\n\n");
    return -2;
  }
  goodlog("\n>>> 2. send upgrade command to bridge success.\n\n");
  ret = is_switch_ok(fd);
  if (ret) {
    errlog("\n>>> switch check failed.\n\n");
    return -3;
  }
  goodlog("\n>>> 3. switch check success\n\n");
  return ret;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<Dico_String>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  lea    D39(%rip),%rax
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <Label_Printf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdx
  lea    D19(%rip),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <Inst_Printf@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D39
datatype: string
name: retrieve_data
arguments: data_tag: D24
datatype: string
name: retrieve_data
arguments: data_tag: D19
datatype: string
name: retrieve_data
arguments: data_tag: D25
datatype: string

tool: D39: $LC

tool: D24: %s%d:

tool: D19: %s

tool: D25: .ascii

assistant: ```c
void Dico_String(int str_no, char *asciiz) {
  Label_Printf("%s%d:", "$LC", str_no);
  Inst_Printf(".ascii", "%s", asciiz);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<Dico_String>:
  endbr64
  push   %rbx
  mov    %edi,%edx
  mov    %rsi,%rbx
  lea    D16(%rip),%rsi
  lea    D29(%rip),%rdi
  call   <Label_Printf@plt>
  mov    %rbx,%rdx
  lea    D39(%rip),%rsi
  lea    D36(%rip),%rdi
  call   <Inst_Printf@plt>
  pop    %rbx
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D16
type_guessed: string
name: retrieve_data
arguments: tag: D29
type_guessed: string
name: retrieve_data
arguments: tag: D39
type_guessed: string
name: retrieve_data
arguments: tag: D36
type_guessed: string

tool: D16: $LC

tool: D29: %s%d:

tool: D39: %s

tool: D36: .ascii

assistant: ```c
void Dico_String(int str_no, char *asciiz) {
  Label_Printf("%s%d:", "$LC", str_no);
  Inst_Printf(".ascii", "%s", asciiz);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<Dico_String>:
  endbr64
  push   %r12
  mov    %edi,%edx
  mov    %rsi,%r12
  lea    D10(%rip),%rdi
  lea    D8(%rip),%rsi
  call   <Label_Printf@plt>
  mov    %r12,%rdx
  pop    %r12
  lea    D4(%rip),%rsi
  lea    D5(%rip),%rdi
  jmp    1070 <Inst_Printf@plt>
```

tool_calls: name: retrieve_data
arguments: label: D10
data_type: string
name: retrieve_data
arguments: label: D8
data_type: string
name: retrieve_data
arguments: label: D4
data_type: string
name: retrieve_data
arguments: label: D5
data_type: string

tool: D10: %s%d:

tool: D8: $LC

tool: D4: %s

tool: D5: .ascii

assistant: ```c
void Dico_String(int str_no, char *asciiz) {
  Label_Printf("%s%d:", "$LC", str_no);
  Inst_Printf(".ascii", "%s", asciiz);
}
```
user: Translate the below assembly code into C programming language:

```asm
<Dico_String>:
  endbr64
  push   %r12
  mov    %edi,%edx
  mov    %rsi,%r12
  lea    D38(%rip),%rdi
  lea    D10(%rip),%rsi
  call   <Label_Printf@plt>
  mov    %r12,%rdx
  pop    %r12
  lea    D33(%rip),%rsi
  lea    D27(%rip),%rdi
  jmp    1070 <Inst_Printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D38
type_infered: string
name: extract_symbolic_data
arguments: tag: D10
type_infered: string
name: extract_symbolic_data
arguments: tag: D33
type_infered: string
name: extract_symbolic_data
arguments: tag: D27
type_infered: string

tool: D38: %s%d:

tool: D10: $LC

tool: D33: %s

tool: D27: .ascii

assistant: ```c
void Dico_String(int str_no, char *asciiz) {
  Label_Printf("%s%d:", "$LC", str_no);
  Inst_Printf(".ascii", "%s", asciiz);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<round>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <isfinite@plt>
  test   %eax,%eax
  jne    L34
  movsd  -0x18(%rbp),%xmm0
  jmp    L54
L34:
  movsd  -0x18(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L37
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <ceil@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  comisd D24(%rip),%xmm0
  jbe    L22
  movsd  -0x8(%rbp),%xmm0
  movsd  D1(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L22:
  movsd  -0x8(%rbp),%xmm0
  jmp    L54
L37:
  movsd  -0x18(%rbp),%xmm0
  movq   D35(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <ceil@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  addsd  -0x18(%rbp),%xmm0
  comisd D24(%rip),%xmm0
  jbe    L57
  movsd  -0x8(%rbp),%xmm0
  movsd  D1(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L57:
  movsd  -0x8(%rbp),%xmm0
  movq   D35(%rip),%xmm1
  xorpd  %xmm1,%xmm0
L54:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D24
type: f64[2]
name: parse_data
arguments: label: D1
type: f64
name: parse_data
arguments: label: D35
type: f32[2]

tool: {"D24": [0.5,1.0]}

tool: D1: 1

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

assistant: ```c
double round(double x) {
  double t;
  if (!isfinite(x))
    return (x);
  if (x >= 0.0) {
    t = ceil(x);
    if (t - x > 0.5)
      t -= 1.0;
    return (t);
  } else {
    t = ceil(-x);
    if (t + x > 0.5)
      t -= 1.0;
    return (-t);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<round>:
  endbr64
  push   %rbx
  movq   %xmm0,%rbx
  call   <isfinite@plt>
  movq   %rbx,%xmm0
  test   %eax,%eax
  je     L30
  movq   %rbx,%xmm5
  comisd D61(%rip),%xmm0
  jb     L45
  movq   %rbx,%xmm1
  movsd  D89(%rip),%xmm2
  andpd  %xmm2,%xmm0
  movsd  D7(%rip),%xmm3
  ucomisd %xmm0,%xmm3
  jbe    L7
  cvttsd2si %xmm5,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  cmpnlesd %xmm0,%xmm1
  movsd  D37(%rip),%xmm3
  andpd  %xmm3,%xmm1
  addsd  %xmm0,%xmm1
  andnpd %xmm5,%xmm2
  orpd   %xmm2,%xmm1
L7:
  movapd %xmm1,%xmm0
  movapd %xmm1,%xmm2
  movq   %rbx,%xmm6
  subsd  %xmm6,%xmm2
  comisd D55(%rip),%xmm2
  jbe    L30
  subsd  D37(%rip),%xmm1
  movapd %xmm1,%xmm0
  jmp    L30
L45:
  movq   %rbx,%xmm1
  xorpd  D119(%rip),%xmm1
  movapd %xmm1,%xmm2
  movsd  D89(%rip),%xmm3
  movapd %xmm1,%xmm0
  andpd  %xmm3,%xmm0
  movsd  D7(%rip),%xmm4
  ucomisd %xmm0,%xmm4
  jbe    L39
  cvttsd2si %xmm1,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  cmpnlesd %xmm0,%xmm2
  movsd  D37(%rip),%xmm4
  andpd  %xmm4,%xmm2
  addsd  %xmm0,%xmm2
  andnpd %xmm1,%xmm3
  orpd   %xmm3,%xmm2
L39:
  movapd %xmm2,%xmm0
  movq   %rbx,%xmm1
  addsd  %xmm2,%xmm1
  comisd D55(%rip),%xmm1
  jbe    L27
  subsd  D37(%rip),%xmm2
  movapd %xmm2,%xmm0
L27:
  xorpd  D119(%rip),%xmm0
L30:
  pop    %rbx
  ret
```

tool_calls: name: parse_data
arguments: tag: D61
datatype: f64[2]
name: parse_data
arguments: tag: D89
datatype: byte[8]
name: parse_data
arguments: tag: D7
datatype: byte[8]
name: parse_data
arguments: tag: D37
datatype: f64
name: parse_data
arguments: tag: D55
datatype: f64[2]
name: parse_data
arguments: tag: D119
datatype: byte[16]

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

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

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

tool: D37: 1

tool: {"D55": [0.5,0.0]}

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

assistant: ```c
double round(double x) {
  double t;
  if (!isfinite(x))
    return (x);
  if (x >= 0.0) {
    t = ceil(x);
    if (t - x > 0.5)
      t -= 1.0;
    return (t);
  } else {
    t = ceil(-x);
    if (t + x > 0.5)
      t -= 1.0;
    return (-t);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<round>:
  endbr64
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <isfinite@plt>
  movsd  0x8(%rsp),%xmm1
  test   %eax,%eax
  je     L74
  comisd D8(%rip),%xmm1
  jb     L58
  movsd  D15(%rip),%xmm3
  movsd  D40(%rip),%xmm4
  movapd %xmm1,%xmm2
  movapd %xmm1,%xmm0
  andpd  %xmm3,%xmm2
  ucomisd %xmm2,%xmm4
  ja     L54
L23:
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  comisd D31(%rip),%xmm2
  jbe    L48
  subsd  D86(%rip),%xmm0
L48:
  add    $0x18,%rsp
  ret
L58:
  movq   D57(%rip),%xmm4
  movapd %xmm1,%xmm0
  movsd  D15(%rip),%xmm3
  movsd  D40(%rip),%xmm5
  xorpd  %xmm4,%xmm0
  movapd %xmm0,%xmm2
  andpd  %xmm3,%xmm2
  ucomisd %xmm2,%xmm5
  ja     L76
  addsd  %xmm0,%xmm1
  comisd D31(%rip),%xmm1
  jbe    L16
L45:
  subsd  D86(%rip),%xmm0
L16:
  xorpd  %xmm4,%xmm0
  add    $0x18,%rsp
  ret
  nopl   (%rax)
L74:
  movapd %xmm1,%xmm0
  add    $0x18,%rsp
  ret
  nopl   0x0(%rax)
L54:
  cvttsd2si %xmm1,%rax
  pxor   %xmm2,%xmm2
  movsd  D86(%rip),%xmm4
  andnpd %xmm1,%xmm3
  cvtsi2sd %rax,%xmm2
  cmpnlesd %xmm2,%xmm0
  andpd  %xmm4,%xmm0
  addsd  %xmm2,%xmm0
  orpd   %xmm3,%xmm0
  jmp    L23
L76:
  cvttsd2si %xmm0,%rax
  pxor   %xmm2,%xmm2
  movapd %xmm0,%xmm5
  movsd  D86(%rip),%xmm6
  andnpd %xmm0,%xmm3
  cvtsi2sd %rax,%xmm2
  cmpnlesd %xmm2,%xmm5
  andpd  %xmm6,%xmm5
  addsd  %xmm5,%xmm2
  orpd   %xmm3,%xmm2
  movapd %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  comisd D31(%rip),%xmm1
  jbe    L16
  jmp    L45
```

tool_calls: name: disassemble_data
arguments: data_tag: D8
datatype: f64[2]
name: disassemble_data
arguments: data_tag: D15
datatype: byte[8]
name: disassemble_data
arguments: data_tag: D40
datatype: byte[8]
name: disassemble_data
arguments: data_tag: D31
datatype: f64[2]
name: disassemble_data
arguments: data_tag: D86
datatype: f64
name: disassemble_data
arguments: data_tag: D57
datatype: byte[8]

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

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

tool: {"D40": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

tool: {"D31": [0.5,0.0]}

tool: D86: 1

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

assistant: ```c
double round(double x) {
  double t;
  if (!isfinite(x))
    return (x);
  if (x >= 0.0) {
    t = ceil(x);
    if (t - x > 0.5)
      t -= 1.0;
    return (t);
  } else {
    t = ceil(-x);
    if (t + x > 0.5)
      t -= 1.0;
    return (-t);
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<round>:
  endbr64
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <isfinite@plt>
  movsd  0x8(%rsp),%xmm1
  test   %eax,%eax
  je     L20
  comisd D1(%rip),%xmm1
  jb     L89
  movsd  D45(%rip),%xmm3
  movsd  D25(%rip),%xmm4
  movapd %xmm1,%xmm2
  movapd %xmm1,%xmm0
  andpd  %xmm3,%xmm2
  ucomisd %xmm2,%xmm4
  ja     L66
L10:
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  comisd D15(%rip),%xmm2
  jbe    L8
  subsd  D79(%rip),%xmm0
L8:
  add    $0x18,%rsp
  ret
L89:
  movq   D69(%rip),%xmm4
  movapd %xmm1,%xmm0
  movsd  D45(%rip),%xmm3
  movsd  D25(%rip),%xmm5
  xorpd  %xmm4,%xmm0
  movapd %xmm0,%xmm2
  andpd  %xmm3,%xmm2
  ucomisd %xmm2,%xmm5
  ja     L57
  addsd  %xmm0,%xmm1
  comisd D15(%rip),%xmm1
  jbe    L84
L76:
  subsd  D79(%rip),%xmm0
L84:
  xorpd  %xmm4,%xmm0
  add    $0x18,%rsp
  ret
  nopl   (%rax)
L20:
  movapd %xmm1,%xmm0
  add    $0x18,%rsp
  ret
  nopl   0x0(%rax)
L66:
  cvttsd2si %xmm1,%rax
  pxor   %xmm2,%xmm2
  movsd  D79(%rip),%xmm4
  andnpd %xmm1,%xmm3
  cvtsi2sd %rax,%xmm2
  cmpnlesd %xmm2,%xmm0
  andpd  %xmm4,%xmm0
  addsd  %xmm2,%xmm0
  orpd   %xmm3,%xmm0
  jmp    L10
L57:
  cvttsd2si %xmm0,%rax
  pxor   %xmm2,%xmm2
  movapd %xmm0,%xmm5
  movsd  D79(%rip),%xmm6
  andnpd %xmm0,%xmm3
  cvtsi2sd %rax,%xmm2
  cmpnlesd %xmm2,%xmm5
  andpd  %xmm6,%xmm5
  addsd  %xmm5,%xmm2
  orpd   %xmm3,%xmm2
  movapd %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  comisd D15(%rip),%xmm1
  jbe    L84
  jmp    L76
```

tool_calls: name: parse_data
arguments: tag: D1
datatype: f64[2]
name: parse_data
arguments: tag: D45
datatype: byte[8]
name: parse_data
arguments: tag: D25
datatype: byte[8]
name: parse_data
arguments: tag: D15
datatype: f64[2]
name: parse_data
arguments: tag: D79
datatype: f64
name: parse_data
arguments: tag: D69
datatype: byte[8]

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

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

tool: {"D25": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

tool: {"D15": [0.5,0.0]}

tool: D79: 1

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

assistant: ```c
double round(double x) {
  double t;
  if (!isfinite(x))
    return (x);
  if (x >= 0.0) {
    t = ceil(x);
    if (t - x > 0.5)
      t -= 1.0;
    return (t);
  } else {
    t = ceil(-x);
    if (t + x > 0.5)
      t -= 1.0;
    return (-t);
  }
}
```