ylfeng/ReF-Decompile-dataset huggingface dataset:
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
  sub    $0x468,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x458(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  call   <init@plt>
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rsi
  lea    D36(%rip),%rdi
  call   <scanf@plt>
  mov    %r12,%rsi
  lea    D46(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <extract@plt>
  lea    D15(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L10
  lea    0x70(%rsp),%r14
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  lea    D64(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <file@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <diff@plt>
L18:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x458(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x468,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L10:
  lea    D35(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <file@plt>
  lea    D38(%rip),%rdi
  call   <puts@plt>
  jmp    L18
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D43
type_infered: string
name: disassemble_data
arguments: data_label: D36
type_infered: string
name: disassemble_data
arguments: data_label: D46
type_infered: string
name: disassemble_data
arguments: data_label: D15
type_infered: string
name: disassemble_data
arguments: data_label: D64
type_infered: string
name: disassemble_data
arguments: data_label: D35
type_infered: string
name: disassemble_data
arguments: data_label: D38
type_infered: string

tool: D43: Enter the location to perform Filing (Drive or any folder): 

tool: D36: %s

tool: D46: 
Now Scanning %s

tool: D15: r

tool: D64: .TMP

tool: D35: File was not previously catalogued.

tool: D38: File successfully catalogued.

assistant: ```c
void main(int argc, char *argv[]) {
  FILE *cr;
  char loc[100], *generated;
  init();
  printf("Enter the location to perform Filing (Drive or any folder): ");
  scanf("%s", loc);
  printf("\nNow Scanning %s", loc);
  generated = extract(loc);
  cr = fopen(generated, "r");
  if (!cr) {
    printf("File was not previously catalogued.\n");
    file(generated, loc);
    printf("File successfully catalogued.\n");
  } else {
    char tmpname[1000];
    strcpy(tmpname, generated);
    strcat(tmpname, ".TMP");
    file(tmpname, loc);
    diff(tmpname, generated, loc);
  }
  fclose(cr);
  free(generated);
  return;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  sub    $0x468,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x458(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  call   <init@plt>
  lea    D39(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rsi
  lea    D38(%rip),%rdi
  call   <scanf@plt>
  mov    %r12,%rsi
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <extract@plt>
  lea    D44(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L23
  lea    0x70(%rsp),%r14
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  lea    D68(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <file@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <diff@plt>
L10:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x458(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  add    $0x468,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L23:
  lea    D21(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <file@plt>
  lea    D45(%rip),%rdi
  call   <puts@plt>
  jmp    L10
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D39
type_infered: string
name: parse_data
arguments: tag: D38
type_infered: string
name: parse_data
arguments: tag: D1
type_infered: string
name: parse_data
arguments: tag: D44
type_infered: string
name: parse_data
arguments: tag: D68
type_infered: string
name: parse_data
arguments: tag: D21
type_infered: string
name: parse_data
arguments: tag: D45
type_infered: string

tool: D39: Enter the location to perform Filing (Drive or any folder): 

tool: D38: %s

tool: D1: 
Now Scanning %s

tool: D44: r

tool: D68: .TMP

tool: D21: File was not previously catalogued.

tool: D45: File successfully catalogued.

assistant: ```c
void main(int argc, char *argv[]) {
  FILE *cr;
  char loc[100], *generated;
  init();
  printf("Enter the location to perform Filing (Drive or any folder): ");
  scanf("%s", loc);
  printf("\nNow Scanning %s", loc);
  generated = extract(loc);
  cr = fopen(generated, "r");
  if (!cr) {
    printf("File was not previously catalogued.\n");
    file(generated, loc);
    printf("File successfully catalogued.\n");
  } else {
    char tmpname[1000];
    strcpy(tmpname, generated);
    strcat(tmpname, ".TMP");
    file(tmpname, loc);
    diff(tmpname, generated, loc);
  }
  fclose(cr);
  free(generated);
  return;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<parse_arguments>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  cmpl   $0x4,-0x4(%rbp)
  je     L41
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
  jmp    L65
L41:
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    -0x18(%rbp),%rdx
  lea    D10(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L6
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
  jmp    L65
L6:
  mov    -0x10(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    -0x20(%rbp),%rdx
  lea    D10(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L53
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
  jmp    L65
L53:
  mov    -0x10(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%rdx
  lea    D10(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L56
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
  jmp    L65
L56:
  mov    $0x1,%eax
L65:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D60
data_type: string
name: read_data
arguments: data_label: D10
data_type: string
name: read_data
arguments: data_label: D51
data_type: string
name: read_data
arguments: data_label: D21
data_type: string
name: read_data
arguments: data_label: D13
data_type: string

tool: D60: wrong number of arguments

tool: D10: %d

tool: D51: red brightness error

tool: D21: green brightness error

tool: D13: blue brightness error

assistant: ```c
int parse_arguments(int argc, char **argv, int *r, int *g, int *b) {
  if (argc != 4) {
    show_help("wrong number of arguments");
    return 0;
  }
  if (sscanf(argv[1], "%d", r) != 1) {
    show_help("red brightness error");
    return 0;
  }
  if (sscanf(argv[2], "%d", g) != 1) {
    show_help("green brightness error");
    return 0;
  }
  if (sscanf(argv[3], "%d", b) != 1) {
    show_help("blue brightness error");
    return 0;
  }
  return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<parse_arguments>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  cmp    $0x4,%edi
  je     L64
  lea    D34(%rip),%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
L48:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L64:
  mov    %rsi,%rbx
  mov    %rcx,%r12
  mov    %r8,%rbp
  mov    0x8(%rsi),%rdi
  lea    D61(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L3
  lea    D65(%rip),%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
  jmp    L48
L3:
  mov    0x10(%rbx),%rdi
  mov    %r12,%rdx
  lea    D61(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L39
  lea    D36(%rip),%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
  jmp    L48
L39:
  mov    0x18(%rbx),%rdi
  mov    %rbp,%rdx
  lea    D61(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L48
  lea    D35(%rip),%rdi
  call   <show_help@plt>
  mov    $0x0,%eax
  jmp    L48
```

tool_calls: name: parse_data
arguments: tag: D34
type_guessed: string
name: parse_data
arguments: tag: D61
type_guessed: string
name: parse_data
arguments: tag: D65
type_guessed: string
name: parse_data
arguments: tag: D36
type_guessed: string
name: parse_data
arguments: tag: D35
type_guessed: string

tool: D34: wrong number of arguments

tool: D61: %d

tool: D65: red brightness error

tool: D36: green brightness error

tool: D35: blue brightness error

assistant: ```c
int parse_arguments(int argc, char **argv, int *r, int *g, int *b) {
  if (argc != 4) {
    show_help("wrong number of arguments");
    return 0;
  }
  if (sscanf(argv[1], "%d", r) != 1) {
    show_help("red brightness error");
    return 0;
  }
  if (sscanf(argv[2], "%d", g) != 1) {
    show_help("green brightness error");
    return 0;
  }
  if (sscanf(argv[3], "%d", b) != 1) {
    show_help("blue brightness error");
    return 0;
  }
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<parse_arguments>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x4,%edi
  je     L31
  lea    D26(%rip),%rdi
  call   <show_help@plt>
  xor    %eax,%eax
L42:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L31:
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  mov    %rcx,%r12
  mov    %r8,%r13
  lea    D29(%rip),%rbp
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L48
  lea    D48(%rip),%rdi
  call   <show_help@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L48:
  mov    0x10(%rbx),%rdi
  mov    %r12,%rdx
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L37
  lea    D21(%rip),%rdi
  call   <show_help@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L37:
  mov    0x18(%rbx),%rdi
  mov    %r13,%rdx
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L42
  lea    D38(%rip),%rdi
  call   <show_help@plt>
  xor    %eax,%eax
  jmp    L42
```

tool_calls: name: parse_data
arguments: tag: D26
type_guessed: string
name: parse_data
arguments: tag: D29
type_guessed: string
name: parse_data
arguments: tag: D48
type_guessed: string
name: parse_data
arguments: tag: D21
type_guessed: string
name: parse_data
arguments: tag: D38
type_guessed: string

tool: D26: wrong number of arguments

tool: D29: %d

tool: D48: red brightness error

tool: D21: green brightness error

tool: D38: blue brightness error

assistant: ```c
int parse_arguments(int argc, char **argv, int *r, int *g, int *b) {
  if (argc != 4) {
    show_help("wrong number of arguments");
    return 0;
  }
  if (sscanf(argv[1], "%d", r) != 1) {
    show_help("red brightness error");
    return 0;
  }
  if (sscanf(argv[2], "%d", g) != 1) {
    show_help("green brightness error");
    return 0;
  }
  if (sscanf(argv[3], "%d", b) != 1) {
    show_help("blue brightness error");
    return 0;
  }
  return 1;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<parse_arguments>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x4,%edi
  je     L2
  lea    D31(%rip),%rdi
  call   <show_help@plt>
  xor    %eax,%eax
L41:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L2:
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  mov    %rcx,%r12
  mov    %r8,%r13
  lea    D37(%rip),%rbp
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L20
  lea    D35(%rip),%rdi
  call   <show_help@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L20:
  mov    0x10(%rbx),%rdi
  mov    %r12,%rdx
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L3
  lea    D4(%rip),%rdi
  call   <show_help@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L3:
  mov    0x18(%rbx),%rdi
  mov    %r13,%rdx
  mov    %rbp,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L41
  lea    D6(%rip),%rdi
  call   <show_help@plt>
  xor    %eax,%eax
  jmp    L41
```

tool_calls: name: read_data
arguments: data_label: D31
datatype: string
name: read_data
arguments: data_label: D37
datatype: string
name: read_data
arguments: data_label: D35
datatype: string
name: read_data
arguments: data_label: D4
datatype: string
name: read_data
arguments: data_label: D6
datatype: string

tool: D31: wrong number of arguments

tool: D37: %d

tool: D35: red brightness error

tool: D4: green brightness error

tool: D6: blue brightness error

assistant: ```c
int parse_arguments(int argc, char **argv, int *r, int *g, int *b) {
  if (argc != 4) {
    show_help("wrong number of arguments");
    return 0;
  }
  if (sscanf(argv[1], "%d", r) != 1) {
    show_help("red brightness error");
    return 0;
  }
  if (sscanf(argv[2], "%d", g) != 1) {
    show_help("green brightness error");
    return 0;
  }
  if (sscanf(argv[3], "%d", b) != 1) {
    show_help("blue brightness error");
    return 0;
  }
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<devicesChangedCallback>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D4
datatype: string

tool: D4: Portaudio device list have changed!


assistant: ```c
void devicesChangedCallback(void *p) {
  (void)p;
  printf("Portaudio device list have changed!\n");
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<devicesChangedCallback>:
  endbr64
  sub    $0x8,%rsp
  lea    D1(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D1
type_guessed: string

tool: D1: Portaudio device list have changed!


assistant: ```c
void devicesChangedCallback(void *p) {
  (void)p;
  printf("Portaudio device list have changed!\n");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<devicesChangedCallback>:
  endbr64
  lea    D3(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D3
type_infered: string

tool: D3: Portaudio device list have changed!


assistant: ```c
void devicesChangedCallback(void *p) {
  (void)p;
  printf("Portaudio device list have changed!\n");
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<devicesChangedCallback>:
  endbr64
  lea    D6(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D6
type: string

tool: D6: Portaudio device list have changed!


assistant: ```c
void devicesChangedCallback(void *p) {
  (void)p;
  printf("Portaudio device list have changed!\n");
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<SetClearPasswd>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x538,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r14
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x528(%rsp)
  xor    %eax,%eax
  lea    0x120(%rsp),%rbx
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  lea    0x30(%rsp),%r13
  mov    $0x21,%edx
  mov    $0x0,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  lea    0xa0(%rsp),%rbp
  mov    $0x80,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  lea    0x60(%rsp),%rdi
  mov    $0x40,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  lea    0x1f(%rsp),%r15
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  mov    $0x3ff,%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strncpy@plt>
  mov    %r13,%rdi
  call   <getKey@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    $0x3ff,%edx
  sub    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncat@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <hashckey@plt>
  mov    %rax,%rcx
  lea    0x27(%rsp),%rbx
  lea    D0(%rip),%rdx
  mov    $0x9,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0xe(%rax),%r12d
  add    $0x7,%eax
  cmovns %eax,%r12d
  and    $0xfffffff8,%r12d
  mov    %r15,%r8
  mov    %r12d,%ecx
  mov    %rbx,%rdx
  mov    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  call   <DES_CBC_Encryption@plt>
  mov    0x528(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  mov    %r12d,%eax
  add    $0x538,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D0
type_infered: string

tool: D0: %.8x

assistant: ```c
int SetClearPasswd(char *sClearPwd, char *sKey, char *sEncPwd) {
  int rc;
  char sUserKey[1024];
  char sInnerKey[33];
  unsigned long i;
  char sTmp[8 + 1];
  char sEncPswd[128];
  int nEncPswdLen;
  char sEnc[64];
  char sIv[8];
  memset(sUserKey, 0x00, sizeof(sUserKey));
  memset(sInnerKey, 0x00, sizeof(sInnerKey));
  memset(sEncPswd, 0x00, sizeof(sEncPswd));
  memset(sEnc, 0x00, sizeof(sEnc));
  memset(sIv, 0x00, sizeof(sIv));
  strncpy(sUserKey, sKey, sizeof(sUserKey) - 1);
  getKey(sInnerKey);
  strncat(sUserKey, sInnerKey, sizeof(sUserKey) - strlen(sUserKey) - 1);
  i = hashckey(sUserKey, strlen(sUserKey));
  snprintf(sTmp, sizeof(sTmp), "%.8x", i);
  strcpy(sEncPswd, sClearPwd);
  nEncPswdLen = strlen(sEncPswd);
  DES_CBC_Encryption(sEncPswd, sEncPwd, sTmp, (nEncPswdLen + 7) / 8 * 8, sIv);
  return (nEncPswdLen + 7) / 8 * 8;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<SetClearPasswd>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  mov    $0x400,%edx
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x538,%rsp
  mov    %rsi,0x8(%rsp)
  lea    0x30(%rsp),%r15
  lea    0x120(%rsp),%rbp
  xor    %esi,%esi
  mov    %rbp,%rdi
  lea    0xa0(%rsp),%r13
  lea    0x1f(%rsp),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x528(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  xor    %esi,%esi
  mov    %r15,%rdi
  mov    $0x21,%edx
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x80,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  lea    0x60(%rsp),%rdi
  mov    $0x40,%edx
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x8,%edx
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%rsi
  mov    $0x3ff,%edx
  mov    %rbp,%rdi
  call   <strncpy@plt>
  mov    %r15,%rdi
  call   <getKey@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    $0x3ff,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  sub    %eax,%edx
  lea    0x27(%rsp),%r15
  call   <strncat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <hashckey@plt>
  lea    D9(%rip),%rdx
  mov    $0x9,%esi
  mov    %r15,%rdi
  mov    %rax,%rcx
  call   <snprintf@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %rbx,%r8
  mov    %r15,%rdx
  mov    %r14,%rsi
  lea    0xe(%rax),%r12d
  add    $0x7,%eax
  mov    %r13,%rdi
  cmovns %eax,%r12d
  and    $0xfffffff8,%r12d
  mov    %r12d,%ecx
  call   <DES_CBC_Encryption@plt>
  mov    0x528(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x538,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D9
type: string

tool: D9: %.8x

assistant: ```c
int SetClearPasswd(char *sClearPwd, char *sKey, char *sEncPwd) {
  int rc;
  char sUserKey[1024];
  char sInnerKey[33];
  unsigned long i;
  char sTmp[8 + 1];
  char sEncPswd[128];
  int nEncPswdLen;
  char sEnc[64];
  char sIv[8];
  memset(sUserKey, 0x00, sizeof(sUserKey));
  memset(sInnerKey, 0x00, sizeof(sInnerKey));
  memset(sEncPswd, 0x00, sizeof(sEncPswd));
  memset(sEnc, 0x00, sizeof(sEnc));
  memset(sIv, 0x00, sizeof(sIv));
  strncpy(sUserKey, sKey, sizeof(sUserKey) - 1);
  getKey(sInnerKey);
  strncat(sUserKey, sInnerKey, sizeof(sUserKey) - strlen(sUserKey) - 1);
  i = hashckey(sUserKey, strlen(sUserKey));
  snprintf(sTmp, sizeof(sTmp), "%.8x", i);
  strcpy(sEncPswd, sClearPwd);
  nEncPswdLen = strlen(sEncPswd);
  DES_CBC_Encryption(sEncPswd, sEncPwd, sTmp, (nEncPswdLen + 7) / 8 * 8, sIv);
  return (nEncPswdLen + 7) / 8 * 8;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<SetClearPasswd>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  mov    $0x400,%edx
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x538,%rsp
  mov    %rsi,0x8(%rsp)
  lea    0x30(%rsp),%r15
  lea    0x120(%rsp),%rbp
  xor    %esi,%esi
  mov    %rbp,%rdi
  lea    0xa0(%rsp),%r13
  lea    0x1f(%rsp),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x528(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  xor    %esi,%esi
  mov    %r15,%rdi
  mov    $0x21,%edx
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x80,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  lea    0x60(%rsp),%rdi
  mov    $0x40,%edx
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x8,%edx
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%rsi
  mov    $0x3ff,%edx
  mov    %rbp,%rdi
  call   <strncpy@plt>
  mov    %r15,%rdi
  call   <getKey@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    $0x3ff,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  sub    %eax,%edx
  lea    0x27(%rsp),%r15
  call   <strncat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <hashckey@plt>
  lea    D5(%rip),%rdx
  mov    $0x9,%esi
  mov    %r15,%rdi
  mov    %rax,%rcx
  call   <snprintf@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %rbx,%r8
  mov    %r15,%rdx
  mov    %r14,%rsi
  lea    0xe(%rax),%r12d
  add    $0x7,%eax
  mov    %r13,%rdi
  cmovns %eax,%r12d
  and    $0xfffffff8,%r12d
  mov    %r12d,%ecx
  call   <DES_CBC_Encryption@plt>
  mov    0x528(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x538,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D5
type: string

tool: D5: %.8x

assistant: ```c
int SetClearPasswd(char *sClearPwd, char *sKey, char *sEncPwd) {
  int rc;
  char sUserKey[1024];
  char sInnerKey[33];
  unsigned long i;
  char sTmp[8 + 1];
  char sEncPswd[128];
  int nEncPswdLen;
  char sEnc[64];
  char sIv[8];
  memset(sUserKey, 0x00, sizeof(sUserKey));
  memset(sInnerKey, 0x00, sizeof(sInnerKey));
  memset(sEncPswd, 0x00, sizeof(sEncPswd));
  memset(sEnc, 0x00, sizeof(sEnc));
  memset(sIv, 0x00, sizeof(sIv));
  strncpy(sUserKey, sKey, sizeof(sUserKey) - 1);
  getKey(sInnerKey);
  strncat(sUserKey, sInnerKey, sizeof(sUserKey) - strlen(sUserKey) - 1);
  i = hashckey(sUserKey, strlen(sUserKey));
  snprintf(sTmp, sizeof(sTmp), "%.8x", i);
  strcpy(sEncPswd, sClearPwd);
  nEncPswdLen = strlen(sEncPswd);
  DES_CBC_Encryption(sEncPswd, sEncPwd, sTmp, (nEncPswdLen + 7) / 8 * 8, sIv);
  return (nEncPswdLen + 7) / 8 * 8;
}
```