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

```asm
<expectedmsgrcd>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %edx,%ebx
  mov    $0x4,%edx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r13
  mov    %r13,%rdi
  call   <memset@plt>
  cmp    $0xa0,%ebx
  jg     L237
  cmp    $0x7f,%ebx
  jg     L152
  cmp    $0x40,%ebx
  je     L224
  jle    L128
  cmp    $0x60,%ebx
  jne    L156
L44:
  mov    0x4(%rbp),%ecx
  mov    %ecx,%esi
  test   %ecx,%ecx
  je     L150
  cmp    $0x60,%ecx
  je     L150
L340:
  lea    -0xb8(%rsi),%eax
  cmp    $0xa0,%esi
  ja     L225
L35:
  cmp    $0x7f,%esi
  ja     L355
  cmp    $0x40,%esi
  je     L141
  ja     L382
  test   %esi,%esi
  je     L195
  cmp    $0x20,%esi
  jne    L164
L141:
  lea    D20(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
L32:
  mov    0x28(%rbp),%esi
  mov    0x4(%rbp),%ecx
L81:
  mov    %ebx,%r8d
  mov    %r12,%rdx
  lea    D48(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r13,%rsi
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L297
  nopw   0x0(%rax,%rax,1)
L128:
  test   %ebx,%ebx
  je     L44
  cmp    $0x20,%ebx
  jne    L156
L224:
  mov    0x4(%rbp),%ecx
  lea    -0x20(%rcx),%eax
  mov    %ecx,%esi
  and    $0xffffffdf,%eax
  jne    L340
L150:
  mov    0x28(%rbp),%eax
  mov    %rax,%rsi
  cmp    %r12,%rax
  jne    L81
  mov    $0x1,%eax
L297:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L169
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L152:
  movabs $0x100000101,%rdx
  lea    -0x80(%rbx),%eax
  bt     %rax,%rdx
  jb     L185
L156:
  mov    %ebx,%esi
  lea    D19(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x4(%rbp),%esi
  lea    -0xb8(%rsi),%eax
  cmp    $0xa0,%esi
  jbe    L35
L225:
  cmp    $0x28,%eax
  ja     L164
  movabs $0x10001000101,%rdx
  bt     %rax,%rdx
  jae    L164
  lea    D74(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  jmp    L32
  nopl   (%rax)
L237:
  lea    -0xb8(%rbx),%eax
  cmp    $0x28,%eax
  ja     L156
  movabs $0x10001000101,%rdx
  bt     %rax,%rdx
  jae    L156
  mov    0x4(%rbp),%esi
  lea    -0xb8(%rsi),%eax
  mov    %esi,%ecx
  cmp    $0x28,%eax
  ja     L68
  movabs $0xfffffefffefffefe,%rdx
  bt     %rax,%rdx
  jae    L150
  jmp    L225
  nopl   (%rax)
L382:
  cmp    $0x60,%esi
  jne    L164
L195:
  lea    D1(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  jmp    L32
  nopl   0x0(%rax)
L355:
  movabs $0x100000101,%rdx
  lea    -0x80(%rsi),%eax
  bt     %rax,%rdx
  jb     L134
L164:
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L32
  cs nopw 0x0(%rax,%rax,1)
L185:
  mov    0x4(%rbp),%ecx
  mov    %ecx,%eax
  mov    %ecx,%esi
  and    $0xfffffff7,%eax
  cmp    $0x80,%eax
  je     L150
  cmp    $0xa0,%ecx
  je     L150
  jmp    L340
  cs nopw 0x0(%rax,%rax,1)
L68:
  cmp    $0xa0,%esi
  jbe    L35
  jmp    L164
  xchg   %ax,%ax
L134:
  lea    D78(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  jmp    L32
L169:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D20
type: string
name: retrieve_data
arguments: data_label: D48
type: string
name: retrieve_data
arguments: data_label: D0
type: string
name: retrieve_data
arguments: data_label: D19
type: string
name: retrieve_data
arguments: data_label: D74
type: string
name: retrieve_data
arguments: data_label: D1
type: string
name: retrieve_data
arguments: data_label: D8
type: string
name: retrieve_data
arguments: data_label: D78
type: string

tool: D20: BK

tool: D48: 
expectedmsgrcd no match: rmsg[10] %u expect type %lu rmsg[1] as tos 0x%x expect tos 0x%x


tool: D0: expectedmsgrcd::rcv %s as repeate pkt for previous state


tool: D19: 
expectedmsgrcd not know tos=0x%x


tool: D74: VO

tool: D1: BE

tool: D8: 
expectedmsgrcd check unexpected TOS:not know rmsg[1]=0x%x


tool: D78: VI

assistant: ```c
int expectedmsgrcd(unsigned int *rmsg, unsigned long type, int tos) {
  char type_ok = 0, acBuf[4];
  char tos_ok = 0;
  int r = 0;
  memset(acBuf, 0, 4);
  switch (tos) {
  case 0xE0:
  case 0xD0:
  case 0xC0:
  case 0xB8:
    if (rmsg[1] == 0xE0 || rmsg[1] == 0xD0 || rmsg[1] == 0xC0 || rmsg[1] == 0xB8) {
      tos_ok = 1;
    }
    break;
  case 0xA0:
  case 0x80:
  case 0x88:
    if (rmsg[1] == 0xA0 || rmsg[1] == 0x80 || rmsg[1] == 0x88) {
      tos_ok = 1;
    }
    break;
  case 0x00:
  case 0x60:
    if (rmsg[1] == 0x00 || rmsg[1] == 0x60) {
      tos_ok = 1;
    }
    break;
  case 0x20:
  case 0x40:
    if (rmsg[1] == 0x20 || rmsg[1] == 0x40) {
      tos_ok = 1;
    }
    break;
  default:
    printf("\nexpectedmsgrcd not know tos=0x%x\n", tos);
  }
  if (tos_ok == 0) {
    switch (rmsg[1]) {
    case 0xE0:
    case 0xD0:
    case 0xC0:
    case 0xB8:
      strcat(acBuf, "VO");
      break;
    case 0xA0:
    case 0x80:
    case 0x88:
      strcat(acBuf, "VI");
      break;
    case 0x00:
    case 0x60:
      strcat(acBuf, "BE");
      break;
    case 0x20:
    case 0x40:
      strcat(acBuf, "BK");
      break;
    default:
      printf("\nexpectedmsgrcd check unexpected TOS:not know rmsg[1]=0x%x\n", rmsg[1]);
    }
  }
  type_ok = ((rmsg[10] == type) ? 1 : 0);
  r = (type_ok && tos_ok);
  if (!r) {
    printf("\nexpectedmsgrcd no match: rmsg[10] %u expect type %lu rmsg[1] as tos 0x%x expect tos 0x%x\n", rmsg[10], type, rmsg[1], tos);
    printf("expectedmsgrcd::rcv %s as repeate pkt for previous state\n", acBuf);
  }
  return r;
}
```