user: Please show me the C implementation that matches the assembly code listed below:

```asm
<brute_force_write_seq>:
  endbr64
  push   %rbp
  lea    D1(%rip),%rdi
  push   %rbx
  sub    $0x8,%rsp
  call   <writeString@plt>
  mov    $0x4e2,%edi
  call   <writeHex@plt>
  lea    D5(%rip),%rdi
  call   <writeString@plt>
  mov    $0x4e2,%edi
  call   <i2c_write_clock_scale@plt>
  xor    %eax,%eax
  call   <i2c_read_clock_scale@plt>
  lea    D106(%rip),%rdi
  mov    %eax,%ebp
  call   <writeString@plt>
  mov    %ebp,%edi
  call   <writeHex@plt>
  cmp    $0x4e2,%ebp
  je     L43
  lea    D99(%rip),%rdi
  call   <writeString@plt>
L1:
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%edi
  call   <hdmi_read_reg@plt>
  mov    %eax,%ebp
  cmp    $0xca,%eax
  je     L24
  lea    D10(%rip),%rdi
  call   <writeString@plt>
  mov    %ebp,%edi
  call   <writeHex@plt>
  lea    D63(%rip),%rdi
  call   <writeString@plt>
L54:
  mov    $0x2,%edi
  call   <hdmi_read_reg@plt>
  mov    $0x3,%edi
  mov    %eax,%ebx
  call   <hdmi_read_reg@plt>
  shl    $0x8,%eax
  mov    %eax,%ebp
  and    $0xf00,%ebp
  or     %ebx,%ebp
  cmp    $0x613,%ebp
  je     L51
  lea    D87(%rip),%rdi
  call   <writeString@plt>
  mov    %ebp,%edi
  call   <writeHex@plt>
  lea    D34(%rip),%rdi
  call   <writeString@plt>
L59:
  xor    %esi,%esi
  mov    $0x5,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x3d,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1d,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x30,%esi
  mov    $0x61,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xb2,%esi
  mov    $0x9,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xf8,%esi
  mov    $0xa,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x37,%esi
  mov    $0xb,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xc9,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xca,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xcb,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xcc,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xcd,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xce,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xcf,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xd0,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xe1,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xc3,%esi
  mov    $0xf8,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xa5,%esi
  mov    $0xf8,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x60,%esi
  mov    $0x22,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xe0,%esi
  mov    $0x1a,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x48,%esi
  mov    $0x22,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xff,%esi
  mov    $0xf8,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1d,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x30,%esi
  mov    $0x61,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xff,%esi
  mov    $0xc,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xff,%esi
  mov    $0xd,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xcf,%esi
  mov    $0xe,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xce,%esi
  mov    $0xe,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x9,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x9,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xa0,%esi
  mov    $0x11,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x12,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x20,%esi
  mov    $0x13,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x14,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x3,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x9,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xa0,%esi
  mov    $0x11,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x20,%esi
  mov    $0x12,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x20,%esi
  mov    $0x13,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x14,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x3,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x9,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xa0,%esi
  mov    $0x11,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x40,%esi
  mov    $0x12,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x20,%esi
  mov    $0x13,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x14,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x3,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x9,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0x10,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xa0,%esi
  mov    $0x11,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x60,%esi
  mov    $0x12,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x20,%esi
  mov    $0x13,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x14,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x3,%esi
  mov    $0x15,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1d,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x30,%esi
  mov    $0x61,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x41,%esi
  mov    $0xc1,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x10,%esi
  mov    $0x58,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x68,%esi
  mov    $0x59,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x5a,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x3,%esi
  mov    $0x5b,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x5c,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x5e,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x5f,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x60,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x61,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x62,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x63,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x64,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x65,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xf4,%esi
  mov    $0x5d,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x3,%esi
  mov    $0xcd,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1d,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x70,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x72,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xc0,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x15,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x10,%esi
  mov    $0x61,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x18,%esi
  mov    $0x62,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x10,%esi
  mov    $0x63,%edi
  call   <hdmi_write_reg@plt>
  mov    $0xc,%esi
  mov    $0x64,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x15,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x15,%esi
  mov    $0x4,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xc,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x40,%esi
  mov    $0xd,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x1,%esi
  mov    $0xe,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xe,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0x61,%edi
  call   <hdmi_write_reg@plt>
  xor    %esi,%esi
  mov    $0xf,%edi
  call   <hdmi_write_reg@plt>
  mov    $0x40,%esi
  mov    $0xc1,%edi
  call   <hdmi_write_reg@plt>
  add    $0x8,%rsp
  mov    $0x3,%esi
  mov    $0xc6,%edi
  pop    %rbx
  pop    %rbp
  jmp    10e0 <hdmi_write_reg@plt>
  nopl   0x0(%rax,%rax,1)
L43:
  lea    D24(%rip),%rdi
  call   <writeString@plt>
  jmp    L1
  nopl   0x0(%rax)
L51:
  lea    D20(%rip),%rdi
  call   <writeString@plt>
  jmp    L59
  nopl   0x0(%rax)
L24:
  lea    D74(%rip),%rdi
  call   <writeString@plt>
  jmp    L54
```

tool_calls: name: unpack_data
arguments: data_tag: D1
type: string
name: unpack_data
arguments: data_tag: D5
type: string
name: unpack_data
arguments: data_tag: D106
type: string
name: unpack_data
arguments: data_tag: D99
type: string
name: unpack_data
arguments: data_tag: D10
type: string
name: unpack_data
arguments: data_tag: D63
type: string
name: unpack_data
arguments: data_tag: D87
type: string
name: unpack_data
arguments: data_tag: D34
type: string
name: unpack_data
arguments: data_tag: D24
type: string
name: unpack_data
arguments: data_tag: D20
type: string
name: unpack_data
arguments: data_tag: D74
type: string

tool: D1: Setting clock_scale to 0x

tool: D5: 


tool: D106: clock scale = 0x

tool: D99:  - FAILED


tool: D10: FAILED - Vendor ID=0x

tool: D63:  but should be 0xca


tool: D87: FAILED - Device ID=0x

tool: D34:  but should be 0x613


tool: D24:  - passed


tool: D20: Correct device ID


tool: D74: Correct vendor ID


assistant: ```c
void brute_force_write_seq(void) {
  {
    int j;
    writeString("Setting clock_scale to 0x");
    writeHex(1250);
    writeString("\n");
    i2c_write_clock_scale(1250);
    j = i2c_read_clock_scale();
    writeString("clock scale = 0x");
    writeHex(j);
    if (j == 1250)
      writeString(" - passed\n");
    else
      writeString(" - FAILED\n");
    hdmi_write_reg(0x0f, 0);
    j = hdmi_read_reg(1);
    if (j == 0xca)
      writeString("Correct vendor ID\n");
    else {
      writeString("FAILED - Vendor ID=0x");
      writeHex(j);
      writeString(" but should be 0xca\n");
    }
    j = hdmi_read_reg(2) | ((hdmi_read_reg(3) & 0xf) << 8);
    if (j == 0x613)
      writeString("Correct device ID\n");
    else {
      writeString("FAILED - Device ID=0x");
      writeHex(j);
      writeString(" but should be 0x613\n");
    }
  }
  hdmi_write_reg(0x5, 0x0);
  hdmi_write_reg(0x4, 0x3d);
  hdmi_write_reg(0x4, 0x1d);
  hdmi_write_reg(0x61, 0x30);
  hdmi_write_reg(0x9, 0xb2);
  hdmi_write_reg(0xa, 0xf8);
  hdmi_write_reg(0xb, 0x37);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0xc9, 0x0);
  hdmi_write_reg(0xca, 0x0);
  hdmi_write_reg(0xcb, 0x0);
  hdmi_write_reg(0xcc, 0x0);
  hdmi_write_reg(0xcd, 0x0);
  hdmi_write_reg(0xce, 0x0);
  hdmi_write_reg(0xcf, 0x0);
  hdmi_write_reg(0xd0, 0x0);
  hdmi_write_reg(0xe1, 0x0);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0xf8, 0xc3);
  hdmi_write_reg(0xf8, 0xa5);
  hdmi_write_reg(0x22, 0x60);
  hdmi_write_reg(0x1a, 0xe0);
  hdmi_write_reg(0x22, 0x48);
  hdmi_write_reg(0xf8, 0xff);
  hdmi_write_reg(0x4, 0x1d);
  hdmi_write_reg(0x61, 0x30);
  hdmi_write_reg(0xc, 0xff);
  hdmi_write_reg(0xd, 0xff);
  hdmi_write_reg(0xe, 0xcf);
  hdmi_write_reg(0xe, 0xce);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x15, 0x9);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x15, 0x9);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x11, 0xa0);
  hdmi_write_reg(0x12, 0x0);
  hdmi_write_reg(0x13, 0x20);
  hdmi_write_reg(0x14, 0x0);
  hdmi_write_reg(0x15, 0x3);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x15, 0x9);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x11, 0xa0);
  hdmi_write_reg(0x12, 0x20);
  hdmi_write_reg(0x13, 0x20);
  hdmi_write_reg(0x14, 0x0);
  hdmi_write_reg(0x15, 0x3);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x15, 0x9);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x11, 0xa0);
  hdmi_write_reg(0x12, 0x40);
  hdmi_write_reg(0x13, 0x20);
  hdmi_write_reg(0x14, 0x0);
  hdmi_write_reg(0x15, 0x3);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x15, 0x9);
  hdmi_write_reg(0x10, 0x1);
  hdmi_write_reg(0x11, 0xa0);
  hdmi_write_reg(0x12, 0x60);
  hdmi_write_reg(0x13, 0x20);
  hdmi_write_reg(0x14, 0x0);
  hdmi_write_reg(0x15, 0x3);
  hdmi_write_reg(0x4, 0x1d);
  hdmi_write_reg(0x61, 0x30);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0xc1, 0x41);
  hdmi_write_reg(0xf, 0x1);
  hdmi_write_reg(0x58, 0x10);
  hdmi_write_reg(0x59, 0x68);
  hdmi_write_reg(0x5a, 0x0);
  hdmi_write_reg(0x5b, 0x3);
  hdmi_write_reg(0x5c, 0x0);
  hdmi_write_reg(0x5e, 0x0);
  hdmi_write_reg(0x5f, 0x0);
  hdmi_write_reg(0x60, 0x0);
  hdmi_write_reg(0x61, 0x0);
  hdmi_write_reg(0x62, 0x0);
  hdmi_write_reg(0x63, 0x0);
  hdmi_write_reg(0x64, 0x0);
  hdmi_write_reg(0x65, 0x0);
  hdmi_write_reg(0x5d, 0xf4);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0xcd, 0x3);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0xf, 0x1);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0x4, 0x1d);
  hdmi_write_reg(0x70, 0x0);
  hdmi_write_reg(0x72, 0x0);
  hdmi_write_reg(0xc0, 0x0);
  hdmi_write_reg(0x4, 0x15);
  hdmi_write_reg(0x61, 0x10);
  hdmi_write_reg(0x62, 0x18);
  hdmi_write_reg(0x63, 0x10);
  hdmi_write_reg(0x64, 0xc);
  hdmi_write_reg(0x4, 0x15);
  hdmi_write_reg(0x4, 0x15);
  hdmi_write_reg(0xc, 0x0);
  hdmi_write_reg(0xd, 0x40);
  hdmi_write_reg(0xe, 0x1);
  hdmi_write_reg(0xe, 0x0);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0x61, 0x0);
  hdmi_write_reg(0xf, 0x0);
  hdmi_write_reg(0xc1, 0x40);
  hdmi_write_reg(0xc6, 0x3);
}
```