user: 请从给定的汇编指令推导出C源代码:

```asm
<generate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %edx,-0x4c(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,%edi
  call   <random_int@plt>
  add    $0x1,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x40(%rbp)
  jmp    L37
L12:
  mov    $0x3e8,%esi
  mov    $0x5,%edi
  call   <random_int2@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x4c(%rbp),%edx
  mov    -0x48(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <random_int2@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x3c(%rbp)
  jmp    L27
L42:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    $0x3e8,%esi
  mov    $0x1,%edi
  call   <random_int2@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x3c(%rbp)
L27:
  mov    -0x3c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L42
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L4
L96:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <random_int@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <random_int@plt>
  mov    %eax,-0x34(%rbp)
L4:
  mov    -0x38(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  je     L96
  mov    -0x28(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,%edi
  call   <random_int@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x28(%rbp),%edx
  sub    %ecx,%edx
  mov    %edx,(%rax)
  mov    $0x0,%eax
  call   <rand@plt>
  and    $0x1,%eax
  test   %eax,%eax
  jne    L22
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x38(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
L22:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x3e8,%eax
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x3e8,%eax
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  cmp    %eax,-0x28(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x30(%rbp)
  jmp    L71
L78:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x30(%rbp)
  jne    L87
  mov    $0xa,%edx
  jmp    L105
L87:
  mov    $0x20,%edx
L105:
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x30(%rbp)
L71:
  mov    -0x30(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L78
  addl   $0x1,-0x40(%rbp)
L37:
  mov    -0x40(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L12
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D10
data_type: string
name: disassemble_data
arguments: tag: D6
data_type: string

tool: D10: %d


tool: D6: %d%c

assistant: ```c
void generate(int max_cases, int min_items, int max_items) {
  int *prices = malloc(max_items * sizeof(*prices));
  int cases = 1 + random_int(max_cases);
  printf("%d\n", cases);
  for (int i = 0; i < cases; i++) {
    int credit = random_int2(5, 1000);
    int num_items = random_int2(min_items, max_items);
    printf("%d\n", credit);
    printf("%d\n", num_items);
    for (int j = 0; j < num_items; j++) {
      prices[j] = random_int2(1, 1000);
    }
    int a = 0;
    int b = 0;
    while (a == b) {
      a = random_int(num_items);
      b = random_int(num_items);
    }
    int middle = random_int(credit - 2 * 1);
    prices[a] = 1 + middle;
    prices[b] = credit - prices[a];
    if (rand() % 2 == 0) {
      int temp = prices[a];
      prices[a] = prices[b];
      prices[b] = temp;
    }
    assert(prices[a] >= 1);
    assert(prices[a] <= 1000);
    assert(prices[b] >= 1);
    assert(prices[b] <= 1000);
    assert(prices[a] + prices[b] == credit);
    for (int j = 0; j < num_items; j++) {
      printf("%d%c", prices[j], (j == num_items - 1) ? '\n' : ' ');
    }
  }
}
```