user: 请将以下的汇编代码转换成C语言代码：

```asm
<pci_read_configuration>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x240,%rsp
  mov    %edi,-0x234(%rbp)
  mov    %esi,-0x238(%rbp)
  mov    %edx,-0x23c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  call   <options_get_string@plt>
  mov    %rax,%rsi
  mov    -0x23c(%rbp),%edi
  mov    -0x238(%rbp),%ecx
  mov    -0x234(%rbp),%edx
  lea    -0x210(%rbp),%rax
  mov    %edi,%r9d
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %rsi,%rdx
  lea    D50(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x228(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L77
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  call   <options_get_string@plt>
  mov    %rax,%rsi
  mov    -0x23c(%rbp),%edi
  mov    -0x238(%rbp),%ecx
  mov    -0x234(%rbp),%edx
  lea    -0x210(%rbp),%rax
  mov    %edi,%r9d
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %rsi,%rdx
  lea    D68(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x228(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L77
  mov    $0x0,%eax
  jmp    L42
L77:
  lea    -0x210(%rbp),%rax
  lea    D12(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x220(%rbp)
  cmpq   $0x0,-0x220(%rbp)
  jne    L55
  lea    -0x210(%rbp),%rax
  mov    %rax,%rsi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <log_errno@plt>
  mov    $0x0,%eax
  jmp    L42
L55:
  mov    -0x228(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x218(%rbp)
  mov    -0x228(%rbp),%esi
  mov    -0x220(%rbp),%rdx
  mov    -0x218(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread@plt>
  mov    %eax,-0x224(%rbp)
  cmpl   $0x1,-0x224(%rbp)
  je     L29
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <log_errno@plt>
  mov    $0x0,%eax
  jmp    L42
L29:
  mov    -0x220(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x218(%rbp),%rax
L42:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L74
  call   <__stack_chk_fail@plt>
L74:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D60
type_guessed: string
name: read_data
arguments: tag: D50
type_guessed: string
name: read_data
arguments: tag: D68
type_guessed: string
name: read_data
arguments: tag: D12
type_guessed: string
name: read_data
arguments: tag: D11
type_guessed: string
name: read_data
arguments: tag: D55
type_guessed: string

tool: D60: proc_pci_bus

tool: D50: %s/%02x_%02x.%d

tool: D68: %s/%02x/%02x.%d

tool: D12: r

tool: D11: Unable to read PCI configuration data from %s

tool: D55: Unable to read the CPU PCI configuration data. You may not have the necessary user privileges, please retry with administrator root privileges.


assistant: ```c
void *pci_read_configuration(int bus, int device, int function) {
  struct stat st;
  char buf[512];
  sprintf(buf, "%s/%02x_%02x.%d", options_get_string("proc_pci_bus"), bus, device, function);
  if (stat(buf, &st) != 0) {
    sprintf(buf, "%s/%02x/%02x.%d", options_get_string("proc_pci_bus"), bus, device, function);
    if (stat(buf, &st) != 0) {
      return NULL;
    }
  }
  FILE *f = fopen(buf, "r");
  if (!f) {
    log_errno("Unable to read PCI configuration data from %s", buf);
    return NULL;
  }
  void *data = malloc(st.st_size);
  int n = fread(data, st.st_size, 1, f);
  if (n != 1) {
    log_errno("Unable to read the CPU PCI configuration data. You may not "
              "have the necessary user privileges, please retry with "
              "administrator root privileges.\n");
    return NULL;
  }
  fclose(f);
  return data;
}
```