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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x8(%rsp)
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x14(%rsp)
  lea    D43(%rip),%rdi
  call   <puts@plt>
  lea    D35(%rip),%rbx
L126:
  lea    0x8(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmpl   $0x0,0x8(%rsp)
  jle    L126
  lea    D73(%rip),%rdi
  call   <puts@plt>
  lea    D35(%rip),%rbx
L36:
  lea    0xc(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmpl   $0x0,0xc(%rsp)
  jle    L36
  mov    $0x0,%r15d
  mov    $0x0,%r14d
  lea    D77(%rip),%rbp
  lea    D81(%rip),%rbx
  lea    D100(%rip),%r13
  lea    D80(%rip),%r12
  jmp    L55
L4:
  mov    0x14(%rsp),%eax
  cmp    0x8(%rsp),%eax
  jg     L133
  test   %eax,%eax
  jne    L12
L133:
  mov    %r13,%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L55:
  cmpl   $0x0,0x8(%rsp)
  jg     L42
  cmpl   $0x0,0xc(%rsp)
  jle    L17
L42:
  mov    %rbp,%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x10(%rsp),%eax
  cmp    $0x1,%eax
  je     L4
  cmp    $0x2,%eax
  jne    L55
  mov    0x14(%rsp),%eax
  mov    0xc(%rsp),%edx
  test   %eax,%eax
  je     L80
  cmp    %edx,%eax
  jle    L11
L80:
  mov    %r13,%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L55
L12:
  lea    D54(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%esi
  sub    0x14(%rsp),%esi
  mov    %esi,0x8(%rsp)
  mov    0xc(%rsp),%edx
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r14d
  jmp    L55
L11:
  sub    %eax,%edx
  mov    %edx,0xc(%rsp)
  lea    D54(%rip),%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r15d
  jmp    L55
L17:
  lea    D120(%rip),%rdi
  call   <puts@plt>
  mov    %r14d,%esi
  lea    D62(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15d,%esi
  lea    D68(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L130
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L130:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D43
type: string
name: extract_symbolic_data
arguments: label: D35
type: string
name: extract_symbolic_data
arguments: label: D73
type: string
name: extract_symbolic_data
arguments: label: D77
type: string
name: extract_symbolic_data
arguments: label: D81
type: string
name: extract_symbolic_data
arguments: label: D100
type: string
name: extract_symbolic_data
arguments: label: D80
type: string
name: extract_symbolic_data
arguments: label: D54
type: string
name: extract_symbolic_data
arguments: label: D120
type: string
name: extract_symbolic_data
arguments: label: D62
type: string
name: extract_symbolic_data
arguments: label: D68
type: string

tool: D43: Informe a quantidade inicial do produto A:

tool: D35: %d

tool: D73: Informe a quantidade inicial do produto B:

tool: D77: Informe vendas:

tool: D81: %d %d

tool: D100: Venda nao registrada

tool: D80: Estoque: A = %d B = %d


tool: D54: Venda registrada

tool: D120: 
Relatorio:

tool: D62: Numero de registos de venda o produto A: %d


tool: D68: Numero de registos de venda o produto B: %d


assistant: ```c
int main() {
  int prodA = 0, prodB = 0, vendA = 0, vendB = 0;
  int cod, prod = 0;
  printf("Informe a quantidade inicial do produto A:\n");
  do {
    scanf("%d", &prodA);
  } while (prodA <= 0);
  printf("Informe a quantidade inicial do produto B:\n");
  do {
    scanf("%d", &prodB);
  } while (prodB <= 0);
  while (prodA > 0 || prodB > 0) {
    printf("Informe vendas:\n");
    scanf("%d %d", &cod, &prod);
    if (cod == 1) {
      if (prod > prodA || prod == 0) {
        puts("Venda nao registrada");
        printf("Estoque: A = %d B = %d\n", prodA, prodB);
      } else {
        puts("Venda registrada");
        prodA -= prod;
        printf("Estoque: A = %d B = %d\n", prodA, prodB);
        vendA++;
      }
    } else if (cod == 2) {
      if (prod > prodB || prod == 0) {
        puts("Venda nao registrada");
        printf("Estoque: A = %d B = %d\n", prodA, prodB);
      } else {
        prodB -= prod;
        puts("Venda registrada");
        printf("Estoque: A = %d B = %d\n", prodA, prodB);
        vendB++;
      }
    }
  }
  puts("\nRelatorio:");
  printf("Numero de registos de venda o produto A: %d\n", vendA);
  printf("Numero de registos de venda o produto B: %d\n", vendB);
  return 0;
}
```