ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<histfile_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <lgetenv@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L39
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L39
  mov    -0x20(%rbp),%rax
  lea    D64(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L65
  mov    -0x20(%rbp),%rax
  lea    D17(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L42
L65:
  mov    $0x0,%eax
  jmp    L78
L42:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <save@plt>
  jmp    L78
L39:
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  call   <lgetenv@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L85
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L57
L85:
  mov    $0x0,%eax
  jmp    L78
L57:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  add    $0x2,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <ecalloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x24(%rbp),%esi
  mov    -0x20(%rbp),%rax
  lea    D24(%rip),%r8
  mov    %rdx,%rcx
  lea    D60(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    -0x20(%rbp),%rax
L78:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D19
data_type: string
name: read_data
arguments: tag: D64
data_type: string
name: read_data
arguments: tag: D17
data_type: string
name: read_data
arguments: tag: D59
data_type: string
name: read_data
arguments: tag: D24
data_type: string
name: read_data
arguments: tag: D60
data_type: string

tool: D19: LESSHISTFILE

tool: D64: -

tool: D17: /dev/null

tool: D59: HOME

tool: D24: .lesshst

tool: D60: %s/%s

assistant: ```c
char *histfile_name() {
  char *home;
  char *name;
  int len;
  name = lgetenv("LESSHISTFILE");
  if (name != 0 && *name != '\0') {
    if (strcmp(name, "-") == 0 || strcmp(name, "/dev/null") == 0)
      return (0);
    return (save(name));
  }
  home = lgetenv("HOME");
  if (home == 0 || *home == '\0') {
    return (0);
  }
  len = strlen(home) + strlen(".lesshst") + 2;
  name = (char *)ecalloc(len, sizeof(char));
  snprintf((name), (len), ("%s/%s"), (home), (".lesshst"));
  return (name);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<histfile_name>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  lea    D51(%rip),%rdi
  call   <lgetenv@plt>
  test   %rax,%rax
  je     L30
  mov    %rax,%rbx
  cmpb   $0x0,(%rax)
  jne    L7
L30:
  lea    D36(%rip),%rdi
  call   <lgetenv@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L53
  mov    $0x0,%ebp
  cmpb   $0x0,(%rax)
  je     L45
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebp
  lea    D55(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x2(%rbp,%rax,1),%r12d
  mov    $0x1,%esi
  mov    %r12d,%edi
  call   <ecalloc@plt>
  mov    %rax,%rbp
  mov    %r13,%r8
  mov    %rbx,%rcx
  lea    D53(%rip),%rdx
  mov    %r12d,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
L45:
  mov    %rbp,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L7:
  lea    D32(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  mov    $0x0,%ebp
  test   %rax,%rax
  je     L45
  lea    D6(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L45
  mov    %rbx,%rdi
  call   <save@plt>
  mov    %rax,%rbp
  jmp    L45
L53:
  mov    %rax,%rbp
  jmp    L45
```

tool_calls: name: extract_symbolic_data
arguments: label: D51
type_guessed: string
name: extract_symbolic_data
arguments: label: D36
type_guessed: string
name: extract_symbolic_data
arguments: label: D55
type_guessed: string
name: extract_symbolic_data
arguments: label: D53
type_guessed: string
name: extract_symbolic_data
arguments: label: D32
type_guessed: string
name: extract_symbolic_data
arguments: label: D6
type_guessed: string

tool: D51: LESSHISTFILE

tool: D36: HOME

tool: D55: .lesshst

tool: D53: %s/%s

tool: D32: -

tool: D6: /dev/null

assistant: ```c
char *histfile_name() {
  char *home;
  char *name;
  int len;
  name = lgetenv("LESSHISTFILE");
  if (name != 0 && *name != '\0') {
    if (strcmp(name, "-") == 0 || strcmp(name, "/dev/null") == 0)
      return (0);
    return (save(name));
  }
  home = lgetenv("HOME");
  if (home == 0 || *home == '\0') {
    return (0);
  }
  len = strlen(home) + strlen(".lesshst") + 2;
  name = (char *)ecalloc(len, sizeof(char));
  snprintf((name), (len), ("%s/%s"), (home), (".lesshst"));
  return (name);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<histfile_name>:
  endbr64
  push   %r13
  lea    D29(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <lgetenv@plt>
  test   %rax,%rax
  je     L57
  cmpb   $0x0,(%rax)
  mov    %rax,%rbp
  jne    L55
L57:
  lea    D22(%rip),%rdi
  call   <lgetenv@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L15
  cmpb   $0x0,(%rax)
  je     L15
  lea    D3(%rip),%rbx
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,%ebp
  call   <strlen@plt>
  mov    $0x1,%esi
  lea    0x2(%rbp,%rax,1),%ebp
  mov    %ebp,%edi
  call   <ecalloc@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %ebp,%esi
  lea    D35(%rip),%rdx
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L55:
  lea    D13(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L37
L15:
  add    $0x8,%rsp
  xor    %r13d,%r13d
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L37:
  lea    D10(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L15
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10d0 <save@plt>
```

tool_calls: name: parse_data
arguments: data_label: D29
type: string
name: parse_data
arguments: data_label: D22
type: string
name: parse_data
arguments: data_label: D3
type: string
name: parse_data
arguments: data_label: D35
type: string
name: parse_data
arguments: data_label: D13
type: string
name: parse_data
arguments: data_label: D10
type: string

tool: D29: LESSHISTFILE

tool: D22: HOME

tool: D3: .lesshst

tool: D35: %s/%s

tool: D13: -

tool: D10: /dev/null

assistant: ```c
char *histfile_name() {
  char *home;
  char *name;
  int len;
  name = lgetenv("LESSHISTFILE");
  if (name != 0 && *name != '\0') {
    if (strcmp(name, "-") == 0 || strcmp(name, "/dev/null") == 0)
      return (0);
    return (save(name));
  }
  home = lgetenv("HOME");
  if (home == 0 || *home == '\0') {
    return (0);
  }
  len = strlen(home) + strlen(".lesshst") + 2;
  name = (char *)ecalloc(len, sizeof(char));
  snprintf((name), (len), ("%s/%s"), (home), (".lesshst"));
  return (name);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<histfile_name>:
  endbr64
  push   %r13
  lea    D5(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <lgetenv@plt>
  test   %rax,%rax
  je     L39
  cmpb   $0x0,(%rax)
  mov    %rax,%rbp
  jne    L11
L39:
  lea    D31(%rip),%rdi
  call   <lgetenv@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L47
  cmpb   $0x0,(%rax)
  je     L47
  lea    D17(%rip),%rbx
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,%ebp
  call   <strlen@plt>
  mov    $0x1,%esi
  lea    0x2(%rbp,%rax,1),%ebp
  mov    %ebp,%edi
  call   <ecalloc@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %ebp,%esi
  lea    D29(%rip),%rdx
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L11:
  lea    D13(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L17
L47:
  add    $0x8,%rsp
  xor    %r13d,%r13d
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L17:
  lea    D6(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L47
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10d0 <save@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D5
type_guessed: string
name: unpack_data
arguments: data_label: D31
type_guessed: string
name: unpack_data
arguments: data_label: D17
type_guessed: string
name: unpack_data
arguments: data_label: D29
type_guessed: string
name: unpack_data
arguments: data_label: D13
type_guessed: string
name: unpack_data
arguments: data_label: D6
type_guessed: string

tool: D5: LESSHISTFILE

tool: D31: HOME

tool: D17: .lesshst

tool: D29: %s/%s

tool: D13: -

tool: D6: /dev/null

assistant: ```c
char *histfile_name() {
  char *home;
  char *name;
  int len;
  name = lgetenv("LESSHISTFILE");
  if (name != 0 && *name != '\0') {
    if (strcmp(name, "-") == 0 || strcmp(name, "/dev/null") == 0)
      return (0);
    return (save(name));
  }
  home = lgetenv("HOME");
  if (home == 0 || *home == '\0') {
    return (0);
  }
  len = strlen(home) + strlen(".lesshst") + 2;
  name = (char *)ecalloc(len, sizeof(char));
  snprintf((name), (len), ("%s/%s"), (home), (".lesshst"));
  return (name);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<_get_digit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L14
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  lea    -0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    $0x3c,%edx
  mov    %edx,%ecx
  shr    %cl,%eax
  and    $0xf,%eax
  add    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L9
L14:
  movl   $0x30,-0x4(%rbp)
L9:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
char _get_digit(uint64_t *fr, int *digit_count) {
  int rval;
  if (*digit_count > 0) {
    *digit_count -= 1;
    *fr = *fr * 10U;
    rval = ((*fr >> 60) & 0xF) + '0';
    *fr &= 0x0FFFFFFFFFFFFFFFull;
  } else {
    rval = '0';
  }
  return (char)(rval);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<_get_digit>:
  endbr64
  mov    (%rsi),%eax
  test   %eax,%eax
  jle    L6
  sub    $0x1,%eax
  mov    %eax,(%rsi)
  mov    (%rdi),%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  mov    %eax,(%rdi)
L6:
  mov    $0x30,%eax
  ret
```

assistant: ```c
char _get_digit(uint64_t *fr, int *digit_count) {
  int rval;
  if (*digit_count > 0) {
    *digit_count -= 1;
    *fr = *fr * 10U;
    rval = ((*fr >> 60) & 0xF) + '0';
    *fr &= 0x0FFFFFFFFFFFFFFFull;
  } else {
    rval = '0';
  }
  return (char)(rval);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<_get_digit>:
  endbr64
  mov    (%rsi),%eax
  test   %eax,%eax
  jle    L0
  sub    $0x1,%eax
  mov    %eax,(%rsi)
  mov    (%rdi),%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  mov    %eax,(%rdi)
L0:
  mov    $0x30,%eax
  ret
```

assistant: ```c
char _get_digit(uint64_t *fr, int *digit_count) {
  int rval;
  if (*digit_count > 0) {
    *digit_count -= 1;
    *fr = *fr * 10U;
    rval = ((*fr >> 60) & 0xF) + '0';
    *fr &= 0x0FFFFFFFFFFFFFFFull;
  } else {
    rval = '0';
  }
  return (char)(rval);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<_get_digit>:
  endbr64
  mov    (%rsi),%eax
  test   %eax,%eax
  jle    L9
  sub    $0x1,%eax
  mov    %eax,(%rsi)
  mov    (%rdi),%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  mov    %eax,(%rdi)
L9:
  mov    $0x30,%eax
  ret
```

assistant: ```c
char _get_digit(uint64_t *fr, int *digit_count) {
  int rval;
  if (*digit_count > 0) {
    *digit_count -= 1;
    *fr = *fr * 10U;
    rval = ((*fr >> 60) & 0xF) + '0';
    *fr &= 0x0FFFFFFFFFFFFFFFull;
  } else {
    rval = '0';
  }
  return (char)(rval);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<gen_div>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <gen_pop@plt>
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <gen_call@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D7
type_guessed: string

tool: D7: _div

assistant: ```c
void gen_div(void) {
  gen_pop();
  gen_call("_div");
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<gen_div>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <gen_pop@plt>
  lea    D7(%rip),%rdi
  call   <gen_call@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: label: D7
datatype: string

tool: D7: _div

assistant: ```c
void gen_div(void) {
  gen_pop();
  gen_call("_div");
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<gen_div>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <gen_pop@plt>
  lea    D2(%rip),%rdi
  add    $0x8,%rsp
  jmp    1070 <gen_call@plt>
```

tool_calls: name: disassemble_data
arguments: label: D2
datatype: string

tool: D2: _div

assistant: ```c
void gen_div(void) {
  gen_pop();
  gen_call("_div");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<gen_div>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <gen_pop@plt>
  lea    D3(%rip),%rdi
  add    $0x8,%rsp
  jmp    1070 <gen_call@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type_infered: string

tool: D3: _div

assistant: ```c
void gen_div(void) {
  gen_pop();
  gen_call("_div");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<dec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %edx,%eax
  mov    %al,-0x10(%rbp)
  cmpb   $0x1,-0x10(%rbp)
  jne    L8
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <doztodec@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L12
L8:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <doztodec@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L12:
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D12
type: string
name: disassemble_data
arguments: data_tag: D2
type: string

tool: D12: %.*e


tool: D2: %.*f


assistant: ```c
int dec(char *p, int places, char expnot) {
  if (expnot == 1)
    printf("%.*e\n", places, doztodec(p));
  else
    printf("%.*f\n", places, doztodec(p));
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<dec>:
  endbr64
  push   %rbx
  mov    %esi,%ebx
  cmp    $0x1,%dl
  je     L13
  call   <doztodec@plt>
  mov    %eax,%edx
  mov    %ebx,%esi
  lea    D9(%rip),%rdi
  call   <printf@plt>
L4:
  mov    $0x0,%eax
  pop    %rbx
  ret
L13:
  call   <doztodec@plt>
  mov    %eax,%edx
  mov    %ebx,%esi
  lea    D15(%rip),%rdi
  call   <printf@plt>
  jmp    L4
```

tool_calls: name: read_data
arguments: tag: D9
type_infered: string
name: read_data
arguments: tag: D15
type_infered: string

tool: D9: %.*f


tool: D15: %.*e


assistant: ```c
int dec(char *p, int places, char expnot) {
  if (expnot == 1)
    printf("%.*e\n", places, doztodec(p));
  else
    printf("%.*f\n", places, doztodec(p));
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<dec>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  cmp    $0x1,%dl
  je     L6
  call   <doztodec@plt>
  mov    %ebp,%esi
  lea    D3(%rip),%rdi
  mov    %eax,%edx
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
  nopl   (%rax)
L6:
  call   <doztodec@plt>
  mov    %ebp,%esi
  lea    D18(%rip),%rdi
  mov    %eax,%edx
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_label: D3
datatype: string
name: read_data
arguments: data_label: D18
datatype: string

tool: D3: %.*f


tool: D18: %.*e


assistant: ```c
int dec(char *p, int places, char expnot) {
  if (expnot == 1)
    printf("%.*e\n", places, doztodec(p));
  else
    printf("%.*f\n", places, doztodec(p));
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<dec>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  cmp    $0x1,%dl
  je     L2
  call   <doztodec@plt>
  mov    %ebp,%esi
  lea    D11(%rip),%rdi
  mov    %eax,%edx
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
  nopl   (%rax)
L2:
  call   <doztodec@plt>
  mov    %ebp,%esi
  lea    D5(%rip),%rdi
  mov    %eax,%edx
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D11
type_guessed: string
name: extract_symbolic_data
arguments: label: D5
type_guessed: string

tool: D11: %.*f


tool: D5: %.*e


assistant: ```c
int dec(char *p, int places, char expnot) {
  if (expnot == 1)
    printf("%.*e\n", places, doztodec(p));
  else
    printf("%.*f\n", places, doztodec(p));
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<getClosestValidLocationOnMap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %ecx,%eax
  mov    %dx,-0x24(%rbp)
  mov    %ax,-0x28(%rbp)
  movw   $0x2710,-0x6(%rbp)
  movw   $0x2710,-0x4(%rbp)
  movw   $0x1,-0xa(%rbp)
  jmp    L65
L41:
  movw   $0x1,-0x8(%rbp)
  jmp    L7
L79:
  movswq -0xa(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  movswq -0x8(%rbp),%rax
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  js     L19
  movswq -0xa(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  movswq -0x8(%rbp),%rax
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    $0x752f,%ax
  jg     L19
  movswl -0xa(%rbp),%eax
  movswl -0x24(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  movswl -0xa(%rbp),%eax
  movswl -0x24(%rbp),%edx
  sub    %edx,%eax
  imul   %eax,%ecx
  mov    %ecx,%edx
  movswl -0x8(%rbp),%eax
  movswl -0x28(%rbp),%ecx
  sub    %ecx,%eax
  mov    %eax,%esi
  movswl -0x8(%rbp),%eax
  movswl -0x28(%rbp),%ecx
  sub    %ecx,%eax
  imul   %esi,%eax
  add    %edx,%eax
  mov    %ax,-0x2(%rbp)
  movzwl -0x2(%rbp),%eax
  cmp    -0x6(%rbp),%ax
  jl     L1
  movzwl -0x2(%rbp),%eax
  cmp    -0x6(%rbp),%ax
  jne    L19
  movswq -0xa(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  movswq -0x8(%rbp),%rax
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0x4(%rbp)
  jle    L19
L1:
  mov    -0x18(%rbp),%rax
  movzwl -0xa(%rbp),%edx
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  lea    0x2(%rax),%rdx
  movzwl -0x8(%rbp),%eax
  mov    %ax,(%rdx)
  movzwl -0x2(%rbp),%eax
  mov    %ax,-0x6(%rbp)
  movswq -0xa(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  movswq -0x8(%rbp),%rax
  add    %rax,%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  mov    %ax,-0x4(%rbp)
L19:
  movzwl -0x8(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x8(%rbp)
L7:
  cmpw   $0x1b,-0x8(%rbp)
  jle    L79
  movzwl -0xa(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xa(%rbp)
L65:
  cmpw   $0x4d,-0xa(%rbp)
  jle    L41
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void getClosestValidLocationOnMap(short loc[2], short **map, short x, short y) {
  short i, j, dist, closestDistance, lowestMapScore;
  closestDistance = 10000;
  lowestMapScore = 10000;
  for (i = 1; i < (100 - 20 - 1) - 1; i++) {
    for (j = 1; j < ((31 + 5) - 5 - 2) - 1; j++) {
      if (map[i][j] >= 0 && map[i][j] < 30000) {
        dist = (i - x) * (i - x) + (j - y) * (j - y);
        if (dist < closestDistance || dist == closestDistance && map[i][j] < lowestMapScore) {
          loc[0] = i;
          loc[1] = j;
          closestDistance = dist;
          lowestMapScore = map[i][j];
        }
      }
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<getClosestValidLocationOnMap>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  lea    0x8(%rsi),%r8
  mov    $0x2710,%r12d
  mov    $0x2710,%r11d
  mov    $0x1,%r13d
  mov    %edx,%eax
  neg    %eax
  mov    %ax,-0x2(%rsp)
  movswl %cx,%ecx
  mov    $0x1,%r15d
  sub    %ecx,%r15d
  jmp    L71
L0:
  mov    %r13w,0x0(%rbp)
  mov    %r10w,0x2(%rbp)
  mov    (%r9),%rdi
  movzwl (%rdi,%rsi,2),%r12d
  mov    %ecx,%r11d
L59:
  add    $0x1,%rax
  add    $0x1,%edx
  cmp    $0x1b,%rax
  je     L84
L25:
  lea    0x1(%rax),%r10d
  mov    %r8,%r9
  lea    0x1(%rax),%rsi
  mov    (%r8),%rcx
  movzwl (%rcx,%rsi,2),%edi
  cmp    $0x752f,%di
  ja     L59
  mov    %edx,%ecx
  imul   %edx,%ecx
  add    %ebx,%ecx
  cmp    %r11w,%cx
  jl     L0
  cmp    %r12w,%di
  jge    L59
  cmp    %r11w,%cx
  jne    L59
  jmp    L0
L84:
  lea    0x1(%r14),%r13d
  add    $0x8,%r8
  cmp    $0x4d,%r14w
  je     L53
L71:
  mov    %r13d,%r14d
  movzwl -0x2(%rsp),%eax
  lea    (%rax,%r13,1),%ebx
  imul   %ebx,%ebx
  mov    %r15d,%edx
  mov    $0x0,%eax
  jmp    L25
L53:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void getClosestValidLocationOnMap(short loc[2], short **map, short x, short y) {
  short i, j, dist, closestDistance, lowestMapScore;
  closestDistance = 10000;
  lowestMapScore = 10000;
  for (i = 1; i < (100 - 20 - 1) - 1; i++) {
    for (j = 1; j < ((31 + 5) - 5 - 2) - 1; j++) {
      if (map[i][j] >= 0 && map[i][j] < 30000) {
        dist = (i - x) * (i - x) + (j - y) * (j - y);
        if (dist < closestDistance || dist == closestDistance && map[i][j] < lowestMapScore) {
          loc[0] = i;
          loc[1] = j;
          closestDistance = dist;
          lowestMapScore = map[i][j];
        }
      }
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<getClosestValidLocationOnMap>:
  endbr64
  push   %r14
  mov    %edx,%r14d
  mov    %rdi,%r10
  mov    $0x2710,%r11d
  push   %r13
  mov    $0x2710,%r8d
  mov    $0x1,%r13d
  neg    %r14d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  neg    %ebx
  xchg   %ax,%ax
L49:
  lea    (%r14,%r13,1),%r9d
  mov    (%r12,%r13,8),%rsi
  mov    %r13d,%ebp
  mov    $0x1,%eax
  imul   %r9d,%r9d
  jmp    L11
  cs nopw 0x0(%rax,%rax,1)
L53:
  cmp    %r11w,%cx
  jge    L9
  cmp    %r8w,%dx
  je     L7
  nopl   0x0(%rax)
L9:
  add    $0x1,%rax
  cmp    $0x1c,%rax
  je     L58
L11:
  movzwl (%rsi,%rax,2),%ecx
  mov    %eax,%edi
  cmp    $0x752f,%cx
  ja     L9
  lea    (%rbx,%rax,1),%edx
  imul   %edx,%edx
  add    %r9d,%edx
  cmp    %r8w,%dx
  jge    L53
L7:
  mov    %bp,(%r10)
  mov    %edx,%r8d
  mov    %di,0x2(%r10)
  movzwl (%rsi,%rax,2),%r11d
  add    $0x1,%rax
  cmp    $0x1c,%rax
  jne    L11
L58:
  add    $0x1,%r13
  cmp    $0x4e,%r13
  jne    L49
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void getClosestValidLocationOnMap(short loc[2], short **map, short x, short y) {
  short i, j, dist, closestDistance, lowestMapScore;
  closestDistance = 10000;
  lowestMapScore = 10000;
  for (i = 1; i < (100 - 20 - 1) - 1; i++) {
    for (j = 1; j < ((31 + 5) - 5 - 2) - 1; j++) {
      if (map[i][j] >= 0 && map[i][j] < 30000) {
        dist = (i - x) * (i - x) + (j - y) * (j - y);
        if (dist < closestDistance || dist == closestDistance && map[i][j] < lowestMapScore) {
          loc[0] = i;
          loc[1] = j;
          closestDistance = dist;
          lowestMapScore = map[i][j];
        }
      }
    }
  }
}
```