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

```asm
<load_ip_address>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r14
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %r14,%r14
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movzbl (%rbx),%eax
  cmp    $0x20,%al
  je     L47
  cmp    $0x9,%al
  jne    L186
L47:
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  cmp    $0x20,%al
  je     L47
  cmp    $0x9,%al
  je     L47
L186:
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  lea    0x14(%rsp),%r15
  lea    D8(%rip),%r14
L156:
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  mov    %eax,%ebp
  cmp    $0x1,%eax
  jne    L103
  mov    0x14(%rsp),%esi
  cmp    $0xff,%esi
  jg     L198
  test   %esi,%esi
  js     L160
  mov    $0x1,%edi
  call   <assert@plt>
  cmpl   $0xff,0x14(%rsp)
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  shl    $0x8,%r12d
  or     0x14(%rsp),%r12d
  lea    D52(%rip),%rsi
  mov    %rbx,%rdi
  call   <strspn@plt>
  cltq
  add    %rbx,%rax
  movzbl (%rax),%edx
  test   $0xdf,%dl
  je     L97
  cmp    $0x9,%dl
  je     L97
  cmp    $0x2e,%dl
  jne    L106
  cmp    $0x3,%r13d
  je     L25
  lea    0x1(%rax),%rbx
  add    $0x1,%r13d
  jmp    L156
L103:
  mov    %rbx,%rsi
  lea    D75(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebp
  jmp    L144
L198:
  lea    D54(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebp
  jmp    L144
L160:
  lea    D29(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebp
  jmp    L144
L97:
  cmp    $0x3,%r13d
  je     L136
  lea    D56(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebp
  jmp    L144
L25:
  mov    $0x4,%esi
  lea    D79(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebp
L144:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  mov    %ebp,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L106:
  lea    D31(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebp
  jmp    L144
L136:
  mov    %r12d,%edi
  call   <htonl@plt>
  mov    0x8(%rsp),%rcx
  mov    %eax,(%rcx)
  jmp    L144
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D8
type: string
name: read_data
arguments: data_label: D52
type: string
name: read_data
arguments: data_label: D75
type: string
name: read_data
arguments: data_label: D54
type: string
name: read_data
arguments: data_label: D29
type: string
name: read_data
arguments: data_label: D56
type: string
name: read_data
arguments: data_label: D79
type: string
name: read_data
arguments: data_label: D31
type: string

tool: D8: %d

tool: D52: 0123456789

tool: D75: load_ip_address: Unable to parse IP byte from string '%s'


tool: D54: load_ip_address: Invalid IP byte %d higher than 255


tool: D29: load_ip_address: Invalid IP byte %d lower than 0


tool: D56: load_ip_address: Separating dot not found

tool: D79: load_ip_address: Too many IP bytes, only %u expected


tool: D31: load_ip_address: IP byte is not a number

assistant: ```c
int load_ip_address(const char *data, struct in_addr *addr) {
  int i, tmp;
  unsigned int ip;
  const char *pos;
  assert(data != NULL);
  assert(addr != NULL);
  pos = data;
  while (*pos == ' ' || *pos == '\t')
    pos++;
  ip = 0;
  for (i = 0;; i++) {
    if (sscanf(pos, "%d", &tmp) != 1) {
      printf("load_ip_address: Unable to parse IP byte "
             "from string '%s'\n",
             pos);
      return 0;
    }
    if (tmp > 255) {
      printf("load_ip_address: Invalid IP byte %d higher "
             "than 255\n",
             tmp);
      return 0;
    }
    if (tmp < 0) {
      printf("load_ip_address: Invalid IP byte %d lower "
             "than 0\n",
             tmp);
      return 0;
    }
    assert(tmp >= 0);
    assert(tmp <= 255);
    ip = (ip << 8) | tmp;
    pos = pos + strspn(pos, "0123456789");
    if (*pos == '\0' || *pos == ' ' || *pos == '\t') {
      if (i == 4 - 1)
        break;
      printf("load_ip_address: Separating dot not found\n");
      return 0;
    }
    if (*pos == '.') {
      if (i == 4 - 1) {
        printf("load_ip_address: Too many IP "
               "bytes, only %u expected\n",
               4);
        return 0;
      }
      pos++;
    } else {
      printf("load_ip_address: IP byte is not a number\n");
      return 0;
    }
  }
  addr->s_addr = htonl(ip);
  return 1;
}
```