ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么：

```asm
<string_poschar>:
  endbr64
  mov    %esi,%edx
  cmp    (%rdi),%sil
  jne    L15
  xor    %eax,%eax
  nopl   (%rax)
L10:
  mov    %eax,%r8d
  add    $0x1,%rax
  cmp    %dl,(%rdi,%rax,1)
  je     L10
  mov    %r8d,%eax
  ret
L15:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
__attribute__((always_)) int string_poschar(char *str, char c) {
  int pos = 0;
  char *p = str;
  while (*p == c) {
    ++pos;
    ++p;
  }
  return ((pos == 0) ? 0 : (pos - 1));
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<string_poschar>:
  endbr64
  mov    %esi,%edx
  cmp    (%rdi),%sil
  jne    L19
  xor    %eax,%eax
  nopl   (%rax)
L15:
  mov    %eax,%r8d
  add    $0x1,%rax
  cmp    %dl,(%rdi,%rax,1)
  je     L15
  mov    %r8d,%eax
  ret
L19:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
__attribute__((always_)) int string_poschar(char *str, char c) {
  int pos = 0;
  char *p = str;
  while (*p == c) {
    ++pos;
    ++p;
  }
  return ((pos == 0) ? 0 : (pos - 1));
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movl   $0x0,-0xc(%rbp)
  cmpl   $0x5,-0x8(%rbp)
  jle    L19
  addl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x4(%rbp)
  jmp    L4
L19:
  addl   $0x1,-0x4(%rbp)
L4:
  addl   $0x1,-0x8(%rbp)
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  int x, y, z;
  x = 0;
  if (y > 5) {
    x++;
    z++;
  } else {
    z++;
  }
  y++;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  mov    $0x0,%eax
  ret
```

assistant: ```c
int main() {
  int x, y, z;
  x = 0;
  if (y > 5) {
    x++;
    z++;
  } else {
    z++;
  }
  y++;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main() {
  int x, y, z;
  x = 0;
  if (y > 5) {
    x++;
    z++;
  } else {
    z++;
  }
  y++;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main() {
  int x, y, z;
  x = 0;
  if (y > 5) {
    x++;
    z++;
  } else {
    z++;
  }
  y++;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x1,%edi
  call   <sum_of_digits@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0xc,%edi
  call   <sum_of_digits@plt>
  cmp    $0x3,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x7b,%edi
  call   <sum_of_digits@plt>
  cmp    $0x6,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x3039,%edi
  call   <sum_of_digits@plt>
  cmp    $0xf,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x75bcd15,%edi
  call   <sum_of_digits@plt>
  cmp    $0x2d,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0xdfdc1c6f,%edi
  call   <sum_of_digits@plt>
  cmp    $0x3b,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  assert(1 == sum_of_digits(1));
  assert(3 == sum_of_digits(12));
  assert(6 == sum_of_digits(123));
  assert(15 == sum_of_digits(12345));
  assert(45 == sum_of_digits(123456789));
  assert(59 == sum_of_digits(12345678959));
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <sum_of_digits@plt>
  cmp    $0x1,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0xc,%edi
  call   <sum_of_digits@plt>
  cmp    $0x3,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0x7b,%edi
  call   <sum_of_digits@plt>
  cmp    $0x6,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0x3039,%edi
  call   <sum_of_digits@plt>
  cmp    $0xf,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0x75bcd15,%edi
  call   <sum_of_digits@plt>
  cmp    $0x2d,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0xdfdc1c6f,%edi
  call   <sum_of_digits@plt>
  cmp    $0x3b,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  assert(1 == sum_of_digits(1));
  assert(3 == sum_of_digits(12));
  assert(6 == sum_of_digits(123));
  assert(15 == sum_of_digits(12345));
  assert(45 == sum_of_digits(123456789));
  assert(59 == sum_of_digits(12345678959));
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x1,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0xc,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x3,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0x7b,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x6,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0x3039,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0xf,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0x75bcd15,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x2d,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0xdfdc1c6f,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x3b,%eax
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  assert(1 == sum_of_digits(1));
  assert(3 == sum_of_digits(12));
  assert(6 == sum_of_digits(123));
  assert(15 == sum_of_digits(12345));
  assert(45 == sum_of_digits(123456789));
  assert(59 == sum_of_digits(12345678959));
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x1,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0xc,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x3,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0x7b,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x6,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0x3039,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0xf,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0x75bcd15,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x2d,%eax
  sete   %dil
  call   <assert@plt>
  mov    $0xdfdc1c6f,%edi
  call   <sum_of_digits@plt>
  xor    %edi,%edi
  cmp    $0x3b,%eax
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  assert(1 == sum_of_digits(1));
  assert(3 == sum_of_digits(12));
  assert(6 == sum_of_digits(123));
  assert(15 == sum_of_digits(12345));
  assert(45 == sum_of_digits(123456789));
  assert(59 == sum_of_digits(12345678959));
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<write_new_certificate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x14(%rbp)
  mov    %ecx,-0x18(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L1
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <i2d_X509_bio@plt>
  jmp    L22
L1:
  cmpl   $0x0,-0x18(%rbp)
  jne    L25
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <X509_print@plt>
L25:
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <PEM_write_bio_X509@plt>
L22:
  leave
  ret
```

assistant: ```c
void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext) {
  if (output_der) {
    (void)i2d_X509_bio(bp, x);
    return;
  }
  if (!notext)
    X509_print(bp, x);
  PEM_write_bio_X509(bp, x);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<write_new_certificate>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  test   %edx,%edx
  jne    L33
  test   %ecx,%ecx
  je     L3
L24:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <PEM_write_bio_X509@plt>
L31:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L33:
  call   <i2d_X509_bio@plt>
  jmp    L31
L3:
  call   <X509_print@plt>
  jmp    L24
```

assistant: ```c
void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext) {
  if (output_der) {
    (void)i2d_X509_bio(bp, x);
    return;
  }
  if (!notext)
    X509_print(bp, x);
  PEM_write_bio_X509(bp, x);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<write_new_certificate>:
  endbr64
  test   %edx,%edx
  jne    L3
  test   %ecx,%ecx
  je     L12
  jmp    1090 <PEM_write_bio_X509@plt>
  nopl   0x0(%rax)
L12:
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rdi,(%rsp)
  call   <X509_print@plt>
  mov    0x8(%rsp),%rsi
  mov    (%rsp),%rdi
  add    $0x18,%rsp
  jmp    1090 <PEM_write_bio_X509@plt>
  nopl   0x0(%rax)
L3:
  jmp    1080 <i2d_X509_bio@plt>
```

assistant: ```c
void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext) {
  if (output_der) {
    (void)i2d_X509_bio(bp, x);
    return;
  }
  if (!notext)
    X509_print(bp, x);
  PEM_write_bio_X509(bp, x);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<write_new_certificate>:
  endbr64
  test   %edx,%edx
  jne    L3
  test   %ecx,%ecx
  je     L17
  jmp    1090 <PEM_write_bio_X509@plt>
  nopl   0x0(%rax)
L17:
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rdi,(%rsp)
  call   <X509_print@plt>
  mov    0x8(%rsp),%rsi
  mov    (%rsp),%rdi
  add    $0x18,%rsp
  jmp    1090 <PEM_write_bio_X509@plt>
  nopl   0x0(%rax)
L3:
  jmp    1080 <i2d_X509_bio@plt>
```

assistant: ```c
void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext) {
  if (output_der) {
    (void)i2d_X509_bio(bp, x);
    return;
  }
  if (!notext)
    X509_print(bp, x);
  PEM_write_bio_X509(bp, x);
}
```
user: What is the c source code of the assembly code below?

```asm
<hash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  cmpl   $0x5,-0x1c(%rbp)
  je     L118
  mov    $0xffffffff,%eax
  jmp    L79
L118:
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L78
L144:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  movl   $0x0,-0x4(%rbp)
  cmpb   $0x61,-0xd(%rbp)
  je     L108
  cmpb   $0x41,-0xd(%rbp)
  je     L108
  cmpb   $0x63,-0xd(%rbp)
  je     L24
  cmpb   $0x43,-0xd(%rbp)
  jne    L137
L24:
  movl   $0x1,-0x4(%rbp)
  jmp    L70
L137:
  cmpb   $0x67,-0xd(%rbp)
  je     L22
  cmpb   $0x47,-0xd(%rbp)
  jne    L154
L22:
  movl   $0x2,-0x4(%rbp)
  jmp    L70
L154:
  cmpb   $0x74,-0xd(%rbp)
  je     L136
  cmpb   $0x54,-0xd(%rbp)
  jne    L75
L136:
  movl   $0x3,-0x4(%rbp)
  jmp    L70
L75:
  mov    $0xffffffff,%eax
  jmp    L79
L70:
  mov    $0x4,%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,%esi
  mov    $0x4,%edi
  call   <power@plt>
  imul   -0x4(%rbp),%eax
  add    %eax,-0xc(%rbp)
  jmp    L77
L108:
  nop
L77:
  addl   $0x1,-0x8(%rbp)
L78:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L144
  mov    -0xc(%rbp),%eax
L79:
  leave
  ret
```

assistant: ```c
int hash(char *kmer, int length) {
  if (length != 5) {
    return -1;
  }
  int hash_value = 0;
  for (int i = 0; i < length; i++) {
    char dna = kmer[i];
    int value = 0;
    if (dna == 'a' || dna == 'A') {
      continue;
    } else if (dna == 'c' || dna == 'C') {
      value = 1;
    } else if (dna == 'g' || dna == 'G') {
      value = 2;
    } else if (dna == 't' || dna == 'T') {
      value = 3;
    } else {
      return -1;
    }
    hash_value += power(4, 4 - i) * value;
  }
  return hash_value;
}
```
user: Translate the below assembly code into C programming language:

```asm
<hash>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x5,%esi
  jne    L39
  mov    %rdi,%r12
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  movabs $0x100000001,%r13
  movabs $0x1000000010,%r14
  movabs $0x2000000020000,%r15
  jmp    L9
L89:
  movl   $0x3,0xc(%rsp)
  jmp    L46
L34:
  movl   $0x1,0xc(%rsp)
L46:
  mov    $0x4,%esi
  sub    %ebx,%esi
  mov    $0x4,%edi
  call   <power@plt>
  imul   0xc(%rsp),%eax
  add    %eax,%ebp
L71:
  add    $0x1,%rbx
  cmp    $0x5,%rbx
  je     L58
L9:
  movzbl (%r12,%rbx,1),%ecx
  mov    %ecx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x41,%al
  je     L71
  sub    $0x43,%ecx
  cmp    $0x31,%cl
  ja     L31
  mov    $0x1,%eax
  shl    %cl,%rax
  test   %r13,%rax
  jne    L34
  test   %r14,%rax
  jne    L20
  test   %r15,%rax
  jne    L89
  mov    $0xffffffff,%ebp
L58:
  mov    %ebp,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L20:
  movl   $0x2,0xc(%rsp)
  jmp    L46
L39:
  mov    $0xffffffff,%ebp
  jmp    L58
L31:
  mov    $0xffffffff,%ebp
  jmp    L58
```

assistant: ```c
int hash(char *kmer, int length) {
  if (length != 5) {
    return -1;
  }
  int hash_value = 0;
  for (int i = 0; i < length; i++) {
    char dna = kmer[i];
    int value = 0;
    if (dna == 'a' || dna == 'A') {
      continue;
    } else if (dna == 'c' || dna == 'C') {
      value = 1;
    } else if (dna == 'g' || dna == 'G') {
      value = 2;
    } else if (dna == 't' || dna == 'T') {
      value = 3;
    } else {
      return -1;
    }
    hash_value += power(4, 4 - i) * value;
  }
  return hash_value;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<hash>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x5,%esi
  jne    L34
  mov    %rdi,%r13
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  mov    $0x1,%ebp
  movabs $0x100000001,%rbx
  movabs $0x1000000010,%r12
L35:
  movzbl 0x0(%r13,%r14,1),%ecx
  mov    %ecx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x41,%al
  je     L81
  sub    $0x43,%ecx
  cmp    $0x31,%cl
  ja     L34
  mov    %rbp,%rax
  shl    %cl,%rax
  test   %rbx,%rax
  jne    L92
  test   %r12,%rax
  jne    L37
  movabs $0x2000000020000,%rdx
  test   %rdx,%rax
  jne    L11
L34:
  mov    $0xffffffff,%r15d
L95:
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L92:
  movl   $0x1,0xc(%rsp)
L39:
  mov    $0x4,%esi
  mov    $0x4,%edi
  sub    %r14d,%esi
  call   <power@plt>
  imul   0xc(%rsp),%eax
  add    %eax,%r15d
L81:
  add    $0x1,%r14
  cmp    $0x5,%r14
  jne    L35
  jmp    L95
  nopw   0x0(%rax,%rax,1)
L37:
  movl   $0x2,0xc(%rsp)
  jmp    L39
  nopw   0x0(%rax,%rax,1)
L11:
  movl   $0x3,0xc(%rsp)
  jmp    L39
```

assistant: ```c
int hash(char *kmer, int length) {
  if (length != 5) {
    return -1;
  }
  int hash_value = 0;
  for (int i = 0; i < length; i++) {
    char dna = kmer[i];
    int value = 0;
    if (dna == 'a' || dna == 'A') {
      continue;
    } else if (dna == 'c' || dna == 'C') {
      value = 1;
    } else if (dna == 'g' || dna == 'G') {
      value = 2;
    } else if (dna == 't' || dna == 'T') {
      value = 3;
    } else {
      return -1;
    }
    hash_value += power(4, 4 - i) * value;
  }
  return hash_value;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<hash>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x5,%esi
  jne    L21
  mov    %rdi,%r13
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  mov    $0x1,%ebp
  movabs $0x100000001,%rbx
  movabs $0x1000000010,%r12
L57:
  movzbl 0x0(%r13,%r14,1),%ecx
  mov    %ecx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x41,%al
  je     L88
  sub    $0x43,%ecx
  cmp    $0x31,%cl
  ja     L21
  mov    %rbp,%rax
  shl    %cl,%rax
  test   %rbx,%rax
  jne    L74
  test   %r12,%rax
  jne    L19
  movabs $0x2000000020000,%rdx
  test   %rdx,%rax
  jne    L89
L21:
  mov    $0xffffffff,%r15d
L20:
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L74:
  movl   $0x1,0xc(%rsp)
L13:
  mov    $0x4,%esi
  mov    $0x4,%edi
  sub    %r14d,%esi
  call   <power@plt>
  imul   0xc(%rsp),%eax
  add    %eax,%r15d
L88:
  add    $0x1,%r14
  cmp    $0x5,%r14
  jne    L57
  jmp    L20
  nopw   0x0(%rax,%rax,1)
L19:
  movl   $0x2,0xc(%rsp)
  jmp    L13
  nopw   0x0(%rax,%rax,1)
L89:
  movl   $0x3,0xc(%rsp)
  jmp    L13
```

assistant: ```c
int hash(char *kmer, int length) {
  if (length != 5) {
    return -1;
  }
  int hash_value = 0;
  for (int i = 0; i < length; i++) {
    char dna = kmer[i];
    int value = 0;
    if (dna == 'a' || dna == 'A') {
      continue;
    } else if (dna == 'c' || dna == 'C') {
      value = 1;
    } else if (dna == 'g' || dna == 'G') {
      value = 2;
    } else if (dna == 't' || dna == 'T') {
      value = 3;
    } else {
      return -1;
    }
    hash_value += power(4, 4 - i) * value;
  }
  return hash_value;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<show_errors_from_file>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x3f8,%rsp
  mov    %rdi,-0x3f8(%rbp)
  mov    %rsi,-0x400(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x3f8(%rbp)
  je     L50
  movb   $0x0,-0x340(%rbp)
  jmp    L22
L60:
  movzbl -0x3e0(%rbp),%eax
  cmp    $0xa,%al
  jne    L96
  jmp    L22
L96:
  lea    -0x340(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  lea    -0x3e0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  add    $0x1,%eax
  cmp    $0x31f,%eax
  jbe    L47
  lea    -0x340(%rbp),%rdx
  mov    -0x400(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <prompt_error_msg@plt>
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  mov    %eax,-0x3e4(%rbp)
  movb   $0x0,-0x340(%rbp)
  cmpl   $0x0,-0x3e4(%rbp)
  jne    L3
L47:
  lea    -0x3e0(%rbp),%rdx
  lea    -0x340(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L22:
  mov    -0x3f8(%rbp),%rdx
  lea    -0x3e0(%rbp),%rax
  mov    $0xa0,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    -0x3e0(%rbp),%rdx
  cmp    %rdx,%rax
  je     L60
  jmp    L23
L3:
  nop
L23:
  movzbl -0x340(%rbp),%eax
  test   %al,%al
  je     L82
  lea    -0x340(%rbp),%rdx
  mov    -0x400(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <show_error_msg@plt>
L82:
  mov    -0x3f8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  jmp    L89
L50:
  nop
L89:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L100
  call   <__stack_chk_fail@plt>
L100:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void show_errors_from_file(FILE *ef, const char title[]) {
  char linebuf[160];
  char buf[sizeof(linebuf) * 5];
  if (ef == NULL)
    return;
  buf[0] = '\0';
  while (fgets(linebuf, sizeof(linebuf), ef) == linebuf) {
    if (linebuf[0] == '\n')
      continue;
    if (strlen(buf) + strlen(linebuf) + 1 >= sizeof(buf)) {
      int skip = (prompt_error_msg(title, buf) != 0);
      buf[0] = '\0';
      if (skip)
        break;
    }
    strcat(buf, linebuf);
  }
  if (buf[0] != '\0') {
    show_error_msg(title, buf);
  }
  fclose(ef);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<show_errors_from_file>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x3d8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3c8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L55
  mov    %rdi,%r12
  mov    %rsi,%r13
  movb   $0x0,0xa0(%rsp)
  mov    %rsp,%rbx
  jmp    L4
L77:
  lea    0xa0(%rsp),%rdi
  mov    %rbx,%rsi
  call   <strcat@plt>
L4:
  mov    %r12,%rdx
  mov    $0xa0,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  cmp    %rax,%rbx
  jne    L64
  cmpb   $0xa,(%rsp)
  je     L4
  lea    0xa0(%rsp),%rdi
  call   <strlen@plt>
  mov    %eax,%ebp
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(%rbp,%rax,1),%eax
  cmp    $0x31f,%eax
  jbe    L77
  lea    0xa0(%rsp),%rsi
  mov    %r13,%rdi
  call   <prompt_error_msg@plt>
  movb   $0x0,0xa0(%rsp)
  test   %rax,%rax
  je     L77
  jmp    L79
L64:
  cmpb   $0x0,0xa0(%rsp)
  jne    L68
L79:
  mov    %r12,%rdi
  call   <fclose@plt>
L55:
  mov    0x3c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L66
  add    $0x3d8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L68:
  lea    0xa0(%rsp),%rsi
  mov    %r13,%rdi
  call   <show_error_msg@plt>
  jmp    L79
L66:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void show_errors_from_file(FILE *ef, const char title[]) {
  char linebuf[160];
  char buf[sizeof(linebuf) * 5];
  if (ef == NULL)
    return;
  buf[0] = '\0';
  while (fgets(linebuf, sizeof(linebuf), ef) == linebuf) {
    if (linebuf[0] == '\n')
      continue;
    if (strlen(buf) + strlen(linebuf) + 1 >= sizeof(buf)) {
      int skip = (prompt_error_msg(title, buf) != 0);
      buf[0] = '\0';
      if (skip)
        break;
    }
    strcat(buf, linebuf);
  }
  if (buf[0] != '\0') {
    show_error_msg(title, buf);
  }
  fclose(ef);
}
```
user: What is the c source code of the assembly code below:

```asm
<show_errors_from_file>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x3d0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3c8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L35
  movb   $0x0,0xa0(%rsp)
  mov    %rdi,%r13
  mov    %rsi,%r14
  mov    %rsp,%rbx
  lea    0xa0(%rsp),%r12
  nopl   0x0(%rax,%rax,1)
L76:
  mov    %r13,%rdx
  mov    $0xa0,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  cmp    %rax,%rbx
  jne    L37
  cmpb   $0xa,(%rsp)
  je     L76
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,%ebp
  call   <strlen@plt>
  lea    0x1(%rbp,%rax,1),%eax
  cmp    $0x31f,%eax
  jbe    L71
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <prompt_error_msg@plt>
  movb   $0x0,0xa0(%rsp)
  test   %rax,%rax
  jne    L89
L71:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L76
  nopl   (%rax)
L37:
  cmpb   $0x0,0xa0(%rsp)
  jne    L0
L89:
  mov    %r13,%rdi
  call   <fclose@plt>
L35:
  mov    0x3c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L88
  add    $0x3d0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L0:
  mov    %r14,%rdi
  lea    0xa0(%rsp),%rsi
  call   <show_error_msg@plt>
  mov    %r13,%rdi
  call   <fclose@plt>
  jmp    L35
L88:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void show_errors_from_file(FILE *ef, const char title[]) {
  char linebuf[160];
  char buf[sizeof(linebuf) * 5];
  if (ef == NULL)
    return;
  buf[0] = '\0';
  while (fgets(linebuf, sizeof(linebuf), ef) == linebuf) {
    if (linebuf[0] == '\n')
      continue;
    if (strlen(buf) + strlen(linebuf) + 1 >= sizeof(buf)) {
      int skip = (prompt_error_msg(title, buf) != 0);
      buf[0] = '\0';
      if (skip)
        break;
    }
    strcat(buf, linebuf);
  }
  if (buf[0] != '\0') {
    show_error_msg(title, buf);
  }
  fclose(ef);
}
```