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

```asm
<main>:
  endbr64
  push   %r15
  lea    D12(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rsi
  call   <scanf@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L72
  lea    0x21(%rsp),%rax
  mov    $0x1,%r12d
  lea    0x20(%rsp),%rbx
  mov    %rax,0x8(%rsp)
  lea    D13(%rip),%rbp
  nopl   0x0(%rax,%rax,1)
L133:
  mov    %rbx,%rdi
  call   <gets@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L78
  lea    -0x1(%rax),%esi
  mov    %rbx,%rcx
  add    0x8(%rsp),%rsi
  xor    %r8d,%r8d
  mov    $0xffffff8f,%r14d
  mov    $0x73,%r13d
  mov    $0xffffff8b,%r11d
  mov    $0x76,%r10d
  mov    $0x25,%r9d
  mov    $0x6f,%edi
  jmp    L76
  nopl   0x0(%rax,%rax,1)
L147:
  lea    -0x70(%rdx),%eax
  cmp    $0x3,%al
  ja     L143
  mov    %edx,%eax
  mov    %edx,%r15d
  imul   %r9b
  sar    $0x7,%r15b
  sar    $0xc,%ax
  sub    %r15d,%eax
  lea    0x4(%r8),%r15d
  imul   %edi,%eax
  sub    %eax,%edx
  mov    %edx,%eax
  and    $0x3,%eax
  add    %r8d,%eax
  and    $0x3,%edx
  mov    %r15d,%r8d
  cmovne %eax,%r8d
L4:
  movb   $0x0,(%rcx)
  add    $0x1,%rcx
  cmp    %rcx,%rsi
  je     L26
L76:
  movzbl (%rcx),%edx
  cmp    $0x20,%dl
  jne    L147
  movb   $0x0,(%rcx)
  add    $0x1,%rcx
  add    $0x1,%r8d
  cmp    %rcx,%rsi
  jne    L76
L26:
  mov    %r12d,%esi
  mov    %r8d,%edx
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <printf@plt>
  cmp    %r12d,0x1c(%rsp)
  jge    L133
L72:
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L110
  add    $0x98,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L143:
  lea    -0x77(%rdx),%eax
  cmp    $0x3,%al
  ja     L46
  mov    %edx,%eax
  mov    %edx,%r15d
  imul   %r11b
  sar    $0x7,%r15b
  shr    $0x8,%ax
  add    %edx,%eax
  sar    $0x6,%al
  sub    %r15d,%eax
  lea    0x4(%r8),%r15d
  imul   %r10d,%eax
  sub    %eax,%edx
  mov    %edx,%eax
  and    $0x3,%eax
  add    %r8d,%eax
  and    $0x3,%edx
  cmovne %eax,%r15d
  mov    %r15d,%r8d
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L46:
  lea    -0x74(%rdx),%eax
  cmp    $0x2,%al
  ja     L66
  mov    %edx,%eax
  mov    %edx,%r15d
  imul   %r14b
  sar    $0x7,%r15b
  shr    $0x8,%ax
  add    %edx,%eax
  sar    $0x6,%al
  sub    %r15d,%eax
  mov    $0xaaaaaaab,%r15d
  imul   %r13d,%eax
  sub    %eax,%edx
  movsbl %dl,%eax
  mov    %rax,%rdx
  imul   %r15,%rax
  shr    $0x21,%rax
  lea    (%rax,%rax,2),%r15d
  mov    %edx,%eax
  lea    0x3(%r8),%edx
  sub    %r15d,%eax
  add    %eax,%r8d
  test   %eax,%eax
  cmove  %edx,%r8d
  jmp    L4
  nopl   0x0(%rax)
L66:
  mov    $0x2b,%eax
  mov    %edx,%r15d
  imul   %dl
  sar    $0x7,%r15b
  sar    $0xc,%ax
  sub    %r15d,%eax
  lea    (%rax,%rax,2),%eax
  shl    $0x5,%eax
  sub    %eax,%edx
  movsbq %dl,%rax
  movsbl %dl,%r15d
  imul   $0x55555556,%rax,%rax
  mov    %r15d,%edx
  sar    $0x1f,%edx
  shr    $0x20,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,2),%edx
  mov    %r15d,%eax
  sub    %edx,%eax
  lea    0x3(%r8),%edx
  add    %eax,%r8d
  test   %eax,%eax
  cmove  %edx,%r8d
  jmp    L4
  nopw   0x0(%rax,%rax,1)
L78:
  xor    %r8d,%r8d
  jmp    L26
L110:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D12
type: string
name: unpack_data
arguments: label: D13
type: string

tool: D12: %d

tool: D13: Case #%d: %d


assistant: ```c
int main() {
  char a[101];
  int n, total = 0, i, j, t, len, num, mod;
  scanf("%d", &t);
  getchar();
  for (j = 1; j <= t; j++) {
    gets(a);
    len = strlen(a);
    for (i = 0; i < len; i++) {
      if (a[i] == ' ') {
        total++;
        ;
      } else if (a[i] >= 'p' && a[i] <= 's') {
        num = a[i] % 111;
        mod = num % 4;
        if (mod == 0) {
          total += 4;
        } else {
          total += mod;
        }
      } else if (a[i] >= 'w' && a[i] <= 'z') {
        num = a[i] % 118;
        mod = num % 4;
        if (mod == 0) {
          total += 4;
        } else {
          total += mod;
        }
      } else if (a[i] >= 't' && a[i] <= 'v') {
        num = a[i] % 115;
        mod = num % 3;
        if (mod == 0) {
          total += 3;
        } else {
          total += mod;
        }
      } else {
        num = a[i] % 96;
        mod = num % 3;
        if (mod == 0) {
          total += 3;
        } else {
          total += mod;
        }
      }
      a[i] = '\0';
    }
    printf("Case #%d: %d\n", j, total);
    total = 0;
  }
  return 0;
}
```