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

```asm
<dice_parse>:
  endbr64
  push   %r14
  movl   $0x0,(%rsi)
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  movl   $0x0,(%rdx)
  movl   $0x0,(%rcx)
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L365
  mov    %rsi,%rbx
  mov    %rdx,%rbp
  mov    %rcx,%r12
L44:
  cmp    $0x2b,%dil
  je     L206
  cmp    $0x2d,%dil
  jne    L224
  movsbl 0x1(%r13),%edi
  lea    0x1(%r13),%r14
  test   %dil,%dil
  je     L57
L270:
  mov    $0xffffffff,%ebp
L13:
  call   <isdigit@plt>
  test   %eax,%eax
  je     L73
  mov    %r14,%rdi
  lea    0x1(%r14),%r13
  call   <atoi@plt>
  movsbl 0x1(%r14),%edi
  mov    %eax,%ebx
  test   %eax,%eax
  je     L196
  test   %dil,%dil
  jne    L345
  jmp    L174
  nopl   0x0(%rax,%rax,1)
L231:
  movsbl 0x0(%r13),%eax
  movsbl 0x1(%r13),%edi
  lea    (%rbx,%rbx,4),%edx
  add    $0x1,%r13
  lea    -0x30(%rax,%rdx,2),%ebx
  test   %dil,%dil
  je     L174
L345:
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L231
  nopw   0x0(%rax,%rax,1)
L73:
  mov    $0xffffffff,%eax
L4:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L196:
  test   %dil,%dil
  je     L57
  mov    %r13,%r14
  jmp    L13
  xchg   %ax,%ax
L206:
  movsbl 0x1(%r13),%edi
  lea    0x1(%r13),%r14
  test   %dil,%dil
  je     L57
L115:
  mov    $0x1,%ebp
  jmp    L13
  nopl   0x0(%rax)
L224:
  call   <isdigit@plt>
  test   %eax,%eax
  je     L73
  movsbl 0x0(%r13),%r14d
  add    $0x1,%r13
  movsbl 0x0(%r13),%edi
  sub    $0x30,%r14d
  jne    L184
  test   %dil,%dil
  jne    L44
L365:
  xor    %eax,%eax
L75:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L184:
  test   %dil,%dil
  je     L271
L284:
  cmp    $0x64,%dil
  jne    L170
  mov    %r14d,(%rbx)
  movsbl 0x1(%r13),%edi
  lea    0x1(%r13),%rbx
  test   %dil,%dil
  je     L73
L5:
  call   <isdigit@plt>
  test   %eax,%eax
  je     L73
  movsbl (%rbx),%r13d
  add    $0x1,%rbx
  movsbl (%rbx),%edi
  sub    $0x30,%r13d
  je     L21
  test   %dil,%dil
  je     L237
L16:
  call   <isdigit@plt>
  test   %eax,%eax
  je     L55
  movsbl (%rbx),%eax
  movsbl 0x1(%rbx),%edi
  lea    0x0(%r13,%r13,4),%edx
  add    $0x1,%rbx
  lea    -0x30(%rax,%rdx,2),%r13d
  test   %dil,%dil
  jne    L16
L237:
  mov    %r13d,0x0(%rbp)
  xor    %eax,%eax
  jmp    L4
  nopl   0x0(%rax)
L55:
  movzbl (%rbx),%eax
  cmp    $0x2b,%al
  je     L54
  cmp    $0x2d,%al
  jne    L73
  mov    %r13d,0x0(%rbp)
  movsbl 0x1(%rbx),%edi
  lea    0x1(%rbx),%r14
  test   %dil,%dil
  jne    L270
L57:
  movl   $0x0,(%r12)
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L21:
  test   %dil,%dil
  jne    L5
  jmp    L73
  cs nopw 0x0(%rax,%rax,1)
L170:
  call   <isdigit@plt>
  test   %eax,%eax
  je     L73
  movsbl 0x0(%r13),%eax
  movsbl 0x1(%r13),%edi
  lea    (%r14,%r14,4),%edx
  add    $0x1,%r13
  lea    -0x30(%rax,%rdx,2),%r14d
  test   %dil,%dil
  jne    L284
L271:
  mov    %r14d,(%r12)
  xor    %eax,%eax
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L54:
  mov    %r13d,0x0(%rbp)
  movsbl 0x1(%rbx),%edi
  lea    0x1(%rbx),%r14
  test   %dil,%dil
  jne    L115
  jmp    L57
L174:
  imul   %ebx,%ebp
  xor    %eax,%eax
  mov    %ebp,(%r12)
  jmp    L75
```

assistant: ```c
int dice_parse(const char *ptr, int *num, int *faces, int *bias) {
  int state = 0, val = 0, sign = 1;
  *num = 0;
  *faces = 0;
  *bias = 0;
  while (*ptr) {
    switch (state) {
    case 0:
      if (*ptr == '+') {
        sign = 1;
        state = 4;
      } else if (*ptr == '-') {
        sign = -1;
        state = 4;
      } else if (isdigit(*ptr)) {
        val = *ptr - '0';
        if (val)
          state = 1;
      } else {
        goto error;
      }
      break;
    case 1:
      if (*ptr == 'd') {
        *num = val * sign;
        val = 0;
        sign = 1;
        state = 2;
      } else if (isdigit(*ptr)) {
        val = (val * 10) + *ptr - '0';
      } else {
        goto error;
      }
      break;
    case 2:
      if (isdigit(*ptr)) {
        val = *ptr - '0';
        if (val)
          state = 3;
      } else {
        goto error;
      }
      break;
    case 3:
      if (isdigit(*ptr)) {
        val = (val * 10) + *ptr - '0';
      } else if (*ptr == '+') {
        *faces = val;
        val = 0;
        state = 4;
        sign = 1;
      } else if (*ptr == '-') {
        *faces = val;
        val = 0;
        state = 4;
        sign = -1;
      } else {
        goto error;
      }
      break;
    case 4:
      if (isdigit(*ptr)) {
        val = atoi(ptr);
        if (val)
          state = 5;
      } else {
        goto error;
      }
      break;
    case 5:
      if (isdigit(*ptr)) {
        val = (val * 10) + *ptr - '0';
      } else {
        goto error;
      }
      break;
    default:
      assert(false);
      goto error;
    }
    ptr++;
  }
  switch (state) {
  case 0:
    break;
  case 1:
    *bias = val * sign;
    break;
  case 2:
    goto error;
    break;
  case 3:
    *faces = val * sign;
    break;
  case 4:
    *bias = val * sign;
    break;
  case 5:
    *bias = val * sign;
    break;
  default:
    assert(false);
    goto error;
  }
  return 0;
error:
  return -1;
}
```