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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  sub    $0x8,%rsp
  push   $0x9
  push   $0x8
  push   $0x7
  mov    $0x6,%r9d
  mov    $0x5,%r8d
  mov    $0x4,%ecx
  mov    $0x3,%edx
  mov    $0x2,%esi
  mov    $0x1,%edi
  call   <Bar9@plt>
  add    $0x20,%rsp
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D4
data_type: string

tool: D4: main: total = %d


assistant: ```c
int main() {
  int total;
  total = Bar9(1, 2, 3, 4, 5, 6, 7, 8, 9);
  printf("main: total = %d\n", total);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  sub    $0x10,%rsp
  push   $0x9
  push   $0x8
  push   $0x7
  mov    $0x6,%r9d
  mov    $0x5,%r8d
  mov    $0x4,%ecx
  mov    $0x3,%edx
  mov    $0x2,%esi
  mov    $0x1,%edi
  call   <Bar9@plt>
  mov    %eax,%esi
  add    $0x20,%rsp
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: tag: D1
type: string

tool: D1: main: total = %d


assistant: ```c
int main() {
  int total;
  total = Bar9(1, 2, 3, 4, 5, 6, 7, 8, 9);
  printf("main: total = %d\n", total);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x10,%rsp
  mov    $0x6,%r9d
  mov    $0x5,%r8d
  mov    $0x4,%ecx
  push   $0x9
  mov    $0x3,%edx
  mov    $0x2,%esi
  mov    $0x1,%edi
  push   $0x8
  push   $0x7
  call   <Bar9@plt>
  add    $0x20,%rsp
  lea    D1(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: data_tag: D1
datatype: string

tool: D1: main: total = %d


assistant: ```c
int main() {
  int total;
  total = Bar9(1, 2, 3, 4, 5, 6, 7, 8, 9);
  printf("main: total = %d\n", total);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x10,%rsp
  mov    $0x6,%r9d
  mov    $0x5,%r8d
  mov    $0x4,%ecx
  push   $0x9
  mov    $0x3,%edx
  mov    $0x2,%esi
  mov    $0x1,%edi
  push   $0x8
  push   $0x7
  call   <Bar9@plt>
  add    $0x20,%rsp
  lea    D1(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D1
data_type: string

tool: D1: main: total = %d


assistant: ```c
int main() {
  int total;
  total = Bar9(1, 2, 3, 4, 5, 6, 7, 8, 9);
  printf("main: total = %d\n", total);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<usage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D8
type_infered: string

tool: D8: Usage: %s grib_file


assistant: ```c
void usage(char *prog) {
  printf("Usage: %s grib_file\n", prog);
  exit(1);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<usage>:
  endbr64
  sub    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D0(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: label: D0
datatype: string

tool: D0: Usage: %s grib_file


assistant: ```c
void usage(char *prog) {
  printf("Usage: %s grib_file\n", prog);
  exit(1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<usage>:
  endbr64
  sub    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D9
data_type: string

tool: D9: Usage: %s grib_file


assistant: ```c
void usage(char *prog) {
  printf("Usage: %s grib_file\n", prog);
  exit(1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<usage>:
  endbr64
  sub    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D9
datatype: string

tool: D9: Usage: %s grib_file


assistant: ```c
void usage(char *prog) {
  printf("Usage: %s grib_file\n", prog);
  exit(1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<telnetd_connected>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D18(%rip),%rdx
  lea    D49(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <telnetd_output@plt>
  mov    -0x8(%rbp),%rax
  lea    D18(%rip),%rdx
  lea    D12(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <telnetd_output@plt>
  mov    -0x8(%rbp),%rax
  lea    D30(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <telnetd_prompt@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D18
type_guessed: string
name: unpack_data
arguments: data_label: D49
type_guessed: string
name: unpack_data
arguments: data_label: D12
type_guessed: string
name: unpack_data
arguments: data_label: D30
type_guessed: string

tool: 

tool: D49: uIP command shell

tool: D12: Type '?' for help

tool: D30: uIP-0.9> 

assistant: ```c
void telnetd_connected(struct telnetd_state *s) {
  telnetd_output(s, "uIP command shell", "");
  telnetd_output(s, "Type '?' for help", "");
  telnetd_prompt(s, "uIP-0.9> ");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<telnetd_connected>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  lea    D27(%rip),%rbp
  mov    %rbp,%rdx
  lea    D26(%rip),%rsi
  call   <telnetd_output@plt>
  mov    %rbp,%rdx
  lea    D11(%rip),%rsi
  mov    %rbx,%rdi
  call   <telnetd_output@plt>
  lea    D39(%rip),%rsi
  mov    %rbx,%rdi
  call   <telnetd_prompt@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D27
type_infered: string
name: disassemble_data
arguments: data_tag: D26
type_infered: string
name: disassemble_data
arguments: data_tag: D11
type_infered: string
name: disassemble_data
arguments: data_tag: D39
type_infered: string

tool: 

tool: D26: uIP command shell

tool: D11: Type '?' for help

tool: D39: uIP-0.9> 

assistant: ```c
void telnetd_connected(struct telnetd_state *s) {
  telnetd_output(s, "uIP command shell", "");
  telnetd_output(s, "Type '?' for help", "");
  telnetd_prompt(s, "uIP-0.9> ");
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<telnetd_connected>:
  endbr64
  push   %r12
  lea    D21(%rip),%r12
  lea    D20(%rip),%rsi
  push   %rbp
  mov    %r12,%rdx
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <telnetd_output@plt>
  mov    %rbp,%rdi
  mov    %r12,%rdx
  lea    D19(%rip),%rsi
  call   <telnetd_output@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  lea    D7(%rip),%rsi
  pop    %rbp
  pop    %r12
  jmp    1070 <telnetd_prompt@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D21
type_infered: string
name: retrieve_data
arguments: tag: D20
type_infered: string
name: retrieve_data
arguments: tag: D19
type_infered: string
name: retrieve_data
arguments: tag: D7
type_infered: string

tool: 

tool: D20: uIP command shell

tool: D19: Type '?' for help

tool: D7: uIP-0.9> 

assistant: ```c
void telnetd_connected(struct telnetd_state *s) {
  telnetd_output(s, "uIP command shell", "");
  telnetd_output(s, "Type '?' for help", "");
  telnetd_prompt(s, "uIP-0.9> ");
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<telnetd_connected>:
  endbr64
  push   %r12
  lea    D37(%rip),%r12
  lea    D31(%rip),%rsi
  push   %rbp
  mov    %r12,%rdx
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <telnetd_output@plt>
  mov    %rbp,%rdi
  mov    %r12,%rdx
  lea    D13(%rip),%rsi
  call   <telnetd_output@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  lea    D15(%rip),%rsi
  pop    %rbp
  pop    %r12
  jmp    1070 <telnetd_prompt@plt>
```

tool_calls: name: read_data
arguments: label: D37
type: string
name: read_data
arguments: label: D31
type: string
name: read_data
arguments: label: D13
type: string
name: read_data
arguments: label: D15
type: string

tool: 

tool: D31: uIP command shell

tool: D13: Type '?' for help

tool: D15: uIP-0.9> 

assistant: ```c
void telnetd_connected(struct telnetd_state *s) {
  telnetd_output(s, "uIP command shell", "");
  telnetd_output(s, "Type '?' for help", "");
  telnetd_prompt(s, "uIP-0.9> ");
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<MapForward>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,%eax
  mov    %esi,%edx
  mov    %dx,-0x1c(%rbp)
  mov    %ax,-0x20(%rbp)
  movw   $0x0,-0x4(%rbp)
  jmp    L20
L9:
  movw   $0x0,-0x2(%rbp)
  jmp    L50
L31:
  movzwl -0x4(%rbp),%edx
  movzwl -0x2(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  movzwl -0x2(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L8
  movzwl -0x2(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x2(%rbp)
L50:
  movzwl -0x2(%rbp),%eax
  cmp    -0x20(%rbp),%ax
  jb     L31
  movzwl -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  jmp    L16
L8:
  nop
  movzwl -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x4(%rbp)
L20:
  movzwl -0x1c(%rbp),%eax
  movzwl -0x20(%rbp),%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  movzwl -0x4(%rbp),%eax
  cmp    %eax,%edx
  jge    L9
  mov    $0x0,%eax
L16:
  pop    %rbp
  ret
```

assistant: ```c
unsigned char *MapForward(unsigned char *pMapData, unsigned short MapDataLength, unsigned char *pMapPoints, unsigned short MapPointsLength) {
  unsigned short DataIndex;
  unsigned short MapPointIndex;
  for (DataIndex = 0; DataIndex < MapDataLength - MapPointsLength + 1; DataIndex++) {
    for (MapPointIndex = 0; MapPointIndex < MapPointsLength; MapPointIndex++) {
      if (pMapData[DataIndex + MapPointIndex] != pMapPoints[MapPointIndex]) {
        goto PICK_NEXT_FMAPDATA;
      }
    }
    return (&pMapData[DataIndex]);
  PICK_NEXT_FMAPDATA:;
  }
  return (NULL);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<MapForward>:
  endbr64
  mov    %rdi,%rax
  mov    %ecx,%r8d
  movzwl %si,%esi
  movzwl %cx,%ecx
  mov    $0x0,%r9d
  mov    $0x0,%edi
  sub    %ecx,%esi
  js     L8
L29:
  test   %r8w,%r8w
  je     L27
  mov    $0x0,%ecx
  movslq %edi,%rdi
  add    %rax,%rdi
L30:
  movzbl (%rdx,%rcx,1),%r10d
  cmp    %r10b,(%rdi,%rcx,1)
  jne    L43
  add    $0x1,%rcx
  cmp    %cx,%r8w
  ja     L30
L27:
  movzwl %r9w,%r9d
  add    %r9,%rax
  ret
L8:
  mov    $0x0,%eax
  ret
L43:
  add    $0x1,%r9d
  movzwl %r9w,%edi
  cmp    %esi,%edi
  jle    L29
  mov    $0x0,%eax
  ret
```

assistant: ```c
unsigned char *MapForward(unsigned char *pMapData, unsigned short MapDataLength, unsigned char *pMapPoints, unsigned short MapPointsLength) {
  unsigned short DataIndex;
  unsigned short MapPointIndex;
  for (DataIndex = 0; DataIndex < MapDataLength - MapPointsLength + 1; DataIndex++) {
    for (MapPointIndex = 0; MapPointIndex < MapPointsLength; MapPointIndex++) {
      if (pMapData[DataIndex + MapPointIndex] != pMapPoints[MapPointIndex]) {
        goto PICK_NEXT_FMAPDATA;
      }
    }
    return (&pMapData[DataIndex]);
  PICK_NEXT_FMAPDATA:;
  }
  return (NULL);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<MapForward>:
  endbr64
  mov    %ecx,%r8d
  movzwl %si,%esi
  movzwl %cx,%ecx
  mov    %rdi,%rax
  xor    %r9d,%r9d
  xor    %edi,%edi
  sub    %ecx,%esi
  js     L42
L1:
  test   %r8w,%r8w
  je     L27
  xor    %ecx,%ecx
  add    %rax,%rdi
  jmp    L39
  cs nopw 0x0(%rax,%rax,1)
L16:
  add    $0x1,%rcx
  cmp    %cx,%r8w
  jbe    L27
L39:
  movzbl (%rdx,%rcx,1),%r10d
  cmp    %r10b,(%rdi,%rcx,1)
  je     L16
  add    $0x1,%r9d
  movzwl %r9w,%edi
  cmp    %esi,%edi
  jle    L1
L42:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax)
L27:
  movzwl %r9w,%r9d
  add    %r9,%rax
  ret
```

assistant: ```c
unsigned char *MapForward(unsigned char *pMapData, unsigned short MapDataLength, unsigned char *pMapPoints, unsigned short MapPointsLength) {
  unsigned short DataIndex;
  unsigned short MapPointIndex;
  for (DataIndex = 0; DataIndex < MapDataLength - MapPointsLength + 1; DataIndex++) {
    for (MapPointIndex = 0; MapPointIndex < MapPointsLength; MapPointIndex++) {
      if (pMapData[DataIndex + MapPointIndex] != pMapPoints[MapPointIndex]) {
        goto PICK_NEXT_FMAPDATA;
      }
    }
    return (&pMapData[DataIndex]);
  PICK_NEXT_FMAPDATA:;
  }
  return (NULL);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<MapForward>:
  endbr64
  mov    %ecx,%r8d
  movzwl %si,%esi
  movzwl %cx,%ecx
  mov    %rdi,%rax
  xor    %r9d,%r9d
  xor    %edi,%edi
  sub    %ecx,%esi
  js     L30
L10:
  test   %r8w,%r8w
  je     L42
  xor    %ecx,%ecx
  add    %rax,%rdi
  jmp    L15
  cs nopw 0x0(%rax,%rax,1)
L43:
  add    $0x1,%rcx
  cmp    %cx,%r8w
  jbe    L42
L15:
  movzbl (%rdx,%rcx,1),%r10d
  cmp    %r10b,(%rdi,%rcx,1)
  je     L43
  add    $0x1,%r9d
  movzwl %r9w,%edi
  cmp    %esi,%edi
  jle    L10
L30:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax)
L42:
  movzwl %r9w,%r9d
  add    %r9,%rax
  ret
```

assistant: ```c
unsigned char *MapForward(unsigned char *pMapData, unsigned short MapDataLength, unsigned char *pMapPoints, unsigned short MapPointsLength) {
  unsigned short DataIndex;
  unsigned short MapPointIndex;
  for (DataIndex = 0; DataIndex < MapDataLength - MapPointsLength + 1; DataIndex++) {
    for (MapPointIndex = 0; MapPointIndex < MapPointsLength; MapPointIndex++) {
      if (pMapData[DataIndex + MapPointIndex] != pMapPoints[MapPointIndex]) {
        goto PICK_NEXT_FMAPDATA;
      }
    }
    return (&pMapData[DataIndex]);
  PICK_NEXT_FMAPDATA:;
  }
  return (NULL);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<build_xlaw_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L51
L32:
  cmpl   $0x7f,-0x14(%rbp)
  je     L15
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  xor    %edx,%eax
  movzbl %al,%eax
  mov    -0x30(%rbp),%rdx
  mov    %eax,%edi
  call   *%rdx
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  xor    %edx,%eax
  movzbl %al,%eax
  mov    -0x30(%rbp),%rdx
  mov    %eax,%edi
  call   *%rdx
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  add    $0x4,%eax
  sar    $0x3,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L50
L15:
  movl   $0x2000,-0xc(%rbp)
  jmp    L50
L16:
  mov    -0x10(%rbp),%eax
  add    $0x2000,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  xor    -0x34(%rbp),%eax
  mov    %eax,(%rdx)
  cmpl   $0x0,-0x10(%rbp)
  jle    L23
  mov    -0x34(%rbp),%eax
  xor    $0x80,%al
  mov    $0x2000,%edx
  sub    -0x10(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  xor    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
L23:
  addl   $0x1,-0x10(%rbp)
L50:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L16
  addl   $0x1,-0x14(%rbp)
L51:
  cmpl   $0x7f,-0x14(%rbp)
  jle    L32
  mov    -0x28(%rbp),%rax
  mov    0x4(%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
__attribute__((cold)) void build_xlaw_table(uint8_t *linear_to_xlaw, int (*xlaw2linear)(unsigned char), int mask) {
  int i, j, v, v1, v2;
  j = 0;
  for (i = 0; i < 128; i++) {
    if (i != 127) {
      v1 = xlaw2linear(i ^ mask);
      v2 = xlaw2linear((i + 1) ^ mask);
      v = (v1 + v2 + 4) >> 3;
    } else {
      v = 8192;
    }
    for (; j < v; j++) {
      linear_to_xlaw[8192 + j] = (i ^ mask);
      if (j > 0)
        linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80));
    }
  }
  linear_to_xlaw[0] = linear_to_xlaw[1];
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<build_xlaw_table>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r13
  mov    %edx,0xc(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%ebx
  mov    $0x2000,%r15d
L18:
  mov    0xc(%rsp),%dil
  xor    %ebx,%edi
  movzbl %dil,%edi
  call   *%r13
  mov    %eax,%r14d
  lea    0x1(%rbx),%edi
  xor    0xc(%rsp),%edi
  movzbl %dil,%edi
  call   *%r13
  lea    0x4(%r14,%rax,1),%eax
  sar    $0x3,%eax
  jmp    L48
L47:
  mov    %r15d,%eax
  jne    L18
L48:
  movslq %r12d,%rdx
  mov    0xc(%rsp),%esi
  xor    %ebx,%esi
  mov    %esi,%edi
  xor    $0x80,%dil
  jmp    L49
L45:
  mov    %esi,0x8000(%rbp,%rdx,4)
  test   %edx,%edx
  jle    L8
  mov    %r15d,%ecx
  sub    %edx,%ecx
  movslq %ecx,%rcx
  mov    %edi,0x0(%rbp,%rcx,4)
L8:
  inc    %rdx
L49:
  cmp    %edx,%eax
  jg     L45
  mov    %eax,%edx
  sub    %r12d,%edx
  cmp    %r12d,%eax
  mov    $0x0,%eax
  cmovl  %eax,%edx
  add    %edx,%r12d
  inc    %ebx
  cmp    $0x7f,%ebx
  jle    L47
  mov    0x4(%rbp),%eax
  mov    %eax,0x0(%rbp)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
__attribute__((cold)) void build_xlaw_table(uint8_t *linear_to_xlaw, int (*xlaw2linear)(unsigned char), int mask) {
  int i, j, v, v1, v2;
  j = 0;
  for (i = 0; i < 128; i++) {
    if (i != 127) {
      v1 = xlaw2linear(i ^ mask);
      v2 = xlaw2linear((i + 1) ^ mask);
      v = (v1 + v2 + 4) >> 3;
    } else {
      v = 8192;
    }
    for (; j < v; j++) {
      linear_to_xlaw[8192 + j] = (i ^ mask);
      if (j > 0)
        linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80));
    }
  }
  linear_to_xlaw[0] = linear_to_xlaw[1];
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<build_xlaw_table>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  push   %rcx
L14:
  mov    $0x2000,%eax
  cmp    $0x7f,%ebx
  je     L22
  mov    %ebx,%edi
  xor    %r12d,%edi
  movzbl %dil,%edi
  call   *%r13
  lea    0x1(%rbx),%edi
  xor    %r12d,%edi
  mov    %eax,%r14d
  movzbl %dil,%edi
  call   *%r13
  lea    0x4(%r14,%rax,1),%eax
  sar    $0x3,%eax
L22:
  mov    %r12d,%esi
  movslq %r15d,%rdx
  xor    %ebx,%esi
  mov    %esi,%edi
  xor    $0x80,%dil
L4:
  cmp    %edx,%eax
  jle    L13
  mov    %esi,0x8000(%rbp,%rdx,4)
  test   %edx,%edx
  je     L5
  mov    $0x2000,%ecx
  sub    %edx,%ecx
  movslq %ecx,%rcx
  mov    %edi,0x0(%rbp,%rcx,4)
L5:
  inc    %rdx
  jmp    L4
L13:
  mov    %eax,%edx
  sub    %r15d,%edx
  cmp    %r15d,%eax
  mov    $0x0,%eax
  cmovl  %eax,%edx
  inc    %ebx
  add    %edx,%r15d
  cmp    $0x80,%ebx
  jne    L14
  mov    0x4(%rbp),%eax
  mov    %eax,0x0(%rbp)
  pop    %rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
__attribute__((cold)) void build_xlaw_table(uint8_t *linear_to_xlaw, int (*xlaw2linear)(unsigned char), int mask) {
  int i, j, v, v1, v2;
  j = 0;
  for (i = 0; i < 128; i++) {
    if (i != 127) {
      v1 = xlaw2linear(i ^ mask);
      v2 = xlaw2linear((i + 1) ^ mask);
      v = (v1 + v2 + 4) >> 3;
    } else {
      v = 8192;
    }
    for (; j < v; j++) {
      linear_to_xlaw[8192 + j] = (i ^ mask);
      if (j > 0)
        linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80));
    }
  }
  linear_to_xlaw[0] = linear_to_xlaw[1];
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<build_xlaw_table>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  push   %rcx
L39:
  mov    $0x2000,%eax
  cmp    $0x7f,%ebx
  je     L17
  mov    %ebx,%edi
  xor    %r12d,%edi
  movzbl %dil,%edi
  call   *%r13
  lea    0x1(%rbx),%edi
  xor    %r12d,%edi
  mov    %eax,%r14d
  movzbl %dil,%edi
  call   *%r13
  lea    0x4(%r14,%rax,1),%eax
  sar    $0x3,%eax
L17:
  mov    %r12d,%esi
  movslq %r15d,%rdx
  xor    %ebx,%esi
  mov    %esi,%edi
  xor    $0x80,%dil
L46:
  cmp    %edx,%eax
  jle    L22
  mov    %esi,0x8000(%rbp,%rdx,4)
  test   %edx,%edx
  je     L25
  mov    $0x2000,%ecx
  sub    %edx,%ecx
  movslq %ecx,%rcx
  mov    %edi,0x0(%rbp,%rcx,4)
L25:
  inc    %rdx
  jmp    L46
L22:
  mov    %eax,%edx
  sub    %r15d,%edx
  cmp    %r15d,%eax
  mov    $0x0,%eax
  cmovl  %eax,%edx
  inc    %ebx
  add    %edx,%r15d
  cmp    $0x80,%ebx
  jne    L39
  mov    0x4(%rbp),%eax
  mov    %eax,0x0(%rbp)
  pop    %rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
__attribute__((cold)) void build_xlaw_table(uint8_t *linear_to_xlaw, int (*xlaw2linear)(unsigned char), int mask) {
  int i, j, v, v1, v2;
  j = 0;
  for (i = 0; i < 128; i++) {
    if (i != 127) {
      v1 = xlaw2linear(i ^ mask);
      v2 = xlaw2linear((i + 1) ^ mask);
      v = (v1 + v2 + 4) >> 3;
    } else {
      v = 8192;
    }
    for (; j < v; j++) {
      linear_to_xlaw[8192 + j] = (i ^ mask);
      if (j > 0)
        linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80));
    }
  }
  linear_to_xlaw[0] = linear_to_xlaw[1];
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<inet_nsap_addr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  movq   $0x0,-0x18(%rbp)
  jmp    L103
L133:
  cmpb   $0x2e,-0x1a(%rbp)
  je     L103
  cmpb   $0x2b,-0x1a(%rbp)
  je     L103
  cmpb   $0x2f,-0x1a(%rbp)
  jne    L12
  jmp    L103
L12:
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <isascii@plt>
  test   %eax,%eax
  jne    L8
  mov    $0x0,%eax
  jmp    L98
L8:
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,-0x1a(%rbp)
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L132
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <xtob@plt>
  mov    %al,-0x19(%rbp)
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x1a(%rbp)
  cmpb   $0x0,-0x1a(%rbp)
  je     L143
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,-0x1a(%rbp)
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L62
  movsbl -0x19(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ebx
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <xtob@plt>
  mov    %eax,%ecx
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  or     %ecx,%ebx
  mov    %ebx,%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x18(%rbp)
  jmp    L103
L62:
  mov    $0x0,%eax
  jmp    L98
L143:
  mov    $0x0,%eax
  jmp    L98
L132:
  mov    $0x0,%eax
  jmp    L98
L103:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x1a(%rbp)
  cmpb   $0x0,-0x1a(%rbp)
  je     L71
  mov    -0x34(%rbp),%eax
  cltq
  cmp    %rax,-0x18(%rbp)
  jl     L133
L71:
  mov    -0x18(%rbp),%rax
L98:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
u_int inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) {
  u_char c, nib;
  u_int len = 0;
  while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
    if (c == '.' || c == '+' || c == '/')
      continue;
    if (!isascii(c))
      return (0);
    c = toupper(c);
    if (isxdigit(c)) {
      nib = xtob(c);
      c = *ascii++;
      if (c != '\0') {
        c = toupper(c);
        if (isxdigit(c)) {
          *binary++ = (nib << 4) | xtob(c);
          len++;
        } else
          return (0);
      } else
        return (0);
    } else
      return (0);
  }
  return (len);
}
```