user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<query_tree>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    %r9d,-0x30(%rbp)
  mov    -0x28(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jg     L42
  mov    -0x28(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jg     L42
  mov    -0x2c(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jge    L49
L42:
  mov    $0x0,%eax
  jmp    L39
L49:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L31
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x2c(%rbp),%eax
  sub    -0x28(%rbp),%eax
  add    $0x1,%eax
  imul   %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  je     L37
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x20(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rsi
  mov    -0x20(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
L37:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L31:
  mov    -0x28(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L87
  mov    -0x2c(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jg     L87
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  jmp    L39
L87:
  mov    -0x28(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r10d
  mov    -0x24(%rbp),%eax
  lea    (%rax,%rax,1),%edi
  mov    -0x30(%rbp),%r8d
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x10(%rbp),%ecx
  push   %rcx
  mov    %r8d,%r9d
  mov    %r10d,%r8d
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <query_tree>
  add    $0x10,%rsp
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  lea    0x1(%rax),%ecx
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  lea    0x1(%rax),%edx
  mov    -0x30(%rbp),%r9d
  mov    -0x2c(%rbp),%r8d
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x10(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <query_tree>
  add    $0x10,%rsp
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
L39:
  leave
  ret
```

assistant: ```c
long long int query_tree(int *tree, int *lazy, int node, int a, int b, int i, int j) {
  if (a > b || a > j || b < i)
    return 0;
  if (lazy[node] != 0) {
    tree[node] += lazy[node] * (b - a + 1);
    if (a != b) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2 + 1] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a >= i && b <= j)
    return tree[node];
  long long int q1 = query_tree(tree, lazy, node * 2, a, (a + b) / 2, i, j);
  long long int q2 = query_tree(tree, lazy, 1 + node * 2, 1 + (a + b) / 2, b, i, j);
  return q1 + q2;
}
```