user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x1,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D117(%rip),%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rax
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L27:
  mov    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  test   %rax,%rax
  je     L67
  mov    0x20(%rsp),%esi
  test   %esi,%esi
  je     L67
  mov    $0x0,%ebx
  mov    $0x1,%r12d
  lea    0x24(%rsp),%r13
  jle    L209
  nopl   0x0(%rax,%rax,1)
L179:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <scanf@plt>
  mov    0x20(%rsp),%esi
  add    0x24(%rsp),%ebx
  cmp    %r12d,%esi
  jge    L179
  mov    %ebx,%r8d
  neg    %r8d
  cmovs  %ebx,%r8d
  mov    %r8d,%r14d
L305:
  mov    %r14d,%edi
  call   <isdivisable@plt>
  mov    %eax,%ecx
  test   %eax,%eax
  jne    L215
  mov    0x20(%rsp),%ecx
L422:
  mov    %r14d,%eax
  cltd
  idiv   %ecx
  mov    %eax,%edi
  mov    %edx,0xc(%rsp)
  mov    %eax,%r13d
  call   <countchar@plt>
  mov    0x20(%rsp),%edi
  mov    %eax,0x18(%rsp)
  call   <countchar@plt>
  mov    0xc(%rsp),%edi
  mov    %eax,%r12d
  call   <countchar@plt>
  mov    %eax,%edx
  mov    0x20(%rsp),%eax
  cmp    $0x1,%eax
  je     L401
  cmp    %r14d,%eax
  jge    L33
  mov    0x18(%rsp),%eax
  lea    (%rax,%r12,1),%r14d
  test   %ebx,%ebx
  jg     L370
  jne    L253
L199:
  add    $0x1,%r15d
  jmp    L27
  nopw   0x0(%rax,%rax,1)
L215:
  mov    %r14d,%eax
  cltd
  idiv   %ecx
  mov    %eax,%r14d
  mov    0x20(%rsp),%eax
  cltd
  idiv   %ecx
  mov    %eax,0x20(%rsp)
  mov    %eax,%ecx
  jmp    L422
  nopl   0x0(%rax,%rax,1)
L401:
  mov    %r13d,%edx
  mov    %r15d,%esi
  test   %ebx,%ebx
  js     L359
  lea    D19(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L199
  xchg   %ax,%ax
L33:
  jle    L199
  test   %ebx,%ebx
  jg     L137
  je     L199
  mov    %r15d,%esi
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  mov    %edx,0x18(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%edx
  mov    %r12d,%ebx
  xor    %r13d,%r13d
  sub    %edx,%ebx
  cmp    $0xffffffff,%ebx
  jl     L168
  nopw   0x0(%rax,%rax,1)
L71:
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    %r13d,%eax
  add    $0x1,%r13d
  cmp    %eax,%ebx
  jge    L71
L168:
  mov    0xc(%rsp),%esi
  lea    D136(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
  lea    D97(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  test   %r12d,%r12d
  jle    L295
  nopl   0x0(%rax)
L57:
  mov    $0x2d,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    %ebx,%r12d
  jne    L57
L295:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    $0x20,%edi
  jmp    L112
  nopl   0x0(%rax,%rax,1)
L359:
  lea    D76(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L199
  nopl   0x0(%rax,%rax,1)
L67:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L132
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L209:
  xor    %r14d,%r14d
  jmp    L305
L370:
  mov    %r15d,%esi
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  mov    %edx,0x1c(%rsp)
  call   <printf@plt>
  mov    0x1c(%rsp),%edx
  xor    %ebx,%ebx
  sub    %edx,%r14d
  test   %r14d,%r14d
  jle    L346
  nopl   0x0(%rax,%rax,1)
L279:
  mov    $0x20,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    %r14d,%ebx
  jne    L279
L346:
  mov    0xc(%rsp),%esi
  lea    D136(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
  mov    %r13d,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  test   %r12d,%r12d
  jle    L232
  nopl   0x0(%rax,%rax,1)
L95:
  mov    $0x2d,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    %ebx,%r12d
  jne    L95
L232:
  mov    $0xa,%edi
  xor    %ebx,%ebx
  call   <putchar@plt>
  cmpl   $0x0,0x18(%rsp)
  mov    0x18(%rsp),%r12d
  jle    L195
  nopw   0x0(%rax,%rax,1)
L117:
  mov    $0x20,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    %ebx,%r12d
  jne    L117
L195:
  mov    0x20(%rsp),%esi
  lea    D136(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L199
L253:
  mov    %r15d,%esi
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  mov    %edx,0x1c(%rsp)
  call   <printf@plt>
  mov    0x1c(%rsp),%edx
  mov    %r14d,%ebx
  xor    %r14d,%r14d
  sub    %edx,%ebx
  cmp    $0xffffffff,%ebx
  jl     L255
  nop
L249:
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    %r14d,%eax
  add    $0x1,%r14d
  cmp    %eax,%ebx
  jge    L249
L255:
  mov    0xc(%rsp),%esi
  lea    D136(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
  mov    %r13d,%esi
  lea    D111(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  test   %r12d,%r12d
  jle    L216
  nop
L392:
  mov    $0x2d,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    %ebx,%r12d
  jne    L392
L216:
  mov    $0xa,%edi
  xor    %ebx,%ebx
  call   <putchar@plt>
  cmpl   $0xffffffff,0x18(%rsp)
  mov    0x18(%rsp),%r12d
  jl     L195
  xchg   %ax,%ax
L68:
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    %ebx,%eax
  add    $0x1,%ebx
  cmp    %eax,%r12d
  jge    L68
  jmp    L195
L137:
  mov    %r15d,%esi
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  mov    %edx,0x18(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%edx
  mov    %r12d,%ebx
  xor    %r13d,%r13d
  sub    %edx,%ebx
  test   %ebx,%ebx
  jle    L349
  xchg   %ax,%ax
L143:
  mov    $0x20,%edi
  add    $0x1,%r13d
  call   <putchar@plt>
  cmp    %r13d,%ebx
  jne    L143
L349:
  mov    0xc(%rsp),%esi
  lea    D136(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
  test   %r12d,%r12d
  jle    L322
  nopl   0x0(%rax)
L329:
  mov    $0x2d,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    %ebx,%r12d
  jne    L329
L322:
  mov    $0xa,%edi
L112:
  call   <putchar@plt>
  jmp    L195
L132:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D117
type: string
name: read_data
arguments: data_label: D19
type: string
name: read_data
arguments: data_label: D45
type: string
name: read_data
arguments: data_label: D136
type: string
name: read_data
arguments: data_label: D97
type: string
name: read_data
arguments: data_label: D76
type: string
name: read_data
arguments: data_label: D111
type: string

tool: D117: %d

tool: D19: Case %d:
%d


tool: D45: Case %d:


tool: D136: %d


tool: D97: - 

tool: D76: Case %d:
- %d


tool: D111: - %d

assistant: ```c
int main() {
  int n, i, j, k, l = 1, m, p, a, b, c, in_avg, rest, total;
  while (scanf("%d", &n) && n) {
    b = 0, m = 0;
    for (i = 1; i <= n; i++) {
      scanf("%d", &a);
      b = b + a;
    }
    c = abs(b);
    m = isdivisable(c, n);
    if (m != 0) {
      c = c / m;
      n = n / m;
    }
    in_avg = c / n;
    rest = c - in_avg * n;
    j = countchar(in_avg);
    k = countchar(n);
    p = countchar(rest);
    total = j + k;
    if (n == 1) {
      if (b < 0) {
        printf("Case %d:\n- %d\n", l, in_avg);
      } else {
        printf("Case %d:\n%d\n", l, in_avg);
      }
    } else if (c > n) {
      if (b > 0) {
        printf("Case %d:\n", l);
        for (i = 0; i < total - p; i++) {
          printf(" ");
        }
        printf("%d\n", rest);
        printf("%d", in_avg);
        for (i = 0; i < total - j; i++) {
          printf("-");
        }
        printf("\n");
        for (i = 0; i < total - k; i++) {
          printf(" ");
        }
        printf("%d\n", n);
      } else if (b < 0) {
        printf("Case %d:\n", l);
        for (i = 0; i < total - p + 2; i++) {
          printf(" ");
        }
        printf("%d\n", rest);
        printf("- %d", in_avg);
        for (i = 0; i < total - j; i++) {
          printf("-");
        }
        printf("\n");
        for (i = 0; i < total - k + 2; i++) {
          printf(" ");
        }
        printf("%d\n", n);
      }
    } else if (c < n) {
      if (b > 0) {
        printf("Case %d:\n", l);
        for (i = 0; i < k - p; i++) {
          printf(" ");
        }
        printf("%d\n", rest);
        for (i = 0; i < k; i++) {
          printf("-");
        }
        printf("\n");
        printf("%d\n", n);
      } else if (b < 0) {
        printf("Case %d:\n", l);
        for (i = 0; i < k - p + 2; i++) {
          printf(" ");
        }
        printf("%d\n", rest);
        printf("- ");
        for (i = 0; i < k; i++) {
          printf("-");
        }
        printf("\n");
        for (i = 0; i < 2; i++) {
          printf(" ");
        }
        printf("%d\n", n);
      }
    }
    l++;
  }
  return 0;
}
```