user: Demonstrate the C code that generates the assembly output below:

```asm
<I2C_write>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0xc(%rsp)
  mov    %rdx,%r13
  mov    %ecx,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  add    %edi,%edi
  movzbl %dil,%ebp
  mov    $0x5,%r15d
  lea    0x14(%rsp),%r14
L141:
  mov    $0x0,%eax
  call   <send_i2c_start@plt>
  test   %eax,%eax
  jne    L63
  mov    %ebp,%edi
  call   <send_i2c_data@plt>
  test   %eax,%eax
  jne    L63
  mov    %r14,%rdi
  call   <receive_i2c_ack@plt>
  test   %eax,%eax
  jne    L63
  cmpl   $0x0,0x14(%rsp)
  jne    L82
  call   <send_i2c_stop@plt>
  test   %eax,%eax
  je     L37
L63:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L175
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  mov    $0xa,%edi
  call   <OS_mdelay@plt>
L172:
  sub    $0x1,%r15d
  jne    L141
  mov    $0x1122,%eax
  jmp    L63
L82:
  movzbl 0xc(%rsp),%edi
  call   <send_i2c_data@plt>
  test   %eax,%eax
  jne    L63
  mov    %r14,%rdi
  call   <receive_i2c_ack@plt>
  test   %eax,%eax
  jne    L63
  cmpl   $0x0,0x14(%rsp)
  jne    L148
  mov    $0x0,%eax
  call   <send_i2c_stop@plt>
  test   %eax,%eax
  jne    L63
  mov    $0xa,%edi
  call   <OS_mdelay@plt>
  jmp    L172
L148:
  test   %r12d,%r12d
  je     L49
  mov    $0x0,%ebx
L53:
  lea    0x0(,%rbx,8),%ecx
  mov    %r13,%rdi
  shr    %cl,%rdi
  movzbl %dil,%edi
  call   <send_i2c_data@plt>
  test   %eax,%eax
  jne    L63
  mov    %r14,%rdi
  call   <receive_i2c_ack@plt>
  test   %eax,%eax
  jne    L63
  cmpl   $0x0,0x14(%rsp)
  je     L109
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  jne    L53
L49:
  mov    $0x0,%eax
  call   <send_i2c_stop@plt>
  jmp    L63
L109:
  call   <send_i2c_stop@plt>
  test   %eax,%eax
  jne    L63
  mov    $0xa,%edi
  call   <OS_mdelay@plt>
  jmp    L172
L175:
  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;
}
```