ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_cpu_features>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    -0x8(%rbp),%esi
  mov    -0xc(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %esi,%r8d
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <__cpuid@plt>
  mov    D122(%rip),%rax
  mov    (%rax),%edx
  mov    D85(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D108(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D44(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D1(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D59(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D82(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  and    %eax,-0xc(%rbp)
  mov    D39(%rip),%rax
  mov    (%rax),%edx
  mov    D99(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D35(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  and    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  or     -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%esi
  mov    -0xc(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %esi,%r9d
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0x0,%esi
  mov    $0x7,%edi
  call   <__cpuid_count@plt>
  mov    D29(%rip),%rax
  mov    (%rax),%edx
  mov    D86(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D124(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  and    %eax,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  or     -0x10(%rbp),%eax
  leave
  ret
```

assistant: ```c
int get_cpu_features(void) {
  int a, b, c, d, _tmp;
  __cpuid(1, a, b, c, d);
  c &= bit_SSE3 | bit_SSSE3 | bit_FMA | bit_SSE4_1 | bit_SSE4_2 | bit_AVX | bit_F16C;
  d &= bit_SSE | bit_SSE2 | bit_MMX;
  _tmp = c | d;
  __cpuid_count(7, 0, a, b, c, d);
  b &= bit_BMI | bit_AVX2 | bit_BMI2;
  return _tmp | b;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<get_cpu_features>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%ebp
  mov    %ebp,%edx
  mov    $0x0,%ebx
  mov    %ebx,%esi
  mov    $0x1,%edi
  call   <__cpuid@plt>
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    %ebp,%ecx
  mov    %ebx,%edx
  mov    $0x0,%esi
  mov    $0x7,%edi
  call   <__cpuid_count@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int get_cpu_features(void) {
  int a, b, c, d, _tmp;
  __cpuid(1, a, b, c, d);
  c &= bit_SSE3 | bit_SSSE3 | bit_FMA | bit_SSE4_1 | bit_SSE4_2 | bit_AVX | bit_F16C;
  d &= bit_SSE | bit_SSE2 | bit_MMX;
  _tmp = c | d;
  __cpuid_count(7, 0, a, b, c, d);
  b &= bit_BMI | bit_AVX2 | bit_BMI2;
  return _tmp | b;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<get_cpu_features>:
  endbr64
  push   %r13
  xor    %r13d,%r13d
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  push   %r12
  xor    %r12d,%r12d
  mov    %r13d,%edx
  mov    $0x1,%edi
  mov    %r12d,%esi
  sub    $0x8,%rsp
  call   <__cpuid@plt>
  mov    %r13d,%ecx
  mov    %r12d,%edx
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  xor    %esi,%esi
  mov    $0x7,%edi
  call   <__cpuid_count@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int get_cpu_features(void) {
  int a, b, c, d, _tmp;
  __cpuid(1, a, b, c, d);
  c &= bit_SSE3 | bit_SSSE3 | bit_FMA | bit_SSE4_1 | bit_SSE4_2 | bit_AVX | bit_F16C;
  d &= bit_SSE | bit_SSE2 | bit_MMX;
  _tmp = c | d;
  __cpuid_count(7, 0, a, b, c, d);
  b &= bit_BMI | bit_AVX2 | bit_BMI2;
  return _tmp | b;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<get_cpu_features>:
  endbr64
  push   %r13
  xor    %r13d,%r13d
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  push   %r12
  xor    %r12d,%r12d
  mov    %r13d,%edx
  mov    $0x1,%edi
  mov    %r12d,%esi
  sub    $0x8,%rsp
  call   <__cpuid@plt>
  mov    %r13d,%ecx
  mov    %r12d,%edx
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  xor    %esi,%esi
  mov    $0x7,%edi
  call   <__cpuid_count@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int get_cpu_features(void) {
  int a, b, c, d, _tmp;
  __cpuid(1, a, b, c, d);
  c &= bit_SSE3 | bit_SSSE3 | bit_FMA | bit_SSE4_1 | bit_SSE4_2 | bit_AVX | bit_F16C;
  d &= bit_SSE | bit_SSE2 | bit_MMX;
  _tmp = c | d;
  __cpuid_count(7, 0, a, b, c, d);
  b &= bit_BMI | bit_AVX2 | bit_BMI2;
  return _tmp | b;
}
```
user: Translate the below assembly code into C programming language:

```asm
<InsertSort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x1,-0xc(%rbp)
  jmp    L48
L35:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L33
L38:
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x8(%rbp)
L33:
  cmpl   $0x0,-0x8(%rbp)
  jle    L4
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x4(%rbp)
  jl     L38
L4:
  addl   $0x1,-0xc(%rbp)
L48:
  mov    -0xc(%rbp),%eax
  cmp    %eax,-0x1c(%rbp)
  ja     L35
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void InsertSort(char array[], unsigned int n) {
  int i, j;
  int temp;
  for (i = 1; i < n; i++) {
    temp = array[i];
    for (j = i; j > 0 && temp < array[j - 1]; j--) {
      array[j] = array[j - 1];
      array[j - 1] = temp;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<InsertSort>:
  endbr64
  cmp    $0x1,%esi
  jbe    L60
  mov    %esi,%r9d
  mov    $0x1,%r8d
  lea    -0x1(%rdi),%r10
  jmp    L64
L39:
  add    $0x1,%r8
  cmp    %r9,%r8
  je     L60
L64:
  movzbl (%rdi,%r8,1),%ecx
  test   %r8d,%r8d
  jle    L39
  lea    (%r10,%r8,1),%rax
  lea    -0x1(%rdi),%rsi
L13:
  movzbl (%rax),%edx
  cmp    %dl,%cl
  jge    L39
  mov    %dl,0x1(%rax)
  mov    %cl,(%rax)
  sub    $0x1,%rax
  cmp    %rsi,%rax
  jne    L13
  jmp    L39
L60:
  ret
```

assistant: ```c
void InsertSort(char array[], unsigned int n) {
  int i, j;
  int temp;
  for (i = 1; i < n; i++) {
    temp = array[i];
    for (j = i; j > 0 && temp < array[j - 1]; j--) {
      array[j] = array[j - 1];
      array[j - 1] = temp;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<InsertSort>:
  endbr64
  cmp    $0x1,%esi
  jbe    L7
  mov    %esi,%r9d
  mov    $0x1,%r8d
  lea    -0x1(%rdi),%r10
  cs nopw 0x0(%rax,%rax,1)
L34:
  movzbl (%rdi,%r8,1),%ecx
  lea    (%r10,%r8,1),%rax
  lea    -0x1(%rdi),%rsi
  nopl   (%rax)
L17:
  movzbl (%rax),%edx
  cmp    %dl,%cl
  jge    L4
  mov    %dl,0x1(%rax)
  sub    $0x1,%rax
  mov    %cl,0x1(%rax)
  cmp    %rsi,%rax
  jne    L17
L4:
  add    $0x1,%r8
  cmp    %r9,%r8
  jne    L34
  ret
L7:
  ret
```

assistant: ```c
void InsertSort(char array[], unsigned int n) {
  int i, j;
  int temp;
  for (i = 1; i < n; i++) {
    temp = array[i];
    for (j = i; j > 0 && temp < array[j - 1]; j--) {
      array[j] = array[j - 1];
      array[j - 1] = temp;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<InsertSort>:
  endbr64
  cmp    $0x1,%esi
  jbe    L21
  mov    %esi,%r9d
  mov    $0x1,%r8d
  lea    -0x1(%rdi),%r10
  cs nopw 0x0(%rax,%rax,1)
L32:
  movzbl (%rdi,%r8,1),%ecx
  lea    (%r10,%r8,1),%rax
  lea    -0x1(%rdi),%rsi
  nopl   (%rax)
L23:
  movzbl (%rax),%edx
  cmp    %dl,%cl
  jge    L16
  mov    %dl,0x1(%rax)
  sub    $0x1,%rax
  mov    %cl,0x1(%rax)
  cmp    %rax,%rsi
  jne    L23
L16:
  add    $0x1,%r8
  cmp    %r9,%r8
  jne    L32
  ret
L21:
  ret
```

assistant: ```c
void InsertSort(char array[], unsigned int n) {
  int i, j;
  int temp;
  for (i = 1; i < n; i++) {
    temp = array[i];
    for (j = i; j > 0 && temp < array[j - 1]; j--) {
      array[j] = array[j - 1];
      array[j - 1] = temp;
    }
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<get_int32_t>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L7
L26:
  mov    -0x10(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    $0x8,%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x24(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L3
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L21
L3:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x8(%rbp)
L21:
  mov    -0x8(%rbp),%eax
  mov    -0xc(%rbp),%edx
  mov    %edx,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    -0x10(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%edi
  mov    %eax,%ecx
  shl    %cl,%edi
  mov    %edi,%eax
  sub    $0x1,%eax
  and    %edx,%eax
  or     %esi,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x8(%rbp),%eax
  sub    %eax,-0x24(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0x10(%rbp)
L7:
  cmpl   $0x0,-0x24(%rbp)
  jg     L26
  mov    -0x20(%rbp),%rax
  mov    -0x10(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0xc(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int32_t get_int32_t(uint8_t *buf, int32_t *bip, int32_t n) {
  int32_t i = *bip;
  int32_t a = 0;
  int32_t mb;
  int32_t wb;
  while (n > 0) {
    mb = 8 - (i % 8);
    if (n > mb) {
      wb = mb;
    } else {
      wb = n;
    }
    a = (a << wb) | ((buf[i / 8] >> (mb - wb)) & ((1 << wb) - 1));
    n -= wb;
    i += wb;
  }
  (*bip) = i;
  return (a);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<get_int32_t>:
  endbr64
  mov    %rsi,%r11
  mov    (%rsi),%esi
  test   %edx,%edx
  jle    L13
  push   %rbp
  push   %rbx
  mov    %rdi,%r9
  mov    %edx,%r8d
  mov    $0x0,%eax
  mov    $0x8,%ebx
  mov    $0x1,%r10d
L4:
  mov    %esi,%ecx
  sar    $0x1f,%ecx
  shr    $0x1d,%ecx
  lea    (%rsi,%rcx,1),%edx
  and    $0x7,%edx
  sub    %ecx,%edx
  mov    %ebx,%ebp
  sub    %edx,%ebp
  cmp    %r8d,%ebp
  mov    %r8d,%edi
  cmovle %ebp,%edi
  mov    %edi,%ecx
  shl    %cl,%eax
  lea    0x7(%rsi),%edx
  test   %esi,%esi
  cmovns %esi,%edx
  sar    $0x3,%edx
  movslq %edx,%rdx
  mov    %ebp,%ecx
  sub    %edi,%ecx
  mov    (%r9,%rdx,4),%edx
  sar    %cl,%edx
  mov    %r10d,%ebp
  mov    %edi,%ecx
  shl    %cl,%ebp
  mov    %ebp,%ecx
  sub    $0x1,%ecx
  and    %ecx,%edx
  or     %edx,%eax
  sub    %edi,%r8d
  add    %edi,%esi
  test   %r8d,%r8d
  jg     L4
  mov    %esi,(%r11)
  pop    %rbx
  pop    %rbp
  ret
L13:
  mov    $0x0,%eax
  mov    %esi,(%r11)
  ret
```

assistant: ```c
int32_t get_int32_t(uint8_t *buf, int32_t *bip, int32_t n) {
  int32_t i = *bip;
  int32_t a = 0;
  int32_t mb;
  int32_t wb;
  while (n > 0) {
    mb = 8 - (i % 8);
    if (n > mb) {
      wb = mb;
    } else {
      wb = n;
    }
    a = (a << wb) | ((buf[i / 8] >> (mb - wb)) & ((1 << wb) - 1));
    n -= wb;
    i += wb;
  }
  (*bip) = i;
  return (a);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<get_int32_t>:
  endbr64
  mov    %rsi,%r11
  mov    (%rsi),%esi
  test   %edx,%edx
  jle    L11
  push   %rbp
  mov    %rdi,%r9
  mov    %edx,%r8d
  xor    %eax,%eax
  push   %rbx
  mov    $0x1,%r10d
  mov    $0x8,%ebx
  nopw   0x0(%rax,%rax,1)
L3:
  mov    %esi,%ecx
  mov    %ebx,%ebp
  mov    %r8d,%edi
  sar    $0x1f,%ecx
  shr    $0x1d,%ecx
  lea    (%rsi,%rcx,1),%edx
  and    $0x7,%edx
  sub    %ecx,%edx
  sub    %edx,%ebp
  lea    0x7(%rsi),%edx
  cmp    %r8d,%ebp
  cmovle %ebp,%edi
  mov    %edi,%ecx
  shl    %cl,%eax
  test   %esi,%esi
  mov    %ebp,%ecx
  mov    %r10d,%ebp
  cmovns %esi,%edx
  sub    %edi,%ecx
  sub    %edi,%r8d
  add    %edi,%esi
  sar    $0x3,%edx
  movslq %edx,%rdx
  mov    (%r9,%rdx,4),%edx
  sar    %cl,%edx
  mov    %edi,%ecx
  shl    %cl,%ebp
  mov    %ebp,%ecx
  sub    $0x1,%ecx
  and    %ecx,%edx
  or     %edx,%eax
  test   %r8d,%r8d
  jg     L3
  pop    %rbx
  pop    %rbp
  mov    %esi,(%r11)
  ret
  nopl   0x0(%rax)
L11:
  mov    %esi,(%r11)
  xor    %eax,%eax
  ret
```

assistant: ```c
int32_t get_int32_t(uint8_t *buf, int32_t *bip, int32_t n) {
  int32_t i = *bip;
  int32_t a = 0;
  int32_t mb;
  int32_t wb;
  while (n > 0) {
    mb = 8 - (i % 8);
    if (n > mb) {
      wb = mb;
    } else {
      wb = n;
    }
    a = (a << wb) | ((buf[i / 8] >> (mb - wb)) & ((1 << wb) - 1));
    n -= wb;
    i += wb;
  }
  (*bip) = i;
  return (a);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_int32_t>:
  endbr64
  mov    %rsi,%r11
  mov    (%rsi),%esi
  test   %edx,%edx
  jle    L1
  push   %rbp
  mov    %rdi,%r9
  mov    %edx,%r8d
  xor    %eax,%eax
  push   %rbx
  mov    $0x1,%r10d
  mov    $0x8,%ebx
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %esi,%ecx
  mov    %ebx,%ebp
  mov    %r8d,%edi
  sar    $0x1f,%ecx
  shr    $0x1d,%ecx
  lea    (%rsi,%rcx,1),%edx
  and    $0x7,%edx
  sub    %ecx,%edx
  sub    %edx,%ebp
  lea    0x7(%rsi),%edx
  cmp    %r8d,%ebp
  cmovle %ebp,%edi
  mov    %edi,%ecx
  shl    %cl,%eax
  test   %esi,%esi
  mov    %ebp,%ecx
  mov    %r10d,%ebp
  cmovns %esi,%edx
  sub    %edi,%ecx
  sub    %edi,%r8d
  add    %edi,%esi
  sar    $0x3,%edx
  movslq %edx,%rdx
  mov    (%r9,%rdx,4),%edx
  sar    %cl,%edx
  mov    %edi,%ecx
  shl    %cl,%ebp
  mov    %ebp,%ecx
  sub    $0x1,%ecx
  and    %ecx,%edx
  or     %edx,%eax
  test   %r8d,%r8d
  jg     L5
  pop    %rbx
  pop    %rbp
  mov    %esi,(%r11)
  ret
  nopl   0x0(%rax)
L1:
  mov    %esi,(%r11)
  xor    %eax,%eax
  ret
```

assistant: ```c
int32_t get_int32_t(uint8_t *buf, int32_t *bip, int32_t n) {
  int32_t i = *bip;
  int32_t a = 0;
  int32_t mb;
  int32_t wb;
  while (n > 0) {
    mb = 8 - (i % 8);
    if (n > mb) {
      wb = mb;
    } else {
      wb = n;
    }
    a = (a << wb) | ((buf[i / 8] >> (mb - wb)) & ((1 << wb) - 1));
    n -= wb;
    i += wb;
  }
  (*bip) = i;
  return (a);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<getop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  nop
L81:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L81
  cmpl   $0x9,-0x8(%rbp)
  je     L81
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L44
  cmpl   $0x2e,-0x8(%rbp)
  je     L44
  cmpl   $0x2d,-0x8(%rbp)
  je     L44
  mov    -0x8(%rbp),%eax
  jmp    L49
L44:
  movl   $0x0,-0xc(%rbp)
  cmpl   $0x2d,-0x8(%rbp)
  jne    L148
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L104
  cmpl   $0x2e,-0x4(%rbp)
  je     L104
  mov    -0x8(%rbp),%eax
  jmp    L49
L104:
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L60
L148:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L60
L131:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x8(%rbp)
L60:
  addl   $0x1,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  mov    %dl,(%rax)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L131
  cmpl   $0x2e,-0x8(%rbp)
  jne    L92
  nop
L99:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  mov    %dl,(%rax)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L99
L92:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  je     L10
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <ungetch@plt>
L10:
  mov    $0x30,%eax
L49:
  leave
  ret
```

assistant: ```c
int getop(char *s) {
  int i, c;
  while ((s[0] = c = getch()) == ' ' || c == '\t')
    ;
  s[1] = '\0';
  if (!isdigit(c) && c != '.' && c != '-') {
    return c;
  }
  i = 0;
  if (c == '-') {
    int next = getch();
    if (!isdigit(next) && next != '.') {
      return c;
    }
    c = next;
  } else {
    c = getch();
  }
  while (isdigit(s[++i] = c))
    c = getch();
  if (c == '.') {
    while (isdigit(s[++i] = c = getch()))
      ;
  }
  s[i] = '\0';
  if (c != EOF) {
    ungetch(c);
  }
  return '0';
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<getop>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
L6:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,%ebx
  mov    %al,(%r12)
  cmp    $0x9,%eax
  je     L6
  cmp    $0x20,%al
  je     L6
  movb   $0x0,0x1(%r12)
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L92
  lea    -0x2d(%rbx),%eax
  cmp    $0x1,%eax
  ja     L14
L92:
  cmp    $0x2d,%ebx
  je     L103
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,%ebp
L64:
  mov    $0x1,%ebx
  jmp    L140
L103:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,%ebp
  movsbl %al,%edi
  call   <isdigit@plt>
  cmp    $0x2e,%ebp
  je     L64
  test   %rax,%rax
  jne    L64
  jmp    L14
L146:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,%ebp
L140:
  mov    %ebx,%r13d
  mov    %bpl,(%r12,%rbx,1)
  movsbl %bpl,%edi
  call   <isdigit@plt>
  add    $0x1,%rbx
  test   %rax,%rax
  jne    L146
  cmp    $0x2e,%ebp
  je     L21
L17:
  movslq %r13d,%r13
  movb   $0x0,(%r12,%r13,1)
  mov    $0x30,%ebx
  mov    D7(%rip),%rax
  cmp    %ebp,(%rax)
  jne    L8
L14:
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L21:
  lea    0x1(%r13),%ebx
  movslq %ebx,%rbx
L118:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,%ebp
  mov    %ebx,%r13d
  mov    %al,(%r12,%rbx,1)
  movsbl %al,%edi
  call   <isdigit@plt>
  add    $0x1,%rbx
  test   %rax,%rax
  jne    L118
  jmp    L17
L8:
  mov    %ebp,%edi
  call   <ungetch@plt>
  jmp    L14
```

assistant: ```c
int getop(char *s) {
  int i, c;
  while ((s[0] = c = getch()) == ' ' || c == '\t')
    ;
  s[1] = '\0';
  if (!isdigit(c) && c != '.' && c != '-') {
    return c;
  }
  i = 0;
  if (c == '-') {
    int next = getch();
    if (!isdigit(next) && next != '.') {
      return c;
    }
    c = next;
  } else {
    c = getch();
  }
  while (isdigit(s[++i] = c))
    c = getch();
  if (c == '.') {
    while (isdigit(s[++i] = c = getch()))
      ;
  }
  s[i] = '\0';
  if (c != EOF) {
    ungetch(c);
  }
  return '0';
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<getop>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  nopl   (%rax)
L107:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,(%rbx)
  mov    %eax,%r12d
  movsbl %al,%edi
  cmp    $0x20,%al
  je     L107
  cmp    $0x9,%eax
  je     L107
  movb   $0x0,0x1(%rbx)
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L142
  lea    -0x2d(%r12),%eax
  cmp    $0x1,%eax
  ja     L129
L142:
  xor    %eax,%eax
  cmp    $0x2d,%r12d
  je     L55
  call   <getch@plt>
  mov    %eax,%ebp
  movsbl %al,%edi
L143:
  mov    %ebx,%r15d
  lea    0x1(%rbx),%r12
  neg    %r15d
  jmp    L6
  nopw   0x0(%rax,%rax,1)
L69:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%ebp
  movsbl %al,%edi
L6:
  mov    %bpl,(%r12)
  lea    (%r15,%r12,1),%r14d
  mov    %r12,%r13
  add    $0x1,%r12
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L69
  cmp    $0x2e,%ebp
  je     L17
L44:
  mov    D1(%rip),%rax
  movb   $0x0,0x0(%r13)
  mov    $0x30,%r12d
  cmp    %ebp,(%rax)
  jne    L20
L129:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %ebp,%edi
  call   <ungetch@plt>
  jmp    L129
  nopl   0x0(%rax)
L17:
  movslq %r14d,%r14
  lea    0x1(%rbx,%r14,1),%rbx
L52:
  xor    %eax,%eax
  mov    %rbx,%r13
  add    $0x1,%rbx
  call   <getch@plt>
  mov    %al,-0x1(%rbx)
  movsbl %al,%edi
  mov    %eax,%ebp
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L52
  jmp    L44
  nopw   0x0(%rax,%rax,1)
L55:
  call   <getch@plt>
  movsbl %al,%edi
  mov    %eax,%ebp
  mov    %edi,0xc(%rsp)
  call   <isdigit@plt>
  mov    0xc(%rsp),%edi
  test   %rax,%rax
  jne    L143
  cmp    $0x2e,%ebp
  je     L143
  jmp    L129
```

assistant: ```c
int getop(char *s) {
  int i, c;
  while ((s[0] = c = getch()) == ' ' || c == '\t')
    ;
  s[1] = '\0';
  if (!isdigit(c) && c != '.' && c != '-') {
    return c;
  }
  i = 0;
  if (c == '-') {
    int next = getch();
    if (!isdigit(next) && next != '.') {
      return c;
    }
    c = next;
  } else {
    c = getch();
  }
  while (isdigit(s[++i] = c))
    c = getch();
  if (c == '.') {
    while (isdigit(s[++i] = c = getch()))
      ;
  }
  s[i] = '\0';
  if (c != EOF) {
    ungetch(c);
  }
  return '0';
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<getop>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  nopl   (%rax)
L116:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,(%rbx)
  mov    %eax,%r12d
  movsbl %al,%edi
  cmp    $0x20,%al
  je     L116
  cmp    $0x9,%eax
  je     L116
  movb   $0x0,0x1(%rbx)
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L36
  lea    -0x2d(%r12),%eax
  cmp    $0x1,%eax
  ja     L15
L36:
  xor    %eax,%eax
  cmp    $0x2d,%r12d
  je     L50
  call   <getch@plt>
  mov    %eax,%ebp
  movsbl %al,%edi
L102:
  mov    %ebx,%r15d
  lea    0x1(%rbx),%r12
  neg    %r15d
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L120:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%ebp
  movsbl %al,%edi
L32:
  mov    %bpl,(%r12)
  lea    (%r15,%r12,1),%r14d
  mov    %r12,%r13
  add    $0x1,%r12
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L120
  cmp    $0x2e,%ebp
  je     L81
L145:
  mov    D5(%rip),%rax
  movb   $0x0,0x0(%r13)
  mov    $0x30,%r12d
  cmp    %ebp,(%rax)
  jne    L23
L15:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L23:
  mov    %ebp,%edi
  call   <ungetch@plt>
  jmp    L15
  nopl   0x0(%rax)
L81:
  movslq %r14d,%r14
  lea    0x1(%rbx,%r14,1),%rbx
L11:
  xor    %eax,%eax
  mov    %rbx,%r13
  add    $0x1,%rbx
  call   <getch@plt>
  mov    %al,-0x1(%rbx)
  movsbl %al,%edi
  mov    %eax,%ebp
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L11
  jmp    L145
  nopw   0x0(%rax,%rax,1)
L50:
  call   <getch@plt>
  movsbl %al,%edi
  mov    %eax,%ebp
  mov    %edi,0xc(%rsp)
  call   <isdigit@plt>
  mov    0xc(%rsp),%edi
  test   %rax,%rax
  jne    L102
  cmp    $0x2e,%ebp
  je     L102
  jmp    L15
```

assistant: ```c
int getop(char *s) {
  int i, c;
  while ((s[0] = c = getch()) == ' ' || c == '\t')
    ;
  s[1] = '\0';
  if (!isdigit(c) && c != '.' && c != '-') {
    return c;
  }
  i = 0;
  if (c == '-') {
    int next = getch();
    if (!isdigit(next) && next != '.') {
      return c;
    }
    c = next;
  } else {
    c = getch();
  }
  while (isdigit(s[++i] = c))
    c = getch();
  if (c == '.') {
    while (isdigit(s[++i] = c = getch()))
      ;
  }
  s[i] = '\0';
  if (c != EOF) {
    ungetch(c);
  }
  return '0';
}
```