ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<helval>:
  endbr64
  push   %rbp
  pxor   %xmm2,%xmm2
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movsd  (%rdi),%xmm1
  movsd  0x8(%rdi),%xmm0
  comisd %xmm1,%xmm2
  ja     L38
  comisd %xmm2,%xmm1
  jbe    L55
  divsd  %xmm1,%xmm0
  call   <atan@plt>
  movsd  D60(%rip),%xmm3
  pxor   %xmm2,%xmm2
  divsd  D35(%rip),%xmm0
  mulsd  %xmm3,%xmm0
L13:
  movsd  0x10(%rbx),%xmm1
  subsd  %xmm0,%xmm1
  mulsd  %xmm3,%xmm1
  movsd  %xmm1,0x0(%rbp)
  movsd  (%rbx),%xmm0
  movsd  0x8(%rbx),%xmm1
  mulsd  %xmm0,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm2
  ja     L60
  sqrtsd %xmm0,%xmm0
L29:
  subsd  D62(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,0x8(%rbp)
  movsd  0x10(%rbx),%xmm0
  movsd  %xmm0,0x10(%rbp)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L55:
  comisd %xmm2,%xmm0
  jb     L21
  movsd  D41(%rip),%xmm0
  movsd  D60(%rip),%xmm3
  jmp    L13
L38:
  divsd  %xmm1,%xmm0
  call   <atan@plt>
  divsd  D35(%rip),%xmm0
  pxor   %xmm2,%xmm2
  addsd  D96(%rip),%xmm0
  movsd  D60(%rip),%xmm3
  mulsd  %xmm3,%xmm0
  jmp    L13
  xchg   %ax,%ax
L21:
  movsd  D57(%rip),%xmm0
  movsd  D60(%rip),%xmm3
  jmp    L13
L60:
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm3
  jmp    L29
```

tool_calls: name: parse_data
arguments: tag: D60
datatype: f64
name: parse_data
arguments: tag: D35
datatype: byte[8]
name: parse_data
arguments: tag: D62
datatype: f64
name: parse_data
arguments: tag: D41
datatype: f32[2]
name: parse_data
arguments: tag: D96
datatype: f64
name: parse_data
arguments: tag: D57
datatype: f32[2]

tool: D60: 10

tool: {"D35": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: D62: 1

tool: {"D41": [0.0,2.0625]}

tool: D96: 0.5

tool: {"D57": [0.0,-2.0625]}

assistant: ```c
void helval(double *p, double *x, int m, int n, void *data) {
  double theta;
  if (p[0] < 0.0)
    theta = atan(p[1] / p[0]) / (2.0 * 3.14159265358979323846) + 0.5;
  else if (0.0 < p[0])
    theta = atan(p[1] / p[0]) / (2.0 * 3.14159265358979323846);
  else
    theta = (p[1] >= 0) ? 0.25 : -0.25;
  x[0] = 10.0 * (p[2] - 10.0 * theta);
  x[1] = 10.0 * (sqrt(p[0] * p[0] + p[1] * p[1]) - 1.0);
  x[2] = p[2];
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<helval>:
  endbr64
  push   %rbp
  pxor   %xmm2,%xmm2
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movsd  (%rdi),%xmm1
  movsd  0x8(%rdi),%xmm0
  comisd %xmm1,%xmm2
  ja     L77
  comisd %xmm2,%xmm1
  jbe    L8
  divsd  %xmm1,%xmm0
  call   <atan@plt>
  movsd  D43(%rip),%xmm3
  pxor   %xmm2,%xmm2
  divsd  D81(%rip),%xmm0
  mulsd  %xmm3,%xmm0
L20:
  movsd  0x10(%rbx),%xmm1
  subsd  %xmm0,%xmm1
  mulsd  %xmm3,%xmm1
  movsd  %xmm1,0x0(%rbp)
  movsd  (%rbx),%xmm0
  movsd  0x8(%rbx),%xmm1
  mulsd  %xmm0,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm2
  ja     L39
  sqrtsd %xmm0,%xmm0
L26:
  subsd  D58(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,0x8(%rbp)
  movsd  0x10(%rbx),%xmm0
  movsd  %xmm0,0x10(%rbp)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L8:
  comisd %xmm2,%xmm0
  jb     L46
  movsd  D95(%rip),%xmm0
  movsd  D43(%rip),%xmm3
  jmp    L20
L77:
  divsd  %xmm1,%xmm0
  call   <atan@plt>
  divsd  D81(%rip),%xmm0
  pxor   %xmm2,%xmm2
  addsd  D75(%rip),%xmm0
  movsd  D43(%rip),%xmm3
  mulsd  %xmm3,%xmm0
  jmp    L20
  xchg   %ax,%ax
L46:
  movsd  D97(%rip),%xmm0
  movsd  D43(%rip),%xmm3
  jmp    L20
L39:
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm3
  jmp    L26
```

tool_calls: name: disassemble_data
arguments: data_label: D43
type_guessed: f64
name: disassemble_data
arguments: data_label: D81
type_guessed: byte[8]
name: disassemble_data
arguments: data_label: D58
type_guessed: f64
name: disassemble_data
arguments: data_label: D95
type_guessed: f32[2]
name: disassemble_data
arguments: data_label: D75
type_guessed: f64
name: disassemble_data
arguments: data_label: D97
type_guessed: f32[2]

tool: D43: 10

tool: {"D81": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: D58: 1

tool: {"D95": [0.0,2.0625]}

tool: D75: 0.5

tool: {"D97": [0.0,-2.0625]}

assistant: ```c
void helval(double *p, double *x, int m, int n, void *data) {
  double theta;
  if (p[0] < 0.0)
    theta = atan(p[1] / p[0]) / (2.0 * 3.14159265358979323846) + 0.5;
  else if (0.0 < p[0])
    theta = atan(p[1] / p[0]) / (2.0 * 3.14159265358979323846);
  else
    theta = (p[1] >= 0) ? 0.25 : -0.25;
  x[0] = 10.0 * (p[2] - 10.0 * theta);
  x[1] = 10.0 * (sqrt(p[0] * p[0] + p[1] * p[1]) - 1.0);
  x[2] = p[2];
}
```
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
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x50(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x50(%rbp),%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
L52:
  cmp    %rdx,%rsp
  je     L8
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L52
L8:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L7
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L7:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L36
L29:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x4c(%rbp)
L36:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L29
  mov    -0x50(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <NOK@plt>
  mov    $0x0,%eax
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L38
  call   <__stack_chk_fail@plt>
L38:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D14
type_guessed: string
name: disassemble_data
arguments: data_tag: D16
type_guessed: string

tool: D14: input size 

tool: D16: %d

assistant: ```c
int main(int argc, char const *argv[]) {
  int size;
  printf("input size ");
  scanf("%d", &size);
  int array[size];
  for (int i = 0; i < size; i++) {
    scanf("%d", &array[i]);
  }
  NOK(array, size);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    D4(%rip),%rdi
  call   <printf@plt>
  lea    -0x2c(%rbp),%rsi
  lea    D16(%rip),%rdi
  call   <scanf@plt>
  mov    -0x2c(%rbp),%esi
  movslq %esi,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L9:
  cmp    %rdx,%rsp
  je     L15
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L9
L15:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L37
  orq    $0x0,-0x8(%rsp,%rax,1)
L37:
  mov    %rsp,%r14
  test   %esi,%esi
  jle    L24
  mov    %r14,%r12
  mov    $0x0,%ebx
  lea    D16(%rip),%r13
L46:
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  add    $0x1,%ebx
  mov    -0x2c(%rbp),%esi
  add    $0x4,%r12
  cmp    %ebx,%esi
  jg     L46
L24:
  mov    %r14,%rdi
  call   <NOK@plt>
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  mov    $0x0,%eax
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D4
type: string
name: parse_data
arguments: tag: D16
type: string

tool: D4: input size 

tool: D16: %d

assistant: ```c
int main(int argc, char const *argv[]) {
  int size;
  printf("input size ");
  scanf("%d", &size);
  int array[size];
  for (int i = 0; i < size; i++) {
    scanf("%d", &array[i]);
  }
  NOK(array, size);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D10(%rip),%rdi
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  lea    D13(%rip),%r13
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    -0x2c(%rbp),%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  movslq -0x2c(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rax,%rsi
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L22
L55:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L55
L22:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L42
L41:
  mov    %rsp,%r14
  test   %esi,%esi
  jle    L48
  mov    %r14,%r12
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L30:
  mov    %r12,%rsi
  mov    %r13,%rdi
  add    $0x1,%ebx
  add    $0x4,%r12
  call   <scanf@plt>
  mov    -0x2c(%rbp),%esi
  cmp    %ebx,%esi
  jg     L30
L48:
  mov    %r14,%rdi
  call   <NOK@plt>
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  lea    -0x20(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L42:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L41
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D10
type_guessed: string
name: parse_data
arguments: label: D13
type_guessed: string

tool: D10: input size 

tool: D13: %d

assistant: ```c
int main(int argc, char const *argv[]) {
  int size;
  printf("input size ");
  scanf("%d", &size);
  int array[size];
  for (int i = 0; i < size; i++) {
    scanf("%d", &array[i]);
  }
  NOK(array, size);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %rbp
  lea    D1(%rip),%rdi
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  lea    D14(%rip),%r13
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    -0x2c(%rbp),%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  movslq -0x2c(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rax,%rsi
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L65
L56:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L56
L65:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L69
L15:
  mov    %rsp,%r14
  test   %esi,%esi
  jle    L17
  mov    %r14,%r12
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L36:
  mov    %r12,%rsi
  mov    %r13,%rdi
  add    $0x1,%ebx
  add    $0x4,%r12
  call   <scanf@plt>
  mov    -0x2c(%rbp),%esi
  cmp    %ebx,%esi
  jg     L36
L17:
  mov    %r14,%rdi
  call   <NOK@plt>
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  lea    -0x20(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L69:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L15
L43:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D1
type_infered: string
name: parse_data
arguments: data_label: D14
type_infered: string

tool: D1: input size 

tool: D14: %d

assistant: ```c
int main(int argc, char const *argv[]) {
  int size;
  printf("input size ");
  scanf("%d", &size);
  int array[size];
  for (int i = 0; i < size; i++) {
    scanf("%d", &array[i]);
  }
  NOK(array, size);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<set_setting_DOUBLE>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movsd  %xmm0,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rdx
  lea    -0x10(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D0(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <asprintf@plt>
  mov    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <set_setting@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D0
type_infered: string

tool: D0: %f

assistant: ```c
void set_setting_DOUBLE(char *filename, char *settingname, double value) {
  char *tempstr;
  asprintf(&tempstr, "%f", value);
  set_setting(filename, settingname, tempstr);
  free(tempstr);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<set_setting_DOUBLE>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  lea    D8(%rip),%rsi
  call   <asprintf@plt>
  mov    (%rsp),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <set_setting@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

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

tool: D8: %f

assistant: ```c
void set_setting_DOUBLE(char *filename, char *settingname, double value) {
  char *tempstr;
  asprintf(&tempstr, "%f", value);
  set_setting(filename, settingname, tempstr);
  free(tempstr);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<set_setting_DOUBLE>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  lea    D6(%rip),%rsi
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <asprintf@plt>
  mov    (%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <set_setting@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x18,%rsp
  pop    %rbp
  pop    %r12
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D6
type: string

tool: D6: %f

assistant: ```c
void set_setting_DOUBLE(char *filename, char *settingname, double value) {
  char *tempstr;
  asprintf(&tempstr, "%f", value);
  set_setting(filename, settingname, tempstr);
  free(tempstr);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<set_setting_DOUBLE>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  lea    D6(%rip),%rsi
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <asprintf@plt>
  mov    (%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <set_setting@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x18,%rsp
  pop    %rbp
  pop    %r12
  ret
L7:
  call   <__stack_chk_fail@plt>
```

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

tool: D6: %f

assistant: ```c
void set_setting_DOUBLE(char *filename, char *settingname, double value) {
  char *tempstr;
  asprintf(&tempstr, "%f", value);
  set_setting(filename, settingname, tempstr);
  free(tempstr);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<ig_smib_table_sc_sa_get>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  cmpl   $0x1f,-0x28(%rbp)
  jbe    L6
  mov    $0xffffffff,%eax
  jmp    L28
L6:
  movl   $0x0,-0x10(%rbp)
  jmp    L1
L36:
  mov    -0x28(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  or     $0x40006000,%eax
  mov    %eax,-0x14(%rbp)
  lea    -0x14(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <ig_table_cmd_set@plt>
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x24(%rbp),%eax
  mov    $0x2,%ecx
  mov    $0x140,%esi
  mov    %eax,%edi
  call   <ingress_reg_tbl_get@plt>
  addl   $0x2,-0xc(%rbp)
  addl   $0x1,-0x10(%rbp)
L1:
  cmpl   $0xb,-0x10(%rbp)
  jle    L36
  mov    $0x0,%eax
L28:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

assistant: ```c
int ig_smib_table_sc_sa_get(unsigned int dev_id, unsigned int index, unsigned int *pentry) {
  int i;
  int entry_offset = 0;
  unsigned int cmd = 0;
  if ((index < 0) || (index > 31)) {
    return -1;
  }
  for (i = 0; i < 12; i++) {
    cmd = (0x1 << 30) | (6 << 12) | ((index * 12) + i);
    ig_table_cmd_set(dev_id, (union ig_table_cmd_u *)&cmd);
    ingress_reg_tbl_get(dev_id, 0x140, (pentry + entry_offset), 2);
    entry_offset += 2;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<ig_smib_table_sc_sa_get>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  cmp    $0x1f,%esi
  ja     L18
  mov    %edi,%r12d
  lea    (%rsi,%rsi,2),%ebp
  shl    $0x2,%ebp
  mov    %rdx,%rbx
  lea    0x60(%rdx),%r13
  lea    0x4(%rsp),%r14
L21:
  mov    %ebp,%eax
  or     $0x40006000,%eax
  mov    %eax,0x4(%rsp)
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <ig_table_cmd_set@plt>
  mov    $0x2,%ecx
  mov    %rbx,%rdx
  mov    $0x140,%esi
  mov    %r12d,%edi
  call   <ingress_reg_tbl_get@plt>
  add    $0x1,%ebp
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L21
  mov    $0x0,%eax
L25:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L24
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L18:
  mov    $0xffffffff,%eax
  jmp    L25
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ig_smib_table_sc_sa_get(unsigned int dev_id, unsigned int index, unsigned int *pentry) {
  int i;
  int entry_offset = 0;
  unsigned int cmd = 0;
  if ((index < 0) || (index > 31)) {
    return -1;
  }
  for (i = 0; i < 12; i++) {
    cmd = (0x1 << 30) | (6 << 12) | ((index * 12) + i);
    ig_table_cmd_set(dev_id, (union ig_table_cmd_u *)&cmd);
    ingress_reg_tbl_get(dev_id, 0x140, (pentry + entry_offset), 2);
    entry_offset += 2;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<ig_smib_table_sc_sa_get>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  cmp    $0x1f,%esi
  ja     L35
  lea    (%rsi,%rsi,2),%ebp
  mov    %edi,%r12d
  lea    0x60(%rdx),%r14
  mov    %rdx,%rbx
  shl    $0x2,%ebp
  lea    0x4(%rsp),%r13
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %ebp,%eax
  mov    %r13,%rsi
  mov    %r12d,%edi
  add    $0x1,%ebp
  or     $0x40006000,%eax
  mov    %eax,0x4(%rsp)
  call   <ig_table_cmd_set@plt>
  mov    %rbx,%rdx
  mov    $0x2,%ecx
  mov    %r12d,%edi
  mov    $0x140,%esi
  add    $0x8,%rbx
  call   <ingress_reg_tbl_get@plt>
  cmp    %r14,%rbx
  jne    L5
  xor    %eax,%eax
L25:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L30
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L35:
  mov    $0xffffffff,%eax
  jmp    L25
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ig_smib_table_sc_sa_get(unsigned int dev_id, unsigned int index, unsigned int *pentry) {
  int i;
  int entry_offset = 0;
  unsigned int cmd = 0;
  if ((index < 0) || (index > 31)) {
    return -1;
  }
  for (i = 0; i < 12; i++) {
    cmd = (0x1 << 30) | (6 << 12) | ((index * 12) + i);
    ig_table_cmd_set(dev_id, (union ig_table_cmd_u *)&cmd);
    ingress_reg_tbl_get(dev_id, 0x140, (pentry + entry_offset), 2);
    entry_offset += 2;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<ig_smib_table_sc_sa_get>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  cmp    $0x1f,%esi
  ja     L36
  lea    (%rsi,%rsi,2),%ebp
  mov    %edi,%r12d
  lea    0x60(%rdx),%r14
  mov    %rdx,%rbx
  shl    $0x2,%ebp
  lea    0x4(%rsp),%r13
  nopw   0x0(%rax,%rax,1)
L39:
  mov    %ebp,%eax
  mov    %r13,%rsi
  mov    %r12d,%edi
  add    $0x1,%ebp
  or     $0x40006000,%eax
  mov    %eax,0x4(%rsp)
  call   <ig_table_cmd_set@plt>
  mov    %rbx,%rdx
  mov    $0x2,%ecx
  mov    %r12d,%edi
  mov    $0x140,%esi
  add    $0x8,%rbx
  call   <ingress_reg_tbl_get@plt>
  cmp    %rbx,%r14
  jne    L39
  xor    %eax,%eax
L16:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L36:
  mov    $0xffffffff,%eax
  jmp    L16
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ig_smib_table_sc_sa_get(unsigned int dev_id, unsigned int index, unsigned int *pentry) {
  int i;
  int entry_offset = 0;
  unsigned int cmd = 0;
  if ((index < 0) || (index > 31)) {
    return -1;
  }
  for (i = 0; i < 12; i++) {
    cmd = (0x1 << 30) | (6 << 12) | ((index * 12) + i);
    ig_table_cmd_set(dev_id, (union ig_table_cmd_u *)&cmd);
    ingress_reg_tbl_get(dev_id, 0x140, (pentry + entry_offset), 2);
    entry_offset += 2;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_adrs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movw   $0x0,-0x2(%rbp)
  movzwl -0x2(%rbp),%eax
  mov    %ax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,-0x5(%rbp)
  jmp    L25
L68:
  cmpb   $0x3b,-0x5(%rbp)
  je     L26
  cmpb   $0xa,-0x5(%rbp)
  je     L0
  movsbl -0x5(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L98
  addq   $0x1,-0x18(%rbp)
  cmpw   $0x0,-0x2(%rbp)
  je     L63
  jmp    L10
L98:
  movsbl -0x5(%rbp),%eax
  mov    %eax,%edi
  call   <isoctal@plt>
  test   %eax,%eax
  je     L80
  movw   $0x1,-0x2(%rbp)
  shlw   $0x3,-0x4(%rbp)
  movsbw -0x5(%rbp),%ax
  and    $0x7,%eax
  mov    %eax,%edx
  movzwl -0x4(%rbp),%eax
  or     %edx,%eax
  mov    %ax,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
L63:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,-0x5(%rbp)
L25:
  cmpb   $0x0,-0x5(%rbp)
  jne    L68
  jmp    L10
L26:
  nop
  jmp    L10
L0:
  nop
  jmp    L10
L80:
  nop
L10:
  mov    -0x20(%rbp),%rax
  movzwl -0x4(%rbp),%edx
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *get_adrs(char *text, unsigned short *val) {
  unsigned short result, start;
  char c;
  result = start = 0;
  c = toupper(*text);
  while (c) {
    if (c == ';')
      break;
    if (c == '\n')
      break;
    if (isspace(c)) {
      text++;
      if (start)
        break;
    } else if (!isoctal(c))
      break;
    else {
      start = 1;
      result <<= 3;
      result |= ((unsigned short)c & 7);
      text++;
    }
    c = toupper(*text);
  }
  *val = result;
  return (text);
}
```