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

```asm
<ft_strncmp>:
  endbr64
  xor    %eax,%eax
  test   %rdx,%rdx
  je     L41
  xor    %eax,%eax
  jmp    L25
  nop
L29:
  test   %cl,%cl
  je     L30
  add    $0x1,%rax
  cmp    %rax,%rdx
  je     L15
L25:
  movzbl (%rdi,%rax,1),%r8d
  movzbl (%rsi,%rax,1),%ecx
  cmp    %cl,%r8b
  je     L29
  movzbl %r8b,%eax
  sub    %ecx,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L15:
  xor    %eax,%eax
L41:
  ret
  nopl   0x0(%rax,%rax,1)
L30:
  xor    %eax,%eax
  sub    %ecx,%eax
  ret
```

assistant: ```c
int ft_strncmp(const char *s1, const char *s2, size_t n) {
  size_t i;
  if (n == (i = 0))
    return (0);
  while (s1[i] == s2[i] && s1[i]) {
    if (++i >= n)
      return (0);
  }
  return ((unsigned char)s1[i] - (unsigned char)s2[i]);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<recv_comm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x18(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L30
L41:
  mov    -0x10(%rbp),%edx
  mov    -0x8(%rbp),%rsi
  mov    -0x14(%rbp),%eax
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <recv@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L59
  mov    D1(%rip),%rax
  mov    (%rax),%rdx
  mov    D13(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L62
  jmp    L30
L62:
  mov    $0xfffffffe,%eax
  jmp    L25
L59:
  cmpl   $0x0,-0xc(%rbp)
  jne    L16
  mov    $0xffffffff,%eax
  jmp    L25
L16:
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  sub    %eax,-0x10(%rbp)
L30:
  cmpl   $0x0,-0x10(%rbp)
  jne    L41
  mov    $0x0,%eax
L25:
  leave
  ret
```

assistant: ```c
int recv_comm(int socket, unsigned char *buffer, int length) {
  unsigned char *ptr;
  int bytes_left;
  int bytes_read;
  ptr = buffer;
  bytes_left = length;
  while (bytes_left) {
    bytes_read = recv(socket, ptr, bytes_left, 0);
    if (bytes_read < 0) {
      if (errno == EINTR) {
        continue;
      } else {
        return -2;
      }
    } else if (bytes_read == 0) {
      return -1;
    }
    ptr += bytes_read;
    bytes_left -= bytes_read;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<recv_comm>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %rsi,%rbp
  mov    %edx,%ebx
  test   %edx,%edx
  jne    L45
  mov    %edx,%eax
  jmp    L83
L44:
  mov    D12(%rip),%rdx
  mov    D11(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L18
L5:
  test   %ebx,%ebx
  je     L43
L45:
  mov    $0x0,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <recv@plt>
  test   %eax,%eax
  js     L44
  je     L15
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%ebx
  jmp    L5
L18:
  mov    $0xfffffffe,%eax
  jmp    L83
L43:
  mov    %ebx,%eax
L83:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L15:
  mov    $0xffffffff,%eax
  jmp    L83
```

assistant: ```c
int recv_comm(int socket, unsigned char *buffer, int length) {
  unsigned char *ptr;
  int bytes_left;
  int bytes_read;
  ptr = buffer;
  bytes_left = length;
  while (bytes_left) {
    bytes_read = recv(socket, ptr, bytes_left, 0);
    if (bytes_read < 0) {
      if (errno == EINTR) {
        continue;
      } else {
        return -2;
      }
    } else if (bytes_read == 0) {
      return -1;
    }
    ptr += bytes_read;
    bytes_left -= bytes_read;
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<recv_comm>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edx,%ebx
  test   %edx,%edx
  je     L40
  nopl   0x0(%rax)
L19:
  xor    %ecx,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <recv@plt>
  test   %eax,%eax
  js     L20
  je     L36
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%ebx
  jne    L19
L40:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L20:
  mov    D1(%rip),%rax
  mov    D13(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L19
  pop    %rbx
  mov    $0xfffffffe,%eax
  pop    %rbp
  pop    %r12
  ret
L36:
  pop    %rbx
  mov    $0xffffffff,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int recv_comm(int socket, unsigned char *buffer, int length) {
  unsigned char *ptr;
  int bytes_left;
  int bytes_read;
  ptr = buffer;
  bytes_left = length;
  while (bytes_left) {
    bytes_read = recv(socket, ptr, bytes_left, 0);
    if (bytes_read < 0) {
      if (errno == EINTR) {
        continue;
      } else {
        return -2;
      }
    } else if (bytes_read == 0) {
      return -1;
    }
    ptr += bytes_read;
    bytes_left -= bytes_read;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<recv_comm>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edx,%ebx
  test   %edx,%edx
  je     L34
  nopl   0x0(%rax)
L7:
  xor    %ecx,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <recv@plt>
  test   %eax,%eax
  js     L38
  je     L0
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%ebx
  jne    L7
L34:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L38:
  mov    D15(%rip),%rax
  mov    D8(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L7
  pop    %rbx
  mov    $0xfffffffe,%eax
  pop    %rbp
  pop    %r12
  ret
L0:
  pop    %rbx
  mov    $0xffffffff,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int recv_comm(int socket, unsigned char *buffer, int length) {
  unsigned char *ptr;
  int bytes_left;
  int bytes_read;
  ptr = buffer;
  bytes_left = length;
  while (bytes_left) {
    bytes_read = recv(socket, ptr, bytes_left, 0);
    if (bytes_read < 0) {
      if (errno == EINTR) {
        continue;
      } else {
        return -2;
      }
    } else if (bytes_read == 0) {
      return -1;
    }
    ptr += bytes_read;
    bytes_left -= bytes_read;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<floats_mat44_scale>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <floats_mat44_identity@plt>
  movl   $0x0,-0x4(%rbp)
  jmp    L17
L11:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movss  (%rcx),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x4(%rbp)
L17:
  cmpl   $0x2,-0x4(%rbp)
  jle    L11
  nop
  nop
  leave
  ret
```

assistant: ```c
void floats_mat44_scale(const float sxyz[3], float out[16]) {
  floats_mat44_identity(out);
  for (int i = 0; i < 3; i++)
    out[4 * i + i] = sxyz[i];
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<floats_mat44_scale>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %rsi,%rdi
  call   <floats_mat44_identity@plt>
  movss  0x0(%rbp),%xmm0
  movss  %xmm0,(%rbx)
  movss  0x4(%rbp),%xmm0
  movss  %xmm0,0x14(%rbx)
  movss  0x8(%rbp),%xmm0
  movss  %xmm0,0x28(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void floats_mat44_scale(const float sxyz[3], float out[16]) {
  floats_mat44_identity(out);
  for (int i = 0; i < 3; i++)
    out[4 * i + i] = sxyz[i];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<floats_mat44_scale>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <floats_mat44_identity@plt>
  movss  0x0(%rbp),%xmm0
  movss  %xmm0,(%rbx)
  movss  0x4(%rbp),%xmm0
  movss  %xmm0,0x14(%rbx)
  movss  0x8(%rbp),%xmm0
  movss  %xmm0,0x28(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void floats_mat44_scale(const float sxyz[3], float out[16]) {
  floats_mat44_identity(out);
  for (int i = 0; i < 3; i++)
    out[4 * i + i] = sxyz[i];
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<floats_mat44_scale>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <floats_mat44_identity@plt>
  movss  0x0(%rbp),%xmm0
  movss  %xmm0,(%rbx)
  movss  0x4(%rbp),%xmm0
  movss  %xmm0,0x14(%rbx)
  movss  0x8(%rbp),%xmm0
  movss  %xmm0,0x28(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void floats_mat44_scale(const float sxyz[3], float out[16]) {
  floats_mat44_identity(out);
  for (int i = 0; i < 3; i++)
    out[4 * i + i] = sxyz[i];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<inserir_ordenado_no_vetor>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L23
L25:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  add    $0x1,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  subl   $0x1,-0x4(%rbp)
L23:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x20(%rbp)
  jge    L14
  cmpl   $0x0,-0x4(%rbp)
  jns    L25
L14:
  mov    -0x4(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  pop    %rbp
  ret
```

assistant: ```c
int inserir_ordenado_no_vetor(int *v, int size_v, int i) {
  int j = size_v - 1;
  for (; i < v[j] && j >= 0; j--)
    v[j + 1] = v[j];
  v[j + 1] = i;
  return size_v++;
}
```
user: Translate the below assembly code into C programming language:

```asm
<inserir_ordenado_no_vetor>:
  endbr64
  mov    %esi,%r11d
  lea    -0x1(%rsi),%eax
  movslq %eax,%r9
  mov    (%rdi,%r9,4),%esi
  test   %eax,%eax
  js     L4
  cmp    %esi,%edx
  jge    L4
  sub    $0x1,%r9
  mov    %r9,%rax
  lea    -0x2(%r11),%r10d
  sub    %r9d,%r10d
L19:
  mov    %esi,0x8(%rdi,%rax,4)
  mov    (%rdi,%rax,4),%esi
  lea    (%r10,%rax,1),%ecx
  not    %ecx
  shr    $0x1f,%ecx
  cmp    %edx,%esi
  setg   %r8b
  mov    %rax,%r9
  sub    $0x1,%rax
  test   %cl,%r8b
  jne    L19
L4:
  mov    %edx,0x4(%rdi,%r9,4)
  mov    %r11d,%eax
  ret
```

assistant: ```c
int inserir_ordenado_no_vetor(int *v, int size_v, int i) {
  int j = size_v - 1;
  for (; i < v[j] && j >= 0; j--)
    v[j + 1] = v[j];
  v[j + 1] = i;
  return size_v++;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<inserir_ordenado_no_vetor>:
  endbr64
  lea    -0x1(%rsi),%eax
  push   %r12
  mov    %rdi,%r9
  mov    %esi,%r12d
  movslq %eax,%r11
  mov    (%rdi,%r11,4),%r8d
  test   %eax,%eax
  js     L23
  cmp    %r8d,%edx
  jge    L23
  lea    -0x1(%r11),%rcx
  lea    -0x2(%rsi),%eax
  sub    %ecx,%eax
  nopl   0x0(%rax,%rax,1)
L26:
  mov    %r8d,0x8(%r9,%rcx,4)
  lea    (%rax,%rcx,1),%edi
  mov    (%r9,%rcx,4),%r8d
  mov    %rcx,%r11
  not    %edi
  shr    $0x1f,%edi
  cmp    %edx,%r8d
  setg   %r10b
  sub    $0x1,%rcx
  test   %dil,%r10b
  jne    L26
L23:
  mov    %r12d,%eax
  mov    %edx,0x4(%r9,%r11,4)
  pop    %r12
  ret
```

assistant: ```c
int inserir_ordenado_no_vetor(int *v, int size_v, int i) {
  int j = size_v - 1;
  for (; i < v[j] && j >= 0; j--)
    v[j + 1] = v[j];
  v[j + 1] = i;
  return size_v++;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<inserir_ordenado_no_vetor>:
  endbr64
  lea    -0x1(%rsi),%eax
  push   %r12
  mov    %rdi,%r9
  mov    %esi,%r12d
  movslq %eax,%r11
  mov    (%rdi,%r11,4),%r8d
  test   %eax,%eax
  js     L19
  cmp    %r8d,%edx
  jge    L19
  lea    -0x1(%r11),%rcx
  lea    -0x2(%rsi),%eax
  sub    %ecx,%eax
  nopl   0x0(%rax,%rax,1)
L12:
  mov    %r8d,0x8(%r9,%rcx,4)
  lea    (%rax,%rcx,1),%edi
  mov    (%r9,%rcx,4),%r8d
  mov    %rcx,%r11
  not    %edi
  shr    $0x1f,%edi
  cmp    %edx,%r8d
  setg   %r10b
  sub    $0x1,%rcx
  test   %dil,%r10b
  jne    L12
L19:
  mov    %r12d,%eax
  mov    %edx,0x4(%r9,%r11,4)
  pop    %r12
  ret
```

assistant: ```c
int inserir_ordenado_no_vetor(int *v, int size_v, int i) {
  int j = size_v - 1;
  for (; i < v[j] && j >= 0; j--)
    v[j + 1] = v[j];
  v[j + 1] = i;
  return size_v++;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<hash_information_elements>:
  endbr64
  lea    0x2(%rsi),%eax
  cmp    %eax,%edx
  jbe    L114
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r8d
  mov    %edx,%r12d
  mov    $0x0,%edi
  mov    $0x5,%r13d
  jmp    L62
L34:
  lea    (%rdx,%rax,1),%ebp
  cmp    $0x3,%cl
  je     L101
  cmp    $0xdd,%cl
  je     L43
  test   %cl,%cl
  je     L101
L90:
  add    $0x2,%edx
  mov    %eax,%eax
  lea    -0x2(%rbx,%rax,1),%rsi
  call   <fnv1a_32@plt>
  mov    %eax,%edi
L101:
  lea    0x2(%rbp),%eax
  cmp    %r12d,%eax
  jae    L25
  mov    %ebp,%r8d
L62:
  mov    %r8d,%edx
  movzbl (%rbx,%rdx,1),%ecx
  lea    0x1(%r8),%edx
  movzbl (%rbx,%rdx,1),%edx
  mov    %r12d,%esi
  sub    %eax,%esi
  cmp    %edx,%esi
  jae    L34
  cmp    $0x2,%esi
  je     L25
  mov    %esi,%edx
  jmp    L34
L43:
  cmp    $0x3,%edx
  jbe    L90
  mov    %eax,%ecx
  movzbl (%rbx,%rcx,1),%ecx
  shl    $0x10,%ecx
  lea    0x4(%r8),%esi
  movzbl (%rbx,%rsi,1),%esi
  or     %esi,%ecx
  lea    0x3(%r8),%esi
  movzbl (%rbx,%rsi,1),%esi
  shl    $0x8,%esi
  or     %esi,%ecx
  cmp    $0x50f2,%ecx
  sete   %sil
  lea    0x5(%r8),%ecx
  cmpb   $0x8,(%rbx,%rcx,1)
  sete   %cl
  test   %cl,%sil
  je     L90
  cmp    $0x5,%edx
  jbe    L90
  lea    0x6(%r8),%ecx
  cmpb   $0x0,(%rbx,%rcx,1)
  cmove  %r13d,%edx
  jmp    L90
L114:
  mov    $0x0,%edi
  mov    %edi,%eax
  ret
L25:
  mov    %edi,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
unsigned hash_information_elements(const unsigned char *px, unsigned offset, unsigned length) {
  unsigned hash = 0;
  while (offset + 2 < length) {
    unsigned tlv_tag = px[offset++];
    unsigned tlv_length = px[offset++];
    unsigned tlv_offset = offset;
    unsigned oui = 0;
    unsigned oui_type = 0;
    if (tlv_length > length - offset) {
      if (length - offset == 2)
        break;
      tlv_length = length - offset;
    }
    offset += tlv_length;
    switch (tlv_tag) {
    case 0x00:
    case 0x03:
      continue;
    case 0xdd:
      if (tlv_length >= 4) {
        oui = px[tlv_offset] << 16 | px[tlv_offset + 1] << 8 | px[tlv_offset + 2];
        oui_type = px[tlv_offset + 3];
        switch (oui) {
        case 0x0050f2:
          switch (oui_type) {
          case 8:
            if (tlv_length > 5) {
              switch (px[tlv_offset + 4]) {
              case 0x00:
                if (tlv_length > 5)
                  tlv_length = 5;
                break;
              default:
                break;
              }
            }
            break;
          default:
            break;
          }
          break;
        default:
          break;
        }
      }
      break;
    default:
      break;
    }
    hash = fnv1a_32(hash, px + tlv_offset - 2, tlv_length + 2);
  }
  return hash;
}
```
user: Translate the below assembly code into C programming language:

```asm
<hash_information_elements>:
  endbr64
  lea    0x2(%rsi),%eax
  cmp    %eax,%edx
  jbe    L67
  push   %r12
  xor    %r8d,%r8d
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  jmp    L93
  xchg   %ax,%ax
L75:
  lea    (%rdi,%rax,1),%ebp
  mov    %edi,%edx
L120:
  cmp    $0x3,%cl
  je     L73
  cmp    $0xdd,%cl
  je     L117
  test   %cl,%cl
  je     L73
L127:
  lea    0x2(%rdx),%r9d
L114:
  mov    %r8d,%edi
  lea    -0x2(%rbx,%rax,1),%rsi
  mov    %r9d,%edx
  call   <fnv1a_32@plt>
  mov    %eax,%r8d
L73:
  lea    0x2(%rbp),%eax
  cmp    %r12d,%eax
  jae    L25
  mov    %ebp,%esi
L93:
  mov    %esi,%edx
  movzbl (%rbx,%rdx,1),%ecx
  lea    0x1(%rsi),%edx
  movzbl (%rbx,%rdx,1),%edi
  mov    %r12d,%edx
  sub    %eax,%edx
  cmp    %edi,%edx
  jae    L75
  cmp    $0x2,%edx
  je     L25
  mov    %r12d,%ebp
  jmp    L120
  nopl   0x0(%rax,%rax,1)
L117:
  cmp    $0x3,%edx
  jbe    L127
  movzbl (%rbx,%rax,1),%ecx
  lea    0x4(%rsi),%edi
  movzbl (%rbx,%rdi,1),%edi
  shl    $0x10,%ecx
  or     %edi,%ecx
  lea    0x3(%rsi),%edi
  movzbl (%rbx,%rdi,1),%edi
  shl    $0x8,%edi
  or     %edi,%ecx
  cmp    $0x50f2,%ecx
  lea    0x5(%rsi),%ecx
  sete   %dil
  cmpb   $0x8,(%rbx,%rcx,1)
  sete   %cl
  test   %cl,%dil
  je     L127
  cmp    $0x5,%edx
  jbe    L127
  lea    0x6(%rsi),%ecx
  mov    $0x7,%r9d
  cmpb   $0x0,(%rbx,%rcx,1)
  je     L114
  jmp    L127
  nop
L25:
  pop    %rbx
  mov    %r8d,%eax
  pop    %rbp
  pop    %r12
  ret
L67:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned hash_information_elements(const unsigned char *px, unsigned offset, unsigned length) {
  unsigned hash = 0;
  while (offset + 2 < length) {
    unsigned tlv_tag = px[offset++];
    unsigned tlv_length = px[offset++];
    unsigned tlv_offset = offset;
    unsigned oui = 0;
    unsigned oui_type = 0;
    if (tlv_length > length - offset) {
      if (length - offset == 2)
        break;
      tlv_length = length - offset;
    }
    offset += tlv_length;
    switch (tlv_tag) {
    case 0x00:
    case 0x03:
      continue;
    case 0xdd:
      if (tlv_length >= 4) {
        oui = px[tlv_offset] << 16 | px[tlv_offset + 1] << 8 | px[tlv_offset + 2];
        oui_type = px[tlv_offset + 3];
        switch (oui) {
        case 0x0050f2:
          switch (oui_type) {
          case 8:
            if (tlv_length > 5) {
              switch (px[tlv_offset + 4]) {
              case 0x00:
                if (tlv_length > 5)
                  tlv_length = 5;
                break;
              default:
                break;
              }
            }
            break;
          default:
            break;
          }
          break;
        default:
          break;
        }
      }
      break;
    default:
      break;
    }
    hash = fnv1a_32(hash, px + tlv_offset - 2, tlv_length + 2);
  }
  return hash;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<hash_information_elements>:
  endbr64
  lea    0x2(%rsi),%eax
  cmp    %eax,%edx
  jbe    L91
  push   %r12
  xor    %r8d,%r8d
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  jmp    L123
  xchg   %ax,%ax
L62:
  lea    (%rdi,%rax,1),%ebp
  mov    %edi,%edx
L18:
  cmp    $0x3,%cl
  je     L65
  cmp    $0xdd,%cl
  je     L23
  test   %cl,%cl
  je     L65
L14:
  lea    0x2(%rdx),%r9d
L43:
  mov    %r8d,%edi
  lea    -0x2(%rbx,%rax,1),%rsi
  mov    %r9d,%edx
  call   <fnv1a_32@plt>
  mov    %eax,%r8d
L65:
  lea    0x2(%rbp),%eax
  cmp    %r12d,%eax
  jae    L84
  mov    %ebp,%esi
L123:
  mov    %esi,%edx
  movzbl (%rbx,%rdx,1),%ecx
  lea    0x1(%rsi),%edx
  movzbl (%rbx,%rdx,1),%edi
  mov    %r12d,%edx
  sub    %eax,%edx
  cmp    %edi,%edx
  jae    L62
  cmp    $0x2,%edx
  je     L84
  mov    %r12d,%ebp
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L23:
  cmp    $0x3,%edx
  jbe    L14
  movzbl (%rbx,%rax,1),%ecx
  lea    0x4(%rsi),%edi
  movzbl (%rbx,%rdi,1),%edi
  shl    $0x10,%ecx
  or     %edi,%ecx
  lea    0x3(%rsi),%edi
  movzbl (%rbx,%rdi,1),%edi
  shl    $0x8,%edi
  or     %edi,%ecx
  cmp    $0x50f2,%ecx
  lea    0x5(%rsi),%ecx
  sete   %dil
  cmpb   $0x8,(%rbx,%rcx,1)
  sete   %cl
  test   %cl,%dil
  je     L14
  cmp    $0x5,%edx
  jbe    L14
  lea    0x6(%rsi),%ecx
  mov    $0x7,%r9d
  cmpb   $0x0,(%rbx,%rcx,1)
  je     L43
  jmp    L14
  nop
L84:
  pop    %rbx
  mov    %r8d,%eax
  pop    %rbp
  pop    %r12
  ret
L91:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned hash_information_elements(const unsigned char *px, unsigned offset, unsigned length) {
  unsigned hash = 0;
  while (offset + 2 < length) {
    unsigned tlv_tag = px[offset++];
    unsigned tlv_length = px[offset++];
    unsigned tlv_offset = offset;
    unsigned oui = 0;
    unsigned oui_type = 0;
    if (tlv_length > length - offset) {
      if (length - offset == 2)
        break;
      tlv_length = length - offset;
    }
    offset += tlv_length;
    switch (tlv_tag) {
    case 0x00:
    case 0x03:
      continue;
    case 0xdd:
      if (tlv_length >= 4) {
        oui = px[tlv_offset] << 16 | px[tlv_offset + 1] << 8 | px[tlv_offset + 2];
        oui_type = px[tlv_offset + 3];
        switch (oui) {
        case 0x0050f2:
          switch (oui_type) {
          case 8:
            if (tlv_length > 5) {
              switch (px[tlv_offset + 4]) {
              case 0x00:
                if (tlv_length > 5)
                  tlv_length = 5;
                break;
              default:
                break;
              }
            }
            break;
          default:
            break;
          }
          break;
        default:
          break;
        }
      }
      break;
    default:
      break;
    }
    hash = fnv1a_32(hash, px + tlv_offset - 2, tlv_length + 2);
  }
  return hash;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<invalid_nk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x18(%rbp)
  mov    %rcx,-0x28(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jle    L9
  cmpl   $0x3e,-0x14(%rbp)
  jg     L9
  cmpl   $0x0,-0x18(%rbp)
  jle    L9
  cmpl   $0x3e,-0x18(%rbp)
  jg     L9
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cmp    $0x3f,%eax
  jle    L11
L9:
  mov    $0x1,%eax
  jmp    L99
L11:
  mov    $0x0,%eax
L99:
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L108
  mov    $0x1,%eax
  jmp    L109
L108:
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <bi_len@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  setne  %al
  movzbl %al,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <bi_len@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  setne  %al
  movzbl %al,%eax
  or     %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <bi_blen@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <bi_blen@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x10,-0x8(%rbp)
  jle    L74
  cmpl   $0x10,-0x4(%rbp)
  jle    L74
  mov    -0x20(%rbp),%rcx
  mov    -0x14(%rbp),%edx
  mov    -0x28(%rbp),%rsi
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <bi_lt@plt>
  test   %eax,%eax
  jne    L60
L74:
  mov    $0x1,%eax
  jmp    L45
L60:
  mov    $0x0,%eax
L45:
  or     %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
L109:
  leave
  ret
```

assistant: ```c
int invalid_nk(int nn_len, unsigned long *nn, int ku_len, unsigned long *ku) {
  int invalid, len, nn_blen, ku_blen;
  invalid = (nn_len <= 0 || nn_len > 125 / 2 || ku_len <= 0 || ku_len > 125 / 2 || (nn_len + ku_len) > 63);
  if (invalid)
    return 1;
  len = bi_len(nn_len, nn);
  invalid = len != nn_len;
  len = bi_len(ku_len, ku);
  invalid |= len != ku_len;
  nn_blen = bi_blen(nn_len, nn);
  ku_blen = bi_blen(ku_len, ku);
  invalid |= (nn_blen < 17 || ku_blen < 17 || !bi_lt(ku_len, ku, nn_len, nn));
  return invalid;
}
```