user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<nvram_probe>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebx
  mov    $0x1,%edi
  call   <nvram_open_internal@plt>
  mov    $0x50,%edi
  call   <nvram_read@plt>
  mov    %eax,%ebp
  mov    $0x53,%edi
  call   <nvram_read@plt>
  mov    %al,0xf(%rsp)
  mov    $0x0,%eax
  call   <nvram_close@plt>
  mov    %ebx,%edi
  call   <nvram_open_internal@plt>
  mov    $0x7f,%edi
  call   <nvram_read@plt>
  mov    %eax,%r14d
  mov    $0xfe,%edi
  call   <nvram_read@plt>
  mov    %eax,%r13d
  mov    $0xff,%edi
  call   <nvram_read@plt>
  mov    %eax,%r12d
  mov    $0x1,%ebx
  mov    $0xffffffa5,%r15d
L2:
  movzbl %bl,%esi
  mov    $0xff,%edi
  call   <nvram_write_immediate@plt>
  mov    %r15d,%esi
  sub    %ebx,%esi
  movzbl %sil,%esi
  mov    $0x7f,%edi
  call   <nvram_write_immediate@plt>
  mov    $0x5a,%esi
  sub    %ebx,%esi
  movzbl %sil,%esi
  mov    $0xfe,%edi
  call   <nvram_write_immediate@plt>
  mov    $0xff,%edi
  call   <nvram_read@plt>
  cmp    %bl,%al
  jne    L35
  mov    $0x7f,%edi
  call   <nvram_read@plt>
  cmp    %bl,%al
  je     L53
  mov    $0xfe,%edi
  call   <nvram_read@plt>
  cmp    %bl,%al
  je     L1
  add    %ebx,%ebx
  cmp    $0x80,%bl
  jne    L2
  mov    $0x1,%ebx
L57:
  movzbl %r14b,%esi
  mov    $0x7f,%edi
  call   <nvram_write_immediate@plt>
  movzbl %r13b,%esi
  mov    $0xfe,%edi
  call   <nvram_write_immediate@plt>
  movzbl %r12b,%esi
  mov    $0xff,%edi
  call   <nvram_write_immediate@plt>
  mov    $0x0,%eax
  call   <nvram_close@plt>
  mov    $0x1,%edi
  call   <nvram_open_internal@plt>
  movzbl %bpl,%esi
  mov    $0x50,%edi
  call   <nvram_write_immediate@plt>
  movzbl 0xf(%rsp),%esi
  mov    $0x53,%edi
  call   <nvram_write_immediate@plt>
  mov    $0x0,%eax
  call   <nvram_close@plt>
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  mov    $0x0,%ebx
  jmp    L57
L53:
  mov    $0x0,%ebx
  jmp    L57
L1:
  mov    $0x0,%ebx
  jmp    L57
```

assistant: ```c
int nvram_probe(int nvram_type_arg) {
  unsigned char mask;
  unsigned char nvram_cell_0x50, nvram_cell_0x53, nvram_cell_0x7f, nvram_cell_0xfe, nvram_cell_0xff;
  int result = 0;
  nvram_open_internal(1);
  nvram_cell_0x50 = nvram_read(0x50);
  nvram_cell_0x53 = nvram_read(0x53);
  nvram_close();
  nvram_open_internal(nvram_type_arg);
  nvram_cell_0x7f = nvram_read(0x7f);
  nvram_cell_0xfe = nvram_read(0xfe);
  nvram_cell_0xff = nvram_read(0xff);
  for (mask = 0x01; mask != 0x80; mask *= 2) {
    nvram_write_immediate(0xff, mask);
    nvram_write_immediate(0x7f, (0xa5 - mask));
    nvram_write_immediate(0xfe, (0x5a - mask));
    if (nvram_read(0xff) != mask) {
      goto nvram_probe_end;
    }
    if (nvram_read(0x7f) == mask) {
      goto nvram_probe_end;
    }
    if (nvram_read(0xfe) == mask) {
      goto nvram_probe_end;
    }
  }
  result = 1;
nvram_probe_end:
  nvram_write_immediate(0x7f, nvram_cell_0x7f);
  nvram_write_immediate(0xfe, nvram_cell_0xfe);
  nvram_write_immediate(0xff, nvram_cell_0xff);
  nvram_close();
  nvram_open_internal(1);
  nvram_write_immediate(0x50, nvram_cell_0x50);
  nvram_write_immediate(0x53, nvram_cell_0x53);
  nvram_close();
  return result;
}
```