user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<getMemConfig>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    %rdx,-0x10(%rbp)
  mov    %rcx,-0x18(%rbp)
  mov    %r8,-0x20(%rbp)
  mov    -0x8(%rbp),%eax
  mov    $0x10,%esi
  mov    %eax,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L154
  mov    -0x4(%rbp),%eax
  mov    $0x80,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L154
  mov    -0x4(%rbp),%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L154
  mov    -0x20(%rbp),%rax
  movl   $0x2,(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x2,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0x1f,(%rax)
  jmp    L40
L154:
  mov    -0x8(%rbp),%eax
  mov    $0x10,%esi
  mov    %eax,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L161
  mov    -0x4(%rbp),%eax
  mov    $0x80,%esi
  mov    %eax,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L161
  mov    -0x4(%rbp),%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L161
  mov    -0x20(%rbp),%rax
  movl   $0x10,(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x2,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xff,(%rax)
  jmp    L40
L161:
  mov    -0x8(%rbp),%eax
  mov    $0x10,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L42
  mov    -0x4(%rbp),%eax
  mov    $0x80,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L42
  mov    -0x4(%rbp),%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L42
  mov    -0x20(%rbp),%rax
  movl   $0x10,(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x10,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xff,(%rax)
  jmp    L40
L42:
  mov    -0x8(%rbp),%eax
  mov    $0x10,%esi
  mov    %eax,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L110
  mov    -0x4(%rbp),%eax
  mov    $0x80,%esi
  mov    %eax,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L110
  mov    -0x4(%rbp),%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L110
  mov    -0x20(%rbp),%rax
  movl   $0x20,(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x3,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xff,(%rax)
  jmp    L40
L110:
  mov    -0x8(%rbp),%eax
  mov    $0x10,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L65
  mov    -0x4(%rbp),%eax
  mov    $0x80,%esi
  mov    %eax,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L65
  mov    -0x4(%rbp),%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L65
  mov    -0x20(%rbp),%rax
  movl   $0x20,(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x11,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xff,(%rax)
  jmp    L40
L65:
  mov    -0x20(%rbp),%rax
  movl   $0x20,(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x2,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xff,(%rax)
  nop
L40:
  nop
  leave
  ret
```

assistant: ```c
void getMemConfig(uint8_t mem_cfg, uint8_t chip_cfg, uint8_t *max_blk, uint8_t *app_areas, uint8_t *kb) {
  if (isset(chip_cfg, 0x10) && notset(mem_cfg, 0x80) && notset(mem_cfg, 0x20)) {
    *kb = 2;
    *app_areas = 2;
    *max_blk = 31;
  } else if (isset(chip_cfg, 0x10) && isset(mem_cfg, 0x80) && notset(mem_cfg, 0x20)) {
    *kb = 16;
    *app_areas = 2;
    *max_blk = 255;
  } else if (notset(chip_cfg, 0x10) && notset(mem_cfg, 0x80) && notset(mem_cfg, 0x20)) {
    *kb = 16;
    *app_areas = 16;
    *max_blk = 255;
  } else if (isset(chip_cfg, 0x10) && isset(mem_cfg, 0x80) && isset(mem_cfg, 0x20)) {
    *kb = 32;
    *app_areas = 3;
    *max_blk = 255;
  } else if (notset(chip_cfg, 0x10) && notset(mem_cfg, 0x80) && isset(mem_cfg, 0x20)) {
    *kb = 32;
    *app_areas = 17;
    *max_blk = 255;
  } else {
    *kb = 32;
    *app_areas = 2;
    *max_blk = 255;
  }
}
```