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

```asm
<print_mm_foscsel>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L22
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D157(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L98
L22:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D142(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L98:
  mov    -0x8(%rbp),%rax
  and    $0xc000,%eax
  cmp    $0xc000,%rax
  je     L338
  cmp    $0xc000,%rax
  jg     L175
  cmp    $0x8000,%rax
  je     L328
  cmp    $0x8000,%rax
  jg     L175
  test   %rax,%rax
  je     L76
  cmp    $0x4000,%rax
  je     L151
  jmp    L175
L338:
  mov    $0xc,%esi
  lea    D110(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L175
L328:
  mov    $0x8,%esi
  lea    D105(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L175
L151:
  mov    $0x4,%esi
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L175
L76:
  mov    $0x0,%esi
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L175:
  mov    -0x8(%rbp),%rax
  and    $0x1000,%eax
  test   %rax,%rax
  je     L171
  mov    $0x1,%esi
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L226
L171:
  mov    $0x0,%esi
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L226:
  mov    -0x8(%rbp),%rax
  and    $0x400,%eax
  test   %rax,%rax
  je     L261
  mov    $0x4,%esi
  lea    D243(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L197
L261:
  mov    $0x0,%esi
  lea    D158(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L197:
  mov    -0x8(%rbp),%rax
  and    $0x300,%eax
  cmp    $0x300,%rax
  je     L54
  cmp    $0x300,%rax
  jg     L81
  cmp    $0x200,%rax
  je     L330
  cmp    $0x200,%rax
  jg     L81
  test   %rax,%rax
  je     L236
  cmp    $0x100,%rax
  je     L376
  jmp    L81
L54:
  mov    $0x3,%esi
  lea    D208(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L81
L330:
  mov    $0x2,%esi
  lea    D237(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L81
L376:
  mov    $0x1,%esi
  lea    D170(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L81
L236:
  mov    $0x0,%esi
  lea    D214(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L81:
  mov    -0x8(%rbp),%rax
  and    $0x80,%eax
  test   %rax,%rax
  je     L39
  mov    $0x8,%esi
  lea    D102(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L366
L39:
  mov    $0x0,%esi
  lea    D278(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L366:
  mov    -0x8(%rbp),%rax
  and    $0x40,%eax
  test   %rax,%rax
  je     L374
  mov    $0x4,%esi
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L235
L374:
  mov    $0x0,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L235:
  mov    -0x8(%rbp),%rax
  and    $0x10,%eax
  test   %rax,%rax
  je     L234
  mov    $0x1,%esi
  lea    D134(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L248
L234:
  mov    $0x0,%esi
  lea    D200(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L248:
  mov    -0x8(%rbp),%rax
  and    $0x6,%eax
  cmp    $0x5,%rax
  ja     L290
  lea    0x0(,%rax,4),%rdx
  lea    D111(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D111(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x1,%esi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L351
  mov    $0x2,%esi
  lea    D148(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L351
  mov    $0x3,%esi
  lea    D249(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L351
  mov    $0x4,%esi
  lea    D271(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L351
  mov    $0x5,%esi
  lea    D137(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L351
L290:
  mov    -0x8(%rbp),%rax
  and    $0x6,%eax
  mov    %rax,%rsi
  lea    D217(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L351:
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D157
datatype: string
name: parse_data
arguments: data_tag: D142
datatype: string
name: parse_data
arguments: data_tag: D110
datatype: string
name: parse_data
arguments: data_tag: D105
datatype: string
name: parse_data
arguments: data_tag: D89
datatype: string
name: parse_data
arguments: data_tag: D104
datatype: string
name: parse_data
arguments: data_tag: D61
datatype: string
name: parse_data
arguments: data_tag: D114
datatype: string
name: parse_data
arguments: data_tag: D243
datatype: string
name: parse_data
arguments: data_tag: D158
datatype: string
name: parse_data
arguments: data_tag: D208
datatype: string
name: parse_data
arguments: data_tag: D237
datatype: string
name: parse_data
arguments: data_tag: D170
datatype: string
name: parse_data
arguments: data_tag: D214
datatype: string
name: parse_data
arguments: data_tag: D102
datatype: string
name: parse_data
arguments: data_tag: D278
datatype: string
name: parse_data
arguments: data_tag: D77
datatype: string
name: parse_data
arguments: data_tag: D4
datatype: string
name: parse_data
arguments: data_tag: D134
datatype: string
name: parse_data
arguments: data_tag: D200
datatype: string
name: parse_data
arguments: data_tag: D48
datatype: string
name: parse_data
arguments: data_tag: D148
datatype: string
name: parse_data
arguments: data_tag: D249
datatype: string
name: parse_data
arguments: data_tag: D271
datatype: string
name: parse_data
arguments: data_tag: D137
datatype: string
name: parse_data
arguments: data_tag: D217
datatype: string

tool: D157:     FOSCSEL = 0x%08X


tool: D142:    AFOSCSEL = 0x%08X


tool: D110:                     %01x    Clock switching enabled, Fail safe monitor enabled


tool: D105:                     %01x    Clock switching disabled, Fail safe monitor enabled


tool: D89:                     %01x    Clock switching enabled, Fail safe monitor disabled


tool: D104:                     %01x    Clock switching disabled, Fail safe monitor disabled


tool: D61:                     %01x    SOSC crystal used (pins controlled by SOSC) 


tool: D114:                     %01x    External clock connected to SOSCO, pins controlled by PORTx


tool: D243:                      %01x   OSC2/CLKO pin operated as normal I/O


tool: D158:                      %01x   System clock connected to pin OSC2/CLKO


tool: D208:                      %01x   Primary oscillator disabled


tool: D237:                      %01x   HS Oscillator selected


tool: D170:                      %01x   XT Oscillator selected


tool: D214:                      %01x   EC (External Clock) selected


tool: D102:                       %01x  Two-speed startup enabled


tool: D278:                       %01x  Two-speed startup disabled


tool: D77:                       %01x  Secondary oscillator enabled


tool: D4:                       %01x  Secondary oscillator disabled


tool: D134:                       %01x  FRC is input to PLL on reset


tool: D200:                       %01x  Primary oscillator (POSC) is input to PLL on reset


tool: D48:                        %01x Primary or FRC oscillator + PLL


tool: D148:                        %01x Primary oscillator (XT, HS, EC)


tool: D249:                        %01x Reserved - check your settings!


tool: D271:                        %01x Secondary oscillator (SOSC)


tool: D137:                        %01x Low-power RC oscillator (LPRC)


tool: D217:                        %01x Fast RC (FRC) with Divide-by-N


assistant: ```c
void print_mm_foscsel(uint32_t foscsel, uint32_t alternate) {
  if (0 == alternate) {
    printf("    FOSCSEL = 0x%08X\n", foscsel);
  } else {
    printf("   AFOSCSEL = 0x%08X\n", foscsel);
  }
  switch (foscsel & 0x0000C000) {
  case 0x0000C000:
    printf("                    %01x    Clock switching enabled, Fail safe monitor enabled\n", 0x0000C000 >> 12);
    break;
  case 0x00008000:
    printf("                    %01x    Clock switching disabled, Fail safe monitor enabled\n", 0x00008000 >> 12);
    break;
  case 0x00004000:
    printf("                    %01x    Clock switching enabled, Fail safe monitor disabled\n", 0x00004000 >> 12);
    break;
  case 0x00000000:
    printf("                    %01x    Clock switching disabled, Fail safe monitor disabled\n", 0x00000000 >> 12);
    break;
  }
  if (foscsel & 0x00001000) {
    printf("                    %01x    SOSC crystal used (pins controlled by SOSC) \n", 0x00001000 >> 12);
  } else {
    printf("                    %01x    External clock connected to SOSCO, pins controlled by PORTx\n", 0);
  }
  if (foscsel & 0x00000400) {
    printf("                     %01x   OSC2/CLKO pin operated as normal I/O\n", 0x00000400 >> 8);
  } else {
    printf("                     %01x   System clock connected to pin OSC2/CLKO\n", 0);
  }
  switch (foscsel & 0x00000300) {
  case 0x00000300:
    printf("                     %01x   Primary oscillator disabled\n", 0x00000300 >> 8);
    break;
  case 0x00000200:
    printf("                     %01x   HS Oscillator selected\n", 0x00000200 >> 8);
    break;
  case 0x00000100:
    printf("                     %01x   XT Oscillator selected\n", 0x00000100 >> 8);
    break;
  case 0x00000000:
    printf("                     %01x   EC (External Clock) selected\n", 0x00000000 >> 8);
    break;
  }
  if (foscsel & 0x00000080) {
    printf("                      %01x  Two-speed startup enabled\n", 0x00000080 >> 4);
  } else {
    printf("                      %01x  Two-speed startup disabled\n", 0);
  }
  if (foscsel & 0x00000040) {
    printf("                      %01x  Secondary oscillator enabled\n", 0x00000040 >> 4);
  } else {
    printf("                      %01x  Secondary oscillator disabled\n", 0);
  }
  if (foscsel & 0x00000010) {
    printf("                      %01x  FRC is input to PLL on reset\n", 0x00000010 >> 4);
  } else {
    printf("                      %01x  Primary oscillator (POSC) is input to PLL on reset\n", 0);
  }
  switch (foscsel & 0x00000006) {
  case 0x00000001:
    printf("                       %01x Primary or FRC oscillator + PLL\n", 0x00000001);
    break;
  case 0x00000002:
    printf("                       %01x Primary oscillator (XT, HS, EC)\n", 0x00000002);
    break;
  case 0x00000003:
    printf("                       %01x Reserved - check your settings!\n", 0x00000003);
    break;
  case 0x00000004:
    printf("                       %01x Secondary oscillator (SOSC)\n", 0x00000004);
    break;
  case 0x00000005:
    printf("                       %01x Low-power RC oscillator (LPRC)\n", 0x00000005);
    break;
  default:
    printf("                       %01x Fast RC (FRC) with Divide-by-N\n", (foscsel & 0x00000006));
    break;
  }
}
```