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

```asm
<UTIL_itoa>:
  endbr64
  push   %r13
  mov    %edi,%r13d
  mov    $0x21,%edi
  push   %r12
  sub    $0x8,%rsp
  call   <UTIL_mallocStr@plt>
  mov    %r13d,%edx
  lea    D5(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <sprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: unpack_data
arguments: tag: D5
type_guessed: string

tool: D5: %d

assistant: ```c
char *UTIL_itoa(int num) {
  char *str = UTIL_mallocStr(33);
  sprintf(str, "%d", num);
  return str;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<test_seaway>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <test_seaway1_1@plt>
  mov    $0x0,%eax
  call   <test_seaway1_2@plt>
  mov    $0x0,%eax
  call   <test_seaway1_3@plt>
  mov    $0x0,%eax
  call   <test_seaway2_1@plt>
  mov    $0x0,%eax
  call   <test_seaway2_2@plt>
  mov    $0x0,%eax
  call   <test_seaway32_1@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void test_seaway() {
  test_seaway1_1();
  test_seaway1_2();
  test_seaway1_3();
  test_seaway2_1();
  test_seaway2_2();
  test_seaway32_1();
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<test_seaway>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <test_seaway1_1@plt>
  mov    $0x0,%eax
  call   <test_seaway1_2@plt>
  mov    $0x0,%eax
  call   <test_seaway1_3@plt>
  mov    $0x0,%eax
  call   <test_seaway2_1@plt>
  mov    $0x0,%eax
  call   <test_seaway2_2@plt>
  mov    $0x0,%eax
  call   <test_seaway32_1@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void test_seaway() {
  test_seaway1_1();
  test_seaway1_2();
  test_seaway1_3();
  test_seaway2_1();
  test_seaway2_2();
  test_seaway32_1();
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<test_seaway>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <test_seaway1_1@plt>
  xor    %eax,%eax
  call   <test_seaway1_2@plt>
  xor    %eax,%eax
  call   <test_seaway1_3@plt>
  xor    %eax,%eax
  call   <test_seaway2_1@plt>
  xor    %eax,%eax
  call   <test_seaway2_2@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    10a0 <test_seaway32_1@plt>
```

assistant: ```c
void test_seaway() {
  test_seaway1_1();
  test_seaway1_2();
  test_seaway1_3();
  test_seaway2_1();
  test_seaway2_2();
  test_seaway32_1();
}
```
user: What is the c source code of the assembly code below:

```asm
<test_seaway>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <test_seaway1_1@plt>
  xor    %eax,%eax
  call   <test_seaway1_2@plt>
  xor    %eax,%eax
  call   <test_seaway1_3@plt>
  xor    %eax,%eax
  call   <test_seaway2_1@plt>
  xor    %eax,%eax
  call   <test_seaway2_2@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    10a0 <test_seaway32_1@plt>
```

assistant: ```c
void test_seaway() {
  test_seaway1_1();
  test_seaway1_2();
  test_seaway1_3();
  test_seaway2_1();
  test_seaway2_2();
  test_seaway32_1();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x0,-0x4(%rbp)
  jmp    L52
L13:
  cmpl   $0x0,-0x4(%rbp)
  je     L45
  cmpl   $0x0,-0x4(%rbp)
  js     L65
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  cmp    $0x1,%eax
  ja     L65
  jmp    L60
L45:
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L46
L60:
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L65:
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L46:
  addl   $0x1,-0x4(%rbp)
L52:
  cmpl   $0x2,-0x4(%rbp)
  jle    L13
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D23
datatype: string
name: extract_symbolic_data
arguments: tag: D37
datatype: string
name: extract_symbolic_data
arguments: tag: D4
datatype: string
name: extract_symbolic_data
arguments: tag: D11
datatype: string

tool: D23: i is 0


tool: D37: i is 1 or 2

tool: D4: this is default block

tool: D11: finish

assistant: ```c
int main() {
  for (int i = 0; i < 3; i++) {
    switch (i) {
    case 0:
      printf("i is 0\n");
      break;
    case 1:
    case 2:
      puts("i is 1 or 2");
    default:
      puts("this is default block");
    }
  }
  puts("finish");
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  lea    D25(%rip),%rdi
  call   <printf@plt>
  lea    D0(%rip),%rbp
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    D9(%rip),%rbx
  mov    %rbx,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <puts@plt>
  lea    D39(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: tag: D25
type_guessed: string
name: read_data
arguments: tag: D0
type_guessed: string
name: read_data
arguments: tag: D9
type_guessed: string
name: read_data
arguments: tag: D39
type_guessed: string

tool: D25: i is 0


tool: D0: i is 1 or 2

tool: D9: this is default block

tool: D39: finish

assistant: ```c
int main() {
  for (int i = 0; i < 3; i++) {
    switch (i) {
    case 0:
      printf("i is 0\n");
      break;
    case 1:
    case 2:
      puts("i is 1 or 2");
    default:
      puts("this is default block");
    }
  }
  puts("finish");
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r12
  lea    D27(%rip),%rdi
  lea    D10(%rip),%r12
  push   %rbp
  lea    D25(%rip),%rbp
  sub    $0x8,%rsp
  call   <printf@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    D34(%rip),%rdi
  call   <puts@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D27
data_type: string
name: retrieve_data
arguments: tag: D10
data_type: string
name: retrieve_data
arguments: tag: D25
data_type: string
name: retrieve_data
arguments: tag: D34
data_type: string

tool: D27: i is 0


tool: D10: i is 1 or 2

tool: D25: this is default block

tool: D34: finish

assistant: ```c
int main() {
  for (int i = 0; i < 3; i++) {
    switch (i) {
    case 0:
      printf("i is 0\n");
      break;
    case 1:
    case 2:
      puts("i is 1 or 2");
    default:
      puts("this is default block");
    }
  }
  puts("finish");
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r12
  lea    D25(%rip),%rdi
  lea    D4(%rip),%r12
  push   %rbp
  lea    D28(%rip),%rbp
  sub    $0x8,%rsp
  call   <printf@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    D5(%rip),%rdi
  call   <puts@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D25
type_infered: string
name: unpack_data
arguments: data_label: D4
type_infered: string
name: unpack_data
arguments: data_label: D28
type_infered: string
name: unpack_data
arguments: data_label: D5
type_infered: string

tool: D25: i is 0


tool: D4: i is 1 or 2

tool: D28: this is default block

tool: D5: finish

assistant: ```c
int main() {
  for (int i = 0; i < 3; i++) {
    switch (i) {
    case 0:
      printf("i is 0\n");
      break;
    case 1:
    case 2:
      puts("i is 1 or 2");
    default:
      puts("this is default block");
    }
  }
  puts("finish");
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<uint64_to_bytes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L5
L9:
  mov    $0x7,%eax
  sub    -0x4(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x4(%rbp),%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    -0x14(%rbp),%esi
  mov    %edx,%ecx
  sar    %cl,%esi
  mov    %esi,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L5:
  cmpl   $0x7,-0x4(%rbp)
  jbe    L9
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void uint64_to_bytes(const uint64_t in, uint8_t out[8]) {
  unsigned int i;
  for (i = 0; i < 8; i++)
    out[i] = in >> ((7 - i) * 8);
}
```
user: What is the c source code of the assembly code below:

```asm
<uint64_to_bytes>:
  endbr64
  mov    $0x38,%ecx
L2:
  mov    %edi,%eax
  sar    %cl,%eax
  mov    %eax,(%rsi)
  sub    $0x8,%ecx
  add    $0x4,%rsi
  cmp    $0xfffffff8,%ecx
  jne    L2
  ret
```

assistant: ```c
void uint64_to_bytes(const uint64_t in, uint8_t out[8]) {
  unsigned int i;
  for (i = 0; i < 8; i++)
    out[i] = in >> ((7 - i) * 8);
}
```
user: Translate the below assembly code into C programming language:

```asm
<uint64_to_bytes>:
  endbr64
  mov    $0x38,%ecx
  nopl   0x0(%rax)
L7:
  mov    %edi,%eax
  add    $0x4,%rsi
  sar    %cl,%eax
  sub    $0x8,%ecx
  mov    %eax,-0x4(%rsi)
  cmp    $0xfffffff8,%ecx
  jne    L7
  ret
```

assistant: ```c
void uint64_to_bytes(const uint64_t in, uint8_t out[8]) {
  unsigned int i;
  for (i = 0; i < 8; i++)
    out[i] = in >> ((7 - i) * 8);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<uint64_to_bytes>:
  endbr64
  mov    $0x38,%ecx
  mov    %edi,%eax
  movd   %edi,%xmm4
  mov    %edi,%edx
  sar    %cl,%eax
  mov    $0x30,%ecx
  movd   %eax,%xmm0
  mov    %edi,%eax
  sar    %cl,%eax
  mov    $0x28,%ecx
  sar    %cl,%edx
  mov    $0x20,%ecx
  movd   %eax,%xmm3
  mov    %edi,%eax
  movd   %edx,%xmm1
  mov    %edi,%edx
  punpckldq %xmm3,%xmm0
  sar    $0x18,%eax
  sar    %cl,%edx
  movd   %edx,%xmm2
  mov    %edi,%edx
  punpckldq %xmm2,%xmm1
  sar    $0x8,%edx
  punpcklqdq %xmm1,%xmm0
  movd   %edx,%xmm1
  movups %xmm0,(%rsi)
  movd   %eax,%xmm0
  mov    %edi,%eax
  punpckldq %xmm4,%xmm1
  sar    $0x10,%eax
  movd   %eax,%xmm5
  punpckldq %xmm5,%xmm0
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,0x10(%rsi)
  ret
```

assistant: ```c
void uint64_to_bytes(const uint64_t in, uint8_t out[8]) {
  unsigned int i;
  for (i = 0; i < 8; i++)
    out[i] = in >> ((7 - i) * 8);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x1,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L17
L12:
  mov    $0x28,%eax
  sub    -0x4(%rbp),%eax
  mov    -0x8(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x8(%rbp),%eax
  cltd
  idiv   %ecx
  mov    %eax,-0x8(%rbp)
  addl   $0x1,-0x4(%rbp)
L17:
  cmpl   $0x13,-0x4(%rbp)
  jle    L12
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  leave
  ret
```

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

tool: D0: %lld


assistant: ```c
void main() {
  uint64_t count = 1;
  for (int i = 0; i < 20; i++) {
    count *= (2 * 20) - i;
    count = count / (i + 1);
  }
  printf("%lld\n", count);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%ecx
  mov    $0x1,%eax
  mov    $0x28,%esi
L5:
  mov    %esi,%edx
  sub    %ecx,%edx
  imul   %edx,%eax
  add    $0x1,%ecx
  cltd
  idiv   %ecx
  cmp    $0x14,%ecx
  jne    L5
  mov    %eax,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: data_tag: D2
data_type: string

tool: D2: %lld


assistant: ```c
void main() {
  uint64_t count = 1;
  for (int i = 0; i < 20; i++) {
    count *= (2 * 20) - i;
    count = count / (i + 1);
  }
  printf("%lld\n", count);
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  xor    %ecx,%ecx
  mov    $0x1,%eax
  mov    $0x28,%esi
L2:
  mov    %esi,%edx
  sub    %ecx,%edx
  add    $0x1,%ecx
  imul   %edx,%eax
  cltd
  idiv   %ecx
  cmp    $0x14,%ecx
  jne    L2
  mov    %eax,%esi
  lea    D6(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: unpack_data
arguments: tag: D6
type_infered: string

tool: D6: %lld


assistant: ```c
void main() {
  uint64_t count = 1;
  for (int i = 0; i < 20; i++) {
    count *= (2 * 20) - i;
    count = count / (i + 1);
  }
  printf("%lld\n", count);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  xor    %ecx,%ecx
  mov    $0x1,%eax
  mov    $0x28,%esi
L4:
  mov    %esi,%edx
  sub    %ecx,%edx
  add    $0x1,%ecx
  imul   %edx,%eax
  cltd
  idiv   %ecx
  cmp    $0x14,%ecx
  jne    L4
  mov    %eax,%esi
  lea    D4(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: read_data
arguments: tag: D4
datatype: string

tool: D4: %lld


assistant: ```c
void main() {
  uint64_t count = 1;
  for (int i = 0; i < 20; i++) {
    count *= (2 * 20) - i;
    count = count / (i + 1);
  }
  printf("%lld\n", count);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<IniAf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <AfDrvSw@plt>
  mov    $0x20,%esi
  mov    $0x81,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x83,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x80,%esi
  mov    $0x84,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x90,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x80,%esi
  mov    $0x88,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x82,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x85,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x1,%esi
  mov    $0x91,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x20,%esi
  mov    $0x99,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x40,%esi
  mov    $0xa1,%edi
  call   <RegWriteA_LC898122AF@plt>
  lea    -0x9(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x250,%edi
  call   <RegReadA_LC898122AF@plt>
  movzbl -0x9(%rbp),%eax
  and    $0x7f,%eax
  mov    %al,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  mov    $0x250,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x264,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x302,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x7fff,%esi
  mov    $0x396,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0x75fe,%esi
  mov    $0x398,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0x7f32,%esi
  mov    $0x39a,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0xf1,%esi
  mov    $0x303,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x304,%edi
  call   <RamWriteA_LC898122AF@plt>
  movzbl -0x9(%rbp),%eax
  or     $0xffffff80,%eax
  mov    %al,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  mov    $0x250,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x5,%esi
  mov    $0x264,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x1,%edi
  call   <AfDrvSw@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

assistant: ```c
void IniAf(void) {
  unsigned char UcStbb0;
  AfDrvSw(0x00);
  RegWriteA_LC898122AF(0x0081, 0x20);
  RegWriteA_LC898122AF(0x0083, 0x00);
  RegWriteA_LC898122AF(0x0084, 0x80);
  RegWriteA_LC898122AF(0x0090, 0x00);
  RegWriteA_LC898122AF(0x0088, 0x80);
  RegWriteA_LC898122AF(0x0082, 0x00);
  RegWriteA_LC898122AF(0x0085, 0x00);
  RegWriteA_LC898122AF(0x0091, 0x01);
  RegWriteA_LC898122AF(0x0099, 0x20);
  RegWriteA_LC898122AF(0x00A1, 0x40);
  RegReadA_LC898122AF(0x0250, &UcStbb0);
  UcStbb0 &= 0x7F;
  RegWriteA_LC898122AF(0x0250, UcStbb0);
  RegWriteA_LC898122AF(0x0264, 0x00);
  RegWriteA_LC898122AF(0x0302, 0x00);
  RamWriteA_LC898122AF(0x0396, 0x7FFF);
  RamWriteA_LC898122AF(0x0398, 0x75FE);
  RamWriteA_LC898122AF(0x039A, 0x7F32);
  RegWriteA_LC898122AF(0x0303, 0xF1);
  RamWriteA_LC898122AF(0x0304, 0x0000);
  UcStbb0 |= 0x80;
  RegWriteA_LC898122AF(0x0250, UcStbb0);
  RegWriteA_LC898122AF(0x0264, 0x05);
  AfDrvSw(0x01);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<IniAf>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <AfDrvSw@plt>
  mov    $0x20,%esi
  mov    $0x81,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x83,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x80,%esi
  mov    $0x84,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x90,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x80,%esi
  mov    $0x88,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x82,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x85,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x1,%esi
  mov    $0x91,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x20,%esi
  mov    $0x99,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x40,%esi
  mov    $0xa1,%edi
  call   <RegWriteA_LC898122AF@plt>
  lea    0x7(%rsp),%rsi
  mov    $0x250,%edi
  call   <RegReadA_LC898122AF@plt>
  movzbl 0x7(%rsp),%esi
  and    $0x7f,%esi
  mov    %sil,0x7(%rsp)
  movzbl %sil,%esi
  mov    $0x250,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x264,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x302,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x7fff,%esi
  mov    $0x396,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0x75fe,%esi
  mov    $0x398,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0x7f32,%esi
  mov    $0x39a,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0xf1,%esi
  mov    $0x303,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x0,%esi
  mov    $0x304,%edi
  call   <RamWriteA_LC898122AF@plt>
  movzbl 0x7(%rsp),%esi
  or     $0xffffff80,%esi
  mov    %sil,0x7(%rsp)
  movzbl %sil,%esi
  mov    $0x250,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x5,%esi
  mov    $0x264,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x1,%edi
  call   <AfDrvSw@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x18,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void IniAf(void) {
  unsigned char UcStbb0;
  AfDrvSw(0x00);
  RegWriteA_LC898122AF(0x0081, 0x20);
  RegWriteA_LC898122AF(0x0083, 0x00);
  RegWriteA_LC898122AF(0x0084, 0x80);
  RegWriteA_LC898122AF(0x0090, 0x00);
  RegWriteA_LC898122AF(0x0088, 0x80);
  RegWriteA_LC898122AF(0x0082, 0x00);
  RegWriteA_LC898122AF(0x0085, 0x00);
  RegWriteA_LC898122AF(0x0091, 0x01);
  RegWriteA_LC898122AF(0x0099, 0x20);
  RegWriteA_LC898122AF(0x00A1, 0x40);
  RegReadA_LC898122AF(0x0250, &UcStbb0);
  UcStbb0 &= 0x7F;
  RegWriteA_LC898122AF(0x0250, UcStbb0);
  RegWriteA_LC898122AF(0x0264, 0x00);
  RegWriteA_LC898122AF(0x0302, 0x00);
  RamWriteA_LC898122AF(0x0396, 0x7FFF);
  RamWriteA_LC898122AF(0x0398, 0x75FE);
  RamWriteA_LC898122AF(0x039A, 0x7F32);
  RegWriteA_LC898122AF(0x0303, 0xF1);
  RamWriteA_LC898122AF(0x0304, 0x0000);
  UcStbb0 |= 0x80;
  RegWriteA_LC898122AF(0x0250, UcStbb0);
  RegWriteA_LC898122AF(0x0264, 0x05);
  AfDrvSw(0x01);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<IniAf>:
  endbr64
  sub    $0x18,%rsp
  xor    %edi,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <AfDrvSw@plt>
  mov    $0x20,%esi
  mov    $0x81,%edi
  call   <RegWriteA_LC898122AF@plt>
  xor    %esi,%esi
  mov    $0x83,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x80,%esi
  mov    $0x84,%edi
  call   <RegWriteA_LC898122AF@plt>
  xor    %esi,%esi
  mov    $0x90,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x80,%esi
  mov    $0x88,%edi
  call   <RegWriteA_LC898122AF@plt>
  xor    %esi,%esi
  mov    $0x82,%edi
  call   <RegWriteA_LC898122AF@plt>
  xor    %esi,%esi
  mov    $0x85,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x1,%esi
  mov    $0x91,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x20,%esi
  mov    $0x99,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x40,%esi
  mov    $0xa1,%edi
  call   <RegWriteA_LC898122AF@plt>
  lea    0x7(%rsp),%rsi
  mov    $0x250,%edi
  call   <RegReadA_LC898122AF@plt>
  movzbl 0x7(%rsp),%esi
  mov    $0x250,%edi
  and    $0x7f,%esi
  mov    %sil,0x7(%rsp)
  movzbl %sil,%esi
  call   <RegWriteA_LC898122AF@plt>
  xor    %esi,%esi
  mov    $0x264,%edi
  call   <RegWriteA_LC898122AF@plt>
  xor    %esi,%esi
  mov    $0x302,%edi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x7fff,%esi
  mov    $0x396,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0x75fe,%esi
  mov    $0x398,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0x7f32,%esi
  mov    $0x39a,%edi
  call   <RamWriteA_LC898122AF@plt>
  mov    $0xf1,%esi
  mov    $0x303,%edi
  call   <RegWriteA_LC898122AF@plt>
  xor    %esi,%esi
  mov    $0x304,%edi
  call   <RamWriteA_LC898122AF@plt>
  movzbl 0x7(%rsp),%esi
  mov    $0x250,%edi
  or     $0xffffff80,%esi
  mov    %sil,0x7(%rsp)
  movzbl %sil,%esi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x264,%edi
  mov    $0x5,%esi
  call   <RegWriteA_LC898122AF@plt>
  mov    $0x1,%edi
  call   <AfDrvSw@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x18,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void IniAf(void) {
  unsigned char UcStbb0;
  AfDrvSw(0x00);
  RegWriteA_LC898122AF(0x0081, 0x20);
  RegWriteA_LC898122AF(0x0083, 0x00);
  RegWriteA_LC898122AF(0x0084, 0x80);
  RegWriteA_LC898122AF(0x0090, 0x00);
  RegWriteA_LC898122AF(0x0088, 0x80);
  RegWriteA_LC898122AF(0x0082, 0x00);
  RegWriteA_LC898122AF(0x0085, 0x00);
  RegWriteA_LC898122AF(0x0091, 0x01);
  RegWriteA_LC898122AF(0x0099, 0x20);
  RegWriteA_LC898122AF(0x00A1, 0x40);
  RegReadA_LC898122AF(0x0250, &UcStbb0);
  UcStbb0 &= 0x7F;
  RegWriteA_LC898122AF(0x0250, UcStbb0);
  RegWriteA_LC898122AF(0x0264, 0x00);
  RegWriteA_LC898122AF(0x0302, 0x00);
  RamWriteA_LC898122AF(0x0396, 0x7FFF);
  RamWriteA_LC898122AF(0x0398, 0x75FE);
  RamWriteA_LC898122AF(0x039A, 0x7F32);
  RegWriteA_LC898122AF(0x0303, 0xF1);
  RamWriteA_LC898122AF(0x0304, 0x0000);
  UcStbb0 |= 0x80;
  RegWriteA_LC898122AF(0x0250, UcStbb0);
  RegWriteA_LC898122AF(0x0264, 0x05);
  AfDrvSw(0x01);
}
```