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

```asm
<mask_match>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x24,%al
  jne    L179
  mov    $0x0,%eax
  jmp    L218
L179:
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L74
L209:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L18
  mov    $0x0,%eax
  jmp    L218
L0:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %rax,%rbx
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %rax,%rbx
  je     L168
  mov    $0x0,%eax
  jmp    L218
L168:
  addq   $0x1,-0x38(%rbp)
  addq   $0x1,-0x30(%rbp)
L18:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L196
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L0
L196:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L106
  jmp    L74
L59:
  addq   $0x1,-0x38(%rbp)
L106:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  je     L59
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L44
  mov    $0x1,%eax
  jmp    L218
L44:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L227
L184:
  addq   $0x1,-0x28(%rbp)
L227:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L10
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L184
L10:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
L8:
  subq   $0x1,-0x20(%rbp)
  jmp    L172
L110:
  subq   $0x1,-0x20(%rbp)
L172:
  mov    -0x20(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L160
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L110
L160:
  mov    -0x20(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jae    L107
  mov    $0x0,%eax
  jmp    L218
L107:
  mov    -0x28(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L8
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
L74:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L209
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L112
  mov    $0x0,%eax
  jmp    L218
L112:
  mov    $0x1,%eax
L218:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int mask_match(char *mask, char *val) {
  const char *m, *v, *m2, *v2, *end;
  if (mask[0] == '$') {
    return 0;
  }
  m = mask;
  v = val;
  end = val + strlen(val);
  while (*m) {
    if (!*v)
      return 0;
    while (*m && *m != '*') {
      if (tolower(*m) != tolower(*v))
        return 0;
      m++;
      v++;
    }
    if (*m == 0)
      continue;
    while (*m == '*')
      m++;
    if (!*m)
      return 1;
    m2 = m;
    while (*m2 && *m2 != '*')
      m2++;
    v2 = end;
    do {
      v2--;
      while ((v2 >= v) && *v2 != *m)
        v2--;
      if (v2 < v)
        return 0;
    } while (strncmp(m, v2, m2 - m) != 0);
    v = v2;
  }
  if (*v)
    return 0;
  return 1;
}
```