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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x440,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x43c(%rbp),%rax
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  movl   $0x1,-0x438(%rbp)
  jmp    L40
L117:
  lea    -0x1c0(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  lea    -0x1c0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x424(%rbp)
  movl   $0x0,-0x430(%rbp)
  movl   $0x0,-0x42c(%rbp)
  movl   $0x0,-0x434(%rbp)
  jmp    L66
L31:
  mov    -0x434(%rbp),%eax
  cltq
  movzbl -0x1c0(%rbp,%rax,1),%eax
  cmp    $0x40,%al
  jle    L44
  mov    -0x434(%rbp),%eax
  cltq
  movzbl -0x1c0(%rbp,%rax,1),%eax
  cmp    $0x5a,%al
  jg     L44
  mov    -0x434(%rbp),%eax
  cltq
  movzbl -0x1c0(%rbp,%rax,1),%edx
  mov    -0x430(%rbp),%eax
  cltq
  mov    %dl,-0xe0(%rbp,%rax,1)
  addl   $0x1,-0x430(%rbp)
  addl   $0x1,-0x42c(%rbp)
  mov    -0x42c(%rbp),%eax
  cltq
  movl   $0x0,-0x420(%rbp,%rax,4)
  jmp    L114
L44:
  mov    -0x42c(%rbp),%eax
  cltq
  mov    -0x420(%rbp,%rax,4),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x434(%rbp),%eax
  cltq
  movzbl -0x1c0(%rbp,%rax,1),%eax
  movsbl %al,%eax
  add    %edx,%eax
  lea    -0x30(%rax),%edx
  mov    -0x42c(%rbp),%eax
  cltq
  mov    %edx,-0x420(%rbp,%rax,4)
L114:
  addl   $0x1,-0x434(%rbp)
L66:
  mov    -0x434(%rbp),%eax
  cmp    -0x424(%rbp),%eax
  jl     L31
  movl   $0x1,-0x42c(%rbp)
  mov    -0x438(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x434(%rbp)
  jmp    L17
L90:
  movl   $0x0,-0x428(%rbp)
  jmp    L26
L51:
  mov    -0x434(%rbp),%eax
  cltq
  movzbl -0xe0(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
  addl   $0x1,-0x428(%rbp)
L26:
  mov    -0x42c(%rbp),%eax
  cltq
  mov    -0x420(%rbp,%rax,4),%eax
  cmp    %eax,-0x428(%rbp)
  jl     L51
  addl   $0x1,-0x42c(%rbp)
  addl   $0x1,-0x434(%rbp)
L17:
  mov    -0x434(%rbp),%eax
  cmp    -0x430(%rbp),%eax
  jl     L90
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x438(%rbp)
L40:
  mov    -0x43c(%rbp),%eax
  cmp    %eax,-0x438(%rbp)
  jle    L117
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L109
  call   <__stack_chk_fail@plt>
L109:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D5
data_type: string
name: disassemble_data
arguments: label: D10
data_type: string

tool: D5: %d

tool: D10: Case %d: 

assistant: ```c
int main() {
  int i, j, k, l, m, len, n, c[150];
  char a[210], b[210], dec[210];
  scanf("%d", &n);
  getchar();
  for (i = 1; i <= n; i++) {
    gets(a);
    len = strlen(a);
    k = 0, l = 0;
    for (j = 0; j < len; j++) {
      if (a[j] >= 'A' && a[j] <= 'Z') {
        b[k] = a[j];
        k++;
        l++;
        c[l] = 0;
      } else {
        c[l] = c[l] * 10 + a[j] - '0';
      }
    }
    l = 1;
    printf("Case %d: ", i);
    for (j = 0; j < k; j++) {
      for (m = 0; m < c[l]; m++) {
        printf("%c", b[j]);
      }
      l++;
    }
    printf("\n");
  }
  return 0;
}
```