user: Converte this assembly snippet into its equivalent C code:

```asm
<do_smbus_read_byte>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,%ecx
  mov    %edx,%eax
  mov    %ecx,%edx
  mov    %dl,-0x28(%rbp)
  mov    %al,-0x2c(%rbp)
  movb   $0x0,-0x11(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <smbus_check_stop_condition@plt>
  test   %rax,%rax
  je     L84
  movb   $0x1,-0x11(%rbp)
  jmp    L130
L84:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <smbus_start_condition@plt>
  test   %rax,%rax
  je     L100
  movb   $0x2,-0x11(%rbp)
  jmp    L130
L100:
  movzbl -0x28(%rbp),%eax
  add    %eax,%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <smbus_send_slave_address@plt>
  test   %rax,%rax
  je     L109
  movb   $0x3,-0x11(%rbp)
  jmp    L130
L109:
  mov    -0x24(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <smbus_ack@plt>
  movzbl -0x2c(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <smbus_send_command@plt>
  test   %rax,%rax
  je     L11
  movb   $0x4,-0x11(%rbp)
  jmp    L130
L11:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <smbus_start_condition@plt>
  test   %rax,%rax
  je     L145
  movb   $0x5,-0x11(%rbp)
  jmp    L130
L145:
  movzbl -0x28(%rbp),%eax
  add    %eax,%eax
  or     $0x1,%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <smbus_send_slave_address@plt>
  test   %rax,%rax
  je     L59
  movb   $0x6,-0x11(%rbp)
  jmp    L130
L59:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <smbus_stop_condition@plt>
  test   %rax,%rax
  je     L96
  movb   $0x7,-0x11(%rbp)
  jmp    L130
L96:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <smbus_get_result@plt>
  jmp    L114
L130:
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
  movzbl -0x11(%rbp),%eax
  mov    %eax,%edi
  call   <print_debug_hex8@plt>
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
  movzbl -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <print_debug_hex8@plt>
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <smbus_stop_condition@plt>
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%ebx
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <inb@plt>
  mov    %ebx,%esi
  mov    %eax,%edi
  call   <outb@plt>
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  mov    $0x0,%edi
  call   <outb@plt>
  mov    $0xffffffff,%eax
L114:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D6
type_infered: string
name: parse_data
arguments: tag: D17
type_infered: string
name: parse_data
arguments: tag: D4
type_infered: string

tool: D6: SMBUS READ ERROR:

tool: D17:  device:

tool: D4: 


assistant: ```c
unsigned char do_smbus_read_byte(unsigned smbus_io_base, unsigned char device, unsigned char address) {
  unsigned char error = 0;
  if ((smbus_check_stop_condition(smbus_io_base))) {
    error = 1;
    goto err;
  }
  if ((smbus_start_condition(smbus_io_base))) {
    error = 2;
    goto err;
  }
  if ((smbus_send_slave_address(smbus_io_base, device << 1))) {
    error = 3;
    goto err;
  }
  smbus_ack(smbus_io_base, 1);
  if ((smbus_send_command(smbus_io_base, address))) {
    error = 4;
    goto err;
  }
  if ((smbus_start_condition(smbus_io_base))) {
    error = 5;
    goto err;
  }
  if ((smbus_send_slave_address(smbus_io_base, (device << 1) | 0x01))) {
    error = 6;
    goto err;
  }
  if ((smbus_stop_condition(smbus_io_base))) {
    error = 7;
    goto err;
  }
  return smbus_get_result(smbus_io_base);
err:
  print_debug("SMBUS READ ERROR:");
  print_debug_hex8(error);
  print_debug(" device:");
  print_debug_hex8(device);
  print_debug("\n");
  smbus_stop_condition(smbus_io_base);
  outb(inb(smbus_io_base + 0x01), smbus_io_base + 0x01);
  outb(0x0, smbus_io_base + 0x01);
  return 0xFF;
}
```