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

```asm
<write_fru_data>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %esi,%eax
  mov    %rdx,-0x70(%rbp)
  mov    %ecx,-0x74(%rbp)
  mov    %r8d,%ecx
  mov    %edi,%edx
  mov    %dl,-0x64(%rbp)
  mov    %ax,-0x68(%rbp)
  mov    %ecx,%eax
  mov    %al,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0x50(%rbp)
  movzbl -0x64(%rbp),%eax
  mov    %al,-0x30(%rbp)
  movzwl -0x68(%rbp),%eax
  mov    %ax,-0x56(%rbp)
  movl   $0x10,-0x4c(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L34
L122:
  movzwl -0x56(%rbp),%eax
  mov    %al,-0x2f(%rbp)
  movzwl -0x56(%rbp),%eax
  shr    $0x8,%ax
  mov    %al,-0x2e(%rbp)
  mov    -0x48(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x74(%rbp)
  jge    L80
  mov    -0x74(%rbp),%eax
  sub    -0x48(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
L80:
  mov    -0x48(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x4c(%rbp),%eax
  lea    -0x30(%rbp),%rdx
  lea    0x3(%rdx),%rcx
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <memcpy@plt>
  cmpb   $0x0,-0x78(%rbp)
  je     L62
  mov    -0x4c(%rbp),%eax
  lea    0x3(%rax),%edx
  mov    -0x48(%rbp),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L65
L110:
  mov    -0x44(%rbp),%eax
  cltq
  movzbl -0x30(%rbp,%rax,1),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x44(%rbp)
L65:
  mov    -0x4c(%rbp),%eax
  add    $0x2,%eax
  cmp    %eax,-0x44(%rbp)
  jle    L110
  mov    $0xa,%edi
  call   <putchar@plt>
L62:
  movl   $0x10,-0x54(%rbp)
  movsbl -0x78(%rbp),%esi
  mov    -0x4c(%rbp),%eax
  add    $0x3,%eax
  movzbl %al,%edx
  lea    -0x57(%rbp),%r8
  lea    -0x54(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  push   %rsi
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rsi
  mov    $0xa12,%edi
  call   <ipmi_cmd_mc@plt>
  add    $0x10,%rsp
  mov    %eax,-0x50(%rbp)
  cmpl   $0x0,-0x50(%rbp)
  jne    L107
  movzbl -0x57(%rbp),%eax
  test   %al,%al
  je     L107
  movzbl -0x57(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x50(%rbp)
L107:
  cmpb   $0x0,-0x78(%rbp)
  je     L58
  cmpl   $0x0,-0x50(%rbp)
  jne    L58
  movzbl -0x40(%rbp),%eax
  movzbl %al,%edx
  mov    -0x48(%rbp),%eax
  mov    %eax,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L58:
  cmpl   $0x0,-0x50(%rbp)
  jne    L66
  mov    -0x4c(%rbp),%eax
  add    %ax,-0x56(%rbp)
  mov    -0x4c(%rbp),%eax
  add    %eax,-0x48(%rbp)
L34:
  mov    -0x48(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jl     L122
  jmp    L29
L66:
  nop
L29:
  mov    -0x50(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L11
  call   <__stack_chk_fail@plt>
L11:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D9
type: string
name: unpack_data
arguments: data_tag: D28
type: string
name: unpack_data
arguments: data_tag: D1
type: string

tool: D9: write_fru_data[%d] (len=%d): 

tool: D28: %02x 

tool: D1: write_fru_data[%d]: %d bytes written


assistant: ```c
int write_fru_data(unsigned char id, unsigned short offset, unsigned char *data, int dlen, char fdebug) {
  int ret = -1;
  int chunk;
  unsigned short fruoff;
  unsigned char req[25];
  unsigned char resp[16];
  int sresp;
  unsigned char cc;
  int i, j;
  req[0] = id;
  fruoff = offset;
  chunk = 16;
  for (i = 0; i < dlen; i += chunk) {
    req[1] = fruoff & 0x00ff;
    req[2] = (fruoff & 0xff00) >> 8;
    if ((i + chunk) > dlen)
      chunk = dlen - i;
    memcpy(&req[3], &data[i], chunk);
    if (fdebug) {
      printf("write_fru_data[%d] (len=%d): ", i, chunk + 3);
      for (j = 0; j < chunk + 3; j++)
        printf("%02x ", req[j]);
      printf("\n");
    }
    sresp = sizeof(resp);
    ret = ipmi_cmd_mc((0x12 | (0x0a << 8)), req, (unsigned char)(chunk + 3), resp, &sresp, &cc, fdebug);
    if ((ret == 0) && (cc != 0))
      ret = cc & 0x00ff;
    if (fdebug && ret == 0)
      printf("write_fru_data[%d]: %d bytes written\n", i, resp[0]);
    if (ret != 0)
      break;
    fruoff += chunk;
  }
  return (ret);
}
```