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

```asm
<str_to_field>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rdx
  lea    -0x20(%rbp),%rdi
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <is_long@plt>
  test   %rax,%rax
  je     L145
  mov    -0x18(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <is_range@plt>
  test   %rax,%rax
  je     L52
  mov    -0x18(%rbp),%rdx
  lea    -0x28(%rbp),%rdi
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <is_long@plt>
  test   %rax,%rax
  je     L18
  mov    -0x18(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <is_end@plt>
  test   %rax,%rax
  je     L33
  mov    -0x28(%rbp),%rax
  mov    -0x20(%rbp),%rdx
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <field_range@plt>
  jmp    L146
L18:
  mov    -0x18(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <is_end@plt>
  test   %rax,%rax
  je     L33
  mov    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <field_range@plt>
  jmp    L146
L52:
  mov    -0x18(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <is_end@plt>
  test   %rax,%rax
  je     L33
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <field_number@plt>
  jmp    L146
L145:
  mov    -0x18(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <is_range@plt>
  test   %rax,%rax
  je     L33
  mov    -0x18(%rbp),%rdx
  lea    -0x28(%rbp),%rdi
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <is_long@plt>
  test   %rax,%rax
  je     L20
  mov    -0x18(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <is_end@plt>
  test   %rax,%rax
  je     L33
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <field_range@plt>
  jmp    L146
L20:
  mov    -0x18(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <is_end@plt>
  test   %rax,%rax
  je     L33
  mov    $0x0,%esi
  mov    $0x1,%edi
  call   <field_range@plt>
  jmp    L146
L33:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <field_string@plt>
L146:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L68
  call   <__stack_chk_fail@plt>
L68:
  leave
  ret
```

assistant: ```c
struct field_s *str_to_field(const char *str) {
  unsigned long end;
  unsigned long start;
  size_t at = 0;
  size_t len = strlen(str);
  if (is_long(str, len, at, &at, &start)) {
    if (is_range(str, len, at, &at)) {
      if (is_long(str, len, at, &at, &end)) {
        if (is_end(str, len, at, &at)) {
          return field_range(start, end);
        }
      } else if (is_end(str, len, at, &at)) {
        return field_range(start, 0);
      }
    } else if (is_end(str, len, at, &at)) {
      return field_number(start);
    }
  } else if (is_range(str, len, at, &at)) {
    if (is_long(str, len, at, &at, &end)) {
      if (is_end(str, len, at, &at)) {
        return field_range(1, end);
      }
    } else if (is_end(str, len, at, &at)) {
      return field_range(1, 0);
    }
  }
  return field_string(str);
}
```