user: Please show me the C implementation that matches the assembly code listed below:

```asm
<print_core>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %ecx,-0x20(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L138:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <tabs@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,-0x20(%rbp)
  jne    L149
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <tabs@plt>
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L149:
  cmpl   $0x4,-0x18(%rbp)
  je     L75
  cmpl   $0x4,-0x18(%rbp)
  jg     L130
  cmpl   $0x2,-0x18(%rbp)
  je     L105
  cmpl   $0x3,-0x18(%rbp)
  je     L111
  jmp    L130
L105:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <printTIX2@plt>
  jmp    L130
L111:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <printTIX3@plt>
  jmp    L130
L75:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <printTIX4@plt>
  nop
L130:
  movl   $0x0,-0x4(%rbp)
  jmp    L100
L40:
  mov    -0xc(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  sub    $0x3,%eax
  cltd
  idivl  -0x1c(%rbp)
  mov    %edx,-0xc(%rbp)
  cmpl   $0x1e,-0x1c(%rbp)
  je     L114
  cmpl   $0x24,-0x1c(%rbp)
  je     L42
  jmp    L38
L114:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <printCMIX30@plt>
  jmp    L38
L42:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <printCMIX36@plt>
  nop
L38:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edi
  mov    -0x20(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  call   <printSMIX@plt>
  addl   $0x1,-0x4(%rbp)
L100:
  mov    -0x4(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L40
  addl   $0x1,-0x8(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L125
  movl   $0x0,-0x8(%rbp)
L125:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <printNEXT@plt>
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <tabs@plt>
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  cmpl   $0x0,-0xc(%rbp)
  jne    L138
  nop
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D5
datatype: string
name: unpack_data
arguments: label: D28
datatype: string
name: unpack_data
arguments: label: D11
datatype: string
name: unpack_data
arguments: label: D23
datatype: string

tool: D5: /* k=%d s=%d */


tool: D28: case %d:


tool: D11: q = p;

tool: D23: /* fall through */

assistant: ```c
void print_core(int shift, int k, int s, int java) {
  int i, cc;
  i = 0;
  cc = 0;
  printf("\n");
  printf("/* k=%d s=%d */\n", k, s);
  do {
    int z;
    tabs(shift);
    printf("case %d:\n", cc);
    if (!java) {
      tabs(shift + 1);
      printf("q = p;\n");
    }
    switch (k) {
    case 2:
      printTIX2(shift + 1, i, java);
      break;
    case 3:
      printTIX3(shift + 1, i, java);
      break;
    case 4:
      printTIX4(shift + 1, i, java);
      break;
    }
    for (z = 0; z < k; z++) {
      i = (i + s - 3) % s;
      switch (s) {
      case 30:
        printCMIX30(shift + 1, i, java);
        break;
      case 36:
        printCMIX36(shift + 1, i, java);
        break;
      }
      printSMIX(shift + 1, i, s, java);
    }
    cc++;
    if (i == 0)
      cc = 0;
    printNEXT(shift + 1, cc, java);
    tabs(shift + 1);
    printf("/* fall through */\n");
  } while (i != 0);
}
```