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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x220,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x210(%rbp),%rax
  mov    %rax,%rsi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    -0x210(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x214(%rbp)
  mov    -0x214(%rbp),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x110(%rbp),%rcx
  mov    -0x214(%rbp),%eax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <itoa@plt>
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D4
datatype: string
name: read_data
arguments: data_label: D19
datatype: string

tool: D4: %s

tool: D19: %d


assistant: ```c
int main(void) {
  char mystring[255];
  int test;
  char result[255];
  scanf("%s", mystring);
  test = atoi(mystring);
  printf("%d\n", test);
  itoa(test, result, 10);
  printf("%s\n", result);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x218,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  lea    D13(%rip),%rdi
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  mov    %eax,%esi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x100(%rsp),%rbp
  mov    $0xa,%edx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <itoa@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  mov    $0x0,%eax
  add    $0x218,%rsp
  pop    %rbx
  pop    %rbp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D13
type: string
name: retrieve_data
arguments: label: D19
type: string

tool: D13: %s

tool: D19: %d


assistant: ```c
int main(void) {
  char mystring[255];
  int test;
  char result[255];
  scanf("%s", mystring);
  test = atoi(mystring);
  printf("%d\n", test);
  itoa(test, result, 10);
  printf("%s\n", result);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r12
  lea    D13(%rip),%rdi
  push   %rbp
  sub    $0x218,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x100(%rsp),%r12
  mov    %rbp,%rsi
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <atoi@plt>
  lea    D7(%rip),%rdi
  mov    %eax,%esi
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%edi
  mov    $0xa,%edx
  mov    %r12,%rsi
  call   <itoa@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x218,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D13
type_guessed: string
name: parse_data
arguments: data_tag: D7
type_guessed: string

tool: D13: %s

tool: D7: %d


assistant: ```c
int main(void) {
  char mystring[255];
  int test;
  char result[255];
  scanf("%s", mystring);
  test = atoi(mystring);
  printf("%d\n", test);
  itoa(test, result, 10);
  printf("%s\n", result);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r12
  lea    D5(%rip),%rdi
  push   %rbp
  sub    $0x218,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x100(%rsp),%r12
  mov    %rbp,%rsi
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <atoi@plt>
  lea    D17(%rip),%rdi
  mov    %eax,%esi
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%edi
  mov    $0xa,%edx
  mov    %r12,%rsi
  call   <itoa@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x218,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D5
data_type: string
name: parse_data
arguments: data_label: D17
data_type: string

tool: D5: %s

tool: D17: %d


assistant: ```c
int main(void) {
  char mystring[255];
  int test;
  char result[255];
  scanf("%s", mystring);
  test = atoi(mystring);
  printf("%d\n", test);
  itoa(test, result, 10);
  printf("%s\n", result);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x8(%rbp)
L71:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1b,-0x4(%rbp)
  jne    L21
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x5b,-0x4(%rbp)
  jne    L58
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x4(%rbp)
L58:
  cmpl   $0x41,-0x4(%rbp)
  jne    L94
  lea    D80(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  subl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L71
L94:
  cmpl   $0x42,-0x4(%rbp)
  jne    L93
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  addl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L71
L93:
  cmpl   $0x43,-0x4(%rbp)
  jne    L6
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L71
L6:
  cmpl   $0x44,-0x4(%rbp)
  jne    L71
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L71
L21:
  cmpl   $0xa,-0x4(%rbp)
  jne    L71
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  nop
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D52
type: string
name: parse_data
arguments: data_tag: D55
type: string
name: parse_data
arguments: data_tag: D80
type: string
name: parse_data
arguments: data_tag: D19
type: string
name: parse_data
arguments: data_tag: D72
type: string
name: parse_data
arguments: data_tag: D16
type: string
name: parse_data
arguments: data_tag: D83
type: string
name: parse_data
arguments: data_tag: D15
type: string

tool: D52: Public Domain Menu Program 

tool: D55: 
Use the up and down arrow keys then press Enter

tool: D80: You pressed up arrow! 


tool: D19: Menunum is now %d 


tool: D72: You pressed down arrow! 


tool: D16: You pressed right arrow! 


tool: D83: You pressed left arrow! 


tool: D15: You pressed ENTER! You chose item %d 


assistant: ```c
int main(void) {
  printf("Public Domain Menu Program \n");
  printf("\nUse the up and down arrow keys then press Enter\n");
  int menunum = 0;
  while (1) {
    int key = getch();
    if (key == 27) {
      key = getch();
      if (key == 91)
        key = getch();
      if (key == 65) {
        puts("You pressed up arrow! \n");
        menunum -= 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 66) {
        puts("You pressed down arrow! \n");
        menunum += 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 67) {
        puts("You pressed right arrow! \n");
      } else if (key == 68) {
        puts("You pressed left arrow! \n");
      }
    } else if (key == 10) {
      printf("You pressed ENTER! You chose item %d \n", menunum);
      break;
    }
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D67(%rip),%rdi
  call   <puts@plt>
  lea    D58(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebx
  lea    D27(%rip),%r14
  lea    D35(%rip),%r13
  lea    D79(%rip),%r12
  lea    D57(%rip),%rbp
L26:
  mov    $0x0,%eax
  call   <getch@plt>
  cmp    $0x1b,%eax
  je     L74
  cmp    $0xa,%eax
  jne    L26
  mov    %ebx,%esi
  lea    D5(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L74:
  mov    $0x0,%eax
  call   <getch@plt>
  cmp    $0x5b,%eax
  je     L102
L79:
  cmp    $0x41,%eax
  je     L20
  cmp    $0x42,%eax
  je     L115
  cmp    $0x43,%eax
  je     L51
  cmp    $0x44,%eax
  jne    L26
  mov    %r14,%rdi
  call   <puts@plt>
  jmp    L26
L102:
  mov    $0x0,%eax
  call   <getch@plt>
  jmp    L79
L20:
  lea    D78(%rip),%rdi
  call   <puts@plt>
  sub    $0x1,%ebx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L26
L115:
  mov    %r12,%rdi
  call   <puts@plt>
  add    $0x1,%ebx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L26
L51:
  mov    %r13,%rdi
  call   <puts@plt>
  jmp    L26
```

tool_calls: name: read_data
arguments: label: D67
type_guessed: string
name: read_data
arguments: label: D58
type_guessed: string
name: read_data
arguments: label: D27
type_guessed: string
name: read_data
arguments: label: D35
type_guessed: string
name: read_data
arguments: label: D79
type_guessed: string
name: read_data
arguments: label: D57
type_guessed: string
name: read_data
arguments: label: D5
type_guessed: string
name: read_data
arguments: label: D78
type_guessed: string

tool: D67: Public Domain Menu Program 

tool: D58: 
Use the up and down arrow keys then press Enter

tool: D27: You pressed left arrow! 


tool: D35: You pressed right arrow! 


tool: D79: You pressed down arrow! 


tool: D57: Menunum is now %d 


tool: D5: You pressed ENTER! You chose item %d 


tool: D78: You pressed up arrow! 


assistant: ```c
int main(void) {
  printf("Public Domain Menu Program \n");
  printf("\nUse the up and down arrow keys then press Enter\n");
  int menunum = 0;
  while (1) {
    int key = getch();
    if (key == 27) {
      key = getch();
      if (key == 91)
        key = getch();
      if (key == 65) {
        puts("You pressed up arrow! \n");
        menunum -= 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 66) {
        puts("You pressed down arrow! \n");
        menunum += 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 67) {
        puts("You pressed right arrow! \n");
      } else if (key == 68) {
        puts("You pressed left arrow! \n");
      }
    } else if (key == 10) {
      printf("You pressed ENTER! You chose item %d \n", menunum);
      break;
    }
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r14
  lea    D5(%rip),%rdi
  lea    D7(%rip),%r14
  push   %r13
  lea    D68(%rip),%r13
  push   %r12
  lea    D24(%rip),%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  lea    D38(%rip),%rbx
  call   <puts@plt>
  lea    D49(%rip),%rdi
  call   <puts@plt>
  nopw   0x0(%rax,%rax,1)
L9:
  xor    %eax,%eax
  call   <getch@plt>
  cmp    $0x1b,%eax
  je     L21
  cmp    $0xa,%eax
  jne    L9
  mov    %ebp,%esi
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L21:
  xor    %eax,%eax
  call   <getch@plt>
  cmp    $0x5b,%eax
  je     L51
L77:
  cmp    $0x41,%eax
  je     L34
  cmp    $0x42,%eax
  je     L57
  cmp    $0x43,%eax
  je     L81
  cmp    $0x44,%eax
  jne    L9
  mov    %r14,%rdi
  call   <puts@plt>
  jmp    L9
L34:
  lea    D9(%rip),%rdi
  sub    $0x1,%ebp
  call   <puts@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L9
L51:
  xor    %eax,%eax
  call   <getch@plt>
  jmp    L77
L57:
  mov    %r12,%rdi
  add    $0x1,%ebp
  call   <puts@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L9
L81:
  mov    %r13,%rdi
  call   <puts@plt>
  jmp    L9
```

tool_calls: name: retrieve_data
arguments: label: D5
type: string
name: retrieve_data
arguments: label: D7
type: string
name: retrieve_data
arguments: label: D68
type: string
name: retrieve_data
arguments: label: D24
type: string
name: retrieve_data
arguments: label: D38
type: string
name: retrieve_data
arguments: label: D49
type: string
name: retrieve_data
arguments: label: D43
type: string
name: retrieve_data
arguments: label: D9
type: string

tool: D5: Public Domain Menu Program 

tool: D7: You pressed left arrow! 


tool: D68: You pressed right arrow! 


tool: D24: You pressed down arrow! 


tool: D38: Menunum is now %d 


tool: D49: 
Use the up and down arrow keys then press Enter

tool: D43: You pressed ENTER! You chose item %d 


tool: D9: You pressed up arrow! 


assistant: ```c
int main(void) {
  printf("Public Domain Menu Program \n");
  printf("\nUse the up and down arrow keys then press Enter\n");
  int menunum = 0;
  while (1) {
    int key = getch();
    if (key == 27) {
      key = getch();
      if (key == 91)
        key = getch();
      if (key == 65) {
        puts("You pressed up arrow! \n");
        menunum -= 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 66) {
        puts("You pressed down arrow! \n");
        menunum += 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 67) {
        puts("You pressed right arrow! \n");
      } else if (key == 68) {
        puts("You pressed left arrow! \n");
      }
    } else if (key == 10) {
      printf("You pressed ENTER! You chose item %d \n", menunum);
      break;
    }
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %r14
  lea    D74(%rip),%rdi
  lea    D4(%rip),%r14
  push   %r13
  lea    D52(%rip),%r13
  push   %r12
  lea    D10(%rip),%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  lea    D24(%rip),%rbx
  call   <puts@plt>
  lea    D73(%rip),%rdi
  call   <puts@plt>
  nopw   0x0(%rax,%rax,1)
L73:
  xor    %eax,%eax
  call   <getch@plt>
  cmp    $0x1b,%eax
  je     L15
  cmp    $0xa,%eax
  jne    L73
  mov    %ebp,%esi
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L15:
  xor    %eax,%eax
  call   <getch@plt>
  cmp    $0x5b,%eax
  je     L8
L87:
  cmp    $0x41,%eax
  je     L98
  cmp    $0x42,%eax
  je     L70
  cmp    $0x43,%eax
  je     L111
  cmp    $0x44,%eax
  jne    L73
  mov    %r14,%rdi
  call   <puts@plt>
  jmp    L73
L98:
  lea    D8(%rip),%rdi
  sub    $0x1,%ebp
  call   <puts@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L73
L8:
  xor    %eax,%eax
  call   <getch@plt>
  jmp    L87
L70:
  mov    %r12,%rdi
  add    $0x1,%ebp
  call   <puts@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L73
L111:
  mov    %r13,%rdi
  call   <puts@plt>
  jmp    L73
```

tool_calls: name: retrieve_data
arguments: tag: D74
data_type: string
name: retrieve_data
arguments: tag: D4
data_type: string
name: retrieve_data
arguments: tag: D52
data_type: string
name: retrieve_data
arguments: tag: D10
data_type: string
name: retrieve_data
arguments: tag: D24
data_type: string
name: retrieve_data
arguments: tag: D73
data_type: string
name: retrieve_data
arguments: tag: D47
data_type: string
name: retrieve_data
arguments: tag: D8
data_type: string

tool: D74: Public Domain Menu Program 

tool: D4: You pressed left arrow! 


tool: D52: You pressed right arrow! 


tool: D10: You pressed down arrow! 


tool: D24: Menunum is now %d 


tool: D73: 
Use the up and down arrow keys then press Enter

tool: D47: You pressed ENTER! You chose item %d 


tool: D8: You pressed up arrow! 


assistant: ```c
int main(void) {
  printf("Public Domain Menu Program \n");
  printf("\nUse the up and down arrow keys then press Enter\n");
  int menunum = 0;
  while (1) {
    int key = getch();
    if (key == 27) {
      key = getch();
      if (key == 91)
        key = getch();
      if (key == 65) {
        puts("You pressed up arrow! \n");
        menunum -= 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 66) {
        puts("You pressed down arrow! \n");
        menunum += 1;
        printf("Menunum is now %d \n", menunum);
      } else if (key == 67) {
        puts("You pressed right arrow! \n");
      } else if (key == 68) {
        puts("You pressed left arrow! \n");
      }
    } else if (key == 10) {
      printf("You pressed ENTER! You chose item %d \n", menunum);
      break;
    }
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<shr_reg64_cl>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    $0x48,%edi
  call   <put8@plt>
  mov    $0xd3,%edi
  call   <put8@plt>
  mov    -0x4(%rbp),%eax
  add    $0xe8,%eax
  mov    %eax,%edi
  call   <put8@plt>
  nop
  leave
  ret
```

assistant: ```c
void shr_reg64_cl(unsigned int reg64) {
  put8(0x48);
  put8(0xD3);
  put8(0xE8 + reg64);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<shr_reg64_cl>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    $0x48,%edi
  call   <put8@plt>
  mov    $0xd3,%edi
  call   <put8@plt>
  lea    0xe8(%rbx),%edi
  call   <put8@plt>
  pop    %rbx
  ret
```

assistant: ```c
void shr_reg64_cl(unsigned int reg64) {
  put8(0x48);
  put8(0xD3);
  put8(0xE8 + reg64);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<shr_reg64_cl>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    $0x48,%edi
  call   <put8@plt>
  mov    $0xd3,%edi
  call   <put8@plt>
  lea    0xe8(%rbx),%edi
  pop    %rbx
  jmp    1050 <put8@plt>
```

assistant: ```c
void shr_reg64_cl(unsigned int reg64) {
  put8(0x48);
  put8(0xD3);
  put8(0xE8 + reg64);
}
```
user: What is the c source code of the assembly code below?

```asm
<shr_reg64_cl>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    $0x48,%edi
  call   <put8@plt>
  mov    $0xd3,%edi
  call   <put8@plt>
  lea    0xe8(%rbx),%edi
  pop    %rbx
  jmp    1050 <put8@plt>
```

assistant: ```c
void shr_reg64_cl(unsigned int reg64) {
  put8(0x48);
  put8(0xD3);
  put8(0xE8 + reg64);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<hddtemp_fetch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x40,%rsp
  mov    %rdi,-0x1028(%rbp)
  mov    %esi,-0x102c(%rbp)
  mov    %rdx,-0x1038(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x1010(%rbp),%rdx
  mov    -0x102c(%rbp),%esi
  mov    -0x1028(%rbp),%rax
  mov    $0x1000,%ecx
  mov    %rax,%rdi
  call   <hddtemp_connect@plt>
  test   %eax,%eax
  jne    L62
  lea    D1(%rip),%rax
  jmp    L22
L62:
  movl   $0x1,-0x101c(%rbp)
L30:
  mov    -0x101c(%rbp),%edx
  lea    -0x1010(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <split@plt>
  mov    %rax,-0x1018(%rbp)
  cmpq   $0x0,-0x1018(%rbp)
  je     L40
  mov    -0x1018(%rbp),%rdx
  mov    -0x1038(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L21
  mov    -0x101c(%rbp),%eax
  lea    0x2(%rax),%edx
  lea    -0x1010(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <split@plt>
  jmp    L22
L21:
  addl   $0x5,-0x101c(%rbp)
  jmp    L30
L40:
  nop
  lea    D16(%rip),%rax
L22:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D1
datatype: string
name: disassemble_data
arguments: data_tag: D16
datatype: string

tool: D1: err

tool: D16: n/a

assistant: ```c
char *hddtemp_fetch(const char *host, int port, const char *device) {
  char buffer[4096];
  char *key;
  int i;
  if (!hddtemp_connect(host, port, buffer, sizeof(buffer))) {
    return "err";
  }
  i = 1;
  while (1) {
    key = split(buffer, i);
    if (key == NULL)
      break;
    if (strcmp(device, key) == 0) {
      return split(buffer, i + 2);
    }
    i += 5;
  }
  return "n/a";
}
```
user: What is the c source code of the assembly code below?

```asm
<hddtemp_fetch>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x10,%rsp
  mov    %rdx,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x1008(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdx
  mov    $0x1000,%ecx
  call   <hddtemp_connect@plt>
  mov    %eax,%edx
  lea    D16(%rip),%rax
  test   %edx,%edx
  je     L29
  mov    $0x1,%ebx
  mov    %rsp,%r12
L42:
  mov    %ebx,%esi
  mov    %r12,%rdi
  call   <split@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L27
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L33
  add    $0x5,%ebx
  jmp    L42
L33:
  lea    0x2(%rbx),%esi
  mov    %rsp,%rdi
  call   <split@plt>
  jmp    L29
L27:
  lea    D9(%rip),%rax
L29:
  mov    0x1008(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L50
  add    $0x1010,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L50:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D16
datatype: string
name: retrieve_data
arguments: label: D9
datatype: string

tool: D16: err

tool: D9: n/a

assistant: ```c
char *hddtemp_fetch(const char *host, int port, const char *device) {
  char buffer[4096];
  char *key;
  int i;
  if (!hddtemp_connect(host, port, buffer, sizeof(buffer))) {
    return "err";
  }
  i = 1;
  while (1) {
    key = split(buffer, i);
    if (key == NULL)
      break;
    if (strcmp(device, key) == 0) {
      return split(buffer, i + 2);
    }
    i += 5;
  }
  return "n/a";
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<hddtemp_fetch>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x10,%rsp
  mov    $0x1000,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x1008(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rdx,%r12
  mov    %rbp,%rdx
  call   <hddtemp_connect@plt>
  mov    %eax,%r8d
  lea    D18(%rip),%rax
  test   %r8d,%r8d
  je     L37
  mov    $0x1,%ebx
  jmp    L55
  nopl   0x0(%rax)
L3:
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L57
  add    $0x5,%ebx
L55:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <split@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  jne    L3
  lea    D17(%rip),%rax
L37:
  mov    0x1008(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L59
  add    $0x1010,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L57:
  lea    0x2(%rbx),%esi
  mov    %rbp,%rdi
  call   <split@plt>
  jmp    L37
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D18
type_guessed: string
name: retrieve_data
arguments: data_tag: D17
type_guessed: string

tool: D18: err

tool: D17: n/a

assistant: ```c
char *hddtemp_fetch(const char *host, int port, const char *device) {
  char buffer[4096];
  char *key;
  int i;
  if (!hddtemp_connect(host, port, buffer, sizeof(buffer))) {
    return "err";
  }
  i = 1;
  while (1) {
    key = split(buffer, i);
    if (key == NULL)
      break;
    if (strcmp(device, key) == 0) {
      return split(buffer, i + 2);
    }
    i += 5;
  }
  return "n/a";
}
```