user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<handle_intel>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x1,-0x38(%rbp)
  seta   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x28(%rbp)
  movl   $0x1,-0x24(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L96
L128:
  mov    -0x14(%rbp),%esi
  mov    -0x18(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %esi,%r8d
  mov    %eax,%esi
  mov    $0x2,%edi
  call   <__cpuid@plt>
  cmpl   $0x1,-0x28(%rbp)
  jne    L121
  mov    -0x20(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  andl   $0xffffff00,-0x20(%rbp)
L121:
  lea    -0x30(%rbp),%rcx
  lea    -0x2c(%rbp),%rdx
  mov    -0x20(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <intel_check_word@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L142
  mov    -0x10(%rbp),%rax
  jmp    L77
L142:
  lea    -0x30(%rbp),%rcx
  lea    -0x2c(%rbp),%rdx
  mov    -0x1c(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <intel_check_word@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L38
  mov    -0x10(%rbp),%rax
  jmp    L77
L38:
  lea    -0x30(%rbp),%rcx
  lea    -0x2c(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <intel_check_word@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L68
  mov    -0x10(%rbp),%rax
  jmp    L77
L68:
  lea    -0x30(%rbp),%rcx
  lea    -0x2c(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <intel_check_word@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L96
  mov    -0x10(%rbp),%rax
  jmp    L77
L96:
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  cmp    %eax,-0x24(%rbp)
  ja     L128
  mov    D17(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x34(%rbp)
  jl     L103
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x34(%rbp)
  jg     L103
  mov    -0x30(%rbp),%eax
  test   %eax,%eax
  je     L103
  mov    $0xffffffffffffffff,%rax
  jmp    L77
L103:
  mov    $0x0,%eax
L77:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L94
  call   <__stack_chk_fail@plt>
L94:
  leave
  ret
```

assistant: ```c
long int __attribute__((no)) handle_intel(int name, unsigned int maxidx) {
  assert(maxidx >= 2);
  unsigned int cnt = 0;
  unsigned int max = 1;
  long int result = 0;
  bool no_level_2_or_3 = false;
  bool has_level_2 = false;
  while (cnt++ < max) {
    unsigned int eax;
    unsigned int ebx;
    unsigned int ecx;
    unsigned int edx;
    __cpuid(2, eax, ebx, ecx, edx);
    if (cnt == 1) {
      max = eax & 0xff;
      eax &= 0xffffff00;
    }
    result = intel_check_word(name, eax, &has_level_2, &no_level_2_or_3);
    if (result != 0)
      return result;
    result = intel_check_word(name, ebx, &has_level_2, &no_level_2_or_3);
    if (result != 0)
      return result;
    result = intel_check_word(name, ecx, &has_level_2, &no_level_2_or_3);
    if (result != 0)
      return result;
    result = intel_check_word(name, edx, &has_level_2, &no_level_2_or_3);
    if (result != 0)
      return result;
  }
  if (name >= _SC_LEVEL2_CACHE_SIZE && name <= _SC_LEVEL3_CACHE_LINESIZE && no_level_2_or_3)
    return -1;
  return 0;
}
```