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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movl   $0x1,-0x4c(%rbp)
  lea    -0x50(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x50(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L58:
  cmp    %rdx,%rsp
  je     L21
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L58
L21:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L25
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L25:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x50(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <prime@plt>
  jmp    L57
L1:
  mov    -0x4c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4c(%rbp)
  mov    -0x40(%rbp),%rdx
  cltq
  mov    (%rdx,%rax,4),%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L57:
  mov    -0x40(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  test   %eax,%eax
  jne    L1
  mov    $0x0,%eax
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D3
type: string
name: disassemble_data
arguments: label: D6
type: string

tool: D3: %d

tool: D6: %d


assistant: ```c
int main(int argc, const char *argv[]) {
  int i = 1, m;
  scanf("%d", &m);
  int p[m + 1];
  prime(p, m);
  while (p[i] != 0)
    printf("%d\n", p[i++]);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    -0x1c(%rbp),%rsi
  lea    D3(%rip),%rdi
  call   <scanf@plt>
  mov    -0x1c(%rbp),%esi
  lea    0x1(%rsi),%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L54:
  cmp    %rdx,%rsp
  je     L10
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L54
L10:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L27
  orq    $0x0,-0x8(%rsp,%rax,1)
L27:
  lea    0x3(%rsp),%rbx
  mov    %rbx,%r12
  shr    $0x2,%r12
  and    $0xfffffffffffffffc,%rbx
  mov    %rbx,%rdi
  call   <prime@plt>
  mov    0x4(,%r12,4),%esi
  test   %esi,%esi
  je     L43
  add    $0x8,%rbx
  lea    D5(%rip),%r12
L19:
  mov    %r12,%rdi
  call   <printf@plt>
  add    $0x4,%rbx
  mov    -0x4(%rbx),%esi
  test   %esi,%esi
  jne    L19
L43:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L42
  mov    $0x0,%eax
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
L42:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D3
type_guessed: string
name: read_data
arguments: tag: D5
type_guessed: string

tool: D3: %d

tool: D5: %d


assistant: ```c
int main(int argc, const char *argv[]) {
  int i = 1, m;
  scanf("%d", &m);
  int p[m + 1];
  prime(p, m);
  while (p[i] != 0)
    printf("%d\n", p[i++]);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D10(%rip),%rdi
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  lea    -0x1c(%rbp),%rsi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x1c(%rbp),%esi
  mov    %rsp,%rcx
  lea    0x1(%rsi),%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L32
L39:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L39
L32:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L41
L40:
  lea    0x3(%rsp),%rbx
  mov    %rbx,%r12
  and    $0xfffffffffffffffc,%rbx
  shr    $0x2,%r12
  mov    %rbx,%rdi
  call   <prime@plt>
  mov    0x4(,%r12,4),%esi
  test   %esi,%esi
  je     L8
  add    $0x8,%rbx
  lea    D6(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L15:
  mov    %r12,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  mov    -0x4(%rbx),%esi
  test   %esi,%esi
  jne    L15
L8:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  lea    -0x10(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
L41:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L40
L11:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D10
type_guessed: string
name: parse_data
arguments: data_tag: D6
type_guessed: string

tool: D10: %d

tool: D6: %d


assistant: ```c
int main(int argc, const char *argv[]) {
  int i = 1, m;
  scanf("%d", &m);
  int p[m + 1];
  prime(p, m);
  while (p[i] != 0)
    printf("%d\n", p[i++]);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %rbp
  lea    D11(%rip),%rdi
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  lea    -0x1c(%rbp),%rsi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x1c(%rbp),%esi
  mov    %rsp,%rcx
  lea    0x1(%rsi),%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L20
L39:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L39
L20:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L47
L43:
  lea    0x3(%rsp),%rbx
  mov    %rbx,%r12
  and    $0xfffffffffffffffc,%rbx
  shr    $0x2,%r12
  mov    %rbx,%rdi
  call   <prime@plt>
  mov    0x4(,%r12,4),%esi
  test   %esi,%esi
  je     L64
  add    $0x8,%rbx
  lea    D3(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L53:
  mov    %r12,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  mov    -0x4(%rbx),%esi
  test   %esi,%esi
  jne    L53
L64:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  lea    -0x10(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
L47:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L43
L30:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D11
type_guessed: string
name: parse_data
arguments: data_tag: D3
type_guessed: string

tool: D11: %d

tool: D3: %d


assistant: ```c
int main(int argc, const char *argv[]) {
  int i = 1, m;
  scanf("%d", &m);
  int p[m + 1];
  prime(p, m);
  while (p[i] != 0)
    printf("%d\n", p[i++]);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<check_set>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L25
L14:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L35
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L0
  mov    -0x20(%rbp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L18
L0:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
L35:
  addl   $0x1,-0x4(%rbp)
L25:
  cmpl   $0x8,-0x4(%rbp)
  jle    L14
  nop
L18:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void check_set(int set[], int *ret_func) {
  for (int i = 0; i < 9; i++) {
    if (set[i] != 0) {
      if (ret_func[0] != 0) {
        ret_func[0] = -1;
        break;
      }
      ret_func[0] = set[i];
      ret_func[1] = i;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<check_set>:
  endbr64
  mov    $0x0,%eax
  jmp    L5
L34:
  movl   $0xffffffff,(%rsi)
  ret
L38:
  add    $0x1,%rax
  cmp    $0x9,%rax
  je     L19
L5:
  mov    (%rdi,%rax,4),%edx
  test   %edx,%edx
  je     L38
  cmpl   $0x0,(%rsi)
  jne    L34
  mov    %edx,(%rsi)
  mov    %eax,0x4(%rsi)
  jmp    L38
L19:
  ret
```

assistant: ```c
void check_set(int set[], int *ret_func) {
  for (int i = 0; i < 9; i++) {
    if (set[i] != 0) {
      if (ret_func[0] != 0) {
        ret_func[0] = -1;
        break;
      }
      ret_func[0] = set[i];
      ret_func[1] = i;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<check_set>:
  endbr64
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L12:
  mov    (%rdi,%rax,4),%edx
  test   %edx,%edx
  je     L14
  mov    (%rsi),%ecx
  test   %ecx,%ecx
  jne    L3
  mov    %edx,(%rsi)
  mov    %eax,0x4(%rsi)
L14:
  add    $0x1,%rax
  cmp    $0x9,%rax
  jne    L12
  ret
  nopl   (%rax)
L3:
  movl   $0xffffffff,(%rsi)
  ret
```

assistant: ```c
void check_set(int set[], int *ret_func) {
  for (int i = 0; i < 9; i++) {
    if (set[i] != 0) {
      if (ret_func[0] != 0) {
        ret_func[0] = -1;
        break;
      }
      ret_func[0] = set[i];
      ret_func[1] = i;
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<check_set>:
  endbr64
  mov    (%rdi),%eax
  test   %eax,%eax
  je     L241
  mov    (%rsi),%r10d
  test   %r10d,%r10d
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x0,0x4(%rsi)
  mov    0x4(%rdi),%r9d
  test   %r9d,%r9d
  jne    L206
L72:
  mov    0x8(%rdi),%eax
  test   %eax,%eax
  je     L24
  mov    (%rsi),%edx
  test   %edx,%edx
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x2,0x4(%rsi)
  mov    0xc(%rdi),%r11d
  test   %r11d,%r11d
  jne    L206
L9:
  mov    0x10(%rdi),%eax
  test   %eax,%eax
  je     L244
  mov    (%rsi),%r8d
  test   %r8d,%r8d
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x4,0x4(%rsi)
  mov    0x14(%rdi),%ecx
  test   %ecx,%ecx
  jne    L206
L170:
  mov    0x18(%rdi),%eax
  test   %eax,%eax
  je     L218
  mov    (%rsi),%r10d
  test   %r10d,%r10d
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x6,0x4(%rsi)
  mov    0x1c(%rdi),%r9d
  test   %r9d,%r9d
  jne    L206
L111:
  mov    0x20(%rdi),%eax
  test   %eax,%eax
  je     L220
  mov    (%rsi),%edx
  test   %edx,%edx
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x8,0x4(%rsi)
L220:
  ret
  xchg   %ax,%ax
L241:
  mov    0x4(%rdi),%eax
  test   %eax,%eax
  je     L72
  mov    (%rsi),%r8d
  test   %r8d,%r8d
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x1,0x4(%rsi)
  mov    0x8(%rdi),%ecx
  test   %ecx,%ecx
  jne    L206
L24:
  mov    0xc(%rdi),%eax
  test   %eax,%eax
  je     L9
  mov    (%rsi),%r10d
  test   %r10d,%r10d
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x3,0x4(%rsi)
  mov    0x10(%rdi),%r9d
  test   %r9d,%r9d
  jne    L206
L244:
  mov    0x14(%rdi),%eax
  test   %eax,%eax
  je     L170
  mov    (%rsi),%edx
  test   %edx,%edx
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x5,0x4(%rsi)
  mov    0x18(%rdi),%r11d
  test   %r11d,%r11d
  jne    L206
L218:
  mov    0x1c(%rdi),%eax
  test   %eax,%eax
  je     L111
  mov    (%rsi),%r8d
  test   %r8d,%r8d
  jne    L206
  mov    %eax,(%rsi)
  movl   $0x7,0x4(%rsi)
  mov    0x20(%rdi),%ecx
  test   %ecx,%ecx
  je     L220
L206:
  movl   $0xffffffff,(%rsi)
  ret
```

assistant: ```c
void check_set(int set[], int *ret_func) {
  for (int i = 0; i < 9; i++) {
    if (set[i] != 0) {
      if (ret_func[0] != 0) {
        ret_func[0] = -1;
        break;
      }
      ret_func[0] = set[i];
      ret_func[1] = i;
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<asn1_find_end>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,%eax
  mov    %al,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
  movzbl -0x44(%rbp),%eax
  test   %al,%al
  jne    L139
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x1,%eax
  jmp    L106
L139:
  movl   $0x1,-0x24(%rbp)
  jmp    L18
L142:
  mov    -0x40(%rbp),%rdx
  lea    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <asn1_check_eoc@plt>
  test   %rax,%rax
  je     L19
  subl   $0x1,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L128
  subq   $0x2,-0x40(%rbp)
  jmp    L18
L19:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x44(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  sub    $0x8,%rsp
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0xffffffffffffffff
  push   -0x40(%rbp)
  mov    %rcx,%r9
  mov    $0x0,%r8d
  mov    %rdx,%rcx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <asn1_check_tlen@plt>
  add    $0x30,%rsp
  test   %eax,%eax
  jne    L49
  mov    D36(%rip),%rax
  mov    (%rax),%edx
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ASN1err@plt>
  mov    $0x0,%eax
  jmp    L106
L49:
  movzbl -0x44(%rbp),%eax
  test   %al,%al
  je     L146
  addl   $0x1,-0x24(%rbp)
  jmp    L135
L146:
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
L135:
  mov    -0x18(%rbp),%rax
  sub    -0x10(%rbp),%rax
  sub    %rax,-0x40(%rbp)
L18:
  cmpq   $0x0,-0x40(%rbp)
  jg     L142
  jmp    L84
L128:
  nop
L84:
  cmpl   $0x0,-0x24(%rbp)
  je     L14
  mov    D28(%rip),%rax
  mov    (%rax),%edx
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ASN1err@plt>
  mov    $0x0,%eax
  jmp    L106
L14:
  mov    -0x18(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x1,%eax
L106:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L78
  call   <__stack_chk_fail@plt>
L78:
  leave
  ret
```

assistant: ```c
int asn1_find_end(const unsigned char **in, long len, char inf) {
  int expected_eoc;
  long plen;
  const unsigned char *p = *in, *q;
  if (inf == 0) {
    *in += len;
    return 1;
  }
  expected_eoc = 1;
  while (len > 0) {
    if (asn1_check_eoc(&p, len)) {
      expected_eoc--;
      if (expected_eoc == 0)
        break;
      len -= 2;
      continue;
    }
    q = p;
    if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len, -1, 0, 0, NULL)) {
      ASN1err(ASN1_F_ASN1_FIND_END, ERR_R_NESTED_ASN1_ERROR);
      return 0;
    }
    if (inf)
      expected_eoc++;
    else
      p += plen;
    len -= p - q;
  }
  if (expected_eoc) {
    ASN1err(ASN1_F_ASN1_FIND_END, ASN1_R_MISSING_EOC);
    return 0;
  }
  *in = p;
  return 1;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<asn1_find_end>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %dl,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%rax
  mov    %rax,0x20(%rsp)
  test   %dl,%dl
  je     L1
  mov    $0x1,%r12d
  lea    0x20(%rsp),%r14
  test   %rsi,%rsi
  jg     L28
  jmp    L127
L1:
  add    %rsi,%rax
  mov    %rax,(%rdi)
  mov    $0x1,%r13d
  jmp    L5
L7:
  sub    $0x2,%rbx
  jmp    L130
L78:
  mov    0x20(%rsp),%r15
  lea    0xc(%rsp),%rcx
  lea    0x18(%rsp),%rdi
  sub    $0x8,%rsp
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0xffffffffffffffff
  push   %rbx
  mov    %r14,%r9
  mov    $0x0,%r8d
  mov    $0x0,%edx
  mov    $0x0,%esi
  call   <asn1_check_tlen@plt>
  mov    %eax,%r13d
  add    $0x30,%rsp
  test   %eax,%eax
  je     L147
  cmpb   $0x0,0xc(%rsp)
  je     L82
  add    $0x1,%r12d
L51:
  sub    0x20(%rsp),%r15
  lea    (%r15,%rbx,1),%rbx
L130:
  test   %rbx,%rbx
  jle    L90
L28:
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <asn1_check_eoc@plt>
  test   %rax,%rax
  je     L78
  sub    $0x1,%r12d
  jne    L7
L14:
  mov    0x20(%rsp),%rax
  mov    %rax,0x0(%rbp)
  mov    $0x1,%r13d
L5:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  mov    %r13d,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L147:
  mov    D11(%rip),%rax
  mov    (%rax),%esi
  mov    D30(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1err@plt>
  jmp    L5
L82:
  mov    0x18(%rsp),%rax
  add    %rax,0x20(%rsp)
  jmp    L51
L90:
  test   %r12d,%r12d
  je     L14
L127:
  mov    D17(%rip),%rax
  mov    (%rax),%esi
  mov    D30(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1err@plt>
  mov    $0x0,%r13d
  jmp    L5
L72:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int asn1_find_end(const unsigned char **in, long len, char inf) {
  int expected_eoc;
  long plen;
  const unsigned char *p = *in, *q;
  if (inf == 0) {
    *in += len;
    return 1;
  }
  expected_eoc = 1;
  while (len > 0) {
    if (asn1_check_eoc(&p, len)) {
      expected_eoc--;
      if (expected_eoc == 0)
        break;
      len -= 2;
      continue;
    }
    q = p;
    if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len, -1, 0, 0, NULL)) {
      ASN1err(ASN1_F_ASN1_FIND_END, ERR_R_NESTED_ASN1_ERROR);
      return 0;
    }
    if (inf)
      expected_eoc++;
    else
      p += plen;
    len -= p - q;
  }
  if (expected_eoc) {
    ASN1err(ASN1_F_ASN1_FIND_END, ASN1_R_MISSING_EOC);
    return 0;
  }
  *in = p;
  return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<asn1_find_end>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  mov    %dl,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  mov    (%rdi),%rax
  mov    %rax,0x20(%rsp)
  test   %dl,%dl
  je     L30
  mov    $0x1,%r12d
  lea    0x20(%rsp),%r15
  lea    0xc(%rsp),%r14
  test   %rsi,%rsi
  jle    L13
L59:
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <asn1_check_eoc@plt>
  test   %rax,%rax
  je     L3
  sub    $0x1,%r12d
  jne    L56
  mov    0x20(%rsp),%rax
  mov    $0x1,%r13d
  mov    %rax,0x0(%rbp)
L73:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0x38,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L3:
  mov    0x20(%rsp),%rax
  lea    0x18(%rsp),%rdi
  sub    $0x8,%rsp
  xor    %edx,%edx
  mov    %r15,%r9
  xor    %r8d,%r8d
  mov    %r14,%rcx
  xor    %esi,%esi
  mov    %rax,0x8(%rsp)
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0xffffffffffffffff
  push   %rbx
  call   <asn1_check_tlen@plt>
  add    $0x30,%rsp
  mov    %eax,%r13d
  test   %eax,%eax
  je     L52
  cmpb   $0x0,0xc(%rsp)
  mov    0x20(%rsp),%rax
  je     L90
  add    $0x1,%r12d
L44:
  sub    (%rsp),%rax
  sub    %rax,%rbx
L74:
  test   %rbx,%rbx
  jg     L59
L13:
  mov    D2(%rip),%rax
  xor    %r13d,%r13d
  mov    (%rax),%esi
  mov    D0(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1err@plt>
  jmp    L73
L30:
  add    %rsi,%rax
  mov    $0x1,%r13d
  mov    %rax,(%rdi)
  jmp    L73
  nopl   0x0(%rax)
L56:
  sub    $0x2,%rbx
  jmp    L74
  xchg   %ax,%ax
L90:
  add    0x18(%rsp),%rax
  mov    %rax,0x20(%rsp)
  jmp    L44
  nopl   0x0(%rax)
L52:
  mov    D12(%rip),%rax
  mov    (%rax),%esi
  mov    D0(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1err@plt>
  jmp    L73
L32:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int asn1_find_end(const unsigned char **in, long len, char inf) {
  int expected_eoc;
  long plen;
  const unsigned char *p = *in, *q;
  if (inf == 0) {
    *in += len;
    return 1;
  }
  expected_eoc = 1;
  while (len > 0) {
    if (asn1_check_eoc(&p, len)) {
      expected_eoc--;
      if (expected_eoc == 0)
        break;
      len -= 2;
      continue;
    }
    q = p;
    if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len, -1, 0, 0, NULL)) {
      ASN1err(ASN1_F_ASN1_FIND_END, ERR_R_NESTED_ASN1_ERROR);
      return 0;
    }
    if (inf)
      expected_eoc++;
    else
      p += plen;
    len -= p - q;
  }
  if (expected_eoc) {
    ASN1err(ASN1_F_ASN1_FIND_END, ASN1_R_MISSING_EOC);
    return 0;
  }
  *in = p;
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<asn1_find_end>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  mov    %dl,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  mov    (%rdi),%rax
  mov    %rax,0x20(%rsp)
  test   %dl,%dl
  je     L111
  mov    $0x1,%r12d
  lea    0x20(%rsp),%r15
  lea    0xc(%rsp),%r14
  test   %rsi,%rsi
  jle    L123
L61:
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <asn1_check_eoc@plt>
  test   %rax,%rax
  je     L27
  sub    $0x1,%r12d
  jne    L66
  mov    0x20(%rsp),%rax
  mov    $0x1,%r13d
  mov    %rax,0x0(%rbp)
L3:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L115
  add    $0x38,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L27:
  mov    0x20(%rsp),%rax
  lea    0x18(%rsp),%rdi
  sub    $0x8,%rsp
  xor    %edx,%edx
  mov    %r15,%r9
  xor    %r8d,%r8d
  mov    %r14,%rcx
  xor    %esi,%esi
  mov    %rax,0x8(%rsp)
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0xffffffffffffffff
  push   %rbx
  call   <asn1_check_tlen@plt>
  add    $0x30,%rsp
  mov    %eax,%r13d
  test   %eax,%eax
  je     L124
  cmpb   $0x0,0xc(%rsp)
  mov    0x20(%rsp),%rax
  je     L38
  add    $0x1,%r12d
L128:
  sub    (%rsp),%rax
  sub    %rax,%rbx
L76:
  test   %rbx,%rbx
  jg     L61
L123:
  mov    D15(%rip),%rax
  xor    %r13d,%r13d
  mov    (%rax),%esi
  mov    D35(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1err@plt>
  jmp    L3
L111:
  add    %rsi,%rax
  mov    $0x1,%r13d
  mov    %rax,(%rdi)
  jmp    L3
  nopl   0x0(%rax)
L66:
  sub    $0x2,%rbx
  jmp    L76
  xchg   %ax,%ax
L38:
  add    0x18(%rsp),%rax
  mov    %rax,0x20(%rsp)
  jmp    L128
  nopl   0x0(%rax)
L124:
  mov    D3(%rip),%rax
  mov    (%rax),%esi
  mov    D35(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1err@plt>
  jmp    L3
L115:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int asn1_find_end(const unsigned char **in, long len, char inf) {
  int expected_eoc;
  long plen;
  const unsigned char *p = *in, *q;
  if (inf == 0) {
    *in += len;
    return 1;
  }
  expected_eoc = 1;
  while (len > 0) {
    if (asn1_check_eoc(&p, len)) {
      expected_eoc--;
      if (expected_eoc == 0)
        break;
      len -= 2;
      continue;
    }
    q = p;
    if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len, -1, 0, 0, NULL)) {
      ASN1err(ASN1_F_ASN1_FIND_END, ERR_R_NESTED_ASN1_ERROR);
      return 0;
    }
    if (inf)
      expected_eoc++;
    else
      p += plen;
    len -= p - q;
  }
  if (expected_eoc) {
    ASN1err(ASN1_F_ASN1_FIND_END, ASN1_R_MISSING_EOC);
    return 0;
  }
  *in = p;
  return 1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<Vec_StrBase10Log>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jne    L26
  mov    $0x0,%eax
  jmp    L37
L26:
  cmpl   $0x1,-0x14(%rbp)
  jne    L53
  mov    $0x1,%eax
  jmp    L37
L53:
  movl   $0x0,-0x4(%rbp)
  subl   $0x1,-0x14(%rbp)
  jmp    L11
L0:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0x14(%rbp)
  addl   $0x1,-0x4(%rbp)
L11:
  cmpl   $0x0,-0x14(%rbp)
  jne    L0
  mov    -0x4(%rbp),%eax
L37:
  pop    %rbp
  ret
```

assistant: ```c
int Vec_StrBase10Log(unsigned Num) {
  int Res;
  if (Num == 0)
    return 0;
  if (Num == 1)
    return 1;
  for (Res = 0, Num--; Num; Num /= 10, Res++)
    ;
  return Res;
}
```