user: Converte this assembly snippet into its equivalent C code:

```asm
<getMemConfig>:
  endbr64
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %esi,%ebp
  mov    $0x10,%esi
  push   %rbx
  mov    %ebp,%edi
  mov    %rdx,%rbx
  call   <isset@plt>
  test   %rax,%rax
  je     L157
  mov    $0x80,%esi
  mov    %r12d,%edi
  call   <notset@plt>
  test   %rax,%rax
  jne    L104
L157:
  mov    $0x10,%esi
  mov    %ebp,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L36
  mov    $0x80,%esi
  mov    %r12d,%edi
  call   <isset@plt>
  test   %rax,%rax
  jne    L62
L36:
  mov    $0x10,%esi
  mov    %ebp,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L85
  mov    $0x80,%esi
  mov    %r12d,%edi
  call   <notset@plt>
  test   %rax,%rax
  jne    L135
L85:
  mov    $0x10,%esi
  mov    %ebp,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L137
  mov    $0x80,%esi
  mov    %r12d,%edi
  call   <isset@plt>
  test   %rax,%rax
  jne    L132
L137:
  mov    $0x10,%esi
  mov    %ebp,%edi
  call   <notset@plt>
  test   %rax,%rax
  jne    L130
L111:
  mov    $0x20,%ecx
  mov    $0x2,%edx
  mov    $0xff,%eax
L194:
  mov    %ecx,(%r14)
  mov    %edx,0x0(%r13)
  mov    %eax,(%rbx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L130:
  mov    $0x80,%esi
  mov    %r12d,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L111
  mov    $0x20,%esi
  mov    %r12d,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L111
  mov    $0x20,%ecx
  mov    $0x11,%edx
  mov    $0xff,%eax
  jmp    L194
  nopl   (%rax)
L104:
  mov    $0x20,%esi
  mov    %r12d,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L157
  mov    $0x2,%ecx
  mov    $0x2,%edx
  mov    $0x1f,%eax
  jmp    L194
  nop
L62:
  mov    $0x20,%esi
  mov    %r12d,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L36
  mov    $0x10,%ecx
  mov    $0x2,%edx
  mov    $0xff,%eax
  jmp    L194
  nopw   0x0(%rax,%rax,1)
L135:
  mov    $0x20,%esi
  mov    %r12d,%edi
  call   <notset@plt>
  test   %rax,%rax
  je     L85
  mov    $0x10,%ecx
  mov    $0x10,%edx
  mov    $0xff,%eax
  jmp    L194
  nopw   0x0(%rax,%rax,1)
L132:
  mov    $0x20,%esi
  mov    %r12d,%edi
  call   <isset@plt>
  test   %rax,%rax
  je     L137
  mov    $0x20,%ecx
  mov    $0x3,%edx
  mov    $0xff,%eax
  jmp    L194
```

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;
  }
}
```