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

```asm
<disable_prefetch_nhm>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  lea    D8(%rip),%rdi
  mov    %ebx,%ebp
  call   <puts@plt>
  cmp    $0xffffffff,%ebx
  jne    L31
  mov    $0x400,%ebp
  xor    %ebx,%ebx
L31:
  lea    D6(%rip),%r12
  lea    D20(%rip),%r13
  cs nopw 0x0(%rax,%rax,1)
L16:
  mov    %ebx,%edi
  call   <open_msr@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  js     L28
  mov    $0x1a4,%esi
  mov    %eax,%edi
  call   <read_msr@plt>
  mov    %eax,%edx
  and    $0x8,%edx
  cmp    $0x1,%edx
  mov    %eax,%edx
  sbb    %edi,%edi
  and    $0x4,%edx
  and    $0xb,%edi
  cmp    $0x1,%edx
  mov    %eax,%edx
  sbb    %esi,%esi
  and    $0x2,%edx
  lea    0x4e(%rdi),%r9d
  mov    %r12,%rdi
  and    $0xb,%esi
  cmp    $0x1,%edx
  sbb    %ecx,%ecx
  and    $0x1,%eax
  lea    0x4e(%rsi),%r8d
  mov    %ebx,%esi
  and    $0xb,%ecx
  add    $0x4e,%ecx
  cmp    $0x1,%eax
  sbb    %edx,%edx
  xor    %eax,%eax
  and    $0xb,%edx
  add    $0x4e,%edx
  call   <printf@plt>
  mov    $0xf,%edx
  mov    $0x1a4,%esi
  mov    %r14d,%edi
  call   <write_msr@plt>
  mov    $0x1a4,%esi
  mov    %r14d,%edi
  call   <read_msr@plt>
  mov    %eax,%edx
  and    $0x8,%edx
  cmp    $0x1,%edx
  mov    %eax,%edx
  sbb    %r9d,%r9d
  and    $0x4,%edx
  and    $0xb,%r9d
  add    $0x4e,%r9d
  cmp    $0x1,%edx
  mov    %eax,%edx
  sbb    %r8d,%r8d
  and    $0x2,%edx
  and    $0xb,%r8d
  add    $0x4e,%r8d
  cmp    $0x1,%edx
  sbb    %ecx,%ecx
  and    $0xb,%ecx
  add    $0x4e,%ecx
  test   $0x1,%al
  je     L43
  mov    %ebx,%esi
  mov    $0x4e,%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x1,%ebx
  mov    %r14d,%edi
  call   <close@plt>
  cmp    %ebp,%ebx
  jle    L16
L28:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L43:
  mov    %ebx,%esi
  mov    $0x59,%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x1,%ebx
  mov    %r14d,%edi
  call   <close@plt>
  cmp    %ebx,%ebp
  jge    L16
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D8
data_type: string
name: unpack_data
arguments: data_tag: D6
data_type: string
name: unpack_data
arguments: data_tag: D20
data_type: string

tool: D8: Disable all prefetch

tool: D6: 	Core %d old : L2HW=%c L2ADJ=%c DCU=%c DCUIP=%c


tool: D20: 	Core %d new : L2HW=%c L2ADJ=%c DCU=%c DCUIP=%c


assistant: ```c
int disable_prefetch_nhm(int core) {
  int fd;
  int result;
  int begin, end, c;
  printf("Disable all prefetch\n");
  if (core == -1) {
    begin = 0;
    end = 1024;
  } else {
    begin = core;
    end = core;
  }
  for (c = begin; c <= end; c++) {
    fd = open_msr(c);
    if (fd < 0)
      break;
    result = read_msr(fd, 0x1a4);
    printf("\tCore %d old : L2HW=%c L2ADJ=%c DCU=%c DCUIP=%c\n", c, result & 0x1 ? 'N' : 'Y', result & 0x2 ? 'N' : 'Y', result & 0x4 ? 'N' : 'Y', result & 0x8 ? 'N' : 'Y');
    result = write_msr(fd, 0x1a4, 0xf);
    result = read_msr(fd, 0x1a4);
    printf("\tCore %d new : L2HW=%c L2ADJ=%c DCU=%c DCUIP=%c\n", c, result & 0x1 ? 'N' : 'Y', result & 0x2 ? 'N' : 'Y', result & 0x4 ? 'N' : 'Y', result & 0x8 ? 'N' : 'Y');
    close(fd);
  }
  return 0;
}
```