user: What would the C source look like for the assembly code provided here?

```asm
<I2C_write>:
  endbr64
  push   %r15
  add    %edi,%edi
  mov    $0x5,%r15d
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  movzbl %dil,%ebp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0xc(%rsp)
  lea    0x14(%rsp),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
L31:
  xor    %eax,%eax
  call   <send_i2c_start@plt>
  test   %eax,%eax
  jne    L150
  mov    %ebp,%edi
  call   <send_i2c_data@plt>
  test   %eax,%eax
  jne    L150
  mov    %r14,%rdi
  call   <receive_i2c_ack@plt>
  test   %eax,%eax
  jne    L150
  mov    0x14(%rsp),%esi
  test   %esi,%esi
  je     L7
  movzbl 0xc(%rsp),%edi
  call   <send_i2c_data@plt>
  test   %eax,%eax
  jne    L150
  mov    %r14,%rdi
  call   <receive_i2c_ack@plt>
  test   %eax,%eax
  jne    L150
  mov    0x14(%rsp),%ecx
  xor    %eax,%eax
  test   %ecx,%ecx
  je     L7
  test   %r12d,%r12d
  je     L128
  xor    %ebx,%ebx
  jmp    L23
  nopl   0x0(%rax)
L49:
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  je     L128
L23:
  lea    0x0(,%rbx,8),%ecx
  mov    %r13,%rdi
  shr    %cl,%rdi
  movzbl %dil,%edi
  call   <send_i2c_data@plt>
  test   %eax,%eax
  jne    L150
  mov    %r14,%rdi
  call   <receive_i2c_ack@plt>
  test   %eax,%eax
  jne    L150
  mov    0x14(%rsp),%edx
  test   %edx,%edx
  jne    L49
  nopw   0x0(%rax,%rax,1)
L7:
  call   <send_i2c_stop@plt>
  test   %eax,%eax
  je     L53
L150:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L139
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L53:
  mov    $0xa,%edi
  call   <OS_mdelay@plt>
  sub    $0x1,%r15d
  jne    L31
  mov    $0x1122,%eax
  jmp    L150
  nopl   0x0(%rax,%rax,1)
L128:
  xor    %eax,%eax
  call   <send_i2c_stop@plt>
  jmp    L150
L139:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int I2C_write(unsigned int address, unsigned int reg, unsigned long value, unsigned int bytes) {
  int err;
  int restart_count = 0;
  int ack;
  unsigned int b;
  int nack;
  while (restart_count++ < 5) {
    err = send_i2c_start();
    if (err)
      return err;
    err = send_i2c_data((char)((address << 1) | 0x00));
    if (err)
      return err;
    err = receive_i2c_ack(&ack);
    if (err)
      return err;
    if (!ack) {
      {}
      err = send_i2c_stop();
      if (err)
        return err;
      OS_mdelay(10);
      continue;
    }
    err = send_i2c_data((unsigned char)reg);
    if (err)
      return err;
    err = receive_i2c_ack(&ack);
    if (err)
      return err;
    if (!ack) {
      {}
      err = send_i2c_stop();
      if (err)
        return err;
      OS_mdelay(10);
      continue;
    }
    nack = 0;
    for (b = 0; b < bytes; b++) {
      err = send_i2c_data((unsigned char)(value >> (b * 8)));
      if (err)
        return err;
      err = receive_i2c_ack(&ack);
      if (err)
        return err;
      if (!ack) {
        {}
        err = send_i2c_stop();
        if (err)
          return err;
        OS_mdelay(10);
        nack = 1;
        break;
      }
    }
    if (nack)
      continue;
    err = send_i2c_stop();
    if (err)
      return err;
    return 0;
  }
  {}
  return 0x1122;
}
```