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

```asm
<define_mode>:
  endbr64
  test   %rdx,%rdx
  je     L390
  push   %r14
  lea    (%rdx,%rdi,1),%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  test   %ecx,%ecx
  jne    L301
  cmpl   $0xff,(%r12)
  jle    L219
  nopw   0x0(%rax,%rax,1)
L234:
  movb   $0x4b,0x0(%r13)
L42:
  add    $0x1,%r13
  add    $0x4,%r12
  cmp    %r14,%r13
  je     L164
L440:
  cmpl   $0xff,(%r12)
  jg     L234
L219:
  movb   $0x42,0x0(%r13)
  mov    (%r12),%edi
  call   <in_alpha@plt>
  test   %rax,%rax
  je     L217
  movb   $0x41,0x0(%r13)
L217:
  mov    (%r12),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L42
  movb   $0x4e,0x0(%r13)
  add    $0x1,%r13
  add    $0x4,%r12
  cmp    %r14,%r13
  jne    L440
  nopw   0x0(%rax,%rax,1)
L164:
  xor    %eax,%eax
  mov    $0x1,%r8d
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L238:
  lea    0x1(%rax),%rdi
L114:
  mov    %rdi,%rax
  cmp    %rdi,%rbp
  je     L447
L10:
  movzbl (%rbx,%rax,1),%ecx
  cmp    $0x4e,%cl
  jne    L238
  test   %rax,%rax
  je     L212
  cmpb   $0x4e,-0x1(%rbx,%rax,1)
  lea    0x1(%rax),%rdi
  je     L114
L302:
  lea    0x1(%rax),%rdi
  xor    %esi,%esi
  mov    %rdi,%rdx
  jmp    L393
  nopl   0x0(%rax)
L226:
  add    $0x1,%esi
  cmp    %rdx,%rbp
  jbe    L240
  movzbl (%rbx,%rdx,1),%ecx
  add    $0x1,%rdx
L393:
  cmp    $0x4e,%cl
  je     L226
  lea    -0x1(%rsi),%edx
  cmp    $0x4,%edx
  ja     L114
L14:
  test   %esi,%esi
  movslq %esi,%rdx
  cmovle %r8,%rdx
  add    %rbx,%rax
  mov    %edx,%esi
  test   %edx,%edx
  je     L114
  xor    %edx,%edx
L341:
  mov    %edx,%ecx
  add    $0x1,%edx
  movb   $0x41,(%rax,%rcx,1)
  cmp    %esi,%edx
  jb     L341
  mov    %rdi,%rax
  cmp    %rdi,%rbp
  jne    L10
  nopw   0x0(%rax,%rax,1)
L447:
  xor    %eax,%eax
  mov    $0x1,%r8d
  jmp    L361
  nopw   0x0(%rax,%rax,1)
L289:
  lea    0x1(%rax),%rdi
L32:
  mov    %rdi,%rax
  cmp    %rdi,%rbp
  je     L335
L361:
  movzbl (%rbx,%rax,1),%ecx
  cmp    $0x41,%cl
  jne    L289
  test   %rax,%rax
  je     L140
  cmpb   $0x41,-0x1(%rbx,%rax,1)
  lea    0x1(%rax),%rdi
  je     L32
L402:
  lea    0x1(%rax),%rdi
  xor    %esi,%esi
  mov    %rdi,%rdx
  jmp    L185
  nopl   0x0(%rax)
L145:
  add    $0x1,%esi
  cmp    %rbp,%rdx
  jae    L359
  movzbl (%rbx,%rdx,1),%ecx
  add    $0x1,%rdx
L185:
  cmp    $0x41,%cl
  je     L145
  lea    -0x1(%rsi),%edx
  cmp    $0x4,%edx
  ja     L32
L305:
  test   %esi,%esi
  movslq %esi,%rdx
  cmovle %r8,%rdx
  add    %rbx,%rax
  mov    %edx,%esi
  test   %edx,%edx
  je     L32
  xor    %edx,%edx
L188:
  mov    %edx,%ecx
  add    $0x1,%edx
  movb   $0x42,(%rax,%rcx,1)
  cmp    %esi,%edx
  jb     L188
  mov    %rdi,%rax
  cmp    %rdi,%rbp
  jne    L361
L335:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L208:
  movb   $0x4b,0x0(%r13)
L3:
  add    $0x1,%r13
  add    $0x4,%r12
  cmp    %r14,%r13
  je     L164
L301:
  cmpl   $0xff,(%r12)
  jg     L208
  movb   $0x42,0x0(%r13)
  mov    (%r12),%edi
  call   <in_alpha@plt>
  test   %rax,%rax
  je     L419
  movb   $0x41,0x0(%r13)
L419:
  mov    (%r12),%eax
  cmp    $0x5b,%eax
  je     L333
L38:
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L3
  movb   $0x4e,0x0(%r13)
  jmp    L3
L212:
  movzbl (%rbx),%ecx
  jmp    L302
  nopl   0x0(%rax,%rax,1)
L140:
  movzbl (%rbx),%ecx
  jmp    L402
  nopl   0x0(%rax,%rax,1)
L240:
  cmp    $0x5,%esi
  jg     L114
  jmp    L14
  xchg   %ax,%ax
L359:
  cmp    $0x5,%esi
  jg     L32
  jmp    L305
  xchg   %ax,%ax
L333:
  movb   $0x41,0x0(%r13)
  mov    (%r12),%eax
  jmp    L38
  nopl   0x0(%rax,%rax,1)
L390:
  ret
```

assistant: ```c
void define_mode(char mode[], const int jisdata[], const size_t length, const int gs1) {
  size_t i;
  int mlen, j;
  for (i = 0; i < length; i++) {
    if (jisdata[i] > 0xff) {
      mode[i] = 'K';
    } else {
      mode[i] = 'B';
      if (in_alpha(jisdata[i])) {
        mode[i] = 'A';
      }
      if (gs1 && (jisdata[i] == '[')) {
        mode[i] = 'A';
      }
      if ((jisdata[i] >= '0') && (jisdata[i] <= '9')) {
        mode[i] = 'N';
      }
    }
  }
  for (i = 0; i < length; i++) {
    if (mode[i] == 'N') {
      if (((i != 0) && (mode[i - 1] != 'N')) || (i == 0)) {
        mlen = 0;
        while (((mlen + i) < length) && (mode[mlen + i] == 'N')) {
          mlen++;
        };
        if (mlen < 6) {
          for (j = 0; j < mlen; j++) {
            mode[i + j] = 'A';
          }
        }
      }
    }
  }
  for (i = 0; i < length; i++) {
    if (mode[i] == 'A') {
      if (((i != 0) && (mode[i - 1] != 'A')) || (i == 0)) {
        mlen = 0;
        while (((mlen + i) < length) && (mode[mlen + i] == 'A')) {
          mlen++;
        };
        if (mlen < 6) {
          for (j = 0; j < mlen; j++) {
            mode[i + j] = 'B';
          }
        }
      }
    }
  }
}
```