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

```asm
<outputData>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movq   $0x0,-0x8(%rbp)
  movq   $0x0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D12(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L4
L15:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D16(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  addl   $0x1,-0xc(%rbp)
L4:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L15
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D12
type_guessed: string
name: disassemble_data
arguments: data_label: D16
type_guessed: string

tool: D12: w

tool: D16: %f 

assistant: ```c
void outputData(char *name, double *data, int nvars) {
  int j;
  FILE *fileHandle = NULL;
  fileHandle = NULL;
  fileHandle = fopen(name, "w");
  for (j = 0; j < nvars; j++) {
    fprintf(fileHandle, "%f ", data[j]);
  }
  fprintf(fileHandle, "\n");
  fclose(fileHandle);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<outputData>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%r13
  mov    %edx,%r12d
  lea    D7(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L15
  mov    %r13,%rbx
  lea    -0x1(%r12),%eax
  lea    0x8(%r13,%rax,8),%r13
  lea    D14(%rip),%r12
L18:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L18
L15:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: unpack_data
arguments: tag: D7
type_guessed: string
name: unpack_data
arguments: tag: D14
type_guessed: string

tool: D7: w

tool: D14: %f 

assistant: ```c
void outputData(char *name, double *data, int nvars) {
  int j;
  FILE *fileHandle = NULL;
  fileHandle = NULL;
  fileHandle = fopen(name, "w");
  for (j = 0; j < nvars; j++) {
    fprintf(fileHandle, "%f ", data[j]);
  }
  fprintf(fileHandle, "\n");
  fclose(fileHandle);
}
```
user: Translate the below assembly code into C programming language:

```asm
<outputData>:
  endbr64
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    D17(%rip),%rsi
  sub    $0x8,%rsp
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L15
  lea    -0x1(%r12),%eax
  lea    D19(%rip),%r12
  lea    0x8(%rbx,%rax,8),%r13
  nopl   0x0(%rax)
L16:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  add    $0x8,%rbx
  call   <fprintf@plt>
  cmp    %r13,%rbx
  jne    L16
L15:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1080 <fclose@plt>
```

tool_calls: name: disassemble_data
arguments: label: D17
type: string
name: disassemble_data
arguments: label: D19
type: string

tool: D17: w

tool: D19: %f 

assistant: ```c
void outputData(char *name, double *data, int nvars) {
  int j;
  FILE *fileHandle = NULL;
  fileHandle = NULL;
  fileHandle = fopen(name, "w");
  for (j = 0; j < nvars; j++) {
    fprintf(fileHandle, "%f ", data[j]);
  }
  fprintf(fileHandle, "\n");
  fclose(fileHandle);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<outputData>:
  endbr64
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    D6(%rip),%rsi
  sub    $0x8,%rsp
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L18
  lea    -0x1(%r12),%eax
  lea    D18(%rip),%r12
  lea    0x8(%rbx,%rax,8),%r13
  nopl   0x0(%rax)
L13:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  add    $0x8,%rbx
  call   <fprintf@plt>
  cmp    %r13,%rbx
  jne    L13
L18:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1080 <fclose@plt>
```

tool_calls: name: disassemble_data
arguments: label: D6
data_type: string
name: disassemble_data
arguments: label: D18
data_type: string

tool: D6: w

tool: D18: %f 

assistant: ```c
void outputData(char *name, double *data, int nvars) {
  int j;
  FILE *fileHandle = NULL;
  fileHandle = NULL;
  fileHandle = fopen(name, "w");
  for (j = 0; j < nvars; j++) {
    fprintf(fileHandle, "%f ", data[j]);
  }
  fprintf(fileHandle, "\n");
  fclose(fileHandle);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  lea    D21(%rip),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x7a,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %rdx,%r9
  lea    D16(%rip),%r8
  mov    %eax,%ecx
  lea    D25(%rip),%rax
  mov    %rax,%rdx
  lea    D3(%rip),%rax
  mov    %rax,%rsi
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D21
data_type: string
name: read_data
arguments: tag: D16
data_type: string
name: read_data
arguments: tag: D25
data_type: string
name: read_data
arguments: tag: D3
data_type: string
name: read_data
arguments: tag: D43
data_type: string

tool: D21: A zoo has many animals including zebras

tool: D16:  is: 

tool: D25: last occurrence of character 

tool: D3: The remainder of string1 beginning with the

tool: D43: %s
%s'%c'%s"%s"


assistant: ```c
int main(void) {
  const char *string1 = "A zoo has many animals including zebras";
  int c = 'z';
  printf("%s\n%s'%c'%s\"%s\"\n", "The remainder of string1 beginning with the", "last occurrence of character ", c, " is: ", strrchr(string1, c));
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D46(%rip),%r9
  lea    D22(%rip),%r8
  mov    $0x7a,%ecx
  lea    D10(%rip),%rdx
  lea    D44(%rip),%rsi
  lea    D26(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D46
datatype: string
name: disassemble_data
arguments: tag: D22
datatype: string
name: disassemble_data
arguments: tag: D10
datatype: string
name: disassemble_data
arguments: tag: D44
datatype: string
name: disassemble_data
arguments: tag: D26
datatype: string

tool: D46: zebras

tool: D22:  is: 

tool: D10: last occurrence of character 

tool: D44: The remainder of string1 beginning with the

tool: D26: %s
%s'%c'%s"%s"


assistant: ```c
int main(void) {
  const char *string1 = "A zoo has many animals including zebras";
  int c = 'z';
  printf("%s\n%s'%c'%s\"%s\"\n", "The remainder of string1 beginning with the", "last occurrence of character ", c, " is: ", strrchr(string1, c));
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D45(%rip),%r9
  lea    D13(%rip),%r8
  mov    $0x7a,%ecx
  lea    D14(%rip),%rdx
  lea    D32(%rip),%rsi
  lea    D36(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: label: D45
type: string
name: retrieve_data
arguments: label: D13
type: string
name: retrieve_data
arguments: label: D14
type: string
name: retrieve_data
arguments: label: D32
type: string
name: retrieve_data
arguments: label: D36
type: string

tool: D45: zebras

tool: D13:  is: 

tool: D14: last occurrence of character 

tool: D32: The remainder of string1 beginning with the

tool: D36: %s
%s'%c'%s"%s"


assistant: ```c
int main(void) {
  const char *string1 = "A zoo has many animals including zebras";
  int c = 'z';
  printf("%s\n%s'%c'%s\"%s\"\n", "The remainder of string1 beginning with the", "last occurrence of character ", c, " is: ", strrchr(string1, c));
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D5(%rip),%r9
  lea    D11(%rip),%r8
  mov    $0x7a,%ecx
  lea    D28(%rip),%rdx
  lea    D2(%rip),%rsi
  lea    D30(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D5
data_type: string
name: disassemble_data
arguments: label: D11
data_type: string
name: disassemble_data
arguments: label: D28
data_type: string
name: disassemble_data
arguments: label: D2
data_type: string
name: disassemble_data
arguments: label: D30
data_type: string

tool: D5: zebras

tool: D11:  is: 

tool: D28: last occurrence of character 

tool: D2: The remainder of string1 beginning with the

tool: D30: %s
%s'%c'%s"%s"


assistant: ```c
int main(void) {
  const char *string1 = "A zoo has many animals including zebras";
  int c = 'z';
  printf("%s\n%s'%c'%s\"%s\"\n", "The remainder of string1 beginning with the", "last occurrence of character ", c, " is: ", strrchr(string1, c));
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<mdelay>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    $0x0,%eax
  call   <hwconfig_simulation_p@plt>
  test   %rax,%rax
  jne    L34
  mov    D16(%rip),%eax
  test   %eax,%eax
  jns    L9
  mov    $0x0,%eax
  call   <hwconfig_wishbone_divisor@plt>
  and    $0x7,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  lea    D3(%rip),%rax
  movzwl (%rdx,%rax,1),%eax
  movzwl %ax,%eax
  mov    %eax,D17(%rip)
L9:
  movl   $0x0,-0x4(%rbp)
  jmp    L33
L28:
  mov    D17(%rip),%eax
  mov    %eax,%edi
  call   <delay_1ms@plt>
  addl   $0x1,-0x4(%rbp)
L33:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L28
  jmp    L6
L34:
  nop
L6:
  leave
  ret
```

assistant: ```c
void mdelay(int ms) {
  static int loop_count = -1;
  if (hwconfig_simulation_p())
    return;
  if (loop_count < 0) {
    static unsigned short lc[8] = {0, (100000000 / (1) / 10000), (100000000 / (2) / 10000), (100000000 / (3) / 10000), (100000000 / (4) / 10000), (100000000 / (5) / 10000), (100000000 / (6) / 10000), (100000000 / (7) / 10000)};
    loop_count = lc[hwconfig_wishbone_divisor() & 0x7];
  }
  int i;
  for (i = 0; i < ms; i++)
    delay_1ms(loop_count);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<stringarg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L0
L74:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
L0:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L74
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L43
L46:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
L43:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L41
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  je     L46
L41:
  cmpq   $0x0,-0x20(%rbp)
  je     L37
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L35
L37:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L35
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rcx
  mov    -0x18(%rbp),%rdx
  mov    %rcx,(%rdx)
  movb   $0x0,(%rax)
L35:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L19
  jmp    L22
L27:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
L22:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L27
L19:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *stringarg(str, end)
char **str;
const char **end;
{
  char *start;
  while (isspace((unsigned char)(**str)))
    ++*str;
  for (start = *str; (**str && !isspace((unsigned char)(**str))); ++*str)
    ;
  if (end)
    *end = *str;
  else if (**str)
    *((*str)++) = '\0';
  if (**str)
    while (isspace((unsigned char)(**str)))
      ++*str;
  return start;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<stringarg>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%r14
  jmp    L91
L43:
  add    $0x1,%rbx
  mov    %rbx,(%r12)
L91:
  mov    (%r12),%rbx
  movzbl (%rbx),%ebp
  movzbl %bpl,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L43
  test   %bpl,%bpl
  je     L41
  mov    %rbx,%rbp
L22:
  mov    %rbp,%r13
  add    $0x1,%rbp
  mov    %rbp,(%r12)
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L15
  movzbl %dil,%edi
  call   <isspace@plt>
  test   %eax,%eax
  je     L22
  test   %r14,%r14
  je     L84
L42:
  mov    %rbp,(%r14)
L138:
  mov    (%r12),%rax
  cmpb   $0x0,(%rax)
  jne    L7
  jmp    L12
L84:
  add    $0x2,%r13
  mov    %r13,(%r12)
  movb   $0x0,0x0(%rbp)
  jmp    L138
L71:
  add    $0x1,%rbp
  mov    %rbp,(%r12)
L7:
  mov    (%r12),%rbp
  movzbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L71
L12:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L15:
  test   %r14,%r14
  jne    L42
  jmp    L138
L41:
  mov    %rbx,%rbp
  test   %r14,%r14
  jne    L42
  jmp    L12
```

assistant: ```c
char *stringarg(str, end)
char **str;
const char **end;
{
  char *start;
  while (isspace((unsigned char)(**str)))
    ++*str;
  for (start = *str; (**str && !isspace((unsigned char)(**str))); ++*str)
    ;
  if (end)
    *end = *str;
  else if (**str)
    *((*str)++) = '\0';
  if (**str)
    while (isspace((unsigned char)(**str)))
      ++*str;
  return start;
}
```
user: What is the c source code of the assembly code below:

```asm
<stringarg>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    (%rdi),%rax
  jmp    L109
  nopw   0x0(%rax,%rax,1)
L108:
  mov    %rax,0x0(%rbp)
L109:
  movzbl (%rax),%edi
  mov    %rax,%r12
  mov    %edi,%ebx
  call   <isspace@plt>
  mov    %eax,%r8d
  lea    0x1(%r12),%rax
  test   %r8d,%r8d
  jne    L108
  test   %bl,%bl
  mov    %r12,%rbx
  je     L32
  nopl   (%rax)
L63:
  mov    %rbx,%r13
  add    $0x1,%rbx
  mov    %rbx,0x0(%rbp)
  movzbl (%rbx),%edi
  test   %dil,%dil
  je     L32
  call   <isspace@plt>
  test   %eax,%eax
  je     L63
  test   %r14,%r14
  je     L80
L47:
  mov    %rbx,(%r14)
L105:
  mov    0x0(%rbp),%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L61
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L93:
  mov    %rbx,0x0(%rbp)
  movzbl (%rbx),%edi
L61:
  add    $0x1,%rbx
  call   <isspace@plt>
  test   %eax,%eax
  jne    L93
L74:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L32:
  test   %r14,%r14
  jne    L47
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L80:
  add    $0x2,%r13
  mov    %r13,0x0(%rbp)
  movb   $0x0,(%rbx)
  jmp    L105
```

assistant: ```c
char *stringarg(str, end)
char **str;
const char **end;
{
  char *start;
  while (isspace((unsigned char)(**str)))
    ++*str;
  for (start = *str; (**str && !isspace((unsigned char)(**str))); ++*str)
    ;
  if (end)
    *end = *str;
  else if (**str)
    *((*str)++) = '\0';
  if (**str)
    while (isspace((unsigned char)(**str)))
      ++*str;
  return start;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<stringarg>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    (%rdi),%rax
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L76:
  mov    %rax,0x0(%rbp)
L26:
  movzbl (%rax),%edi
  mov    %rax,%r12
  mov    %edi,%ebx
  call   <isspace@plt>
  mov    %eax,%r8d
  lea    0x1(%r12),%rax
  test   %r8d,%r8d
  jne    L76
  test   %bl,%bl
  mov    %r12,%rbx
  je     L85
  nopl   (%rax)
L62:
  mov    %rbx,%r13
  add    $0x1,%rbx
  mov    %rbx,0x0(%rbp)
  movzbl (%rbx),%edi
  test   %dil,%dil
  je     L85
  call   <isspace@plt>
  test   %eax,%eax
  je     L62
  test   %r14,%r14
  je     L16
L55:
  mov    %rbx,(%r14)
L81:
  mov    0x0(%rbp),%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L48
  jmp    L103
  nopw   0x0(%rax,%rax,1)
L106:
  mov    %rbx,0x0(%rbp)
  movzbl (%rbx),%edi
L48:
  add    $0x1,%rbx
  call   <isspace@plt>
  test   %eax,%eax
  jne    L106
L103:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L85:
  test   %r14,%r14
  jne    L55
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L16:
  add    $0x2,%r13
  mov    %r13,0x0(%rbp)
  movb   $0x0,(%rbx)
  jmp    L81
```

assistant: ```c
char *stringarg(str, end)
char **str;
const char **end;
{
  char *start;
  while (isspace((unsigned char)(**str)))
    ++*str;
  for (start = *str; (**str && !isspace((unsigned char)(**str))); ++*str)
    ;
  if (end)
    *end = *str;
  else if (**str)
    *((*str)++) = '\0';
  if (**str)
    while (isspace((unsigned char)(**str)))
      ++*str;
  return start;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<getNum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L4
L21:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L26
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L78
L26:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L38
  mov    $0x0,%eax
  jmp    L90
L78:
  addl   $0x1,-0x10(%rbp)
L4:
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L21
  jmp    L42
L38:
  nop
L42:
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  subl   $0x1,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  jmp    L74
L5:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  imul   -0xc(%rbp),%eax
  add    %eax,-0x14(%rbp)
  subl   $0x1,-0x10(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0xc(%rbp)
L74:
  cmpl   $0x0,-0x10(%rbp)
  jns    L5
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L52
L95:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x10(%rbp),%eax
  sub    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x10(%rbp)
L52:
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jle    L95
  mov    -0x10(%rbp),%eax
  sub    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x14(%rbp),%eax
L90:
  leave
  ret
```

assistant: ```c
int getNum(char *text) {
  int ret = 0;
  int i, j, o, l = strlen(text) - 1;
  for (i = 0; i < l; i++)
    if ((text[i] < '0') || (text[i] > '9')) {
      if (text[i] == ' ')
        break;
      else
        return 0;
    }
  o = i + 1;
  for (i--, j = 1; i >= 0; i--, j *= 10)
    ret += j * (text[i] - '0');
  for (i = o; i <= l; i++)
    text[i - o] = text[i];
  text[i - o] = 0;
  return ret;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<getNum>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  mov    %eax,%r8d
  lea    -0x1(%rax),%r9d
  test   %r9d,%r9d
  jle    L81
  mov    %r9d,%edi
  mov    %rbx,%rax
  mov    $0x0,%edx
L75:
  movzbl (%rax),%ecx
  lea    -0x30(%rcx),%esi
  cmp    $0x9,%sil
  ja     L10
  add    $0x1,%edx
  add    $0x1,%rax
  cmp    %edi,%edx
  jne    L75
L70:
  lea    0x1(%rdi),%r10d
  mov    %edi,%ecx
  sub    $0x1,%ecx
  js     L74
  movslq %ecx,%rcx
  add    %rbx,%rcx
  movslq %edi,%rax
  lea    -0x2(%rbx,%rax,1),%rax
  lea    -0x1(%rdi),%edx
  sub    %rdx,%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  mov    $0x0,%esi
L40:
  movsbl (%rcx),%edx
  sub    $0x30,%edx
  imul   %eax,%edx
  add    %edx,%esi
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    $0x1,%rcx
  cmp    %rdi,%rcx
  jne    L40
L84:
  cmp    %r9d,%r10d
  jg     L2
  mov    %rbx,%rax
  lea    -0x1(%r8),%edx
  sub    %r10d,%edx
  lea    0x1(%rbx,%rdx,1),%rdi
  movslq %r10d,%rcx
L99:
  movzbl (%rax,%rcx,1),%edx
  mov    %dl,(%rax)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L99
L98:
  sub    %r10d,%r8d
  movslq %r8d,%r8
  movb   $0x0,(%rbx,%r8,1)
L63:
  mov    %esi,%eax
  pop    %rbx
  ret
L10:
  mov    $0x0,%esi
  cmp    $0x20,%cl
  jne    L63
  mov    %edx,%edi
  jmp    L70
L81:
  mov    $0x1,%r10d
  mov    $0x0,%esi
  jmp    L84
L74:
  mov    $0x0,%esi
  jmp    L84
L2:
  mov    %r10d,%r8d
  jmp    L98
```

assistant: ```c
int getNum(char *text) {
  int ret = 0;
  int i, j, o, l = strlen(text) - 1;
  for (i = 0; i < l; i++)
    if ((text[i] < '0') || (text[i] > '9')) {
      if (text[i] == ' ')
        break;
      else
        return 0;
    }
  o = i + 1;
  for (i--, j = 1; i >= 0; i--, j *= 10)
    ret += j * (text[i] - '0');
  for (i = o; i <= l; i++)
    text[i - o] = text[i];
  text[i - o] = 0;
  return ret;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getNum>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  lea    -0x1(%rax),%edi
  test   %edi,%edi
  jle    L55
  mov    %eax,%esi
  lea    -0x2(%rax),%r9d
  xor    %edx,%edx
  jmp    L24
  nopw   0x0(%rax,%rax,1)
L72:
  lea    0x1(%rdx),%rcx
  cmp    %rdx,%r9
  je     L114
  mov    %rcx,%rdx
L24:
  movsbl (%rbx,%rdx,1),%eax
  movslq %edx,%r8
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  jbe    L72
  cmp    $0x20,%al
  je     L56
  xor    %r8d,%r8d
  pop    %rbx
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L114:
  lea    0x2(%r8),%r9d
L98:
  lea    -0x1(%rbx,%r8,1),%rcx
  mov    $0x1,%edx
  mov    %rcx,%r10
  sub    %r8,%r10
  xor    %r8d,%r8d
  jmp    L100
  nopl   0x0(%rax)
L9:
  movsbl (%rcx),%eax
  sub    $0x1,%rcx
L100:
  sub    $0x30,%eax
  imul   %edx,%eax
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  add    %eax,%r8d
  cmp    %r10,%rcx
  jne    L9
L50:
  cmp    %r9d,%edi
  jl     L4
  sub    %r9d,%edi
  mov    %rbx,%rax
  movslq %r9d,%rcx
  lea    0x1(%rbx,%rdi,1),%rdi
  nopl   (%rax)
L44:
  movzbl (%rax,%rcx,1),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rax,%rdi
  jne    L44
  sub    %r9d,%esi
  movslq %esi,%rsi
  add    %rsi,%rbx
L4:
  movb   $0x0,(%rbx)
  mov    %r8d,%eax
  pop    %rbx
  ret
  nopl   0x0(%rax)
L56:
  lea    0x1(%r8),%r9d
  sub    $0x1,%r8d
  jb     L115
  movslq %r8d,%r8
  movsbl (%rbx,%r8,1),%eax
  jmp    L98
L55:
  xor    %r8d,%r8d
  jmp    L4
L115:
  xor    %r8d,%r8d
  jmp    L50
```

assistant: ```c
int getNum(char *text) {
  int ret = 0;
  int i, j, o, l = strlen(text) - 1;
  for (i = 0; i < l; i++)
    if ((text[i] < '0') || (text[i] > '9')) {
      if (text[i] == ' ')
        break;
      else
        return 0;
    }
  o = i + 1;
  for (i--, j = 1; i >= 0; i--, j *= 10)
    ret += j * (text[i] - '0');
  for (i = o; i <= l; i++)
    text[i - o] = text[i];
  text[i - o] = 0;
  return ret;
}
```