ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<pq_gen_base>:
  endbr64
  movslq %esi,%rax
  shr    $0x3,%rax
  test   %eax,%eax
  jle    L40
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %rdx,%r10
  movslq %edi,%rdx
  shl    $0x3,%rdx
  lea    -0x18(%r10,%rdx,1),%r15
  lea    -0x10(%r10,%rdx,1),%r14
  lea    -0x8(%r10,%rdx,1),%r13
  lea    -0x1(%rax),%eax
  lea    0x8(,%rax,8),%rax
  mov    %rax,-0x8(%rsp)
  mov    $0x0,%r9d
  sub    $0x4,%r12d
  movabs $0x101010101010100,%rbp
  movabs $0x101010101010101,%rbx
  movabs $0x1d1d1d1d1d1d1d1d,%r11
L31:
  mov    (%r15),%rax
  mov    (%rax,%r9,1),%r8
  test   %r12d,%r12d
  js     L11
  movslq %r12d,%rsi
  mov    %r8,%rdi
L41:
  mov    (%r10,%rsi,8),%rax
  mov    (%rax,%r9,1),%rcx
  xor    %rcx,%r8
  lea    (%rdi,%rdi,1),%rdx
  mov    %rdx,%rax
  and    %rbp,%rax
  shr    $0x7,%rdi
  and    %rbx,%rdi
  sub    %rdi,%rax
  and    %r11,%rax
  movabs $0xfefefefefefefefe,%rdi
  and    %rdi,%rdx
  xor    %rcx,%rdx
  mov    %rdx,%rdi
  xor    %rax,%rdi
  sub    $0x1,%rsi
  test   %esi,%esi
  jns    L41
  mov    %rdi,%rax
L48:
  mov    (%r14),%rdx
  mov    %r8,(%rdx,%r9,1)
  mov    0x0(%r13),%rdx
  mov    %rax,(%rdx,%r9,1)
  add    $0x8,%r9
  cmp    -0x8(%rsp),%r9
  jne    L31
  mov    $0x0,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  mov    %r8,%rax
  jmp    L48
L40:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int pq_gen_base(int vects, int len, void **array) {
  int i, j;
  unsigned long p, q, s;
  unsigned long **src = (unsigned long **)array;
  int blocks = len / sizeof(long);
  for (i = 0; i < blocks; i++) {
    q = p = src[vects - 3][i];
    for (j = vects - 4; j >= 0; j--) {
      p ^= s = src[j][i];
      q = s ^ (((q << 1) & 0xfefefefefefefefeULL) ^ ((((q & 0x8080808080808080ULL) << 1) - ((q & 0x8080808080808080ULL) >> 7)) & 0x1d1d1d1d1d1d1d1dULL));
    }
    src[vects - 2][i] = p;
    src[vects - 1][i] = q;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<pq_gen_base>:
  endbr64
  movslq %esi,%rax
  shr    $0x3,%rax
  test   %eax,%eax
  jle    L44
  push   %r15
  mov    %rdx,%r10
  sub    $0x1,%eax
  movslq %edi,%rdx
  push   %r14
  shl    $0x3,%rdx
  lea    0x8(,%rax,8),%rax
  xor    %r9d,%r9d
  movabs $0xfefefefefefefefe,%r11
  push   %r13
  lea    -0x4(%rdi),%r13d
  push   %r12
  movabs $0x101010101010100,%r12
  push   %rbp
  movabs $0x101010101010101,%rbp
  push   %rbx
  mov    -0x8(%r10,%rdx,1),%rbx
  mov    -0x18(%r10,%rdx,1),%r15
  mov    -0x10(%r10,%rdx,1),%r14
  mov    %rax,-0x10(%rsp)
  mov    %rbx,-0x8(%rsp)
  movabs $0x1d1d1d1d1d1d1d1d,%rbx
  nopw   0x0(%rax,%rax,1)
L11:
  mov    (%r15,%r9,1),%r8
  test   %r13d,%r13d
  js     L29
  movslq %r13d,%rsi
  mov    %r8,%rdi
  nop
L24:
  mov    (%r10,%rsi,8),%rax
  lea    (%rdi,%rdi,1),%rdx
  shr    $0x7,%rdi
  sub    $0x1,%rsi
  and    %rbp,%rdi
  mov    (%rax,%r9,1),%rcx
  mov    %rdx,%rax
  and    %r11,%rdx
  and    %r12,%rax
  sub    %rdi,%rax
  xor    %rcx,%rdx
  xor    %rcx,%r8
  and    %rbx,%rax
  xor    %rax,%rdx
  mov    %rdx,%rdi
  test   %esi,%esi
  jns    L24
  mov    %rdx,%rax
L34:
  mov    -0x8(%rsp),%rcx
  mov    %r8,(%r14,%r9,1)
  mov    %rax,(%rcx,%r9,1)
  add    $0x8,%r9
  cmp    %r9,-0x10(%rsp)
  jne    L11
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L29:
  mov    %r8,%rax
  jmp    L34
L44:
  xor    %eax,%eax
  ret
```

assistant: ```c
int pq_gen_base(int vects, int len, void **array) {
  int i, j;
  unsigned long p, q, s;
  unsigned long **src = (unsigned long **)array;
  int blocks = len / sizeof(long);
  for (i = 0; i < blocks; i++) {
    q = p = src[vects - 3][i];
    for (j = vects - 4; j >= 0; j--) {
      p ^= s = src[j][i];
      q = s ^ (((q << 1) & 0xfefefefefefefefeULL) ^ ((((q & 0x8080808080808080ULL) << 1) - ((q & 0x8080808080808080ULL) >> 7)) & 0x1d1d1d1d1d1d1d1dULL));
    }
    src[vects - 2][i] = p;
    src[vects - 1][i] = q;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pq_gen_base>:
  endbr64
  movslq %esi,%rax
  shr    $0x3,%rax
  test   %eax,%eax
  jle    L37
  push   %r15
  mov    %rdx,%r10
  sub    $0x1,%eax
  movslq %edi,%rdx
  push   %r14
  shl    $0x3,%rdx
  lea    0x8(,%rax,8),%rax
  xor    %r9d,%r9d
  movabs $0xfefefefefefefefe,%r11
  push   %r13
  lea    -0x4(%rdi),%r13d
  push   %r12
  movabs $0x101010101010100,%r12
  push   %rbp
  movabs $0x101010101010101,%rbp
  push   %rbx
  mov    -0x8(%r10,%rdx,1),%rbx
  mov    -0x18(%r10,%rdx,1),%r15
  mov    -0x10(%r10,%rdx,1),%r14
  mov    %rax,-0x8(%rsp)
  mov    %rbx,-0x10(%rsp)
  movabs $0x1d1d1d1d1d1d1d1d,%rbx
  nopw   0x0(%rax,%rax,1)
L18:
  mov    (%r15,%r9,1),%r8
  test   %r13d,%r13d
  js     L33
  movslq %r13d,%rsi
  mov    %r8,%rdi
  nop
L3:
  mov    (%r10,%rsi,8),%rax
  lea    (%rdi,%rdi,1),%rdx
  shr    $0x7,%rdi
  sub    $0x1,%rsi
  and    %rbp,%rdi
  mov    (%rax,%r9,1),%rcx
  mov    %rdx,%rax
  and    %r11,%rdx
  and    %r12,%rax
  sub    %rdi,%rax
  xor    %rcx,%rdx
  xor    %rcx,%r8
  and    %rbx,%rax
  xor    %rax,%rdx
  mov    %rdx,%rdi
  test   %esi,%esi
  jns    L3
  mov    %rdx,%rax
L23:
  mov    -0x10(%rsp),%rcx
  mov    %r8,(%r14,%r9,1)
  mov    %rax,(%rcx,%r9,1)
  add    $0x8,%r9
  cmp    %r9,-0x8(%rsp)
  jne    L18
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L33:
  mov    %r8,%rax
  jmp    L23
L37:
  xor    %eax,%eax
  ret
```

assistant: ```c
int pq_gen_base(int vects, int len, void **array) {
  int i, j;
  unsigned long p, q, s;
  unsigned long **src = (unsigned long **)array;
  int blocks = len / sizeof(long);
  for (i = 0; i < blocks; i++) {
    q = p = src[vects - 3][i];
    for (j = vects - 4; j >= 0; j--) {
      p ^= s = src[j][i];
      q = s ^ (((q << 1) & 0xfefefefefefefefeULL) ^ ((((q & 0x8080808080808080ULL) << 1) - ((q & 0x8080808080808080ULL) >> 7)) & 0x1d1d1d1d1d1d1d1dULL));
    }
    src[vects - 2][i] = p;
    src[vects - 1][i] = q;
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<putbus>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%edx
  mov    %esi,%eax
  mov    %dl,-0x4(%rbp)
  mov    %al,-0x8(%rbp)
  mov    $0x400001,%edx
  movzbl -0x4(%rbp),%eax
  mov    %al,(%rdx)
  mov    $0x400000,%edx
  movzbl -0x8(%rbp),%eax
  mov    %al,(%rdx)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void putbus(char instr, char data) {
  (*(volatile unsigned char *)0x400001) = instr;
  (*(volatile unsigned char *)0x400000) = data;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<putbus>:
  endbr64
  mov    %dil,0x400001
  mov    %sil,0x400000
  ret
```

assistant: ```c
void putbus(char instr, char data) {
  (*(volatile unsigned char *)0x400001) = instr;
  (*(volatile unsigned char *)0x400000) = data;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<putbus>:
  endbr64
  mov    %dil,0x400001
  mov    %sil,0x400000
  ret
```

assistant: ```c
void putbus(char instr, char data) {
  (*(volatile unsigned char *)0x400001) = instr;
  (*(volatile unsigned char *)0x400000) = data;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<read_int32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
L38:
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L28
  mov    $0x0,%eax
  jmp    L33
L28:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  and    $0x7f,%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  shl    $0x3,%edx
  sub    %eax,%edx
  mov    %esi,%eax
  mov    %edx,%ecx
  shl    %cl,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  sar    $0x7,%eax
  test   %eax,%eax
  je     L3
  nop
  jmp    L38
L3:
  nop
  mov    -0x18(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
L33:
  pop    %rbp
  ret
```

assistant: ```c
const uint8_t *read_int32(int32_t *v, const uint8_t *buffer, const uint8_t *buffer_end) {
  uint8_t i = 0;
  uint64_t tmp = 0;
  while (1) {
    if (buffer >= buffer_end)
      return NULL;
    tmp |= ((uint64_t)((*buffer) & 0x7f)) << ((i++) * 7);
    if ((*buffer++) >> 7)
      continue;
    break;
  }
  *v = tmp;
  return buffer;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<read_int32>:
  endbr64
  mov    $0x0,%ecx
  mov    $0x0,%r9d
L9:
  cmp    %rdx,%rsi
  jae    L1
  mov    (%rsi),%r8d
  mov    %r8d,%eax
  and    $0x7f,%eax
  shl    %cl,%eax
  or     %eax,%r9d
  lea    0x4(%rsi),%rax
  add    $0x7,%ecx
  shr    $0x7,%r8d
  jne    L15
  mov    %r9d,(%rdi)
  ret
L15:
  mov    %rax,%rsi
  jmp    L9
L1:
  mov    $0x0,%eax
  ret
```

assistant: ```c
const uint8_t *read_int32(int32_t *v, const uint8_t *buffer, const uint8_t *buffer_end) {
  uint8_t i = 0;
  uint64_t tmp = 0;
  while (1) {
    if (buffer >= buffer_end)
      return NULL;
    tmp |= ((uint64_t)((*buffer) & 0x7f)) << ((i++) * 7);
    if ((*buffer++) >> 7)
      continue;
    break;
  }
  *v = tmp;
  return buffer;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<read_int32>:
  endbr64
  xor    %ecx,%ecx
  xor    %r9d,%r9d
L19:
  cmp    %rdx,%rsi
  jae    L20
  mov    (%rsi),%r8d
  mov    %r8d,%eax
  and    $0x7f,%eax
  shl    %cl,%eax
  add    $0x7,%ecx
  or     %eax,%r9d
  shr    $0x7,%r8d
  lea    0x4(%rsi),%rax
  jne    L5
  mov    %r9d,(%rdi)
  ret
  nopl   (%rax)
L5:
  mov    %rax,%rsi
  jmp    L19
  nopl   (%rax)
L20:
  xor    %eax,%eax
  ret
```

assistant: ```c
const uint8_t *read_int32(int32_t *v, const uint8_t *buffer, const uint8_t *buffer_end) {
  uint8_t i = 0;
  uint64_t tmp = 0;
  while (1) {
    if (buffer >= buffer_end)
      return NULL;
    tmp |= ((uint64_t)((*buffer) & 0x7f)) << ((i++) * 7);
    if ((*buffer++) >> 7)
      continue;
    break;
  }
  *v = tmp;
  return buffer;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<read_int32>:
  endbr64
  xor    %ecx,%ecx
  xor    %r9d,%r9d
L24:
  cmp    %rdx,%rsi
  jae    L21
  mov    (%rsi),%r8d
  mov    %r8d,%eax
  and    $0x7f,%eax
  shl    %cl,%eax
  add    $0x7,%ecx
  or     %eax,%r9d
  shr    $0x7,%r8d
  lea    0x4(%rsi),%rax
  jne    L28
  mov    %r9d,(%rdi)
  ret
  nopl   (%rax)
L28:
  mov    %rax,%rsi
  jmp    L24
  nopl   (%rax)
L21:
  xor    %eax,%eax
  ret
```

assistant: ```c
const uint8_t *read_int32(int32_t *v, const uint8_t *buffer, const uint8_t *buffer_end) {
  uint8_t i = 0;
  uint64_t tmp = 0;
  while (1) {
    if (buffer >= buffer_end)
      return NULL;
    tmp |= ((uint64_t)((*buffer) & 0x7f)) << ((i++) * 7);
    if ((*buffer++) >> 7)
      continue;
    break;
  }
  *v = tmp;
  return buffer;
}
```
user: Translate the below assembly code into C programming language:

```asm
<file_read_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    D32(%rip),%rax
  mov    (%rax),%edx
  mov    D31(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <file_open@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L21
  mov    D49(%rip),%rax
  mov    (%rax),%eax
  jmp    L57
L21:
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x4(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <file_read@plt>
  test   %rax,%rax
  jns    L11
  mov    D49(%rip),%rax
  mov    (%rax),%eax
  jmp    L57
L11:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <file_close@plt>
  test   %rax,%rax
  jns    L31
  mov    D49(%rip),%rax
  mov    (%rax),%eax
  jmp    L57
L31:
  mov    D20(%rip),%rax
  mov    (%rax),%eax
L57:
  leave
  ret
```

assistant: ```c
int file_read_str(char *path, char *tmp, int buf_len) {
  int fd;
  fd = file_open(path, O_SYNC | O_RDONLY);
  if (fd < 0) {
    return EXIT_FAILURE;
  }
  if (file_read(fd, tmp, buf_len) < 0) {
    return EXIT_FAILURE;
  }
  if (file_close(fd) < 0) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<file_read_str>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbp
  mov    %edx,%r12d
  mov    D42(%rip),%rax
  mov    (%rax),%esi
  mov    D6(%rip),%rax
  or     (%rax),%esi
  call   <file_open@plt>
  test   %eax,%eax
  js     L9
  mov    %eax,%ebx
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <file_read@plt>
  test   %rax,%rax
  js     L41
  mov    %ebx,%edi
  call   <file_close@plt>
  test   %rax,%rax
  js     L35
  mov    D50(%rip),%rax
  mov    (%rax),%eax
  jmp    L13
L9:
  mov    D9(%rip),%rax
  mov    (%rax),%eax
L13:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L41:
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  jmp    L13
L35:
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  jmp    L13
```

assistant: ```c
int file_read_str(char *path, char *tmp, int buf_len) {
  int fd;
  fd = file_open(path, O_SYNC | O_RDONLY);
  if (fd < 0) {
    return EXIT_FAILURE;
  }
  if (file_read(fd, tmp, buf_len) < 0) {
    return EXIT_FAILURE;
  }
  if (file_close(fd) < 0) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<file_read_str>:
  endbr64
  mov    D6(%rip),%rax
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    (%rax),%esi
  mov    D29(%rip),%rax
  or     (%rax),%esi
  call   <file_open@plt>
  test   %eax,%eax
  js     L6
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %eax,%edi
  mov    %eax,%ebp
  call   <file_read@plt>
  test   %rax,%rax
  js     L6
  mov    %ebp,%edi
  call   <file_close@plt>
  test   %rax,%rax
  js     L6
  mov    D36(%rip),%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  mov    (%rax),%eax
  ret
  nopl   0x0(%rax)
L6:
  mov    D37(%rip),%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  mov    (%rax),%eax
  ret
```

assistant: ```c
int file_read_str(char *path, char *tmp, int buf_len) {
  int fd;
  fd = file_open(path, O_SYNC | O_RDONLY);
  if (fd < 0) {
    return EXIT_FAILURE;
  }
  if (file_read(fd, tmp, buf_len) < 0) {
    return EXIT_FAILURE;
  }
  if (file_close(fd) < 0) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<file_read_str>:
  endbr64
  mov    D35(%rip),%rax
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    (%rax),%esi
  mov    D33(%rip),%rax
  or     (%rax),%esi
  call   <file_open@plt>
  test   %eax,%eax
  js     L2
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %eax,%edi
  mov    %eax,%ebp
  call   <file_read@plt>
  test   %rax,%rax
  js     L2
  mov    %ebp,%edi
  call   <file_close@plt>
  test   %rax,%rax
  js     L2
  mov    D28(%rip),%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  mov    (%rax),%eax
  ret
  nopl   0x0(%rax)
L2:
  mov    D17(%rip),%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  mov    (%rax),%eax
  ret
```

assistant: ```c
int file_read_str(char *path, char *tmp, int buf_len) {
  int fd;
  fd = file_open(path, O_SYNC | O_RDONLY);
  if (fd < 0) {
    return EXIT_FAILURE;
  }
  if (file_read(fd, tmp, buf_len) < 0) {
    return EXIT_FAILURE;
  }
  if (file_close(fd) < 0) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mapExtension>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  lea    D78(%rip),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L25
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x8(%rbp),%rax
  lea    D61(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L43
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L25
L43:
  mov    -0x8(%rbp),%rax
  lea    D45(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L78
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L25
L78:
  mov    -0x8(%rbp),%rax
  lea    D15(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L17
  mov    -0x8(%rbp),%rax
  lea    D41(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L25
L17:
  mov    -0x8(%rbp),%rax
  lea    D54(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L25
  mov    -0x8(%rbp),%rax
  lea    D37(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L25:
  lea    D7(%rip),%rax
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D78
type: string
name: parse_data
arguments: data_label: D61
type: string
name: parse_data
arguments: data_label: D45
type: string
name: parse_data
arguments: data_label: D15
type: string
name: parse_data
arguments: data_label: D41
type: string
name: parse_data
arguments: data_label: D54
type: string
name: parse_data
arguments: data_label: D37
type: string

tool: D78: $(BLD_OBJ)

tool: D61: .c

tool: D45: .cpp

tool: D15: .java

tool: D41: .class

tool: D54: .cs

tool: D37: $(BLD_LIB)

assistant: ```c
char *mapExtension(char *path) {
  static char ext[16];
  char *cp;
  char *object;
  object = "$(BLD_OBJ)";
  if ((cp = strrchr(path, '.'))) {
    strcpy(ext, cp);
    if (strcmp(cp, ".c") == 0) {
      strcpy(cp, object);
    } else if (strcmp(cp, ".cpp") == 0) {
      strcpy(cp, object);
    } else if (strcmp(cp, ".java") == 0) {
      strcpy(cp, ".class");
    } else if (strcmp(cp, ".cs") == 0) {
      strcpy(cp, "$(BLD_LIB)");
    }
  }
  return ext;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<mapExtension>:
  endbr64
  push   %rbx
  mov    $0x2e,%esi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L36
  mov    %rax,%rbx
  mov    %rax,%rsi
  lea    D70(%rip),%rdi
  call   <strcpy@plt>
  lea    D71(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L71
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
L36:
  lea    D70(%rip),%rax
  pop    %rbx
  ret
L71:
  lea    D8(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L30
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L36
L30:
  lea    D68(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L18
  lea    D28(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L36
L18:
  lea    D43(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L36
  lea    D76(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  jmp    L36
```

tool_calls: name: disassemble_data
arguments: label: D71
type: string
name: disassemble_data
arguments: label: D56
type: string
name: disassemble_data
arguments: label: D8
type: string
name: disassemble_data
arguments: label: D68
type: string
name: disassemble_data
arguments: label: D28
type: string
name: disassemble_data
arguments: label: D43
type: string
name: disassemble_data
arguments: label: D76
type: string

tool: D71: .c

tool: D56: $(BLD_OBJ)

tool: D8: .cpp

tool: D68: .java

tool: D28: .class

tool: D43: .cs

tool: D76: $(BLD_LIB)

assistant: ```c
char *mapExtension(char *path) {
  static char ext[16];
  char *cp;
  char *object;
  object = "$(BLD_OBJ)";
  if ((cp = strrchr(path, '.'))) {
    strcpy(ext, cp);
    if (strcmp(cp, ".c") == 0) {
      strcpy(cp, object);
    } else if (strcmp(cp, ".cpp") == 0) {
      strcpy(cp, object);
    } else if (strcmp(cp, ".java") == 0) {
      strcpy(cp, ".class");
    } else if (strcmp(cp, ".cs") == 0) {
      strcpy(cp, "$(BLD_LIB)");
    }
  }
  return ext;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<mapExtension>:
  endbr64
  push   %r12
  mov    $0x2e,%esi
  lea    D42(%rip),%r12
  push   %rbp
  sub    $0x8,%rsp
  call   <strrchr@plt>
  test   %rax,%rax
  je     L55
  lea    D42(%rip),%r12
  mov    %rax,%rbp
  mov    %rax,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  lea    D57(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L15
L52:
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
L55:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L15:
  lea    D65(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L52
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L4
  lea    D18(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  jmp    L55
  nopl   0x0(%rax)
L4:
  lea    D43(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L55
  lea    D79(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  jmp    L55
```

tool_calls: name: extract_symbolic_data
arguments: tag: D57
type_guessed: string
name: extract_symbolic_data
arguments: tag: D7
type_guessed: string
name: extract_symbolic_data
arguments: tag: D65
type_guessed: string
name: extract_symbolic_data
arguments: tag: D58
type_guessed: string
name: extract_symbolic_data
arguments: tag: D18
type_guessed: string
name: extract_symbolic_data
arguments: tag: D43
type_guessed: string
name: extract_symbolic_data
arguments: tag: D79
type_guessed: string

tool: D57: .c

tool: D7: $(BLD_OBJ)

tool: D65: .cpp

tool: D58: .java

tool: D18: .class

tool: D43: .cs

tool: D79: $(BLD_LIB)

assistant: ```c
char *mapExtension(char *path) {
  static char ext[16];
  char *cp;
  char *object;
  object = "$(BLD_OBJ)";
  if ((cp = strrchr(path, '.'))) {
    strcpy(ext, cp);
    if (strcmp(cp, ".c") == 0) {
      strcpy(cp, object);
    } else if (strcmp(cp, ".cpp") == 0) {
      strcpy(cp, object);
    } else if (strcmp(cp, ".java") == 0) {
      strcpy(cp, ".class");
    } else if (strcmp(cp, ".cs") == 0) {
      strcpy(cp, "$(BLD_LIB)");
    }
  }
  return ext;
}
```