ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below:

```asm
<show_pairs_with_diff>:
  endbr64
  lea    -0x1(%rdx),%eax
  test   %eax,%eax
  jle    L51
  push   %r15
  lea    -0x2(%rdx),%eax
  mov    $0x1,%r15d
  push   %r14
  lea    0x4(%rdi,%rax,4),%r14
  push   %r13
  lea    D14(%rip),%r13
  push   %r12
  lea    D18(%rip),%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  jmp    L38
L41:
  add    $0x4,%rbx
  cmp    %r14,%rbx
  je     L1
L38:
  mov    (%rbx),%esi
  lea    (%rsi,%rbp,1),%edx
  cmp    0x4(%rbx),%edx
  jne    L41
  test   %r15d,%r15d
  je     L58
  mov    %r12,%rdi
  add    $0x4,%rbx
  xor    %r15d,%r15d
  call   <printf@plt>
  cmp    %r14,%rbx
  jne    L38
L1:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  mov    %r13,%rdi
  call   <printf@plt>
  jmp    L41
  nopw   0x0(%rax,%rax,1)
L51:
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D14
type: string
name: retrieve_data
arguments: data_label: D18
type: string

tool: D14:  %d %d

tool: D18: %d %d

assistant: ```c
void show_pairs_with_diff(int values[], int diff, size_t size) {
  int max = size - 1, first = 1, i;
  for (i = 0; i < max; ++i) {
    if (values[i] + diff == values[i + 1]) {
      if (first) {
        first = 0;
        printf("%d %d", values[i], values[i + 1]);
      } else {
        printf(" %d %d", values[i], values[i + 1]);
      }
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<show_pairs_with_diff>:
  endbr64
  lea    -0x1(%rdx),%eax
  test   %eax,%eax
  jle    L25
  push   %r15
  lea    -0x2(%rdx),%eax
  mov    $0x1,%r15d
  push   %r14
  lea    0x4(%rdi,%rax,4),%r14
  push   %r13
  lea    D16(%rip),%r13
  push   %r12
  lea    D14(%rip),%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  jmp    L63
L28:
  add    $0x4,%rbx
  cmp    %rbx,%r14
  je     L47
L63:
  mov    (%rbx),%esi
  lea    (%rsi,%rbp,1),%edx
  cmp    0x4(%rbx),%edx
  jne    L28
  test   %r15d,%r15d
  je     L29
  mov    %r12,%rdi
  add    $0x4,%rbx
  xor    %r15d,%r15d
  call   <printf@plt>
  cmp    %rbx,%r14
  jne    L63
L47:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L29:
  mov    %r13,%rdi
  call   <printf@plt>
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L25:
  ret
```

tool_calls: name: read_data
arguments: tag: D16
type_guessed: string
name: read_data
arguments: tag: D14
type_guessed: string

tool: D16:  %d %d

tool: D14: %d %d

assistant: ```c
void show_pairs_with_diff(int values[], int diff, size_t size) {
  int max = size - 1, first = 1, i;
  for (i = 0; i < max; ++i) {
    if (values[i] + diff == values[i + 1]) {
      if (first) {
        first = 0;
        printf("%d %d", values[i], values[i + 1]);
      } else {
        printf(" %d %d", values[i], values[i + 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
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0xc(%rbp)
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  jmp    L24
L28:
  mov    -0xc(%rbp),%eax
  imul   %eax,%eax
  imul   -0xc(%rbp),%eax
  mov    %eax,%ecx
  mov    -0xc(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0xc(%rbp)
L24:
  mov    -0x10(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L28
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D19
data_type: string
name: unpack_data
arguments: tag: D1
data_type: string

tool: D19:  %d

tool: D1: %d %d %d


assistant: ```c
int main() {
  int N, i = 1;
  scanf(" %d", &N);
  while (i <= N) {
    printf("%d %d %d\n", i, i * i, i * i * i);
    i++;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  lea    D17(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x0,0x4(%rsp)
  jle    L13
  mov    $0x1,%ebx
  lea    D7(%rip),%rbp
L23:
  mov    %ebx,%edx
  imul   %ebx,%edx
  mov    %edx,%ecx
  imul   %ebx,%ecx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x4(%rsp)
  jge    L23
L13:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L26:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D17
datatype: string
name: retrieve_data
arguments: data_label: D7
datatype: string

tool: D17:  %d

tool: D7: %d %d %d


assistant: ```c
int main() {
  int N, i = 1;
  scanf(" %d", &N);
  while (i <= N) {
    printf("%d %d %d\n", i, i * i, i * i * i);
    i++;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D3(%rip),%rdi
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L7
  mov    $0x1,%ebx
  lea    D1(%rip),%rbp
  nop
L9:
  mov    %ebx,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  imul   %ebx,%edx
  mov    %edx,%ecx
  imul   %ebx,%ecx
  add    $0x1,%ebx
  call   <printf@plt>
  cmp    %ebx,0x4(%rsp)
  jge    L9
L7:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L23:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D3
datatype: string
name: parse_data
arguments: data_label: D1
datatype: string

tool: D3:  %d

tool: D1: %d %d %d


assistant: ```c
int main() {
  int N, i = 1;
  scanf(" %d", &N);
  while (i <= N) {
    printf("%d %d %d\n", i, i * i, i * i * i);
    i++;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D19(%rip),%rdi
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L25
  mov    $0x1,%ebx
  lea    D18(%rip),%rbp
  nop
L17:
  mov    %ebx,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  imul   %ebx,%edx
  mov    %edx,%ecx
  imul   %ebx,%ecx
  add    $0x1,%ebx
  call   <printf@plt>
  cmp    %ebx,0x4(%rsp)
  jge    L17
L25:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D19
type_guessed: string
name: read_data
arguments: data_tag: D18
type_guessed: string

tool: D19:  %d

tool: D18: %d %d %d


assistant: ```c
int main() {
  int N, i = 1;
  scanf(" %d", &N);
  while (i <= N) {
    printf("%d %d %d\n", i, i * i, i * i * i);
    i++;
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<strpbrk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L47
L39:
  movl   $0x0,-0x4(%rbp)
  jmp    L46
L5:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L1
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  jmp    L49
L1:
  addl   $0x1,-0x4(%rbp)
L46:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L5
  addl   $0x1,-0x8(%rbp)
L47:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L39
  mov    $0x0,%eax
L49:
  pop    %rbp
  ret
```

assistant: ```c
char *strpbrk(const char *s, const char *charset) {
  int x, y;
  for (x = 0; s[x] != 0; x++)
    for (y = 0; charset[y] != 0; y++)
      if (s[x] == charset[y])
        return (char *)&s[x];
  return NULL;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<strpbrk>:
  endbr64
  mov    %rdi,%rax
  movzbl (%rdi),%r8d
  test   %r8b,%r8b
  je     L35
  movzbl (%rsi),%edi
L33:
  lea    0x1(%rsi),%rcx
  mov    %edi,%edx
  test   %dil,%dil
  je     L27
L38:
  cmp    %r8b,%dl
  je     L5
  add    $0x1,%rcx
  movzbl -0x1(%rcx),%edx
  test   %dl,%dl
  jne    L38
L27:
  add    $0x1,%rax
  movzbl (%rax),%r8d
  test   %r8b,%r8b
  jne    L33
  mov    $0x0,%eax
L5:
  ret
L35:
  mov    $0x0,%eax
  ret
```

assistant: ```c
char *strpbrk(const char *s, const char *charset) {
  int x, y;
  for (x = 0; s[x] != 0; x++)
    for (y = 0; charset[y] != 0; y++)
      if (s[x] == charset[y])
        return (char *)&s[x];
  return NULL;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<strpbrk>:
  endbr64
  movzbl (%rdi),%r8d
  mov    %rdi,%rax
  test   %r8b,%r8b
  je     L41
  movzbl (%rsi),%edi
L33:
  lea    0x1(%rsi),%rcx
  mov    %edi,%edx
  test   %dil,%dil
  jne    L32
  jmp    L56
L29:
  movzbl (%rcx),%edx
  add    $0x1,%rcx
  test   %dl,%dl
  je     L56
L32:
  cmp    %r8b,%dl
  jne    L29
  ret
  nopl   0x0(%rax)
L56:
  movzbl 0x1(%rax),%r8d
  add    $0x1,%rax
  test   %r8b,%r8b
  jne    L33
L41:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *strpbrk(const char *s, const char *charset) {
  int x, y;
  for (x = 0; s[x] != 0; x++)
    for (y = 0; charset[y] != 0; y++)
      if (s[x] == charset[y])
        return (char *)&s[x];
  return NULL;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<strpbrk>:
  endbr64
  movzbl (%rdi),%r8d
  mov    %rdi,%rax
  test   %r8b,%r8b
  je     L19
  movzbl (%rsi),%edi
L49:
  lea    0x1(%rsi),%rcx
  mov    %edi,%edx
  test   %dil,%dil
  jne    L48
  jmp    L18
L46:
  movzbl (%rcx),%edx
  add    $0x1,%rcx
  test   %dl,%dl
  je     L18
L48:
  cmp    %r8b,%dl
  jne    L46
  ret
  nopl   0x0(%rax)
L18:
  movzbl 0x1(%rax),%r8d
  add    $0x1,%rax
  test   %r8b,%r8b
  jne    L49
L19:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *strpbrk(const char *s, const char *charset) {
  int x, y;
  for (x = 0; s[x] != 0; x++)
    for (y = 0; charset[y] != 0; y++)
      if (s[x] == charset[y])
        return (char *)&s[x];
  return NULL;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<swap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x20(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

assistant: ```c
void swap(char *p1, char *p2) {
  char p[20];
  strcpy(p, p1);
  strcpy(p1, p2);
  strcpy(p2, p);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<swap>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %rdi,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void swap(char *p1, char *p2) {
  char p[20];
  strcpy(p, p1);
  strcpy(p1, p2);
  strcpy(p2, p);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<swap>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdi,%rsi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x20,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void swap(char *p1, char *p2) {
  char p[20];
  strcpy(p, p1);
  strcpy(p1, p2);
  strcpy(p2, p);
}
```
user: Translate the below assembly code into C programming language:

```asm
<swap>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdi,%rsi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x20,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void swap(char *p1, char *p2) {
  char p[20];
  strcpy(p, p1);
  strcpy(p1, p2);
  strcpy(p2, p);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_avg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L12
L3:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L12:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L3
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x1c(%rbp),%xmm1
  movsd  -0x8(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

assistant: ```c
double get_avg(const int *str, int lenght) {
  double average = 0.0;
  int i;
  for (i = 0; i < lenght; i++) {
    average += str[i];
  }
  average /= lenght;
  return average;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_avg>:
  endbr64
  test   %esi,%esi
  jle    L27
  mov    %rdi,%rax
  lea    -0x1(%rsi),%edx
  lea    0x4(%rdi,%rdx,4),%rdx
  pxor   %xmm0,%xmm0
L24:
  pxor   %xmm1,%xmm1
  cvtsi2sdl (%rax),%xmm1
  addsd  %xmm1,%xmm0
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L24
L23:
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  divsd  %xmm1,%xmm0
  ret
L27:
  pxor   %xmm0,%xmm0
  jmp    L23
```

assistant: ```c
double get_avg(const int *str, int lenght) {
  double average = 0.0;
  int i;
  for (i = 0; i < lenght; i++) {
    average += str[i];
  }
  average /= lenght;
  return average;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<get_avg>:
  endbr64
  test   %esi,%esi
  jle    L12
  lea    -0x1(%rsi),%eax
  pxor   %xmm0,%xmm0
  lea    0x4(%rdi,%rax,4),%rax
  nopl   0x0(%rax)
L9:
  pxor   %xmm1,%xmm1
  add    $0x4,%rdi
  cvtsi2sdl -0x4(%rdi),%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rax,%rdi
  jne    L9
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  divsd  %xmm1,%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L12:
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %esi,%xmm1
  divsd  %xmm1,%xmm0
  ret
```

assistant: ```c
double get_avg(const int *str, int lenght) {
  double average = 0.0;
  int i;
  for (i = 0; i < lenght; i++) {
    average += str[i];
  }
  average /= lenght;
  return average;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_avg>:
  endbr64
  test   %esi,%esi
  jle    L15
  lea    -0x1(%rsi),%eax
  pxor   %xmm0,%xmm0
  lea    0x4(%rdi,%rax,4),%rax
  nopl   0x0(%rax)
L17:
  pxor   %xmm1,%xmm1
  add    $0x4,%rdi
  cvtsi2sdl -0x4(%rdi),%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rdi,%rax
  jne    L17
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  divsd  %xmm1,%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L15:
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %esi,%xmm1
  divsd  %xmm1,%xmm0
  ret
```

assistant: ```c
double get_avg(const int *str, int lenght) {
  double average = 0.0;
  int i;
  for (i = 0; i < lenght; i++) {
    average += str[i];
  }
  average /= lenght;
  return average;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<res_hnok>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x2e,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L63
L162:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x2e,-0x8(%rbp)
  je     L182
  cmpl   $0x2e,-0xc(%rbp)
  jne    L152
  cmpl   $0x40,-0x8(%rbp)
  jle    L166
  cmpl   $0x5a,-0x8(%rbp)
  jle    L182
L166:
  cmpl   $0x60,-0x8(%rbp)
  jle    L61
  cmpl   $0x7a,-0x8(%rbp)
  jle    L182
L61:
  cmpl   $0x2f,-0x8(%rbp)
  jle    L136
  cmpl   $0x39,-0x8(%rbp)
  jle    L182
L136:
  mov    $0x0,%eax
  jmp    L121
L152:
  cmpl   $0x2e,-0x4(%rbp)
  je     L101
  cmpl   $0x0,-0x4(%rbp)
  jne    L189
L101:
  cmpl   $0x40,-0x8(%rbp)
  jle    L74
  cmpl   $0x5a,-0x8(%rbp)
  jle    L283
L74:
  cmpl   $0x60,-0x8(%rbp)
  jle    L282
  cmpl   $0x7a,-0x8(%rbp)
  jle    L283
L282:
  cmpl   $0x2f,-0x8(%rbp)
  jle    L173
  cmpl   $0x39,-0x8(%rbp)
  jle    L283
L173:
  mov    $0x0,%eax
  jmp    L121
L189:
  cmpl   $0x40,-0x8(%rbp)
  jle    L123
  cmpl   $0x5a,-0x8(%rbp)
  jle    L182
L123:
  cmpl   $0x60,-0x8(%rbp)
  jle    L261
  cmpl   $0x7a,-0x8(%rbp)
  jle    L182
L261:
  cmpl   $0x2f,-0x8(%rbp)
  jle    L72
  cmpl   $0x39,-0x8(%rbp)
  jle    L182
L72:
  cmpl   $0x2d,-0x8(%rbp)
  je     L182
  cmpl   $0x5f,-0x8(%rbp)
  je     L182
  mov    $0x0,%eax
  jmp    L121
L283:
  nop
L182:
  mov    -0x8(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
L63:
  cmpl   $0x0,-0x8(%rbp)
  jne    L162
  mov    $0x1,%eax
L121:
  pop    %rbp
  ret
```

assistant: ```c
int res_hnok(const char *dn) {
  int pch = 0x2e, ch = *dn++;
  while (ch != '\0') {
    int nch = *dn++;
    if (((ch) == 0x2e)) {
      ;
    } else if (((pch) == 0x2e)) {
      if (!((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)))
        return (0);
    } else if (((nch) == 0x2e) || nch == '\0') {
      if (!((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)))
        return (0);
    } else {
      if (!(((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)) || ((ch) == 0x2d) || ((ch) == 0x5f)))
        return (0);
    }
    pch = ch, ch = nch;
  }
  return (1);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<res_hnok>:
  endbr64
  lea    0x1(%rdi),%rcx
  movsbl (%rdi),%eax
  test   %eax,%eax
  je     L51
  mov    $0x2e,%esi
  movabs $0x4000000001ff9,%rdi
  jmp    L19
L100:
  mov    %eax,%esi
  and    $0xffffffdf,%esi
  sub    $0x41,%esi
  cmp    $0x19,%esi
  jbe    L24
  lea    -0x30(%rax),%esi
  cmp    $0x9,%esi
  ja     L101
L24:
  test   %edx,%edx
  je     L25
L62:
  mov    %eax,%esi
  mov    %edx,%eax
L19:
  add    $0x1,%rcx
  movsbl -0x1(%rcx),%edx
  cmp    $0x2e,%eax
  je     L24
  cmp    $0x2e,%esi
  je     L100
  cmp    $0x2e,%edx
  je     L39
  test   %edx,%edx
  je     L39
  mov    %eax,%esi
  and    $0xffffffdf,%esi
  sub    $0x41,%esi
  cmp    $0x19,%esi
  jbe    L62
  lea    -0x2d(%rax),%esi
  cmp    $0x32,%esi
  ja     L77
  bt     %rsi,%rdi
  jb     L62
  mov    $0x0,%eax
  ret
L39:
  mov    %eax,%esi
  and    $0xffffffdf,%esi
  sub    $0x41,%esi
  cmp    $0x19,%esi
  jbe    L24
  lea    -0x30(%rax),%esi
  cmp    $0x9,%esi
  jbe    L24
  mov    $0x0,%eax
  ret
L51:
  mov    $0x1,%eax
  ret
L101:
  mov    $0x0,%eax
  ret
L77:
  mov    $0x0,%eax
  ret
L25:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int res_hnok(const char *dn) {
  int pch = 0x2e, ch = *dn++;
  while (ch != '\0') {
    int nch = *dn++;
    if (((ch) == 0x2e)) {
      ;
    } else if (((pch) == 0x2e)) {
      if (!((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)))
        return (0);
    } else if (((nch) == 0x2e) || nch == '\0') {
      if (!((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)))
        return (0);
    } else {
      if (!(((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)) || ((ch) == 0x2d) || ((ch) == 0x5f)))
        return (0);
    }
    pch = ch, ch = nch;
  }
  return (1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<res_hnok>:
  endbr64
  movsbl (%rdi),%eax
  lea    0x1(%rdi),%rcx
  test   %eax,%eax
  je     L59
  movabs $0xfffbffffffffe006,%rdi
  mov    $0x2e,%esi
  jmp    L126
L60:
  cmp    $0x2e,%esi
  mov    %eax,%esi
  je     L26
  and    $0xffffffdf,%esi
  sub    $0x41,%esi
  cmp    $0x2e,%edx
  je     L121
  test   %edx,%edx
  je     L121
  cmp    $0x19,%esi
  jbe    L111
  lea    -0x2d(%rax),%esi
  cmp    $0x32,%esi
  ja     L27
  bt     %rsi,%rdi
  jb     L27
  nopl   0x0(%rax)
L111:
  mov    %eax,%esi
  mov    %edx,%eax
L126:
  add    $0x1,%rcx
  movsbl -0x1(%rcx),%edx
  cmp    $0x2e,%eax
  jne    L60
L96:
  test   %edx,%edx
  jne    L111
L59:
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  and    $0xffffffdf,%esi
  sub    $0x41,%esi
  cmp    $0x19,%esi
  jbe    L96
L40:
  lea    -0x30(%rax),%esi
  cmp    $0x9,%esi
  jbe    L96
L27:
  xor    %eax,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L121:
  cmp    $0x19,%esi
  ja     L40
  test   %edx,%edx
  jne    L111
  jmp    L59
```

assistant: ```c
int res_hnok(const char *dn) {
  int pch = 0x2e, ch = *dn++;
  while (ch != '\0') {
    int nch = *dn++;
    if (((ch) == 0x2e)) {
      ;
    } else if (((pch) == 0x2e)) {
      if (!((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)))
        return (0);
    } else if (((nch) == 0x2e) || nch == '\0') {
      if (!((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)))
        return (0);
    } else {
      if (!(((((ch) >= 0x41 && (ch) <= 0x5a) || ((ch) >= 0x61 && (ch) <= 0x7a)) || ((ch) >= 0x30 && (ch) <= 0x39)) || ((ch) == 0x2d) || ((ch) == 0x5f)))
        return (0);
    }
    pch = ch, ch = nch;
  }
  return (1);
}
```