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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x64(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x64(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L140:
  cmp    %rdx,%rsp
  je     L191
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L140
L191:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L18
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L18:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x60(%rbp)
  jmp    L84
L157:
  movl   $0x0,-0x5c(%rbp)
  jmp    L55
L146:
  mov    $0x2a,%edi
  call   <putchar@plt>
  addl   $0x1,-0x5c(%rbp)
L55:
  mov    -0x5c(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jle    L146
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x60(%rbp)
L84:
  mov    -0x64(%rbp),%eax
  cmp    %eax,-0x60(%rbp)
  jl     L157
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x0,-0x60(%rbp)
  jmp    L124
L160:
  movl   $0x0,-0x58(%rbp)
  jmp    L134
L90:
  mov    -0x58(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x58(%rbp)
L134:
  mov    -0x58(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jle    L90
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x60(%rbp)
L124:
  mov    -0x64(%rbp),%eax
  cmp    %eax,-0x60(%rbp)
  jl     L160
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x0,-0x60(%rbp)
  jmp    L3
L104:
  movl   $0x0,-0x54(%rbp)
  jmp    L50
L26:
  mov    -0x54(%rbp),%eax
  add    $0x41,%eax
  mov    %eax,%esi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x54(%rbp)
L50:
  mov    -0x54(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jle    L26
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x60(%rbp)
L3:
  mov    -0x64(%rbp),%eax
  cmp    %eax,-0x60(%rbp)
  jl     L104
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x1,-0x50(%rbp)
  movl   $0x0,-0x60(%rbp)
  jmp    L37
L190:
  movl   $0x0,-0x4c(%rbp)
  jmp    L71
L4:
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  mov    %eax,%esi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x4c(%rbp)
L71:
  mov    -0x4c(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jle    L4
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x60(%rbp)
L37:
  mov    -0x64(%rbp),%eax
  cmp    %eax,-0x60(%rbp)
  jle    L190
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%eax
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D8
type_guessed: string
name: disassemble_data
arguments: data_tag: D3
type_guessed: string
name: disassemble_data
arguments: data_tag: D23
type_guessed: string
name: disassemble_data
arguments: data_tag: D35
type_guessed: string
name: disassemble_data
arguments: data_tag: D27
type_guessed: string

tool: D8: Visina?

tool: D3: %d

tool: D23: %d 

tool: D35: %c 

tool: D27: %2d 

assistant: ```c
int main() {
  int v;
  printf("Visina?");
  scanf("%d", &v);
  int niz[v], i;
  for (i = 0; i < v; i++) {
    int j;
    for (j = 0; j <= i; j++)
      printf("*");
    printf("\n");
  }
  printf("\n");
  for (i = 0; i < v; i++) {
    int j;
    for (j = 0; j <= i; j++)
      printf("%d ", j + 1);
    printf("\n");
  }
  printf("\n");
  for (i = 0; i < v; i++) {
    int j;
    for (j = 0; j <= i; j++)
      printf("%c ", 'A' + j);
    printf("\n");
  }
  printf("\n");
  int k = 1;
  for (i = 0; i <= v; i++) {
    int j;
    for (j = 0; j <= i; ++j) {
      printf("%2d ", k++);
    }
    printf("\n");
  }
  printf("\n");
  return 0;
}
```