ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<psycho_3_decimation>:
  endbr64
  movss  D3(%rip),%xmm1
  mov    $0x4,%eax
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L73:
  cmpl   $0x14,(%rsi,%rax,1)
  je     L44
L39:
  add    $0x4,%rax
  cmp    $0x804,%rax
  je     L28
L41:
  cmpl   $0xa,(%rcx,%rax,1)
  jne    L73
  movss  (%rdi,%rax,1),%xmm0
  comiss (%r8,%rax,1),%xmm0
  jbe    L73
  movss  %xmm1,(%r8,%rax,1)
  movl   $0x0,(%rcx,%rax,1)
  cmpl   $0x14,(%rsi,%rax,1)
  jne    L39
  nop
L44:
  movss  (%rdi,%rax,1),%xmm0
  comiss (%rdx,%rax,1),%xmm0
  jbe    L39
  movss  %xmm1,(%rdx,%rax,1)
  movl   $0x0,(%rsi,%rax,1)
  add    $0x4,%rax
  cmp    $0x804,%rax
  jne    L41
L28:
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type: byte[4]

tool: {"D3": [0x00,0x00,0x48,0xc3]}

assistant: ```c
void psycho_3_decimation(float *ath, int *tonelabel, float *Xtm, int *noiselabel, float *Xnm, float *bark) {
  int i;
  for (i = 1; i < 513; i++) {
    if (noiselabel[i] == 10) {
      if (Xnm[i] < ath[i]) {
        Xnm[i] = -200.0;
        noiselabel[i] = 0;
      }
    }
    if (tonelabel[i] == 20) {
      if (Xtm[i] < ath[i]) {
        Xtm[i] = -200.0;
        tonelabel[i] = 0;
      }
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <simple_va_fun@plt>
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xc8,%esi
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <simple_va_fun@plt>
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x12c,%edx
  mov    $0xc8,%esi
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <simple_va_fun@plt>
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <error_second_vsnp@plt>
  lea    D5(%rip),%rax
  mov    %rax,%rdx
  mov    $0x3,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <var_vsnprintf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D44
datatype: string
name: extract_symbolic_data
arguments: tag: D17
datatype: string
name: extract_symbolic_data
arguments: tag: D5
datatype: string
name: extract_symbolic_data
arguments: tag: D1
datatype: string

tool: D44: ==============================


tool: D17: test:=3, =XXXXX


tool: D5: vsnprintf

tool: D1: test:%%d=%d, %%s=%s+++


assistant: ```c
int main(int argc, char **argv) {
  simple_va_fun(100);
  printf("==============================\n");
  simple_va_fun(100, 200);
  printf("==============================\n");
  simple_va_fun(100, 200, 300);
  error_second_vsnp("test:=3, =XXXXX\n");
  var_vsnprintf("test:%%d=%d, %%s=%s+++\n", 3, "vsnprintf");
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbx
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <simple_va_fun@plt>
  lea    D36(%rip),%rbx
  mov    %rbx,%rdi
  call   <printf@plt>
  mov    $0xc8,%esi
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <simple_va_fun@plt>
  mov    %rbx,%rdi
  call   <printf@plt>
  mov    $0x12c,%edx
  mov    $0xc8,%esi
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <simple_va_fun@plt>
  lea    D18(%rip),%rdi
  call   <error_second_vsnp@plt>
  lea    D4(%rip),%rdx
  mov    $0x3,%esi
  lea    D15(%rip),%rdi
  call   <var_vsnprintf@plt>
  mov    $0x0,%eax
  pop    %rbx
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D36
data_type: string
name: disassemble_data
arguments: data_label: D18
data_type: string
name: disassemble_data
arguments: data_label: D4
data_type: string
name: disassemble_data
arguments: data_label: D15
data_type: string

tool: D36: ==============================


tool: D18: test:=3, =XXXXX


tool: D4: vsnprintf

tool: D15: test:%%d=%d, %%s=%s+++


assistant: ```c
int main(int argc, char **argv) {
  simple_va_fun(100);
  printf("==============================\n");
  simple_va_fun(100, 200);
  printf("==============================\n");
  simple_va_fun(100, 200, 300);
  error_second_vsnp("test:=3, =XXXXX\n");
  var_vsnprintf("test:%%d=%d, %%s=%s+++\n", 3, "vsnprintf");
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x64,%edi
  lea    D7(%rip),%rbp
  xor    %eax,%eax
  call   <simple_va_fun@plt>
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    $0xc8,%esi
  mov    $0x64,%edi
  xor    %eax,%eax
  call   <simple_va_fun@plt>
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    $0x12c,%edx
  mov    $0xc8,%esi
  xor    %eax,%eax
  mov    $0x64,%edi
  call   <simple_va_fun@plt>
  lea    D26(%rip),%rdi
  call   <error_second_vsnp@plt>
  lea    D14(%rip),%rdx
  mov    $0x3,%esi
  lea    D28(%rip),%rdi
  call   <var_vsnprintf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D7
type: string
name: extract_symbolic_data
arguments: tag: D26
type: string
name: extract_symbolic_data
arguments: tag: D14
type: string
name: extract_symbolic_data
arguments: tag: D28
type: string

tool: D7: ==============================


tool: D26: test:=3, =XXXXX


tool: D14: vsnprintf

tool: D28: test:%%d=%d, %%s=%s+++


assistant: ```c
int main(int argc, char **argv) {
  simple_va_fun(100);
  printf("==============================\n");
  simple_va_fun(100, 200);
  printf("==============================\n");
  simple_va_fun(100, 200, 300);
  error_second_vsnp("test:=3, =XXXXX\n");
  var_vsnprintf("test:%%d=%d, %%s=%s+++\n", 3, "vsnprintf");
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x64,%edi
  lea    D0(%rip),%rbp
  xor    %eax,%eax
  call   <simple_va_fun@plt>
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    $0xc8,%esi
  mov    $0x64,%edi
  xor    %eax,%eax
  call   <simple_va_fun@plt>
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    $0x12c,%edx
  mov    $0xc8,%esi
  xor    %eax,%eax
  mov    $0x64,%edi
  call   <simple_va_fun@plt>
  lea    D23(%rip),%rdi
  call   <error_second_vsnp@plt>
  lea    D35(%rip),%rdx
  mov    $0x3,%esi
  lea    D9(%rip),%rdi
  call   <var_vsnprintf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D0
data_type: string
name: extract_symbolic_data
arguments: label: D23
data_type: string
name: extract_symbolic_data
arguments: label: D35
data_type: string
name: extract_symbolic_data
arguments: label: D9
data_type: string

tool: D0: ==============================


tool: D23: test:=3, =XXXXX


tool: D35: vsnprintf

tool: D9: test:%%d=%d, %%s=%s+++


assistant: ```c
int main(int argc, char **argv) {
  simple_va_fun(100);
  printf("==============================\n");
  simple_va_fun(100, 200);
  printf("==============================\n");
  simple_va_fun(100, 200, 300);
  error_second_vsnp("test:=3, =XXXXX\n");
  var_vsnprintf("test:%%d=%d, %%s=%s+++\n", 3, "vsnprintf");
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<numberFormattingAsFourDigits>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%eax
  imul   $0x10624dd3,%rax,%rax
  shr    $0x20,%rax
  shr    $0x6,%eax
  mov    %al,-0x4(%rbp)
  movzbl -0x4(%rbp),%eax
  imul   $0x3e8,%eax,%eax
  sub    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%eax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  shr    $0x5,%eax
  mov    %al,-0x3(%rbp)
  movzbl -0x3(%rbp),%eax
  imul   $0x64,%eax,%eax
  sub    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %al,-0x2(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%ecx
  movzbl -0x2(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  mov    %al,-0x1(%rbp)
  movzbl -0x4(%rbp),%eax
  lea    0x30(%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0x3(%rbp),%eax
  lea    0x30(%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0x2(%rbp),%eax
  lea    0x30(%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0x1(%rbp),%eax
  add    $0x30,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %dl,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void numberFormattingAsFourDigits(unsigned int number, char *output) {
  unsigned char thousands = (unsigned char)(number / 1000), hundreds, tens, units;
  number -= thousands * 1000;
  hundreds = (unsigned char)(number / 100);
  number -= hundreds * 100;
  tens = (unsigned char)(number / 10);
  units = (unsigned char)(number - tens * 10);
  *(output++) = '0' + thousands;
  *(output++) = '0' + hundreds;
  *(output++) = '0' + tens;
  *output = '0' + units;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<numberFormattingAsFourDigits>:
  endbr64
  mov    %rsi,%rcx
  mov    %edi,%esi
  imul   $0x10624dd3,%rsi,%rsi
  shr    $0x26,%rsi
  movzbl %sil,%eax
  imul   $0x3e8,%eax,%eax
  sub    %eax,%edi
  mov    %edi,%edx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x25,%rdx
  movzbl %dl,%eax
  imul   $0x64,%eax,%eax
  sub    %eax,%edi
  mov    %edi,%eax
  mov    $0xcccccccd,%r8d
  imul   %r8,%rax
  shr    $0x23,%rax
  add    $0x30,%esi
  mov    %sil,(%rcx)
  add    $0x30,%edx
  mov    %dl,0x1(%rcx)
  lea    0x30(%rax),%edx
  mov    %dl,0x2(%rcx)
  add    $0x30,%edi
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%edi
  mov    %dil,0x3(%rcx)
  ret
```

assistant: ```c
void numberFormattingAsFourDigits(unsigned int number, char *output) {
  unsigned char thousands = (unsigned char)(number / 1000), hundreds, tens, units;
  number -= thousands * 1000;
  hundreds = (unsigned char)(number / 100);
  number -= hundreds * 100;
  tens = (unsigned char)(number / 10);
  units = (unsigned char)(number - tens * 10);
  *(output++) = '0' + thousands;
  *(output++) = '0' + hundreds;
  *(output++) = '0' + tens;
  *output = '0' + units;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<numberFormattingAsFourDigits>:
  endbr64
  mov    %rsi,%rcx
  mov    %edi,%esi
  mov    $0xcccccccd,%r8d
  imul   $0x10624dd3,%rsi,%rsi
  shr    $0x26,%rsi
  movzbl %sil,%eax
  add    $0x30,%esi
  imul   $0x3e8,%eax,%eax
  mov    %sil,(%rcx)
  sub    %eax,%edi
  mov    %edi,%edx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x25,%rdx
  movzbl %dl,%eax
  add    $0x30,%edx
  imul   $0x64,%eax,%eax
  mov    %dl,0x1(%rcx)
  sub    %eax,%edi
  mov    %edi,%eax
  add    $0x30,%edi
  imul   %r8,%rax
  shr    $0x23,%rax
  lea    0x30(%rax),%edx
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  mov    %dl,0x2(%rcx)
  sub    %eax,%edi
  mov    %dil,0x3(%rcx)
  ret
```

assistant: ```c
void numberFormattingAsFourDigits(unsigned int number, char *output) {
  unsigned char thousands = (unsigned char)(number / 1000), hundreds, tens, units;
  number -= thousands * 1000;
  hundreds = (unsigned char)(number / 100);
  number -= hundreds * 100;
  tens = (unsigned char)(number / 10);
  units = (unsigned char)(number - tens * 10);
  *(output++) = '0' + thousands;
  *(output++) = '0' + hundreds;
  *(output++) = '0' + tens;
  *output = '0' + units;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<numberFormattingAsFourDigits>:
  endbr64
  mov    %rsi,%rcx
  mov    %edi,%esi
  mov    $0xcccccccd,%r8d
  imul   $0x10624dd3,%rsi,%rsi
  shr    $0x26,%rsi
  movzbl %sil,%eax
  add    $0x30,%esi
  imul   $0x3e8,%eax,%eax
  mov    %sil,(%rcx)
  sub    %eax,%edi
  mov    %edi,%edx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x25,%rdx
  movzbl %dl,%eax
  add    $0x30,%edx
  imul   $0x64,%eax,%eax
  mov    %dl,0x1(%rcx)
  sub    %eax,%edi
  mov    %edi,%eax
  add    $0x30,%edi
  imul   %r8,%rax
  shr    $0x23,%rax
  lea    0x30(%rax),%edx
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  mov    %dl,0x2(%rcx)
  sub    %eax,%edi
  mov    %dil,0x3(%rcx)
  ret
```

assistant: ```c
void numberFormattingAsFourDigits(unsigned int number, char *output) {
  unsigned char thousands = (unsigned char)(number / 1000), hundreds, tens, units;
  number -= thousands * 1000;
  hundreds = (unsigned char)(number / 100);
  number -= hundreds * 100;
  tens = (unsigned char)(number / 10);
  units = (unsigned char)(number - tens * 10);
  *(output++) = '0' + thousands;
  *(output++) = '0' + hundreds;
  *(output++) = '0' + tens;
  *output = '0' + units;
}
```
user: What is the c source code of the assembly code below?

```asm
<transmit_usart_word>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rcx
  mov    -0x34(%rbp),%eax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <itoa@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L6
L0:
  mov    -0x28(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <transmit_usart@plt>
  addl   $0x1,-0x28(%rbp)
L6:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L0
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L18
  call   <__stack_chk_fail@plt>
L18:
  leave
  ret
```

assistant: ```c
void transmit_usart_word(unsigned int data) {
  char pointer[20];
  int size;
  int i;
  itoa(data, pointer, 10);
  size = strlen(pointer);
  for (i = 0; i < size; ++i)
    transmit_usart(pointer[i]);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<transmit_usart_word>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    $0xa,%edx
  mov    %rbx,%rsi
  call   <itoa@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L25
  lea    -0x1(%rax),%eax
  lea    0x1(%rsp,%rax,1),%rbp
L5:
  movsbl (%rbx),%edi
  call   <transmit_usart@plt>
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L5
L25:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void transmit_usart_word(unsigned int data) {
  char pointer[20];
  int size;
  int i;
  itoa(data, pointer, 10);
  size = strlen(pointer);
  for (i = 0; i < size; ++i)
    transmit_usart(pointer[i]);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<transmit_usart_word>:
  endbr64
  push   %rbp
  mov    $0xa,%edx
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  call   <itoa@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L21
  sub    $0x1,%eax
  lea    0x1(%rsp,%rax,1),%rbp
  xchg   %ax,%ax
L13:
  movsbl (%rbx),%edi
  add    $0x1,%rbx
  call   <transmit_usart@plt>
  cmp    %rbp,%rbx
  jne    L13
L21:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void transmit_usart_word(unsigned int data) {
  char pointer[20];
  int size;
  int i;
  itoa(data, pointer, 10);
  size = strlen(pointer);
  for (i = 0; i < size; ++i)
    transmit_usart(pointer[i]);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<transmit_usart_word>:
  endbr64
  push   %rbp
  mov    $0xa,%edx
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  call   <itoa@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L18
  sub    $0x1,%eax
  lea    0x1(%rsp,%rax,1),%rbp
  xchg   %ax,%ax
L3:
  movsbl (%rbx),%edi
  add    $0x1,%rbx
  call   <transmit_usart@plt>
  cmp    %rbp,%rbx
  jne    L3
L18:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void transmit_usart_word(unsigned int data) {
  char pointer[20];
  int size;
  int i;
  itoa(data, pointer, 10);
  size = strlen(pointer);
  for (i = 0; i < size; ++i)
    transmit_usart(pointer[i]);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<CwLnx_linewrap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  je     L13
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <Enable_Wrap@plt>
  jmp    L6
L13:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <Disable_Wrap@plt>
L6:
  nop
  leave
  ret
```

assistant: ```c
void CwLnx_linewrap(int fd, int on) {
  if (on)
    Enable_Wrap(fd);
  else
    Disable_Wrap(fd);
}
```
user: What is the c source code of the assembly code below:

```asm
<CwLnx_linewrap>:
  endbr64
  sub    $0x8,%rsp
  test   %esi,%esi
  je     L16
  call   <Enable_Wrap@plt>
L6:
  add    $0x8,%rsp
  ret
L16:
  call   <Disable_Wrap@plt>
  jmp    L6
```

assistant: ```c
void CwLnx_linewrap(int fd, int on) {
  if (on)
    Enable_Wrap(fd);
  else
    Disable_Wrap(fd);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<CwLnx_linewrap>:
  endbr64
  test   %esi,%esi
  je     L5
  jmp    1070 <Enable_Wrap@plt>
  nopl   (%rax)
L5:
  jmp    1060 <Disable_Wrap@plt>
```

assistant: ```c
void CwLnx_linewrap(int fd, int on) {
  if (on)
    Enable_Wrap(fd);
  else
    Disable_Wrap(fd);
}
```
user: Translate the below assembly code into C programming language:

```asm
<CwLnx_linewrap>:
  endbr64
  test   %esi,%esi
  je     L3
  jmp    1070 <Enable_Wrap@plt>
  nopl   (%rax)
L3:
  jmp    1060 <Disable_Wrap@plt>
```

assistant: ```c
void CwLnx_linewrap(int fd, int on) {
  if (on)
    Enable_Wrap(fd);
  else
    Disable_Wrap(fd);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<evalfpoly>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x14(%rbp)
  movsd  %xmm0,-0x20(%rbp)
  mov    %rsi,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movsd  D2(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movl   $0x1,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  jmp    L2
L9:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  %xmm3,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x10(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <cos@plt>
  mulsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm4
  movsd  %xmm4,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x10(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  -0x38(%rbp),%xmm0
  addsd  -0x30(%rbp),%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x2,-0xc(%rbp)
  addl   $0x1,-0x10(%rbp)
L2:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L9
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D2
datatype: f64

tool: D2: 5.729577951308232

assistant: ```c
double evalfpoly(int order, double x, double *c) {
  int i, j;
  double y = c[0];
  x = (x - (0.000000000000000)) / (5.729577951308232);
  for (i = 1, j = 1; j <= order; j += 2, i++)
    y += c[j] * cos(i * x) + c[j + 1] * sin(i * x);
  return y;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<evalfpoly>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movsd  (%rsi),%xmm5
  movsd  %xmm5,0x8(%rsp)
  divsd  D9(%rip),%xmm0
  movsd  %xmm0,0x18(%rsp)
  test   %edi,%edi
  jle    L12
  mov    %edi,%r15d
  mov    %rsi,%r14
  mov    $0x1,%ebp
  mov    $0x1,%r12d
L6:
  mov    (%r14,%rbp,8),%rbx
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  mulsd  0x18(%rsp),%xmm0
  cvttsd2si %xmm0,%r13d
  mov    %r13d,%edi
  call   <cos@plt>
  movq   %rbx,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rsp)
  mov    0x8(%r14,%rbp,8),%rbx
  mov    %r13d,%edi
  call   <sin@plt>
  movq   %rbx,%xmm2
  mulsd  %xmm0,%xmm2
  movapd %xmm2,%xmm0
  addsd  0x10(%rsp),%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x1,%r12d
  add    $0x2,%rbp
  cmp    %ebp,%r15d
  jge    L6
L12:
  movsd  0x8(%rsp),%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_label: D9
type_guessed: f64

tool: D9: 5.729577951308232

assistant: ```c
double evalfpoly(int order, double x, double *c) {
  int i, j;
  double y = c[0];
  x = (x - (0.000000000000000)) / (5.729577951308232);
  for (i = 1, j = 1; j <= order; j += 2, i++)
    y += c[j] * cos(i * x) + c[j + 1] * sin(i * x);
  return y;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<evalfpoly>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  divsd  D9(%rip),%xmm0
  movsd  (%rsi),%xmm1
  movsd  %xmm0,0x18(%rsp)
  test   %edi,%edi
  jle    L15
  mov    %edi,%r13d
  mov    %rsi,%r12
  mov    $0x1,%ebx
  mov    $0x1,%ebp
  nopw   0x0(%rax,%rax,1)
L8:
  pxor   %xmm0,%xmm0
  movsd  (%r12,%rbx,8),%xmm3
  movsd  %xmm1,0x10(%rsp)
  cvtsi2sd %ebp,%xmm0
  mulsd  0x18(%rsp),%xmm0
  add    $0x1,%ebp
  movsd  %xmm3,(%rsp)
  cvttsd2si %xmm0,%r14d
  mov    %r14d,%edi
  call   <cos@plt>
  mulsd  (%rsp),%xmm0
  movsd  0x8(%r12,%rbx,8),%xmm5
  mov    %r14d,%edi
  add    $0x2,%rbx
  movsd  %xmm5,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  call   <sin@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  addsd  (%rsp),%xmm0
  addsd  %xmm0,%xmm1
  cmp    %ebx,%r13d
  jge    L8
L15:
  add    $0x20,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D9
type_guessed: f64

tool: D9: 5.729577951308232

assistant: ```c
double evalfpoly(int order, double x, double *c) {
  int i, j;
  double y = c[0];
  x = (x - (0.000000000000000)) / (5.729577951308232);
  for (i = 1, j = 1; j <= order; j += 2, i++)
    y += c[j] * cos(i * x) + c[j + 1] * sin(i * x);
  return y;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<evalfpoly>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  divsd  D5(%rip),%xmm0
  movsd  (%rsi),%xmm1
  movsd  %xmm0,0x18(%rsp)
  test   %edi,%edi
  jle    L16
  mov    %edi,%r13d
  mov    %rsi,%r12
  mov    $0x1,%ebx
  mov    $0x1,%ebp
  nopw   0x0(%rax,%rax,1)
L6:
  pxor   %xmm0,%xmm0
  movsd  (%r12,%rbx,8),%xmm3
  movsd  %xmm1,0x10(%rsp)
  cvtsi2sd %ebp,%xmm0
  mulsd  0x18(%rsp),%xmm0
  add    $0x1,%ebp
  movsd  %xmm3,(%rsp)
  cvttsd2si %xmm0,%r14d
  mov    %r14d,%edi
  call   <cos@plt>
  mulsd  (%rsp),%xmm0
  movsd  0x8(%r12,%rbx,8),%xmm5
  mov    %r14d,%edi
  add    $0x2,%rbx
  movsd  %xmm5,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  call   <sin@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  addsd  (%rsp),%xmm0
  addsd  %xmm0,%xmm1
  cmp    %ebx,%r13d
  jge    L6
L16:
  add    $0x20,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: unpack_data
arguments: tag: D5
data_type: f64

tool: D5: 5.729577951308232

assistant: ```c
double evalfpoly(int order, double x, double *c) {
  int i, j;
  double y = c[0];
  x = (x - (0.000000000000000)) / (5.729577951308232);
  for (i = 1, j = 1; j <= order; j += 2, i++)
    y += c[j] * cos(i * x) + c[j + 1] * sin(i * x);
  return y;
}
```