ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<vt_write_hex_4>:
  endbr64
  sub    $0x18,%rsp
  and    $0xf,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x30(%rdi),%edx
  cmp    $0x9,%edi
  lea    0x37(%rdi),%eax
  cmovle %edx,%eax
  lea    0x4(%rsp),%rsi
  mov    $0x4,%edx
  mov    %eax,0x4(%rsp)
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <write@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x18,%rsp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void vt_write_hex_4(uint8_t value) {
  value &= 0b1111;
  uint8_t ch;
  if (value <= 0x9) {
    ch = (value - 0x0) + '0';
  } else {
    ch = (value - 0xA) + 'A';
  }
  write(STDOUT_FILENO, &ch, sizeof(ch));
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<logger_write>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %edi,-0xc4(%rbp)
  mov    %rsi,-0xd0(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L9
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L9:
  mov    -0xd0(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xb4(%rbp),%edx
  mov    -0xd0(%rbp),%rcx
  mov    -0xc4(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <vsyslog@plt>
  mov    -0xb4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  nop
  leave
  ret
```

assistant: ```c
extern void logger_write(int priority, const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vsyslog(priority, fmt, ap);
  va_end(ap);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<logger_write>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %rsi,%rbx
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <vsyslog@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
extern void logger_write(int priority, const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vsyslog(priority, fmt, ap);
  va_end(ap);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<logger_write>:
  endbr64
  push   %r13
  mov    %edi,%r13d
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %r12d,%edi
  mov    %rsi,%rbp
  call   <va_start@plt>
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <vsyslog@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
extern void logger_write(int priority, const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vsyslog(priority, fmt, ap);
  va_end(ap);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<logger_write>:
  endbr64
  push   %r13
  mov    %edi,%r13d
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %r12d,%edi
  mov    %rsi,%rbp
  call   <va_start@plt>
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <vsyslog@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
extern void logger_write(int priority, const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vsyslog(priority, fmt, ap);
  va_end(ap);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<DelRash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L25
L4:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L26
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L20
L26:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x4(%rbp)
L25:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x4(%rbp)
  jl     L4
  nop
L20:
  nop
  leave
  ret
```

assistant: ```c
void DelRash(char *out, char *in) {
  int i;
  for (i = 0; i < strlen(in); i++) {
    if (in[i] == '.') {
      out[i] = 0;
      break;
    }
    out[i] = in[i];
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<DelRash>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    $0x0,%ebx
  jmp    L7
L4:
  mov    %al,(%r12,%rbx,1)
  add    $0x1,%rbx
L7:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    %ebx,%eax
  jle    L16
  movzbl 0x0(%rbp,%rbx,1),%eax
  cmp    $0x2e,%al
  jne    L4
  movb   $0x0,(%r12,%rbx,1)
L16:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void DelRash(char *out, char *in) {
  int i;
  for (i = 0; i < strlen(in); i++) {
    if (in[i] == '.') {
      out[i] = 0;
      break;
    }
    out[i] = in[i];
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<DelRash>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  jmp    L27
  nopw   0x0(%rax,%rax,1)
L18:
  movzbl 0x0(%rbp,%rbx,1),%eax
  lea    (%r12,%rbx,1),%rdx
  cmp    $0x2e,%al
  je     L21
  mov    %al,(%r12,%rbx,1)
  add    $0x1,%rbx
L27:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    %ebx,%eax
  jg     L18
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L21:
  movb   $0x0,(%rdx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void DelRash(char *out, char *in) {
  int i;
  for (i = 0; i < strlen(in); i++) {
    if (in[i] == '.') {
      out[i] = 0;
      break;
    }
    out[i] = in[i];
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<DelRash>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  jmp    L13
  nopw   0x0(%rax,%rax,1)
L6:
  movzbl 0x0(%rbp,%rbx,1),%eax
  lea    (%r12,%rbx,1),%rdx
  cmp    $0x2e,%al
  je     L12
  mov    %al,(%r12,%rbx,1)
  add    $0x1,%rbx
L13:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    %ebx,%eax
  jg     L6
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L12:
  movb   $0x0,(%rdx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void DelRash(char *out, char *in) {
  int i;
  for (i = 0; i < strlen(in); i++) {
    if (in[i] == '.') {
      out[i] = 0;
      break;
    }
    out[i] = in[i];
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<fatal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r12
  push   %rbx
  sub    $0x40,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r12
  lea    D4(%rip),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %rbx,%rax
  add    $0x1,%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    %rax,%rdx
  mov    %rdx,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  mov    %rax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  mov    %rax,%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
L3:
  cmp    %rdx,%rsp
  je     L1
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L3
L1:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L21
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L21:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x40(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x48(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  mov    %r12,%rsp
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_label: D4
type: string

tool: D4: [!!] Fatal Error: 

assistant: ```c
void fatal(char *message) {
  char *prefix = "[!!] Fatal Error: ", error_message[strlen(prefix) + strlen(message) + 1];
  strcpy(error_message, prefix);
  strcat(error_message, message);
  perror(error_message);
  exit(-1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<fatal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  call   <strlen@plt>
  add    $0x22,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L34:
  cmp    %rdx,%rsp
  je     L22
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L34
L22:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L36
  orq    $0x0,-0x8(%rsp,%rax,1)
L36:
  lea    D5(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %rsp,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  mov    -0x8(%rbp),%rbx
  leave
  ret
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D5
type_infered: string

tool: D5: [!!] Fatal Error: 

assistant: ```c
void fatal(char *message) {
  char *prefix = "[!!] Fatal Error: ", error_message[strlen(prefix) + strlen(message) + 1];
  strcpy(error_message, prefix);
  strcat(error_message, message);
  perror(error_message);
  exit(-1);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<fatal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  mov    %rdi,%r12
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rsp,%rcx
  add    $0x22,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L13
L49:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L49
L13:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L41
L22:
  lea    D8(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %rsp,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  mov    -0x8(%rbp),%r12
  leave
  ret
  nopl   (%rax)
L41:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L22
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D8
type_infered: string

tool: D8: [!!] Fatal Error: 

assistant: ```c
void fatal(char *message) {
  char *prefix = "[!!] Fatal Error: ", error_message[strlen(prefix) + strlen(message) + 1];
  strcpy(error_message, prefix);
  strcat(error_message, message);
  perror(error_message);
  exit(-1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<fatal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  mov    %rdi,%r12
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rsp,%rcx
  add    $0x22,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L26
L36:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L36
L26:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L27
L13:
  lea    D2(%rip),%rsi
  mov    %rsp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rsp,%rdi
  call   <strcat@plt>
  mov    %rsp,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L44
  mov    -0x8(%rbp),%r12
  leave
  ret
  nopl   (%rax)
L27:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L13
L44:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D2
datatype: string

tool: D2: [!!] Fatal Error: 

assistant: ```c
void fatal(char *message) {
  char *prefix = "[!!] Fatal Error: ", error_message[strlen(prefix) + strlen(message) + 1];
  strcpy(error_message, prefix);
  strcat(error_message, message);
  perror(error_message);
  exit(-1);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movss  D27(%rip),%xmm0
  movss  %xmm0,-0x8(%rbp)
  movss  D10(%rip),%xmm0
  movss  %xmm0,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movd   %eax,%xmm0
  call   <asin@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x8(%rbp)
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <print@plt>
  mov    -0x8(%rbp),%eax
  movd   %eax,%xmm0
  call   <printid@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D27
data_type: f32
name: read_data
arguments: tag: D10
data_type: f32
name: read_data
arguments: tag: D8
data_type: string

tool: D27: 2

tool: D10: 3

tool: D8: a -1

assistant: ```c
int main() {
  float a = 2, b = 3;
  a = asin(b);
  print("a -1");
  printid(a);
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  movss  D5(%rip),%xmm0
  call   <asin@plt>
  movss  %xmm0,0xc(%rsp)
  lea    D1(%rip),%rdi
  call   <print@plt>
  movss  0xc(%rsp),%xmm0
  call   <printid@plt>
  mov    $0x0,%eax
  add    $0x18,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D5
data_type: f32
name: extract_symbolic_data
arguments: label: D1
data_type: string

tool: D5: 3

tool: D1: a -1

assistant: ```c
int main() {
  float a = 2, b = 3;
  a = asin(b);
  print("a -1");
  printid(a);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  movss  D12(%rip),%xmm0
  call   <asin@plt>
  lea    D15(%rip),%rdi
  movss  %xmm0,0xc(%rsp)
  call   <print@plt>
  movss  0xc(%rsp),%xmm0
  call   <printid@plt>
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
```

tool_calls: name: parse_data
arguments: label: D12
type_guessed: f32
name: parse_data
arguments: label: D15
type_guessed: string

tool: D12: 3

tool: D15: a -1

assistant: ```c
int main() {
  float a = 2, b = 3;
  a = asin(b);
  print("a -1");
  printid(a);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  movss  D0(%rip),%xmm0
  call   <asin@plt>
  lea    D11(%rip),%rdi
  movss  %xmm0,0xc(%rsp)
  call   <print@plt>
  movss  0xc(%rsp),%xmm0
  call   <printid@plt>
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D0
type_infered: f32
name: disassemble_data
arguments: data_label: D11
type_infered: string

tool: D0: 3

tool: D11: a -1

assistant: ```c
int main() {
  float a = 2, b = 3;
  a = asin(b);
  print("a -1");
  printid(a);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<getnum_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L18
L181:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L2
  cmpl   $0x0,-0x4(%rbp)
  jne    L168
L2:
  cmpl   $0x0,-0xc(%rbp)
  jne    L152
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L18
L168:
  cmpl   $0x3b,-0x4(%rbp)
  jne    L98
  jmp    L96
L6:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
L96:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x20(%rbp)
  jb     L47
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0xa,-0x4(%rbp)
  jne    L6
L47:
  cmpl   $0x0,-0xc(%rbp)
  jne    L42
  jmp    L18
L98:
  mov    -0x4(%rbp),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L27
  cmpl   $0x29,-0x4(%rbp)
  jne    L106
  cmpl   $0x0,-0xc(%rbp)
  je     L106
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L68
L106:
  mov    $0xffffffff,%eax
  jmp    L143
L27:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
L18:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x20(%rbp)
  jae    L181
  jmp    L68
L152:
  nop
  jmp    L68
L42:
  nop
L68:
  mov    -0x10(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
L143:
  leave
  ret
```

assistant: ```c
int getnum_str(u_char **startpp, u_char *endp) {
  int c, n;
  int seendigit = 0;
  int m = 0;
  for (n = 0; *startpp <= endp;) {
    c = **startpp;
    if (isspace(c) || c == '\0') {
      if (seendigit)
        break;
      else {
        (*startpp)++;
        continue;
      }
    }
    if (c == ';') {
      while ((*startpp <= endp) && ((c = **startpp) != '\n'))
        (*startpp)++;
      if (seendigit)
        break;
      continue;
    }
    if (!isdigit(c)) {
      if (c == ')' && seendigit) {
        (*startpp)--;
        break;
      }
      return (-1);
    }
    (*startpp)++;
    n = n * 10 + (c - '0');
    seendigit = 1;
  }
  return (n + m);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<getnum_str>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rax
  cmp    %rax,%rsi
  jb     L82
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  mov    $0x1,%r15d
L145:
  mov    (%rax),%ebp
  mov    %ebp,%edi
  call   <isspace@plt>
  test   %ebp,%ebp
  je     L2
  test   %rax,%rax
  je     L176
L2:
  test   %r14d,%r14d
  je     L74
L108:
  mov    %r13d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L74:
  addq   $0x4,(%rbx)
L172:
  mov    (%rbx),%rax
  cmp    %r12,%rax
  jbe    L145
  jmp    L108
L176:
  cmp    $0x3b,%ebp
  je     L80
  lea    -0x30(%rbp),%eax
  cmp    $0x9,%eax
  ja     L103
  addq   $0x4,(%rbx)
  lea    0x0(%r13,%r13,4),%eax
  lea    -0x30(%rbp,%rax,2),%r13d
  mov    %r15d,%r14d
  jmp    L172
L80:
  mov    (%rbx),%rax
  cmp    %rax,%r12
  jb     L184
L1:
  cmpl   $0xa,(%rax)
  je     L184
  add    $0x4,%rax
  mov    %rax,(%rbx)
  cmp    %r12,%rax
  jbe    L1
L184:
  test   %r14d,%r14d
  jne    L108
  jmp    L172
L103:
  cmp    $0x29,%ebp
  jne    L18
  test   %r14d,%r14d
  je     L18
  subq   $0x4,(%rbx)
  jmp    L108
L82:
  mov    $0x0,%r13d
  jmp    L108
L18:
  mov    $0xffffffff,%r13d
  jmp    L108
```

assistant: ```c
int getnum_str(u_char **startpp, u_char *endp) {
  int c, n;
  int seendigit = 0;
  int m = 0;
  for (n = 0; *startpp <= endp;) {
    c = **startpp;
    if (isspace(c) || c == '\0') {
      if (seendigit)
        break;
      else {
        (*startpp)++;
        continue;
      }
    }
    if (c == ';') {
      while ((*startpp <= endp) && ((c = **startpp) != '\n'))
        (*startpp)++;
      if (seendigit)
        break;
      continue;
    }
    if (!isdigit(c)) {
      if (c == ')' && seendigit) {
        (*startpp)--;
        break;
      }
      return (-1);
    }
    (*startpp)++;
    n = n * 10 + (c - '0');
    seendigit = 1;
  }
  return (n + m);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<getnum_str>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    (%rdi),%rax
  cmp    %rax,%rsi
  jb     L32
  mov    %rdi,%rbx
  mov    %rsi,%r12
  xor    %r13d,%r13d
  xor    %r14d,%r14d
L28:
  mov    (%rax),%ebp
  mov    %ebp,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L158
  test   %ebp,%ebp
  jne    L87
L158:
  test   %r13d,%r13d
  je     L177
L176:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L87:
  cmp    $0x3b,%ebp
  je     L142
  lea    -0x30(%rbp),%edx
  cmp    $0x9,%edx
  ja     L49
  mov    (%rbx),%rax
  lea    (%r14,%r14,4),%ecx
  mov    $0x1,%r13d
  lea    (%rdx,%rcx,2),%r14d
  add    $0x4,%rax
  mov    %rax,(%rbx)
L92:
  cmp    %rax,%r12
  jae    L28
  jmp    L176
  nopl   0x0(%rax)
L177:
  mov    (%rbx),%rax
  add    $0x4,%rax
  mov    %rax,(%rbx)
  jmp    L92
  nopl   0x0(%rax)
L142:
  mov    (%rbx),%rax
  cmp    %rax,%r12
  jae    L197
  jmp    L55
  nopw   0x0(%rax,%rax,1)
L58:
  add    $0x4,%rax
  mov    %rax,(%rbx)
  cmp    %r12,%rax
  ja     L55
L197:
  cmpl   $0xa,(%rax)
  jne    L58
L55:
  test   %r13d,%r13d
  jne    L176
  mov    (%rbx),%rax
  jmp    L92
  nopl   0x0(%rax,%rax,1)
L32:
  xor    %r14d,%r14d
  jmp    L176
L49:
  cmp    $0x29,%ebp
  jne    L94
  test   %r13d,%r13d
  je     L94
  subq   $0x4,(%rbx)
  jmp    L176
L94:
  or     $0xffffffff,%r14d
  jmp    L176
```

assistant: ```c
int getnum_str(u_char **startpp, u_char *endp) {
  int c, n;
  int seendigit = 0;
  int m = 0;
  for (n = 0; *startpp <= endp;) {
    c = **startpp;
    if (isspace(c) || c == '\0') {
      if (seendigit)
        break;
      else {
        (*startpp)++;
        continue;
      }
    }
    if (c == ';') {
      while ((*startpp <= endp) && ((c = **startpp) != '\n'))
        (*startpp)++;
      if (seendigit)
        break;
      continue;
    }
    if (!isdigit(c)) {
      if (c == ')' && seendigit) {
        (*startpp)--;
        break;
      }
      return (-1);
    }
    (*startpp)++;
    n = n * 10 + (c - '0');
    seendigit = 1;
  }
  return (n + m);
}
```