ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<open_if_mouse>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <stat@plt>
  cmp    $0xffffffff,%eax
  je     L40
  mov    0x4(%rsp),%edi
  call   <S_ISCHR@plt>
  test   %rax,%rax
  je     L40
  mov    (%rsp),%eax
  movzbl %ah,%edx
  cmp    $0xd,%edx
  setne  %dl
  test   $0xc0,%al
  sete   %cl
  or     %cl,%dl
  jne    L40
  movzbl %al,%eax
  cmp    $0x60,%eax
  jle    L12
  cs nopw 0x0(%rax,%rax,1)
L40:
  xor    %eax,%eax
L33:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L26
  add    $0x18,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L12:
  mov    D16(%rip),%rax
  mov    %rbp,%rdi
  mov    (%rax),%esi
  mov    D15(%rip),%rax
  or     (%rax),%esi
  call   <open@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L40
  mov    %eax,%esi
  mov    %rbp,%rdi
  call   <init_mouse@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L33
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L40
L26:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int open_if_mouse(const char *fname) {
  struct stat statbuf;
  int fd;
  int devmajor, devminor;
  if (stat(fname, &statbuf) == -1)
    return 0;
  if (S_ISCHR(statbuf.st_mode) == 0)
    return 0;
  devmajor = (statbuf.st_rdev & 0xFF00) >> 8;
  devminor = (statbuf.st_rdev & 0x00FF);
  if ((devmajor != 13) || (devminor < 64) || (devminor > 96))
    return 0;
  if ((fd = open(fname, O_RDONLY | O_NONBLOCK)) == -1)
    return 0;
  if (init_mouse(fname, fd))
    return 1;
  close(fd);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<open_if_mouse>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <stat@plt>
  cmp    $0xffffffff,%eax
  je     L72
  mov    0x4(%rsp),%edi
  call   <S_ISCHR@plt>
  test   %rax,%rax
  je     L72
  mov    (%rsp),%eax
  movzbl %ah,%edx
  cmp    $0xd,%edx
  setne  %dl
  test   $0xc0,%al
  sete   %cl
  or     %cl,%dl
  jne    L72
  movzbl %al,%eax
  cmp    $0x60,%eax
  jle    L25
  cs nopw 0x0(%rax,%rax,1)
L72:
  xor    %eax,%eax
L16:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L12
  add    $0x18,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L25:
  mov    D8(%rip),%rax
  mov    %rbp,%rdi
  mov    (%rax),%esi
  mov    D14(%rip),%rax
  or     (%rax),%esi
  call   <open@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L72
  mov    %eax,%esi
  mov    %rbp,%rdi
  call   <init_mouse@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L16
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L72
L12:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int open_if_mouse(const char *fname) {
  struct stat statbuf;
  int fd;
  int devmajor, devminor;
  if (stat(fname, &statbuf) == -1)
    return 0;
  if (S_ISCHR(statbuf.st_mode) == 0)
    return 0;
  devmajor = (statbuf.st_rdev & 0xFF00) >> 8;
  devminor = (statbuf.st_rdev & 0x00FF);
  if ((devmajor != 13) || (devminor < 64) || (devminor > 96))
    return 0;
  if ((fd = open(fname, O_RDONLY | O_NONBLOCK)) == -1)
    return 0;
  if (init_mouse(fname, fd))
    return 1;
  close(fd);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    D5(%rip),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,%edx
  mov    D5(%rip),%rax
  mov    %edx,%esi
  movq   %rax,%xmm0
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    D40(%rip),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,%edx
  mov    D40(%rip),%rax
  mov    %edx,%esi
  movq   %rax,%xmm0
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D5
type_guessed: f64
name: retrieve_data
arguments: data_tag: D7
type_guessed: string
name: retrieve_data
arguments: data_tag: D40
type_guessed: f64

tool: D5: 4

tool: D7: Square root of %lf is %lf


tool: D40: 5

assistant: ```c
int main() {
  printf("Square root of %lf is %lf\n", 4.0, sqrt(4.0));
  printf("Square root of %lf is %lf\n", 5.0, sqrt(5.0));
  return (0);
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbx
  mov    D33(%rip),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,%esi
  mov    D33(%rip),%rax
  movq   %rax,%xmm0
  lea    D3(%rip),%rbx
  mov    %rbx,%rdi
  call   <printf@plt>
  mov    D1(%rip),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,%esi
  mov    D1(%rip),%rax
  movq   %rax,%xmm0
  mov    %rbx,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  pop    %rbx
  ret
```

tool_calls: name: retrieve_data
arguments: label: D33
type_infered: f64
name: retrieve_data
arguments: label: D3
type_infered: string
name: retrieve_data
arguments: label: D1
type_infered: f64

tool: D33: 4

tool: D3: Square root of %lf is %lf


tool: D1: 5

assistant: ```c
int main() {
  printf("Square root of %lf is %lf\n", 4.0, sqrt(4.0));
  printf("Square root of %lf is %lf\n", 5.0, sqrt(5.0));
  return (0);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<main>:
  endbr64
  push   %rbp
  movsd  D32(%rip),%xmm0
  lea    D7(%rip),%rbp
  call   <sqrt@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  mov    D32(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  movsd  D14(%rip),%xmm0
  call   <sqrt@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  mov    D14(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D32
type_guessed: f64
name: extract_symbolic_data
arguments: label: D7
type_guessed: string
name: extract_symbolic_data
arguments: label: D14
type_guessed: f64

tool: D32: 4

tool: D7: Square root of %lf is %lf


tool: D14: 5

assistant: ```c
int main() {
  printf("Square root of %lf is %lf\n", 4.0, sqrt(4.0));
  printf("Square root of %lf is %lf\n", 5.0, sqrt(5.0));
  return (0);
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %rbp
  movsd  D22(%rip),%xmm0
  lea    D11(%rip),%rbp
  call   <sqrt@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  mov    D22(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  movsd  D20(%rip),%xmm0
  call   <sqrt@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  mov    D20(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D22
data_type: f64
name: unpack_data
arguments: data_tag: D11
data_type: string
name: unpack_data
arguments: data_tag: D20
data_type: f64

tool: D22: 4

tool: D11: Square root of %lf is %lf


tool: D20: 5

assistant: ```c
int main() {
  printf("Square root of %lf is %lf\n", 4.0, sqrt(4.0));
  printf("Square root of %lf is %lf\n", 5.0, sqrt(5.0));
  return (0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x1c(%rbp)
  movl   $0x2,-0x18(%rbp)
  movl   $0x3,-0x14(%rbp)
  movl   $0x4,-0x10(%rbp)
  movl   $0x5,-0xc(%rbp)
  mov    $0xc,%edx
  mov    $0x8,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D4
type: string

tool: D4: %lu %lu


assistant: ```c
int main(void) {
  typedef int A[];
  A a = {1, 2}, b = {3, 4, 5};
  printf("%lu %lu\n", sizeof(a), sizeof(b));
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xc,%edx
  mov    $0x8,%esi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D7
type: string

tool: D7: %lu %lu


assistant: ```c
int main(void) {
  typedef int A[];
  A a = {1, 2}, b = {3, 4, 5};
  printf("%lu %lu\n", sizeof(a), sizeof(b));
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xc,%edx
  mov    $0x8,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
type_infered: string

tool: D2: %lu %lu


assistant: ```c
int main(void) {
  typedef int A[];
  A a = {1, 2}, b = {3, 4, 5};
  printf("%lu %lu\n", sizeof(a), sizeof(b));
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xc,%edx
  mov    $0x8,%esi
  lea    D6(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D6
type_infered: string

tool: D6: %lu %lu


assistant: ```c
int main(void) {
  typedef int A[];
  A a = {1, 2}, b = {3, 4, 5};
  printf("%lu %lu\n", sizeof(a), sizeof(b));
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<current_uptime>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L25
L22:
  cmpl   $0x3c,-0x4(%rbp)
  jle    L24
  addl   $0x1,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
L24:
  subq   $0x3c,-0x20(%rbp)
  addl   $0x1,-0x4(%rbp)
L25:
  cmpq   $0x3b,-0x20(%rbp)
  ja     L22
  mov    -0x4(%rbp),%edi
  mov    -0x8(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x24(%rbp),%esi
  mov    -0x18(%rbp),%rax
  sub    $0x8,%rsp
  push   -0x20(%rbp)
  mov    %edi,%r9d
  mov    %ecx,%r8d
  lea    D3(%rip),%rcx
  mov    %rax,%rdi
  call   <mvwprintw@plt>
  add    $0x10,%rsp
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D3
type_guessed: string

tool: D3: Hrs: %d Mins: %d Secs: %lu


assistant: ```c
void current_uptime(WINDOW *system_window, unsigned long seconds, int y, int x) {
  int hour, minute;
  for (hour = 0, minute = 0; seconds >= 60; seconds -= 60, minute++) {
    if (minute > 60) {
      hour++;
      minute = 0;
    }
  }
  mvwprintw(system_window, y, x, "Hrs: %d Mins: %d Secs: %lu\n", hour, minute, seconds);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<current_uptime>:
  endbr64
  sub    $0x8,%rsp
  mov    %rsi,%rax
  mov    %edx,%esi
  mov    %ecx,%edx
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  cmp    $0x3b,%rax
  jbe    L18
L7:
  sub    $0x3c,%rax
  add    $0x1,%r9d
  cmp    $0x3b,%rax
  jbe    L18
  cmp    $0x3c,%r9d
  jle    L7
  add    $0x1,%r8d
  mov    $0x0,%r9d
  jmp    L7
L18:
  sub    $0x8,%rsp
  push   %rax
  lea    D6(%rip),%rcx
  call   <mvwprintw@plt>
  add    $0x18,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D6
type: string

tool: D6: Hrs: %d Mins: %d Secs: %lu


assistant: ```c
void current_uptime(WINDOW *system_window, unsigned long seconds, int y, int x) {
  int hour, minute;
  for (hour = 0, minute = 0; seconds >= 60; seconds -= 60, minute++) {
    if (minute > 60) {
      hour++;
      minute = 0;
    }
  }
  mvwprintw(system_window, y, x, "Hrs: %d Mins: %d Secs: %lu\n", hour, minute, seconds);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<current_uptime>:
  endbr64
  mov    %rsi,%rax
  sub    $0x8,%rsp
  mov    %edx,%esi
  xor    %r9d,%r9d
  mov    %ecx,%edx
  xor    %r8d,%r8d
  cmp    $0x3b,%rax
  jbe    L5
  nopl   0x0(%rax,%rax,1)
L28:
  sub    $0x3c,%rax
  add    $0x1,%r9d
  cmp    $0x3b,%rax
  jbe    L5
L16:
  cmp    $0x3d,%r9d
  jne    L28
  xor    %r9d,%r9d
  sub    $0x3c,%rax
  add    $0x1,%r8d
  add    $0x1,%r9d
  cmp    $0x3b,%rax
  ja     L16
L5:
  sub    $0x8,%rsp
  lea    D3(%rip),%rcx
  push   %rax
  call   <mvwprintw@plt>
  add    $0x18,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D3
data_type: string

tool: D3: Hrs: %d Mins: %d Secs: %lu


assistant: ```c
void current_uptime(WINDOW *system_window, unsigned long seconds, int y, int x) {
  int hour, minute;
  for (hour = 0, minute = 0; seconds >= 60; seconds -= 60, minute++) {
    if (minute > 60) {
      hour++;
      minute = 0;
    }
  }
  mvwprintw(system_window, y, x, "Hrs: %d Mins: %d Secs: %lu\n", hour, minute, seconds);
}
```
user: Translate the below assembly code into C programming language:

```asm
<current_uptime>:
  endbr64
  mov    %rsi,%rax
  sub    $0x8,%rsp
  mov    %edx,%esi
  mov    %ecx,%edx
  cmp    $0x3b,%rax
  jbe    L15
  sub    $0x3c,%rax
  mov    $0x1,%r9d
  xor    %r8d,%r8d
  cmp    $0x3b,%rax
  jbe    L23
  nopl   0x0(%rax,%rax,1)
L42:
  sub    $0x3c,%rax
  add    $0x1,%r9d
  cmp    $0x3b,%rax
  jbe    L23
L6:
  cmp    $0x3d,%r9d
  jne    L42
  xor    %r9d,%r9d
  sub    $0x3c,%rax
  add    $0x1,%r8d
  add    $0x1,%r9d
  cmp    $0x3b,%rax
  ja     L6
L23:
  sub    $0x8,%rsp
  lea    D9(%rip),%rcx
  push   %rax
  call   <mvwprintw@plt>
  add    $0x18,%rsp
  ret
  nop
L15:
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  jmp    L23
```

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

tool: D9: Hrs: %d Mins: %d Secs: %lu


assistant: ```c
void current_uptime(WINDOW *system_window, unsigned long seconds, int y, int x) {
  int hour, minute;
  for (hour = 0, minute = 0; seconds >= 60; seconds -= 60, minute++) {
    if (minute > 60) {
      hour++;
      minute = 0;
    }
  }
  mvwprintw(system_window, y, x, "Hrs: %d Mins: %d Secs: %lu\n", hour, minute, seconds);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<vary>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  lea    D19(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L7
  lea    D22(%rip),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L9
L7:
  lea    D40(%rip),%rax
  mov    %rax,-0x8(%rbp)
L9:
  mov    -0x18(%rbp),%ecx
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  lea    D39(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <write_value@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D19
datatype: string
name: retrieve_data
arguments: data_tag: D22
datatype: string
name: retrieve_data
arguments: data_tag: D40
datatype: string
name: retrieve_data
arguments: data_tag: D16
datatype: string
name: retrieve_data
arguments: data_tag: D39
datatype: string

tool: D19: 0

tool: D22: offline

tool: D40: online

tool: D16: Vary %s %x.%02x... 

tool: D39: status

assistant: ```c
void vary(int css, int num, const char *dir, const char *val) {
  const char *op;
  if (strcmp(val, "0") == 0)
    op = "offline";
  else
    op = "online";
  printf("Vary %s %x.%02x... ", op, css, num);
  write_value(dir, "status", val);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<vary>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %esi,%r13d
  mov    %rdx,%rbp
  mov    %rcx,%rbx
  lea    D5(%rip),%rsi
  mov    %rcx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  lea    D14(%rip),%rsi
  lea    D49(%rip),%rax
  cmovne %rax,%rsi
  mov    %r13d,%ecx
  mov    %r12d,%edx
  lea    D20(%rip),%rdi
  call   <printf@plt>
  mov    %rbx,%rdx
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  call   <write_value@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: disassemble_data
arguments: label: D5
datatype: string
name: disassemble_data
arguments: label: D14
datatype: string
name: disassemble_data
arguments: label: D49
datatype: string
name: disassemble_data
arguments: label: D20
datatype: string
name: disassemble_data
arguments: label: D1
datatype: string

tool: D5: 0

tool: D14: offline

tool: D49: online

tool: D20: Vary %s %x.%02x... 

tool: D1: status

assistant: ```c
void vary(int css, int num, const char *dir, const char *val) {
  const char *op;
  if (strcmp(val, "0") == 0)
    op = "offline";
  else
    op = "online";
  printf("Vary %s %x.%02x... ", op, css, num);
  write_value(dir, "status", val);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<vary>:
  endbr64
  push   %r14
  mov    %esi,%r14d
  lea    D16(%rip),%rsi
  push   %r13
  mov    %edi,%r13d
  mov    %rcx,%rdi
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdx,%rbp
  sub    $0x8,%rsp
  call   <strcmp@plt>
  lea    D41(%rip),%rsi
  mov    %r13d,%edx
  mov    %r14d,%ecx
  test   %rax,%rax
  lea    D37(%rip),%rax
  lea    D17(%rip),%rdi
  cmovne %rax,%rsi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    %r12,%rdx
  mov    %rbp,%rdi
  lea    D28(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1090 <write_value@plt>
```

tool_calls: name: read_data
arguments: tag: D16
type: string
name: read_data
arguments: tag: D41
type: string
name: read_data
arguments: tag: D37
type: string
name: read_data
arguments: tag: D17
type: string
name: read_data
arguments: tag: D28
type: string

tool: D16: 0

tool: D41: offline

tool: D37: online

tool: D17: Vary %s %x.%02x... 

tool: D28: status

assistant: ```c
void vary(int css, int num, const char *dir, const char *val) {
  const char *op;
  if (strcmp(val, "0") == 0)
    op = "offline";
  else
    op = "online";
  printf("Vary %s %x.%02x... ", op, css, num);
  write_value(dir, "status", val);
}
```
user: What is the c source code of the assembly code below:

```asm
<vary>:
  endbr64
  push   %r14
  mov    %esi,%r14d
  lea    D27(%rip),%rsi
  push   %r13
  mov    %edi,%r13d
  mov    %rcx,%rdi
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdx,%rbp
  sub    $0x8,%rsp
  call   <strcmp@plt>
  lea    D38(%rip),%rsi
  mov    %r13d,%edx
  mov    %r14d,%ecx
  test   %rax,%rax
  lea    D24(%rip),%rax
  lea    D25(%rip),%rdi
  cmovne %rax,%rsi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    %r12,%rdx
  mov    %rbp,%rdi
  lea    D4(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1090 <write_value@plt>
```

tool_calls: name: disassemble_data
arguments: label: D27
type_guessed: string
name: disassemble_data
arguments: label: D38
type_guessed: string
name: disassemble_data
arguments: label: D24
type_guessed: string
name: disassemble_data
arguments: label: D25
type_guessed: string
name: disassemble_data
arguments: label: D4
type_guessed: string

tool: D27: 0

tool: D38: offline

tool: D24: online

tool: D25: Vary %s %x.%02x... 

tool: D4: status

assistant: ```c
void vary(int css, int num, const char *dir, const char *val) {
  const char *op;
  if (strcmp(val, "0") == 0)
    op = "offline";
  else
    op = "online";
  printf("Vary %s %x.%02x... ", op, css, num);
  write_value(dir, "status", val);
}
```
user: Translate the below assembly code into C programming language:

```asm
<io_getdata>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x440,%rsp
  mov    %rdi,-0x428(%rbp)
  mov    %rsi,-0x430(%rbp)
  mov    %edx,-0x434(%rbp)
  mov    %rcx,-0x440(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
L12:
  mov    -0x428(%rbp),%rax
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0x414(%rbp)
  jmp    L17
L26:
  addl   $0x1,-0x414(%rbp)
L17:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    -0x414(%rbp),%edx
  movslq %edx,%rdx
  mov    %al,-0x410(%rbp,%rdx,1)
  mov    -0x414(%rbp),%eax
  cltq
  movzbl -0x410(%rbp,%rax,1),%eax
  cmp    $0xa,%al
  jne    L26
  mov    -0x414(%rbp),%eax
  cltq
  movb   $0x0,-0x410(%rbp,%rax,1)
  cmpl   $0x0,-0x414(%rbp)
  jle    L12
  lea    -0x410(%rbp),%rax
  lea    D13(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L80
  cmpl   $0x0,-0x434(%rbp)
  je     L44
  cmpl   $0x0,-0x434(%rbp)
  jle    L12
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x434(%rbp)
  jne    L12
L44:
  mov    -0x440(%rbp),%rdx
  mov    -0x430(%rbp),%rcx
  lea    -0x410(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  jmp    L41
L80:
  nop
L41:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L53
  call   <__stack_chk_fail@plt>
L53:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D12
type_guessed: string
name: unpack_data
arguments: label: D13
type_guessed: string

tool: D12: %s

tool: D13: ...

assistant: ```c
void io_getdata(const char *tip, const char *fmt, int slen, void *p) {
  int rc;
  int i;
  char input[1024];
  while (1) {
    printf("%s", tip);
    for (i = 0; (input[i] = getchar()) != '\n'; i++)
      ;
    input[i] = 0;
    if (i > 0) {
      if (!strcmp(input, "...")) {
        break;
      } else if (slen == 0 || (slen > 0 && strlen(input) == slen)) {
        sscanf(input, fmt, p);
        break;
      }
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<io_getdata>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %rdi,%r13
  mov    %rsi,(%rsp)
  mov    %edx,%r12d
  mov    %rcx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  lea    D13(%rip),%r14
  lea    D16(%rip),%r15
L32:
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <printf@plt>
  mov    $0x0,%ebx
L25:
  mov    %ebx,%ebp
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %al,0x10(%rsp,%rbx,1)
  add    $0x1,%rbx
  cmp    $0xa,%al
  jne    L25
  movslq %ebp,%rax
  movb   $0x0,0x10(%rsp,%rax,1)
  test   %ebp,%ebp
  jle    L32
  lea    0x10(%rsp),%rdi
  mov    %r15,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L67
  test   %r12d,%r12d
  je     L50
  jle    L32
  lea    0x10(%rsp),%rdi
  call   <strlen@plt>
  cmp    %r12d,%eax
  jne    L32
L50:
  lea    0x10(%rsp),%rdi
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  call   <sscanf@plt>
L67:
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D13
data_type: string
name: read_data
arguments: label: D16
data_type: string

tool: D13: %s

tool: D16: ...

assistant: ```c
void io_getdata(const char *tip, const char *fmt, int slen, void *p) {
  int rc;
  int i;
  char input[1024];
  while (1) {
    printf("%s", tip);
    for (i = 0; (input[i] = getchar()) != '\n'; i++)
      ;
    input[i] = 0;
    if (i > 0) {
      if (!strcmp(input, "...")) {
        break;
      } else if (slen == 0 || (slen > 0 && strlen(input) == slen)) {
        sscanf(input, fmt, p);
        break;
      }
    }
  }
}
```