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

```asm
<gen_balanced_tree>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,0x14(%rsp)
  cmp    %esi,%edi
  jg     L226
  mov    %edi,%r8d
  mov    %rdx,%r9
L187:
  mov    0x14(%rsp),%eax
  lea    0x1(%r8,%rax,1),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  mov    (%r9),%rdx
  sar    %eax
  mov    %eax,%ecx
  mov    %eax,0x18(%rsp)
  lea    0x4(%rdx),%rax
  mov    %rax,(%r9)
  mov    %ecx,(%rdx)
  sub    $0x1,%ecx
  mov    %ecx,0x8(%rsp)
  cmp    %r8d,%ecx
  jl     L205
  mov    %r9,%r11
  mov    %r8d,%r9d
L59:
  mov    0x8(%rsp),%esi
  lea    0x1(%rsi,%r9,1),%ecx
  mov    %ecx,%edx
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  mov    %edx,%edi
  mov    %edx,0x1c(%rsp)
  lea    0x4(%rax),%rdx
  mov    %rdx,(%r11)
  mov    %edi,(%rax)
  lea    -0x1(%rdi),%eax
  mov    %eax,0xc(%rsp)
  cmp    %r9d,%eax
  jl     L99
  mov    %rdx,%rcx
  mov    %r11,%rdx
L76:
  mov    0xc(%rsp),%eax
  lea    0x1(%rax,%r9,1),%esi
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  mov    %eax,%edi
  mov    %eax,0x28(%rsp)
  lea    0x4(%rcx),%rax
  mov    %rax,(%rdx)
  mov    %edi,(%rcx)
  lea    -0x1(%rdi),%ecx
  mov    %ecx,0x10(%rsp)
  cmp    %r9d,%ecx
  jl     L181
L34:
  mov    0x10(%rsp),%edi
  lea    0x1(%rdi,%r9,1),%esi
  mov    %esi,%ecx
  shr    $0x1f,%ecx
  add    %esi,%ecx
  lea    0x4(%rax),%rsi
  sar    %ecx
  mov    %rsi,(%rdx)
  lea    -0x1(%rcx),%r14d
  mov    %ecx,(%rax)
  cmp    %r9d,%r14d
  jl     L228
  mov    %r14d,%eax
L125:
  lea    0x1(%rax,%r9,1),%edi
  mov    %edi,%ebx
  shr    $0x1f,%ebx
  add    %edi,%ebx
  lea    0x4(%rsi),%rdi
  sar    %ebx
  mov    %rdi,(%rdx)
  lea    -0x1(%rbx),%r13d
  mov    %ebx,(%rsi)
  cmp    %r9d,%r13d
  jl     L118
  mov    %r13d,%r11d
L202:
  lea    0x1(%r11,%r9,1),%esi
  mov    %esi,%r12d
  shr    $0x1f,%r12d
  add    %esi,%r12d
  lea    0x4(%rdi),%rsi
  sar    %r12d
  mov    %rsi,(%rdx)
  lea    -0x1(%r12),%r10d
  mov    %r12d,(%rdi)
  cmp    %r9d,%r10d
  jl     L62
L135:
  lea    0x1(%r10,%r9,1),%edi
  mov    %edi,%r15d
  shr    $0x1f,%r15d
  add    %edi,%r15d
  lea    0x4(%rsi),%rdi
  sar    %r15d
  mov    %rdi,(%rdx)
  lea    -0x1(%r15),%r13d
  mov    %r15d,(%rsi)
  cmp    %r9d,%r13d
  jl     L95
  mov    %r15d,%r8d
  mov    %r12d,%r15d
  mov    %ebx,%r12d
L215:
  lea    0x1(%r13,%r9,1),%esi
  mov    %esi,%ebp
  shr    $0x1f,%ebp
  add    %esi,%ebp
  lea    0x4(%rdi),%rsi
  sar    %ebp
  mov    %rsi,(%rdx)
  lea    -0x1(%rbp),%r14d
  mov    %ebp,(%rdi)
  cmp    %r9d,%r14d
  jl     L155
L189:
  lea    0x1(%r14,%r9,1),%edi
  mov    %r8d,0x3c(%rsp)
  mov    %edi,%ebx
  mov    %ecx,0x38(%rsp)
  shr    $0x1f,%ebx
  mov    %r10d,0x34(%rsp)
  add    %edi,%ebx
  lea    0x4(%rsi),%rdi
  mov    %r11d,0x30(%rsp)
  sar    %ebx
  mov    %rdi,(%rdx)
  mov    %r9d,%edi
  mov    %ebx,(%rsi)
  lea    -0x1(%rbx),%esi
  mov    %eax,0x2c(%rsp)
  mov    %rdx,0x20(%rsp)
  call   <gen_balanced_tree>
  lea    0x1(%rbx),%r9d
  mov    0x20(%rsp),%rdx
  mov    0x2c(%rsp),%eax
  cmp    %r9d,%r14d
  mov    0x30(%rsp),%r11d
  mov    0x34(%rsp),%r10d
  mov    0x38(%rsp),%ecx
  mov    0x3c(%rsp),%r8d
  jl     L155
  mov    (%rdx),%rsi
  jmp    L189
L118:
  lea    0x1(%rbx),%r9d
  cmp    %r9d,%eax
  jl     L228
  mov    (%rdx),%rsi
  jmp    L125
  nopl   (%rax)
L155:
  lea    0x1(%rbp),%r9d
  cmp    %r9d,%r13d
  jl     L236
  mov    (%rdx),%rdi
  jmp    L215
  nopl   0x0(%rax)
L236:
  mov    %r12d,%ebx
  mov    %r15d,%r12d
  mov    %r8d,%r15d
L95:
  lea    0x1(%r15),%r9d
  cmp    %r9d,%r10d
  jl     L62
  mov    (%rdx),%rsi
  jmp    L135
  nopw   0x0(%rax,%rax,1)
L62:
  lea    0x1(%r12),%r9d
  cmp    %r9d,%r11d
  jl     L118
  mov    (%rdx),%rdi
  jmp    L202
L228:
  lea    0x1(%rcx),%r9d
  cmp    %r9d,0x10(%rsp)
  jl     L181
  mov    (%rdx),%rax
  jmp    L34
L181:
  mov    0x28(%rsp),%r9d
  add    $0x1,%r9d
  cmp    %r9d,0xc(%rsp)
  jl     L28
  mov    (%rdx),%rcx
  jmp    L76
L28:
  mov    %rdx,%r11
L99:
  mov    0x1c(%rsp),%r9d
  add    $0x1,%r9d
  cmp    %r9d,0x8(%rsp)
  jl     L94
  mov    (%r11),%rax
  jmp    L59
L94:
  mov    %r11,%r9
L205:
  mov    0x18(%rsp),%r8d
  add    $0x1,%r8d
  cmp    0x14(%rsp),%r8d
  jle    L187
L226:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void gen_balanced_tree(int min, int max, int **array) {
  int i;
  if (min > max)
    return;
  i = (min + max + 1) / 2;
  *(*array)++ = i;
  gen_balanced_tree(min, i - 1, array);
  gen_balanced_tree(i + 1, max, array);
}
```