ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<group_name>:
  endbr64
  lea    D63(%rip),%rax
  cmp    $0xe4c8c8c9,%esi
  je     L57
  ja     L23
  lea    D29(%rip),%rax
  cmp    $0xe0000116,%esi
  je     L57
  lea    D8(%rip),%rax
  cmp    $0xe0000123,%esi
  jne    L5
L57:
  ret
  nopl   0x0(%rax)
L5:
  lea    D52(%rip),%rax
  cmp    $0xe00000fb,%esi
  je     L57
L10:
  mov    %esi,%eax
  mov    %esi,%ecx
  mov    %esi,%edx
  sub    $0x8,%rsp
  shr    $0x10,%ecx
  movzbl %ah,%eax
  movzbl %sil,%r9d
  shr    $0x18,%edx
  mov    %eax,%r8d
  movzbl %cl,%ecx
  lea    D34(%rip),%rsi
  call   <FRAMERR@plt>
  lea    D63(%rip),%rax
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax)
L23:
  lea    D20(%rip),%rax
  cmp    $0xeffffffa,%esi
  je     L57
  cmp    $0xeffffffd,%esi
  jne    L10
  lea    D24(%rip),%rax
  ret
```

tool_calls: name: read_data
arguments: data_tag: D63
data_type: string
name: read_data
arguments: data_tag: D29
data_type: string
name: read_data
arguments: data_tag: D8
data_type: string
name: read_data
arguments: data_tag: D52
data_type: string
name: read_data
arguments: data_tag: D34
data_type: string
name: read_data
arguments: data_tag: D20
data_type: string
name: read_data
arguments: data_tag: D24
data_type: string

tool: D63: (unknown)

tool: D29: SLP (General)

tool: D8: SLP (Discovery)

tool: D52: mDNS

tool: D34: igmp: unknown group: %d.%d.%d.%d


tool: D20: SSDP

tool: D24: SLP (Admin Scoped)

assistant: ```c
const char *group_name(struct NetFrame *frame, unsigned group_address) {
  switch (group_address) {
  case 0xeffffffa:
    return "SSDP";
    break;
  case 0xe00000fb:
    return "mDNS";
    break;
  case 0xe0000116:
    return "SLP (General)";
    break;
  case 0xe0000123:
    return "SLP (Discovery)";
    break;
  case 0xe4c8c8c9:
    return "(unknown)";
    break;
  case 0xeffffffd:
    return "SLP (Admin Scoped)";
    break;
  default:
    FRAMERR(frame, "igmp: unknown group: %d.%d.%d.%d\n", (group_address >> 24) & 0xFF, (group_address >> 16) & 0xFF, (group_address >> 8) & 0xFF, (group_address >> 0) & 0xFF);
    return "(unknown)";
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<group_name>:
  endbr64
  lea    D49(%rip),%rax
  cmp    $0xe4c8c8c9,%esi
  je     L29
  ja     L56
  lea    D62(%rip),%rax
  cmp    $0xe0000116,%esi
  je     L29
  lea    D46(%rip),%rax
  cmp    $0xe0000123,%esi
  jne    L47
L29:
  ret
  nopl   0x0(%rax)
L47:
  lea    D54(%rip),%rax
  cmp    $0xe00000fb,%esi
  je     L29
L7:
  mov    %esi,%eax
  mov    %esi,%ecx
  mov    %esi,%edx
  sub    $0x8,%rsp
  shr    $0x10,%ecx
  movzbl %ah,%eax
  movzbl %sil,%r9d
  shr    $0x18,%edx
  mov    %eax,%r8d
  movzbl %cl,%ecx
  lea    D79(%rip),%rsi
  call   <FRAMERR@plt>
  lea    D49(%rip),%rax
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax)
L56:
  lea    D55(%rip),%rax
  cmp    $0xeffffffa,%esi
  je     L29
  cmp    $0xeffffffd,%esi
  jne    L7
  lea    D8(%rip),%rax
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D49
type: string
name: unpack_data
arguments: data_label: D62
type: string
name: unpack_data
arguments: data_label: D46
type: string
name: unpack_data
arguments: data_label: D54
type: string
name: unpack_data
arguments: data_label: D79
type: string
name: unpack_data
arguments: data_label: D55
type: string
name: unpack_data
arguments: data_label: D8
type: string

tool: D49: (unknown)

tool: D62: SLP (General)

tool: D46: SLP (Discovery)

tool: D54: mDNS

tool: D79: igmp: unknown group: %d.%d.%d.%d


tool: D55: SSDP

tool: D8: SLP (Admin Scoped)

assistant: ```c
const char *group_name(struct NetFrame *frame, unsigned group_address) {
  switch (group_address) {
  case 0xeffffffa:
    return "SSDP";
    break;
  case 0xe00000fb:
    return "mDNS";
    break;
  case 0xe0000116:
    return "SLP (General)";
    break;
  case 0xe0000123:
    return "SLP (Discovery)";
    break;
  case 0xe4c8c8c9:
    return "(unknown)";
    break;
  case 0xeffffffd:
    return "SLP (Admin Scoped)";
    break;
  default:
    FRAMERR(frame, "igmp: unknown group: %d.%d.%d.%d\n", (group_address >> 24) & 0xFF, (group_address >> 16) & 0xFF, (group_address >> 8) & 0xFF, (group_address >> 0) & 0xFF);
    return "(unknown)";
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    $0x1,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x9c40,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0xfa0,-0x14(%rbp)
  jmp    L23
L15:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    $0x41,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x8(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    %edx,(%rax)
  addl   $0x1,-0x14(%rbp)
L23:
  cmpl   $0x1387,-0x14(%rbp)
  jbe    L15
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0xfa0,-0x14(%rbp)
  jmp    L27
L36:
  mov    -0x14(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x14(%rbp)
L27:
  cmpl   $0x1387,-0x14(%rbp)
  jbe    L36
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D29
type_guessed: string
name: unpack_data
arguments: label: D4
type_guessed: string
name: unpack_data
arguments: label: D17
type_guessed: string

tool: D29: Alloc


tool: D4: Freeing


tool: D17: OK


assistant: ```c
int main() {
  unsigned int i;
  char *p;
  free(malloc(1));
  int *k;
  k = (int *)malloc(10000 * sizeof(int));
  printf("Alloc\n");
  for (i = 4000; i < 5000; i++) {
    p = malloc(i);
    memset(p, 'A', i);
    k[i] = (unsigned int)p;
  }
  printf("Freeing\n");
  for (i = 4000; i < 5000; i++) {
    free((void *)k[i]);
  }
  free(k);
  printf("OK\n");
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x9c40,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  lea    D15(%rip),%rdi
  call   <printf@plt>
  mov    $0xfa0,%ebx
L10:
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %ebx,%edx
  mov    $0x41,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    %ebp,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  cmp    $0x1388,%rbx
  jne    L10
  lea    D23(%rip),%rdi
  call   <printf@plt>
  lea    0x3e80(%r13),%rbx
  lea    0x4e20(%r13),%rbp
L2:
  movslq (%rbx),%rdi
  call   <free@plt>
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  jne    L2
  mov    %r13,%rdi
  call   <free@plt>
  lea    D20(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D15
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D23
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D20
type_guessed: string

tool: D15: Alloc


tool: D23: Freeing


tool: D20: OK


assistant: ```c
int main() {
  unsigned int i;
  char *p;
  free(malloc(1));
  int *k;
  k = (int *)malloc(10000 * sizeof(int));
  printf("Alloc\n");
  for (i = 4000; i < 5000; i++) {
    p = malloc(i);
    memset(p, 'A', i);
    k[i] = (unsigned int)p;
  }
  printf("Freeing\n");
  for (i = 4000; i < 5000; i++) {
    free((void *)k[i]);
  }
  free(k);
  printf("OK\n");
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r13
  mov    $0x1,%edi
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0xfa0,%ebx
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x9c40,%edi
  call   <malloc@plt>
  lea    D8(%rip),%rdi
  mov    %rax,%r13
  call   <printf@plt>
  xchg   %ax,%ax
L16:
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %ebx,%edx
  mov    $0x41,%esi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <memset@plt>
  mov    %ebp,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  cmp    $0x1388,%rbx
  jne    L16
  lea    D20(%rip),%rdi
  lea    0x3e80(%r13),%rbx
  call   <printf@plt>
  lea    0x4e20(%r13),%rbp
  nopl   (%rax)
L1:
  movslq (%rbx),%rdi
  add    $0x4,%rbx
  call   <free@plt>
  cmp    %rbp,%rbx
  jne    L1
  mov    %r13,%rdi
  call   <free@plt>
  lea    D21(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D8
type_guessed: string
name: retrieve_data
arguments: data_tag: D20
type_guessed: string
name: retrieve_data
arguments: data_tag: D21
type_guessed: string

tool: D8: Alloc


tool: D20: Freeing


tool: D21: OK


assistant: ```c
int main() {
  unsigned int i;
  char *p;
  free(malloc(1));
  int *k;
  k = (int *)malloc(10000 * sizeof(int));
  printf("Alloc\n");
  for (i = 4000; i < 5000; i++) {
    p = malloc(i);
    memset(p, 'A', i);
    k[i] = (unsigned int)p;
  }
  printf("Freeing\n");
  for (i = 4000; i < 5000; i++) {
    free((void *)k[i]);
  }
  free(k);
  printf("OK\n");
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %r13
  mov    $0x1,%edi
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0xfa0,%ebx
  sub    $0x8,%rsp
  call   <malloc@plt>
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x9c40,%edi
  call   <malloc@plt>
  lea    D19(%rip),%rdi
  mov    %rax,%r13
  call   <printf@plt>
  xchg   %ax,%ax
L5:
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %ebx,%edx
  mov    $0x41,%esi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <memset@plt>
  mov    %ebp,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  cmp    $0x1388,%rbx
  jne    L5
  lea    D1(%rip),%rdi
  lea    0x3e80(%r13),%rbx
  call   <printf@plt>
  lea    0x4e20(%r13),%rbp
  nopl   (%rax)
L19:
  movslq (%rbx),%rdi
  add    $0x4,%rbx
  call   <free@plt>
  cmp    %rbx,%rbp
  jne    L19
  mov    %r13,%rdi
  call   <free@plt>
  lea    D29(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: parse_data
arguments: label: D19
type_guessed: string
name: parse_data
arguments: label: D1
type_guessed: string
name: parse_data
arguments: label: D29
type_guessed: string

tool: D19: Alloc


tool: D1: Freeing


tool: D29: OK


assistant: ```c
int main() {
  unsigned int i;
  char *p;
  free(malloc(1));
  int *k;
  k = (int *)malloc(10000 * sizeof(int));
  printf("Alloc\n");
  for (i = 4000; i < 5000; i++) {
    p = malloc(i);
    memset(p, 'A', i);
    k[i] = (unsigned int)p;
  }
  printf("Freeing\n");
  for (i = 4000; i < 5000; i++) {
    free((void *)k[i]);
  }
  free(k);
  printf("OK\n");
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<json_parse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    $0x0,%eax
  call   <json_new_item@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L5
  mov    $0x0,%eax
  jmp    L39
L5:
  lea    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <skip@plt>
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <parse_value@plt>
  test   %eax,%eax
  jne    L16
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <json_delete@plt>
  mov    $0x0,%eax
  jmp    L39
L16:
  mov    -0x10(%rbp),%rax
L39:
  leave
  ret
```

assistant: ```c
struct json *json_parse(const char *value) {
  struct json *c = json_new_item();
  if (!c)
    return 0;
  char **end_ptr = (char **)&value;
  if (!parse_value(c, skip(end_ptr))) {
    json_delete(c);
    return 0;
  }
  return c;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<json_parse>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,0x8(%rsp)
  mov    $0x0,%eax
  call   <json_new_item@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L23
  lea    0x8(%rsp),%rdi
  call   <skip@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <parse_value@plt>
  test   %eax,%eax
  je     L24
L23:
  mov    %rbx,%rax
  add    $0x10,%rsp
  pop    %rbx
  ret
L24:
  mov    %rbx,%rdi
  call   <json_delete@plt>
  mov    $0x0,%ebx
  jmp    L23
```

assistant: ```c
struct json *json_parse(const char *value) {
  struct json *c = json_new_item();
  if (!c)
    return 0;
  char **end_ptr = (char **)&value;
  if (!parse_value(c, skip(end_ptr))) {
    json_delete(c);
    return 0;
  }
  return c;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<json_parse>:
  endbr64
  push   %r12
  xor    %eax,%eax
  sub    $0x10,%rsp
  mov    %rdi,0x8(%rsp)
  call   <json_new_item@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L14
  lea    0x8(%rsp),%rdi
  call   <skip@plt>
  mov    %r12,%rdi
  mov    %eax,%esi
  call   <parse_value@plt>
  test   %eax,%eax
  je     L25
L14:
  add    $0x10,%rsp
  mov    %r12,%rax
  pop    %r12
  ret
L25:
  mov    %r12,%rdi
  xor    %r12d,%r12d
  call   <json_delete@plt>
  jmp    L14
```

assistant: ```c
struct json *json_parse(const char *value) {
  struct json *c = json_new_item();
  if (!c)
    return 0;
  char **end_ptr = (char **)&value;
  if (!parse_value(c, skip(end_ptr))) {
    json_delete(c);
    return 0;
  }
  return c;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<json_parse>:
  endbr64
  push   %r12
  xor    %eax,%eax
  sub    $0x10,%rsp
  mov    %rdi,0x8(%rsp)
  call   <json_new_item@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L2
  lea    0x8(%rsp),%rdi
  call   <skip@plt>
  mov    %r12,%rdi
  mov    %eax,%esi
  call   <parse_value@plt>
  test   %eax,%eax
  je     L23
L2:
  add    $0x10,%rsp
  mov    %r12,%rax
  pop    %r12
  ret
L23:
  mov    %r12,%rdi
  xor    %r12d,%r12d
  call   <json_delete@plt>
  jmp    L2
```

assistant: ```c
struct json *json_parse(const char *value) {
  struct json *c = json_new_item();
  if (!c)
    return 0;
  char **end_ptr = (char **)&value;
  if (!parse_value(c, skip(end_ptr))) {
    json_delete(c);
    return 0;
  }
  return c;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<populate_zip_distance>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x58(%rbp),%rdx
  lea    -0x60(%rbp),%rsi
  mov    -0x68(%rbp),%rax
  lea    D52(%rip),%rcx
  mov    %rax,%rdi
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  jne    L9
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <sm_err_reset@plt>
  mov    $0x0,%eax
  jmp    L43
L9:
  lea    -0x48(%rbp),%rdx
  lea    -0x50(%rbp),%rsi
  mov    -0x70(%rbp),%rax
  lea    D52(%rip),%rcx
  mov    %rax,%rdi
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  jne    L3
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <sm_err_reset@plt>
  mov    $0x0,%eax
  jmp    L43
L3:
  movsd  -0x48(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm1
  movsd  -0x58(%rbp),%xmm0
  mov    -0x60(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x4,%eax
  call   <compute_distance@plt>
  movq   %xmm0,%rax
  lea    -0x40(%rbp),%rdx
  movq   %rax,%xmm0
  lea    D53(%rip),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <sprintf@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <sm_n_putfield@plt>
  mov    $0x0,%eax
L43:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L29
  call   <__stack_chk_fail@plt>
L29:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D52
type_infered: string
name: disassemble_data
arguments: tag: D43
type_infered: string
name: disassemble_data
arguments: tag: D53
type_infered: string
name: disassemble_data
arguments: tag: D49
type_infered: string

tool: D52: ..\lib\search_z.rnd

tool: D43: Cannot get_longitude_latitude()

tool: D53: %.0lf

tool: D49: zip_distance

assistant: ```c
populate_zip_distance(char *this_zip_code, char *that_zip_code) {
  double compute_distance();
  double this_longitude, this_latitude;
  double that_longitude, that_latitude;
  char buffer[50];
  if (!get_longitude_latitude(this_zip_code, &this_longitude, &this_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  if (!get_longitude_latitude(that_zip_code, &that_longitude, &that_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  sprintf(buffer, "%.0lf", compute_distance(this_longitude, this_latitude, that_longitude, that_latitude));
  sm_n_putfield("zip_distance", buffer);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<populate_zip_distance>:
  endbr64
  push   %rbx
  sub    $0x60,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdx
  mov    %rsp,%rsi
  lea    D26(%rip),%rcx
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  je     L25
  lea    0x18(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  lea    D26(%rip),%rcx
  mov    %rbx,%rdi
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  je     L48
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  mov    $0x4,%eax
  call   <compute_distance@plt>
  lea    0x20(%rsp),%rbx
  lea    D46(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  mov    %rbx,%rsi
  lea    D35(%rip),%rdi
  call   <sm_n_putfield@plt>
L27:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  mov    $0x0,%eax
  add    $0x60,%rsp
  pop    %rbx
  ret
L25:
  lea    D15(%rip),%rdi
  call   <sm_err_reset@plt>
  jmp    L27
L48:
  lea    D15(%rip),%rdi
  call   <sm_err_reset@plt>
  jmp    L27
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D26
data_type: string
name: unpack_data
arguments: data_tag: D46
data_type: string
name: unpack_data
arguments: data_tag: D35
data_type: string
name: unpack_data
arguments: data_tag: D15
data_type: string

tool: D26: ..\lib\search_z.rnd

tool: D46: %.0lf

tool: D35: zip_distance

tool: D15: Cannot get_longitude_latitude()

assistant: ```c
populate_zip_distance(char *this_zip_code, char *that_zip_code) {
  double compute_distance();
  double this_longitude, this_latitude;
  double that_longitude, that_latitude;
  char buffer[50];
  if (!get_longitude_latitude(this_zip_code, &this_longitude, &this_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  if (!get_longitude_latitude(that_zip_code, &that_longitude, &that_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  sprintf(buffer, "%.0lf", compute_distance(this_longitude, this_latitude, that_longitude, that_latitude));
  sm_n_putfield("zip_distance", buffer);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<populate_zip_distance>:
  endbr64
  push   %r12
  lea    D39(%rip),%r12
  push   %rbp
  mov    %r12,%rcx
  mov    %rsi,%rbp
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdx
  mov    %rsp,%rsi
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  je     L27
  lea    0x18(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    %r12,%rcx
  mov    %rbp,%rdi
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  je     L27
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  lea    0x20(%rsp),%rbp
  mov    $0x4,%eax
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  call   <compute_distance@plt>
  mov    %rbp,%rdi
  lea    D14(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbp,%rsi
  lea    D1(%rip),%rdi
  call   <sm_n_putfield@plt>
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L27:
  lea    D9(%rip),%rdi
  call   <sm_err_reset@plt>
L8:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x68,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D39
type_guessed: string
name: read_data
arguments: label: D14
type_guessed: string
name: read_data
arguments: label: D1
type_guessed: string
name: read_data
arguments: label: D9
type_guessed: string

tool: D39: ..\lib\search_z.rnd

tool: D14: %.0lf

tool: D1: zip_distance

tool: D9: Cannot get_longitude_latitude()

assistant: ```c
populate_zip_distance(char *this_zip_code, char *that_zip_code) {
  double compute_distance();
  double this_longitude, this_latitude;
  double that_longitude, that_latitude;
  char buffer[50];
  if (!get_longitude_latitude(this_zip_code, &this_longitude, &this_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  if (!get_longitude_latitude(that_zip_code, &that_longitude, &that_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  sprintf(buffer, "%.0lf", compute_distance(this_longitude, this_latitude, that_longitude, that_latitude));
  sm_n_putfield("zip_distance", buffer);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<populate_zip_distance>:
  endbr64
  push   %r12
  lea    D32(%rip),%r12
  push   %rbp
  mov    %r12,%rcx
  mov    %rsi,%rbp
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdx
  mov    %rsp,%rsi
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  je     L13
  lea    0x18(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    %r12,%rcx
  mov    %rbp,%rdi
  call   <get_longitude_latitude@plt>
  test   %eax,%eax
  je     L13
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  lea    0x20(%rsp),%rbp
  mov    $0x4,%eax
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  call   <compute_distance@plt>
  mov    %rbp,%rdi
  lea    D15(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbp,%rsi
  lea    D19(%rip),%rdi
  call   <sm_n_putfield@plt>
  jmp    L14
  nopl   0x0(%rax,%rax,1)
L13:
  lea    D3(%rip),%rdi
  call   <sm_err_reset@plt>
L14:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x68,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L23:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D32
datatype: string
name: extract_symbolic_data
arguments: tag: D15
datatype: string
name: extract_symbolic_data
arguments: tag: D19
datatype: string
name: extract_symbolic_data
arguments: tag: D3
datatype: string

tool: D32: ..\lib\search_z.rnd

tool: D15: %.0lf

tool: D19: zip_distance

tool: D3: Cannot get_longitude_latitude()

assistant: ```c
populate_zip_distance(char *this_zip_code, char *that_zip_code) {
  double compute_distance();
  double this_longitude, this_latitude;
  double that_longitude, that_latitude;
  char buffer[50];
  if (!get_longitude_latitude(this_zip_code, &this_longitude, &this_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  if (!get_longitude_latitude(that_zip_code, &that_longitude, &that_latitude, "..\\lib\\search_z.rnd")) {
    sm_err_reset("Cannot get_longitude_latitude()");
    return 0;
  }
  sprintf(buffer, "%.0lf", compute_distance(this_longitude, this_latitude, that_longitude, that_latitude));
  sm_n_putfield("zip_distance", buffer);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<SFX_Playing>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  and    $0x8000,%eax
  test   %eax,%eax
  je     L0
  mov    -0x4(%rbp),%eax
  and    $0x7fff,%eax
  mov    %eax,%edi
  call   <PCFX_SoundPlaying@plt>
  jmp    L2
L0:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <FX_SoundActive@plt>
L2:
  leave
  ret
```

assistant: ```c
int SFX_Playing(int handle) {
  if (handle & 0x8000) {
    return PCFX_SoundPlaying(handle & 0x7fff);
  }
  return FX_SoundActive(handle);
}
```