ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    D5(%rip),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%edi
  call   <err_check@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(void) {
  errno = 0;
  err_check(errno);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    D5(%rip),%rax
  xor    %edi,%edi
  movq   $0x0,(%rax)
  call   <err_check@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(void) {
  errno = 0;
  err_check(errno);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    D8(%rip),%rax
  xor    %edi,%edi
  movq   $0x0,(%rax)
  call   <err_check@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(void) {
  errno = 0;
  err_check(errno);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<initcol>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  add    $0x100,%rax
  mov    $0xe2d,%esi
  mov    %rax,%rdi
  call   <scaleidctqtab@plt>
  mov    -0x8(%rbp),%rax
  add    $0x200,%rax
  mov    $0xb37,%esi
  mov    %rax,%rdi
  call   <scaleidctqtab@plt>
  nop
  leave
  ret
```

assistant: ```c
void initcol(int q[][64]) {
  scaleidctqtab(q[1], ((int)((1.77200) * (1 << 11) + .5)));
  scaleidctqtab(q[2], ((int)((1.40200) * (1 << 11) + .5)));
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<initcol>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    0x100(%rdi),%rdi
  mov    $0xe2d,%esi
  call   <scaleidctqtab@plt>
  lea    0x200(%rbx),%rdi
  mov    $0xb37,%esi
  call   <scaleidctqtab@plt>
  pop    %rbx
  ret
```

assistant: ```c
void initcol(int q[][64]) {
  scaleidctqtab(q[1], ((int)((1.77200) * (1 << 11) + .5)));
  scaleidctqtab(q[2], ((int)((1.40200) * (1 << 11) + .5)));
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<initcol>:
  endbr64
  push   %rbx
  mov    $0xe2d,%esi
  mov    %rdi,%rbx
  lea    0x100(%rdi),%rdi
  call   <scaleidctqtab@plt>
  lea    0x200(%rbx),%rdi
  mov    $0xb37,%esi
  pop    %rbx
  jmp    1050 <scaleidctqtab@plt>
```

assistant: ```c
void initcol(int q[][64]) {
  scaleidctqtab(q[1], ((int)((1.77200) * (1 << 11) + .5)));
  scaleidctqtab(q[2], ((int)((1.40200) * (1 << 11) + .5)));
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<initcol>:
  endbr64
  push   %rbx
  mov    $0xe2d,%esi
  mov    %rdi,%rbx
  lea    0x100(%rdi),%rdi
  call   <scaleidctqtab@plt>
  lea    0x200(%rbx),%rdi
  mov    $0xb37,%esi
  pop    %rbx
  jmp    1050 <scaleidctqtab@plt>
```

assistant: ```c
void initcol(int q[][64]) {
  scaleidctqtab(q[1], ((int)((1.77200) * (1 << 11) + .5)));
  scaleidctqtab(q[2], ((int)((1.40200) * (1 << 11) + .5)));
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<yas_lis331dl_power_down>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x7,%esi
  mov    $0x20,%edi
  call   <yas_lis331dl_write_reg_byte@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int yas_lis331dl_power_down(void) {
  yas_lis331dl_write_reg_byte(0x20, 0x07);
  return (0);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<yas_lis331dl_power_down>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x7,%esi
  mov    $0x20,%edi
  call   <yas_lis331dl_write_reg_byte@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int yas_lis331dl_power_down(void) {
  yas_lis331dl_write_reg_byte(0x20, 0x07);
  return (0);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<yas_lis331dl_power_down>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x7,%esi
  mov    $0x20,%edi
  call   <yas_lis331dl_write_reg_byte@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int yas_lis331dl_power_down(void) {
  yas_lis331dl_write_reg_byte(0x20, 0x07);
  return (0);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<yas_lis331dl_power_down>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x7,%esi
  mov    $0x20,%edi
  call   <yas_lis331dl_write_reg_byte@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int yas_lis331dl_power_down(void) {
  yas_lis331dl_write_reg_byte(0x20, 0x07);
  return (0);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<print_cells>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L30
L36:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L19
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L29
L19:
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L29:
  addl   $0x1,-0x4(%rbp)
L30:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L36
  nop
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D28
data_type: string
name: disassemble_data
arguments: tag: D20
data_type: string
name: disassemble_data
arguments: tag: D11
data_type: string

tool: D28: 


tool: D20: .

tool: D11: *

assistant: ```c
void print_cells(int *y, int length) {
  int j = 0;
  printf("\n");
  while (j < length) {
    if (*(y + j) == 0)
      printf(".");
    else
      printf("*");
    j++;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<print_cells>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %esi,%ebp
  lea    D12(%rip),%rdi
  call   <printf@plt>
  test   %ebp,%ebp
  jle    L45
  mov    %r12,%rbx
  lea    -0x1(%rbp),%eax
  lea    0x4(%r12,%rax,4),%rbp
  lea    D4(%rip),%r13
  lea    D9(%rip),%r12
  jmp    L37
L23:
  mov    %r13,%rdi
  call   <printf@plt>
L9:
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  je     L45
L37:
  cmpl   $0x0,(%rbx)
  jne    L23
  mov    %r12,%rdi
  call   <printf@plt>
  jmp    L9
L45:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: parse_data
arguments: label: D12
datatype: string
name: parse_data
arguments: label: D4
datatype: string
name: parse_data
arguments: label: D9
datatype: string

tool: D12: 


tool: D4: *

tool: D9: .

assistant: ```c
void print_cells(int *y, int length) {
  int j = 0;
  printf("\n");
  while (j < length) {
    if (*(y + j) == 0)
      printf(".");
    else
      printf("*");
    j++;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<print_cells>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  lea    D19(%rip),%rdi
  sub    $0x8,%rsp
  call   <printf@plt>
  test   %ebp,%ebp
  jle    L36
  lea    -0x1(%rbp),%eax
  lea    D18(%rip),%r13
  lea    0x4(%rbx,%rax,4),%rbp
  lea    D28(%rip),%r12
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L30:
  mov    %r12,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  je     L36
L41:
  mov    (%rbx),%eax
  test   %eax,%eax
  je     L30
  mov    %r13,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L41
L36:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D19
type: string
name: retrieve_data
arguments: data_label: D18
type: string
name: retrieve_data
arguments: data_label: D28
type: string

tool: D19: 


tool: D18: *

tool: D28: .

assistant: ```c
void print_cells(int *y, int length) {
  int j = 0;
  printf("\n");
  while (j < length) {
    if (*(y + j) == 0)
      printf(".");
    else
      printf("*");
    j++;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<print_cells>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  lea    D19(%rip),%rdi
  sub    $0x8,%rsp
  call   <printf@plt>
  test   %ebp,%ebp
  jle    L2
  lea    -0x1(%rbp),%eax
  lea    D3(%rip),%r13
  lea    0x4(%rbx,%rax,4),%rbp
  lea    D18(%rip),%r12
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L48:
  mov    %r12,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  je     L2
L4:
  mov    (%rbx),%eax
  test   %eax,%eax
  je     L48
  mov    %r13,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L4
L2:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D19
data_type: string
name: parse_data
arguments: data_tag: D3
data_type: string
name: parse_data
arguments: data_tag: D18
data_type: string

tool: D19: 


tool: D3: *

tool: D18: .

assistant: ```c
void print_cells(int *y, int length) {
  int j = 0;
  printf("\n");
  while (j < length) {
    if (*(y + j) == 0)
      printf(".");
    else
      printf("*");
    j++;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<hash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L3
L9:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x5,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
L3:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L9
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  imul   $0x446f8657,%rax,%rax
  shr    $0x20,%rax
  mov    %rax,%rcx
  mov    %edx,%eax
  sub    %ecx,%eax
  shr    %eax
  add    %ecx,%eax
  shr    $0x6,%eax
  imul   $0x65,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return (hashval % 101);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<hash>:
  endbr64
  movzbl (%rdi),%eax
  test   %al,%al
  je     L7
  mov    $0x0,%ecx
L2:
  mov    %ecx,%edx
  shl    $0x5,%edx
  sub    %ecx,%edx
  movsbl %al,%eax
  lea    (%rax,%rdx,1),%ecx
  add    $0x1,%rdi
  movzbl (%rdi),%eax
  test   %al,%al
  jne    L2
L11:
  mov    %ecx,%edx
  imul   $0x446f8657,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %ecx,%eax
  sub    %edx,%eax
  shr    %eax
  add    %edx,%eax
  shr    $0x6,%eax
  imul   $0x65,%eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  ret
L7:
  mov    $0x0,%ecx
  jmp    L11
```

assistant: ```c
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return (hashval % 101);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<hash>:
  endbr64
  movsbl (%rdi),%eax
  test   %al,%al
  je     L3
  xor    %ecx,%ecx
  nopl   (%rax)
L8:
  mov    %ecx,%edx
  add    $0x1,%rdi
  shl    $0x5,%edx
  sub    %ecx,%edx
  lea    (%rax,%rdx,1),%ecx
  movsbl (%rdi),%eax
  test   %al,%al
  jne    L8
  mov    %ecx,%edx
  mov    %ecx,%eax
  imul   $0x446f8657,%rdx,%rdx
  shr    $0x20,%rdx
  sub    %edx,%eax
  shr    %eax
  add    %edx,%eax
  shr    $0x6,%eax
  imul   $0x65,%eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  ret
  nopl   (%rax)
L3:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return (hashval % 101);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<hash>:
  endbr64
  movsbl (%rdi),%eax
  test   %al,%al
  je     L15
  xor    %ecx,%ecx
  nopl   (%rax)
L4:
  mov    %ecx,%edx
  add    $0x1,%rdi
  shl    $0x5,%edx
  sub    %ecx,%edx
  lea    (%rax,%rdx,1),%ecx
  movsbl (%rdi),%eax
  test   %al,%al
  jne    L4
  mov    %ecx,%edx
  mov    %ecx,%eax
  imul   $0x446f8657,%rdx,%rdx
  shr    $0x20,%rdx
  sub    %edx,%eax
  shr    %eax
  add    %edx,%eax
  shr    $0x6,%eax
  imul   $0x65,%eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  ret
  nopl   (%rax)
L15:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return (hashval % 101);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<hnoptput>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    %dl,(%rax)
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <hnput@plt>
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  leave
  ret
```

assistant: ```c
unsigned char *hnoptput(unsigned char *p, int opt, long long data, size_t len) {
  *p++ = opt;
  *p++ = (unsigned char)len;
  hnput(p, data, len);
  return p + len;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<hnoptput>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %esi,%eax
  mov    %rdx,%rsi
  mov    %rcx,%rbx
  mov    %al,(%rdi)
  lea    0x2(%rdi),%rbp
  mov    %cl,0x1(%rdi)
  mov    %rcx,%rdx
  mov    %rbp,%rdi
  call   <hnput@plt>
  lea    0x0(%rbp,%rbx,1),%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned char *hnoptput(unsigned char *p, int opt, long long data, size_t len) {
  *p++ = opt;
  *p++ = (unsigned char)len;
  hnput(p, data, len);
  return p + len;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<hnoptput>:
  endbr64
  push   %rbp
  mov    %esi,%r8d
  lea    0x2(%rdi),%rbp
  mov    %rdx,%rsi
  push   %rbx
  mov    %rcx,%rdx
  mov    %rcx,%rbx
  sub    $0x8,%rsp
  mov    %r8b,(%rdi)
  mov    %cl,0x1(%rdi)
  mov    %rbp,%rdi
  call   <hnput@plt>
  add    $0x8,%rsp
  lea    0x0(%rbp,%rbx,1),%rax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned char *hnoptput(unsigned char *p, int opt, long long data, size_t len) {
  *p++ = opt;
  *p++ = (unsigned char)len;
  hnput(p, data, len);
  return p + len;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<hnoptput>:
  endbr64
  push   %rbp
  mov    %esi,%r8d
  lea    0x2(%rdi),%rbp
  mov    %rdx,%rsi
  push   %rbx
  mov    %rcx,%rdx
  mov    %rcx,%rbx
  sub    $0x8,%rsp
  mov    %r8b,(%rdi)
  mov    %cl,0x1(%rdi)
  mov    %rbp,%rdi
  call   <hnput@plt>
  add    $0x8,%rsp
  lea    0x0(%rbp,%rbx,1),%rax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned char *hnoptput(unsigned char *p, int opt, long long data, size_t len) {
  *p++ = opt;
  *p++ = (unsigned char)len;
  hnput(p, data, len);
  return p + len;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<NumberIO_StrToOctInt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rcx
  mov    %esi,%r13d
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%edx
  mov    %edx,%eax
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%rdi
  and    $0xfffffffffffff000,%rdi
  mov    %rsp,%rsi
  sub    %rdi,%rsi
L92:
  cmp    %rsi,%rsp
  je     L109
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L92
L109:
  mov    %rax,%rsi
  and    $0xfff,%esi
  sub    %rsi,%rsp
  test   %rsi,%rsi
  je     L18
  orq    $0x0,-0x8(%rsp,%rsi,1)
L18:
  mov    %rsp,%rbx
  mov    %rcx,%rsi
  mov    %rsp,%rdi
  call   <memcpy@plt>
  mov    %r13d,%ecx
  mov    %rsp,%rdx
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   <StrLib_StrRemoveWhitePrefix@plt>
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   <StrLib_StrLen@plt>
  test   %eax,%eax
  je     L35
  mov    %eax,%edi
  mov    $0x0,%edx
L22:
  mov    %edx,%ecx
  movzbl (%rbx,%rdx,1),%esi
  sub    $0x30,%esi
  cmp    $0x7,%sil
  jbe    L105
  add    $0x1,%rdx
  cmp    %rdi,%rdx
  jne    L22
L35:
  movl   $0x0,(%r12)
L41:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L102
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L105:
  movl   $0x0,(%r12)
  cmp    %edx,%eax
  jbe    L41
  mov    %edx,%edx
  add    %rbx,%rdx
  mov    $0x0,%edi
L116:
  movsbl (%rdx),%esi
  lea    -0x30(%rsi,%rdi,8),%edi
  cmp    %eax,%ecx
  je     L98
  add    $0x1,%ecx
  add    $0x1,%rdx
  mov    %ecx,%esi
  movzbl (%rbx,%rsi,1),%esi
  sub    $0x30,%esi
  cmp    $0x7,%sil
  jbe    L116
  mov    %edi,(%r12)
  jmp    L41
L98:
  mov    %edi,(%r12)
  jmp    L41
L102:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void NumberIO_StrToOctInt(char *a_, unsigned int _a_high, int *x) {
  unsigned int i;
  unsigned int ok;
  unsigned int higha;
  char a[_a_high + 1];
  memcpy(a, a_, _a_high + 1);
  StrLib_StrRemoveWhitePrefix((char *)a, _a_high, (char *)a, _a_high);
  higha = StrLib_StrLen((char *)a, _a_high);
  i = 0;
  ok = (1 == 1);
  while (ok) {
    if (i < higha) {
      if ((a[i] < '0') || (a[i] > '7')) {
        i += 1;
      } else {
        ok = (1 == 0);
      }
    } else {
      ok = (1 == 0);
    }
  }
  (*x) = 0;
  if (i < higha) {
    ok = (1 == 1);
    do {
      (*x) = (8 * (*x)) + ((int)(((unsigned int)(a[i])) - ((unsigned int)('0'))));
      if (i < higha) {
        i += 1;
        if ((a[i] < '0') || (a[i] > '7')) {
          ok = (1 == 0);
        }
      } else {
        ok = (1 == 0);
      }
    } while (!(!ok));
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<NumberIO_StrToOctInt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%eax
  mov    %rsp,%rcx
  mov    %rax,%rdx
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L38
L22:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L22
L38:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L96
L123:
  mov    %rdi,%rsi
  mov    %rsp,%rdi
  mov    %rsp,%rbx
  call   <memcpy@plt>
  mov    %r13d,%esi
  mov    %rsp,%rdi
  mov    %r13d,%ecx
  mov    %rsp,%rdx
  call   <StrLib_StrRemoveWhitePrefix@plt>
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   <StrLib_StrLen@plt>
  test   %eax,%eax
  je     L87
  mov    %eax,%r8d
  xor    %edx,%edx
  jmp    L98
  nopl   0x0(%rax,%rax,1)
L61:
  add    $0x1,%rdx
  cmp    %rdx,%r8
  je     L87
L98:
  movsbl (%rbx,%rdx,1),%ecx
  mov    %edx,%esi
  lea    -0x30(%rcx),%edi
  cmp    $0x7,%dil
  ja     L61
  xor    %edx,%edx
  jmp    L124
  nopl   0x0(%rax)
L33:
  lea    0x1(%rsi),%ecx
  mov    %rcx,%rsi
  movsbl (%rbx,%rcx,1),%ecx
  lea    -0x30(%rcx),%edi
  cmp    $0x7,%dil
  ja     L9
L124:
  lea    -0x30(%rcx,%rdx,8),%edx
  cmp    %eax,%esi
  jb     L33
L9:
  mov    %edx,(%r12)
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L99
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
  nopl   0x0(%rax)
L87:
  xor    %edx,%edx
  jmp    L9
  nopl   0x0(%rax)
L96:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L123
L99:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void NumberIO_StrToOctInt(char *a_, unsigned int _a_high, int *x) {
  unsigned int i;
  unsigned int ok;
  unsigned int higha;
  char a[_a_high + 1];
  memcpy(a, a_, _a_high + 1);
  StrLib_StrRemoveWhitePrefix((char *)a, _a_high, (char *)a, _a_high);
  higha = StrLib_StrLen((char *)a, _a_high);
  i = 0;
  ok = (1 == 1);
  while (ok) {
    if (i < higha) {
      if ((a[i] < '0') || (a[i] > '7')) {
        i += 1;
      } else {
        ok = (1 == 0);
      }
    } else {
      ok = (1 == 0);
    }
  }
  (*x) = 0;
  if (i < higha) {
    ok = (1 == 1);
    do {
      (*x) = (8 * (*x)) + ((int)(((unsigned int)(a[i])) - ((unsigned int)('0'))));
      if (i < higha) {
        i += 1;
        if ((a[i] < '0') || (a[i] > '7')) {
          ok = (1 == 0);
        }
      } else {
        ok = (1 == 0);
      }
    } while (!(!ok));
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<NumberIO_StrToOctInt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%eax
  mov    %rsp,%rcx
  mov    %rax,%rdx
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L62
L78:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L78
L62:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L21
L30:
  mov    %rdi,%rsi
  mov    %rsp,%rdi
  mov    %rsp,%rbx
  call   <memcpy@plt>
  mov    %r13d,%esi
  mov    %rsp,%rdi
  mov    %r13d,%ecx
  mov    %rsp,%rdx
  call   <StrLib_StrRemoveWhitePrefix@plt>
  mov    %r13d,%esi
  mov    %rsp,%rdi
  call   <StrLib_StrLen@plt>
  test   %eax,%eax
  je     L25
  mov    %eax,%edi
  xor    %edx,%edx
  jmp    L14
  nopw   0x0(%rax,%rax,1)
L22:
  add    $0x1,%rdx
  cmp    %rdx,%rdi
  je     L25
L14:
  movzbl (%rbx,%rdx,1),%ecx
  mov    %edx,%esi
  sub    $0x30,%ecx
  cmp    $0x7,%cl
  ja     L22
  add    %rbx,%rdx
  xor    %edi,%edi
  jmp    L59
  xchg   %ax,%ax
L69:
  lea    0x1(%rsi),%ecx
  add    $0x1,%rdx
  mov    %rcx,%rsi
  movzbl (%rbx,%rcx,1),%ecx
  sub    $0x30,%ecx
  cmp    $0x7,%cl
  ja     L89
L59:
  movsbl (%rdx),%ecx
  lea    -0x30(%rcx,%rdi,8),%edi
  cmp    %eax,%esi
  jb     L69
L89:
  mov    %edi,(%r12)
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
  nop
L25:
  xor    %edi,%edi
  jmp    L89
  nopl   0x0(%rax)
L21:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L30
L27:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void NumberIO_StrToOctInt(char *a_, unsigned int _a_high, int *x) {
  unsigned int i;
  unsigned int ok;
  unsigned int higha;
  char a[_a_high + 1];
  memcpy(a, a_, _a_high + 1);
  StrLib_StrRemoveWhitePrefix((char *)a, _a_high, (char *)a, _a_high);
  higha = StrLib_StrLen((char *)a, _a_high);
  i = 0;
  ok = (1 == 1);
  while (ok) {
    if (i < higha) {
      if ((a[i] < '0') || (a[i] > '7')) {
        i += 1;
      } else {
        ok = (1 == 0);
      }
    } else {
      ok = (1 == 0);
    }
  }
  (*x) = 0;
  if (i < higha) {
    ok = (1 == 1);
    do {
      (*x) = (8 * (*x)) + ((int)(((unsigned int)(a[i])) - ((unsigned int)('0'))));
      if (i < higha) {
        i += 1;
        if ((a[i] < '0') || (a[i] > '7')) {
          ok = (1 == 0);
        }
      } else {
        ok = (1 == 0);
      }
    } while (!(!ok));
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<swap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  je     L8
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L15
L8:
  nop
L15:
  pop    %rbp
  ret
```

assistant: ```c
void swap(int *array, int i, int j) {
  if (i == j)
    return;
  int t = array[i];
  array[i] = array[j];
  array[j] = t;
}
```