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

```asm
<frame_size_valid>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  js     L65
  movq   $0x0,0x20(%rsp)
  mov    %edi,%ebp
  mov    %esi,%r14d
  mov    %edx,%ebx
  pxor   %xmm0,%xmm0
  mov    %ecx,%r12d
  xor    %r13d,%r13d
  mov    %rsp,%r15
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
L13:
  mov    %r15,%rcx
  mov    %r13d,%edx
  mov    %r14d,%esi
  mov    %ebp,%edi
  call   <get_nth_frame_size@plt>
  cmp    $0xffffffff,%eax
  je     L36
  mov    (%rsp),%eax
  cmp    $0x81,%eax
  je     L185
  cmp    $0x82,%eax
  je     L83
  cmp    $0x80,%eax
  je     L62
L36:
  xor    %eax,%eax
L116:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L76
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L62:
  mov    0x4(%rsp),%eax
  mov    0x8(%rsp),%ecx
  mov    0xc(%rsp),%edx
  cmp    %ecx,%eax
  jg     L60
  mov    0x10(%rsp),%esi
  mov    0x14(%rsp),%r8d
  mov    0x18(%rsp),%edi
  jmp    L162
  nop
L28:
  cmp    %eax,%ebx
  jne    L98
  cmp    %edx,%r12d
  je     L17
L98:
  add    %r8d,%eax
  add    %edi,%edx
  cmp    %ecx,%eax
  jg     L60
L162:
  cmp    %edx,%esi
  jge    L28
  cs nopw 0x0(%rax,%rax,1)
L60:
  add    $0x1,%r13d
  jmp    L13
  nopl   0x0(%rax)
L83:
  cmp    %ebx,0x4(%rsp)
  jg     L60
  cmp    %ebx,0x8(%rsp)
  jl     L60
  cmp    %r12d,0xc(%rsp)
  jg     L60
  cmp    %r12d,0x10(%rsp)
  jl     L60
  nopw   0x0(%rax,%rax,1)
L17:
  mov    $0x1,%eax
  jmp    L116
  nopw   0x0(%rax,%rax,1)
L185:
  cmp    %ebx,0x1c(%rsp)
  jne    L60
  cmp    %r12d,0x20(%rsp)
  je     L17
  add    $0x1,%r13d
  jmp    L13
  cs nopw 0x0(%rax,%rax,1)
L65:
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    D0(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L116
L76:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int frame_size_valid(int fd, uint32_t pixel_format, int width, int height) {
  if (fd < 0) {
    errno = EINVAL;
    return -1;
  }
  struct v4l2_frmsizeenum fsze = {0};
  int cur_width, cur_height;
  for (int i = 0; - 1 != get_nth_frame_size(fd, pixel_format, i, &fsze); i++) {
    switch (fsze.type) {
    case V4L2_FRMSIZE_TYPE_DISCRETE:
      if (width == fsze.discrete.width && height == fsze.discrete.height) {
        return 1;
      }
      break;
    case V4L2_FRMSIZE_TYPE_CONTINUOUS:
      if ((fsze.stepwise.min_width <= width) && (width <= fsze.stepwise.max_width) && (fsze.stepwise.min_height <= height) && (height <= fsze.stepwise.max_height)) {
        return 1;
      }
      break;
    case V4L2_FRMSIZE_TYPE_STEPWISE:
      cur_width = fsze.stepwise.min_width;
      cur_height = fsze.stepwise.min_height;
      while ((cur_width <= fsze.stepwise.max_width) && (cur_height <= fsze.stepwise.max_height)) {
        if (cur_width == width && cur_height == height) {
          return 1;
        }
        cur_width += fsze.stepwise.step_width;
        cur_height += fsze.stepwise.step_height;
      }
      break;
    default:
      return 0;
    }
  }
  return 0;
}
```