ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码：

```asm
<invalid_nk>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edx,%ebp
  lea    -0x1(%rdi),%edx
  mov    $0x1,%eax
  cmp    $0x3d,%edx
  ja     L13
  mov    %edi,%ebx
  mov    %rsi,%r12
  mov    %rcx,%r13
  lea    -0x1(%rbp),%edx
  cmp    $0x3d,%edx
  ja     L13
  lea    (%rdi,%rbp,1),%edx
  cmp    $0x3f,%edx
  jle    L1
L13:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1:
  call   <bi_len@plt>
  cmp    %eax,%ebx
  setne  %r15b
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <bi_len@plt>
  cmp    %eax,%ebp
  setne  %r14b
  or     %r15d,%r14d
  movzbl %r14b,%r14d
  mov    %r12,%rsi
  mov    %ebx,%edi
  call   <bi_blen@plt>
  mov    %eax,%r15d
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <bi_blen@plt>
  cmp    $0x10,%r15d
  jle    L3
  cmp    $0x10,%eax
  jg     L30
L3:
  mov    $0x1,%eax
L51:
  or     %r14d,%eax
  jmp    L13
L30:
  mov    %r12,%rcx
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <bi_lt@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  jmp    L51
```

assistant: ```c
int invalid_nk(int nn_len, unsigned long *nn, int ku_len, unsigned long *ku) {
  int invalid, len, nn_blen, ku_blen;
  invalid = (nn_len <= 0 || nn_len > 125 / 2 || ku_len <= 0 || ku_len > 125 / 2 || (nn_len + ku_len) > 63);
  if (invalid)
    return 1;
  len = bi_len(nn_len, nn);
  invalid = len != nn_len;
  len = bi_len(ku_len, ku);
  invalid |= len != ku_len;
  nn_blen = bi_blen(nn_len, nn);
  ku_blen = bi_blen(ku_len, ku);
  invalid |= (nn_blen < 17 || ku_blen < 17 || !bi_lt(ku_len, ku, nn_len, nn));
  return invalid;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<invalid_nk>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  lea    -0x1(%rdi),%edx
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x3d,%edx
  ja     L21
  lea    -0x1(%rbp),%edx
  cmp    $0x3d,%edx
  ja     L21
  lea    (%rdi,%rbp,1),%edx
  mov    %edi,%ebx
  cmp    $0x3f,%edx
  jg     L21
  mov    %rcx,%r12
  mov    %rsi,%r14
  call   <bi_len@plt>
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    %eax,%r15d
  call   <bi_len@plt>
  mov    %r14,%rsi
  mov    %ebx,%edi
  mov    %eax,0xc(%rsp)
  call   <bi_blen@plt>
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    %eax,%r13d
  call   <bi_blen@plt>
  cmp    $0x10,%r13d
  jle    L0
  cmp    $0x10,%eax
  jle    L0
  mov    %ebx,%edx
  mov    %r14,%rcx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <bi_lt@plt>
  cmp    %r15d,%ebx
  mov    %eax,%r8d
  setne  %al
  cmp    0xc(%rsp),%ebp
  setne  %dl
  or     %edx,%eax
  test   %r8d,%r8d
  sete   %dl
  or     %edx,%eax
  movzbl %al,%eax
L21:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L0:
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int invalid_nk(int nn_len, unsigned long *nn, int ku_len, unsigned long *ku) {
  int invalid, len, nn_blen, ku_blen;
  invalid = (nn_len <= 0 || nn_len > 125 / 2 || ku_len <= 0 || ku_len > 125 / 2 || (nn_len + ku_len) > 63);
  if (invalid)
    return 1;
  len = bi_len(nn_len, nn);
  invalid = len != nn_len;
  len = bi_len(ku_len, ku);
  invalid |= len != ku_len;
  nn_blen = bi_blen(nn_len, nn);
  ku_blen = bi_blen(ku_len, ku);
  invalid |= (nn_blen < 17 || ku_blen < 17 || !bi_lt(ku_len, ku, nn_len, nn));
  return invalid;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<invalid_nk>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  lea    -0x1(%rdi),%edx
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x3d,%edx
  ja     L38
  lea    -0x1(%rbp),%edx
  cmp    $0x3d,%edx
  ja     L38
  lea    (%rdi,%rbp,1),%edx
  mov    %edi,%ebx
  cmp    $0x3f,%edx
  jg     L38
  mov    %rcx,%r12
  mov    %rsi,%r14
  call   <bi_len@plt>
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    %eax,%r15d
  call   <bi_len@plt>
  mov    %r14,%rsi
  mov    %ebx,%edi
  mov    %eax,0xc(%rsp)
  call   <bi_blen@plt>
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    %eax,%r13d
  call   <bi_blen@plt>
  cmp    $0x10,%r13d
  jle    L35
  cmp    $0x10,%eax
  jle    L35
  mov    %ebx,%edx
  mov    %r14,%rcx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <bi_lt@plt>
  cmp    %r15d,%ebx
  mov    %eax,%r8d
  setne  %al
  cmp    0xc(%rsp),%ebp
  setne  %dl
  or     %edx,%eax
  test   %r8d,%r8d
  sete   %dl
  or     %edx,%eax
  movzbl %al,%eax
L38:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L35:
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int invalid_nk(int nn_len, unsigned long *nn, int ku_len, unsigned long *ku) {
  int invalid, len, nn_blen, ku_blen;
  invalid = (nn_len <= 0 || nn_len > 125 / 2 || ku_len <= 0 || ku_len > 125 / 2 || (nn_len + ku_len) > 63);
  if (invalid)
    return 1;
  len = bi_len(nn_len, nn);
  invalid = len != nn_len;
  len = bi_len(ku_len, ku);
  invalid |= len != ku_len;
  nn_blen = bi_blen(nn_len, nn);
  ku_blen = bi_blen(ku_len, ku);
  invalid |= (nn_blen < 17 || ku_blen < 17 || !bi_lt(ku_len, ku, nn_len, nn));
  return invalid;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<debug_board_write_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  jmp    L8
L14:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <debug_board_write_byte@plt>
L8:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L14
  nop
  nop
  leave
  ret
```

assistant: ```c
void debug_board_write_str(const char *str) {
  while (*str)
    debug_board_write_byte(*str++);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<debug_board_write_str>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  movzbl (%rdi),%edi
  test   %dil,%dil
  je     L7
L10:
  add    $0x1,%rbx
  movsbl %dil,%edi
  call   <debug_board_write_byte@plt>
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L10
L7:
  pop    %rbx
  ret
```

assistant: ```c
void debug_board_write_str(const char *str) {
  while (*str)
    debug_board_write_byte(*str++);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<debug_board_write_str>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L0
L12:
  call   <debug_board_write_byte@plt>
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  jne    L12
L0:
  pop    %rbx
  ret
```

assistant: ```c
void debug_board_write_str(const char *str) {
  while (*str)
    debug_board_write_byte(*str++);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<debug_board_write_str>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L0
L5:
  call   <debug_board_write_byte@plt>
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  jne    L5
L0:
  pop    %rbx
  ret
```

assistant: ```c
void debug_board_write_str(const char *str) {
  while (*str)
    debug_board_write_byte(*str++);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    $0x0,%eax
  call   <parser_run_tests@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  parser_run_tests();
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <parser_run_tests@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  parser_run_tests();
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <parser_run_tests@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  parser_run_tests();
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <parser_run_tests@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  parser_run_tests();
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<four_digits>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,%rax
  mov    %esi,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  imul   $0x68db8bad,%rcx,%rcx
  shr    $0x20,%rcx
  sar    $0xc,%ecx
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  imul   $0x2710,%ecx,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  imul   $0x10624dd3,%rcx,%rcx
  shr    $0x20,%rcx
  sar    $0x6,%ecx
  mov    %edx,%esi
  sar    $0x1f,%esi
  mov    %ecx,%edx
  sub    %esi,%edx
  lea    0x30(%rdx),%ecx
  mov    %rax,%rdx
  lea    0x1(%rdx),%rax
  mov    %cl,(%rdx)
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  imul   $0x10624dd3,%rcx,%rcx
  shr    $0x20,%rcx
  sar    $0x6,%ecx
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  imul   $0x3e8,%ecx,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  imul   $0x51eb851f,%rcx,%rcx
  shr    $0x20,%rcx
  sar    $0x5,%ecx
  mov    %edx,%esi
  sar    $0x1f,%esi
  mov    %ecx,%edx
  sub    %esi,%edx
  lea    0x30(%rdx),%ecx
  mov    %rax,%rdx
  lea    0x1(%rdx),%rax
  mov    %cl,(%rdx)
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  imul   $0x51eb851f,%rcx,%rcx
  shr    $0x20,%rcx
  sar    $0x5,%ecx
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  imul   $0x64,%ecx,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  imul   $0x66666667,%rcx,%rcx
  shr    $0x20,%rcx
  sar    $0x2,%ecx
  mov    %edx,%esi
  sar    $0x1f,%esi
  mov    %ecx,%edx
  sub    %esi,%edx
  lea    0x30(%rdx),%ecx
  mov    %rax,%rdx
  lea    0x1(%rdx),%rax
  mov    %cl,(%rdx)
  mov    -0x4(%rbp),%ecx
  movslq %ecx,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  mov    %ecx,%edi
  sar    $0x1f,%edi
  mov    %edx,%esi
  sub    %edi,%esi
  mov    %esi,%edx
  shl    $0x2,%edx
  add    %esi,%edx
  add    %edx,%edx
  mov    %ecx,%esi
  sub    %edx,%esi
  mov    %esi,%edx
  lea    0x30(%rdx),%ecx
  mov    %rax,%rdx
  lea    0x1(%rdx),%rax
  mov    %cl,(%rdx)
  add    $0x1,%rax
  pop    %rbp
  ret
```

assistant: ```c
char *four_digits(register char *pb, int i) {
  i %= 10000;
  *pb++ = (i / 1000) + '0';
  i %= 1000;
  *pb++ = (i / 100) + '0';
  i %= 100;
  *pb++ = (i / 10) + '0';
  *pb++ = (i % 10) + '0';
  return ++pb;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<four_digits>:
  endbr64
  mov    %rdi,%rax
  movslq %esi,%rdx
  imul   $0x68db8bad,%rdx,%rdx
  sar    $0x2c,%rdx
  mov    %esi,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x2710,%edx,%ecx
  sub    %ecx,%esi
  mov    %esi,%edx
  movslq %esi,%rcx
  imul   $0x10624dd3,%rcx,%rcx
  sar    $0x26,%rcx
  sar    $0x1f,%esi
  sub    %esi,%ecx
  lea    0x30(%rcx),%esi
  mov    %sil,(%rdi)
  imul   $0x3e8,%ecx,%ecx
  sub    %ecx,%edx
  movslq %edx,%rcx
  imul   $0x51eb851f,%rcx,%rcx
  sar    $0x25,%rcx
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  lea    0x30(%rcx),%esi
  mov    %sil,0x1(%rdi)
  imul   $0x64,%ecx,%ecx
  sub    %ecx,%edx
  movslq %edx,%rcx
  imul   $0x66666667,%rcx,%rcx
  sar    $0x22,%rcx
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%ecx
  lea    0x30(%rcx),%esi
  mov    %sil,0x2(%rdi)
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  add    $0x30,%edx
  mov    %dl,0x3(%rdi)
  add    $0x5,%rax
  ret
```

assistant: ```c
char *four_digits(register char *pb, int i) {
  i %= 10000;
  *pb++ = (i / 1000) + '0';
  i %= 1000;
  *pb++ = (i / 100) + '0';
  i %= 100;
  *pb++ = (i / 10) + '0';
  *pb++ = (i % 10) + '0';
  return ++pb;
}
```
user: Translate the below assembly code into C programming language:

```asm
<four_digits>:
  endbr64
  movslq %esi,%rdx
  mov    %esi,%ecx
  mov    %rdi,%rax
  imul   $0x68db8bad,%rdx,%rdx
  sar    $0x1f,%ecx
  add    $0x5,%rax
  sar    $0x2c,%rdx
  sub    %ecx,%edx
  imul   $0x2710,%edx,%ecx
  sub    %ecx,%esi
  movslq %esi,%rcx
  sar    $0x1f,%esi
  mov    %rcx,%rdx
  imul   $0x10624dd3,%rcx,%rcx
  sar    $0x26,%rcx
  sub    %esi,%ecx
  lea    0x30(%rcx),%esi
  imul   $0x3e8,%ecx,%ecx
  mov    %sil,(%rdi)
  sub    %ecx,%edx
  movslq %edx,%rcx
  mov    %edx,%esi
  imul   $0x51eb851f,%rcx,%rcx
  sar    $0x1f,%esi
  sar    $0x25,%rcx
  sub    %esi,%ecx
  lea    0x30(%rcx),%esi
  imul   $0x64,%ecx,%ecx
  mov    %sil,0x1(%rdi)
  sub    %ecx,%edx
  movslq %edx,%rcx
  mov    %edx,%esi
  imul   $0x66666667,%rcx,%rcx
  sar    $0x1f,%esi
  sar    $0x22,%rcx
  sub    %esi,%ecx
  lea    0x30(%rcx),%esi
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  mov    %sil,0x2(%rdi)
  sub    %ecx,%edx
  add    $0x30,%edx
  mov    %dl,0x3(%rdi)
  ret
```

assistant: ```c
char *four_digits(register char *pb, int i) {
  i %= 10000;
  *pb++ = (i / 1000) + '0';
  i %= 1000;
  *pb++ = (i / 100) + '0';
  i %= 100;
  *pb++ = (i / 10) + '0';
  *pb++ = (i % 10) + '0';
  return ++pb;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <parloop@plt>
  movl   $0x0,-0x34(%rbp)
  jmp    L19
L6:
  mov    -0x34(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    -0x34(%rbp),%edx
  add    $0x3,%edx
  cmp    %edx,%eax
  je     L35
  mov    $0x0,%eax
  call   <abort@plt>
L35:
  addl   $0x1,-0x34(%rbp)
L19:
  cmpl   $0x9,-0x34(%rbp)
  jle    L6
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L32
  call   <__stack_chk_fail@plt>
L32:
  leave
  ret
```

assistant: ```c
int main() {
  int i, a[10];
#pragma omp parallel shared(a)
  { parloop(a); }
  for (i = 0; i < 10; i++)
    if (a[i] != i + 3)
      abort();
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rdi
  call   <parloop@plt>
  lea    0x28(%rsp),%r12
  mov    $0x3,%ebp
  jmp    L47
L38:
  add    $0x4,%rbx
  add    $0x1,%ebp
  cmp    %r12,%rbx
  je     L2
L47:
  cmp    %ebp,(%rbx)
  je     L38
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L38
L2:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  mov    $0x0,%eax
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L31:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  int i, a[10];
#pragma omp parallel shared(a)
  { parloop(a); }
  for (i = 0; i < 10; i++)
    if (a[i] != i + 3)
      abort();
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  mov    $0x3,%ebp
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    0x28(%rsp),%r12
  mov    %rbx,%rdi
  call   <parloop@plt>
  nopl   0x0(%rax)
L28:
  cmp    %ebp,(%rbx)
  je     L9
  xor    %eax,%eax
  call   <abort@plt>
L9:
  add    $0x4,%rbx
  add    $0x1,%ebp
  cmp    %r12,%rbx
  jne    L28
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  int i, a[10];
#pragma omp parallel shared(a)
  { parloop(a); }
  for (i = 0; i < 10; i++)
    if (a[i] != i + 3)
      abort();
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <parloop@plt>
  cmpl   $0x3,(%rsp)
  je     L14
  xor    %eax,%eax
  call   <abort@plt>
L14:
  cmpl   $0x4,0x4(%rsp)
  je     L54
  xor    %eax,%eax
  call   <abort@plt>
L54:
  cmpl   $0x5,0x8(%rsp)
  je     L3
  xor    %eax,%eax
  call   <abort@plt>
L3:
  cmpl   $0x6,0xc(%rsp)
  je     L78
  xor    %eax,%eax
  call   <abort@plt>
L78:
  cmpl   $0x7,0x10(%rsp)
  je     L83
  xor    %eax,%eax
  call   <abort@plt>
L83:
  cmpl   $0x8,0x14(%rsp)
  je     L43
  xor    %eax,%eax
  call   <abort@plt>
L43:
  cmpl   $0x9,0x18(%rsp)
  je     L38
  xor    %eax,%eax
  call   <abort@plt>
L38:
  cmpl   $0xa,0x1c(%rsp)
  je     L88
  xor    %eax,%eax
  call   <abort@plt>
L88:
  cmpl   $0xb,0x20(%rsp)
  je     L53
  xor    %eax,%eax
  call   <abort@plt>
L53:
  cmpl   $0xc,0x24(%rsp)
  je     L21
  xor    %eax,%eax
  call   <abort@plt>
L21:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L104
  xor    %eax,%eax
  add    $0x38,%rsp
  ret
L104:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  int i, a[10];
#pragma omp parallel shared(a)
  { parloop(a); }
  for (i = 0; i < 10; i++)
    if (a[i] != i + 3)
      abort();
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<pasm_clean_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  jmp    L113
L148:
  addq   $0x1,-0x28(%rbp)
L113:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L148
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L148
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L18
L124:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3b,%al
  je     L76
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L197
L76:
  mov    -0x14(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  ja     L50
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  jmp    L49
L197:
  addl   $0x1,-0x14(%rbp)
L18:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x14(%rbp)
  jl     L124
  jmp    L20
L50:
  nop
  jmp    L20
L107:
  subq   $0x1,-0x10(%rbp)
L20:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L138
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L138
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L141
L138:
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  ja     L107
L141:
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L14
L91:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L71
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L5
L71:
  mov    -0x8(%rbp),%rax
  movb   $0x20,(%rax)
L5:
  addq   $0x1,-0x8(%rbp)
L14:
  mov    -0x8(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  je     L9
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L91
L9:
  mov    -0x28(%rbp),%rax
L49:
  leave
  ret
```

assistant: ```c
char *pasm_clean_line(char *str) {
  while (*str == ' ' || *str == '\t')
    str++;
  char *end = str + strlen(str);
  for (int i = 0; i < strlen(str); i++) {
    if (str[i] == ';' || str[i] == '#') {
      end = str + i - 1;
      if (end <= str) {
        *str = 0;
        return str;
      }
      break;
    }
  }
  while ((!*end || *end == ' ' || *end == '\t') && end > str) {
    end--;
  }
  *end = 0;
  for (char *c = str; c != end && *c; c++) {
    if (*c == '\t' || *c == '\n') {
      *c = ' ';
    }
  }
  return str;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pasm_clean_line>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  movzbl (%rdi),%eax
  cmp    $0x20,%al
  je     L24
  cmp    $0x9,%al
  jne    L243
L24:
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  cmp    $0x20,%al
  je     L24
  cmp    $0x9,%al
  je     L24
L243:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%ebp
  mov    $0x0,%r12d
L199:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %r12d,%eax
  jle    L38
  movzbl (%rbx,%r12,1),%eax
  lea    0x1(%r12),%rdx
  cmp    $0x3b,%al
  je     L56
  cmp    $0x23,%al
  je     L56
  mov    %rdx,%r12
  jmp    L199
L56:
  lea    -0x1(%rbx,%r12,1),%rax
  cmp    %rbx,%rax
  jbe    L255
  movzbl (%rax),%edx
  test   $0xdf,%dl
  je     L200
  cmp    $0x9,%dl
  je     L200
  movb   $0x0,(%rax)
  jmp    L226
L38:
  movslq %ebp,%rax
  add    %rbx,%rax
  movzbl (%rax),%edx
  test   $0xdf,%dl
  je     L155
  cmp    $0x9,%dl
  jne    L93
L155:
  cmp    %rbx,%rax
  ja     L200
  jmp    L93
L255:
  movb   $0x0,(%rbx)
L91:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L220:
  cmp    %rbx,%rax
  je     L21
L200:
  sub    $0x1,%rax
  movzbl (%rax),%edx
  test   $0xdf,%dl
  je     L220
  cmp    $0x9,%dl
  je     L220
L93:
  movb   $0x0,(%rax)
  cmp    %rax,%rbx
  je     L91
L226:
  mov    %rbx,%rcx
  jmp    L111
L107:
  add    $0x1,%rcx
  cmp    %rax,%rcx
  je     L91
L111:
  movzbl (%rcx),%edx
  test   %dl,%dl
  je     L91
  sub    $0x9,%edx
  cmp    $0x1,%dl
  ja     L107
  movb   $0x20,(%rcx)
  jmp    L107
L21:
  movb   $0x0,(%rbx)
  jmp    L91
```

assistant: ```c
char *pasm_clean_line(char *str) {
  while (*str == ' ' || *str == '\t')
    str++;
  char *end = str + strlen(str);
  for (int i = 0; i < strlen(str); i++) {
    if (str[i] == ';' || str[i] == '#') {
      end = str + i - 1;
      if (end <= str) {
        *str = 0;
        return str;
      }
      break;
    }
  }
  while ((!*end || *end == ' ' || *end == '\t') && end > str) {
    end--;
  }
  *end = 0;
  for (char *c = str; c != end && *c; c++) {
    if (*c == '\t' || *c == '\n') {
      *c = ' ';
    }
  }
  return str;
}
```