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

```asm
<ina226Init>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  lea    D59(%rip),%rdi
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  movzbl %bpl,%ebp
  call   <puts@plt>
  mov    $0x8000,%ecx
  xor    %edx,%edx
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <I2CWriteReg16@plt>
  mov    $0x4f27,%ecx
  xor    %edx,%edx
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <I2CWriteReg16@plt>
  mov    $0x1400,%ecx
  mov    %ebp,%esi
  mov    %r12d,%edi
  mov    $0x5,%edx
  call   <I2CWriteReg16@plt>
  xor    %edx,%edx
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <I2CReadReg16@plt>
  lea    D55(%rip),%rdi
  mov    %eax,%esi
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x5,%edx
  mov    %ebp,%esi
  mov    %r12d,%edi
  cmp    $0x4f27,%ebx
  je     L6
  call   <I2CReadReg16@plt>
  lea    D48(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
L1:
  mov    $0xff,%edx
  mov    %r12d,%edi
  mov    %ebp,%esi
  mov    $0x1,%r12d
  call   <I2CReadReg16@plt>
  lea    D11(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D46(%rip),%rdi
  call   <puts@plt>
L9:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L6:
  call   <I2CReadReg16@plt>
  lea    D48(%rip),%rdi
  mov    %eax,%ebx
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  cmp    $0x1400,%ebx
  jne    L1
  mov    $0xff,%edx
  mov    %r12d,%edi
  mov    %ebp,%esi
  xor    %r12d,%r12d
  call   <I2CReadReg16@plt>
  lea    D11(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D24(%rip),%rdi
  call   <puts@plt>
  jmp    L9
```

tool_calls: name: read_data
arguments: label: D59
type_infered: string
name: read_data
arguments: label: D55
type_infered: string
name: read_data
arguments: label: D48
type_infered: string
name: read_data
arguments: label: D11
type_infered: string
name: read_data
arguments: label: D46
type_infered: string
name: read_data
arguments: label: D24
type_infered: string

tool: D59: Configuring INA226

tool: D55: Config reg = 0x%0x


tool: D48: Cal reg = 0x%0x


tool: D11: Die ID reg = 0x%0x


tool: D46: --- INA226 Init Test failed

tool: D24: --- INA226 Init Test passed

assistant: ```c
unsigned int ina226Init(int fd, unsigned char i2cAddress) {
  unsigned int readData = 0;
  unsigned int writeData;
  unsigned int testFail = 0;
  printf("Configuring INA226\n");
  writeData = 0x8000;
  I2CWriteReg16(fd, i2cAddress, 0x00, writeData);
  writeData = 0x4f27;
  I2CWriteReg16(fd, i2cAddress, 0x00, writeData);
  writeData = 0x1400;
  I2CWriteReg16(fd, i2cAddress, 0x05, writeData);
  readData = I2CReadReg16(fd, i2cAddress, 0x00);
  printf("Config reg = 0x%0x\n", readData);
  if (readData != 0x4f27)
    testFail = 1;
  readData = I2CReadReg16(fd, i2cAddress, 0x05);
  printf("Cal reg = 0x%0x\n", readData);
  if (readData != 0x1400)
    testFail = 1;
  readData = I2CReadReg16(fd, i2cAddress, 0xff);
  printf("Die ID reg = 0x%0x\n", readData);
  if (testFail == 0)
    printf("--- INA226 Init Test passed\n");
  else
    printf("--- INA226 Init Test failed\n");
  printf("\n");
  return testFail;
}
```