user: What would the C source look like for the assembly code provided here:

```asm
<build_segment_tree>:
  endbr64
  push   %r15
  movslq %r8d,%rax
  push   %r14
  push   %r13
  push   %r12
  movslq %ecx,%r12
  push   %rbp
  push   %rbx
  mov    %rax,%rbx
  lea    (%rdi,%rax,4),%rax
  sub    $0x68,%rsp
  mov    %rax,0x10(%rsp)
  cmp    %r12d,%edx
  je     L216
  lea    (%rdx,%r12,1),%eax
  mov    %eax,%ebp
  shr    $0x1f,%ebp
  add    %eax,%ebp
  lea    (%rbx,%rbx,1),%eax
  mov    %eax,0xc(%rsp)
  add    $0x1,%eax
  sar    %ebp
  movslq %eax,%rcx
  lea    (%rdi,%rcx,4),%rcx
  mov    %rcx,0x18(%rsp)
  cmp    %ebp,%edx
  je     L240
  lea    (%rdx,%rbp,1),%ecx
  add    %eax,%eax
  mov    %ecx,%r13d
  lea    0x1(%rax),%r14d
  mov    %eax,0x20(%rsp)
  shr    $0x1f,%r13d
  movslq %r14d,%rax
  add    %ecx,%r13d
  lea    (%rdi,%rax,4),%r9
  sar    %r13d
  cmp    %r13d,%edx
  je     L98
  lea    (%rdx,%r13,1),%eax
  add    %r14d,%r14d
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  lea    0x1(%r14),%eax
  movslq %eax,%rcx
  sar    %r15d
  lea    (%rdi,%rcx,4),%r10
  cmp    %r15d,%edx
  je     L0
  lea    (%rdx,%r15,1),%r8d
  add    %eax,%eax
  mov    %r9,0x50(%rsp)
  mov    %r8d,%ecx
  mov    %r10,0x48(%rsp)
  shr    $0x1f,%ecx
  mov    %eax,0x40(%rsp)
  add    %r8d,%ecx
  lea    0x1(%rax),%r8d
  mov    %rsi,0x30(%rsp)
  sar    %ecx
  mov    %rdi,0x28(%rsp)
  mov    %ecx,0x38(%rsp)
  call   <build_segment_tree>
  mov    0x38(%rsp),%ecx
  mov    0x30(%rsp),%rsi
  lea    0x4(%r14,%r14,1),%r8d
  mov    0x28(%rsp),%rdi
  lea    0x1(%rcx),%edx
  mov    %r15d,%ecx
  call   <build_segment_tree>
  movslq 0x40(%rsp),%rdx
  mov    0x28(%rsp),%rdi
  mov    0x50(%rsp),%r9
  mov    0x48(%rsp),%r10
  mov    0x8(%rdi,%rdx,4),%eax
  mov    0x4(%rdi,%rdx,4),%edx
  mov    0x30(%rsp),%rsi
  cmp    %edx,%eax
  cmovl  %edx,%eax
L214:
  mov    %eax,(%r10)
  mov    0x20(%rsp),%eax
  lea    0x1(%r15),%edx
  lea    0x2(%rax),%r8d
  lea    (%r8,%r8,1),%eax
  movslq %eax,%rcx
  lea    (%rdi,%rcx,4),%r10
  cmp    %edx,%r13d
  je     L114
  lea    0x0(%r13,%rdx,1),%r11d
  lea    0x0(,%r8,4),%r15d
  mov    %r9,0x50(%rsp)
  mov    %r11d,%ecx
  lea    0x1(%r15),%r8d
  mov    %eax,0x40(%rsp)
  movslq %r15d,%r15
  shr    $0x1f,%ecx
  mov    %r10,0x48(%rsp)
  add    %r11d,%ecx
  mov    %rsi,0x30(%rsp)
  sar    %ecx
  mov    %rdi,0x28(%rsp)
  mov    %ecx,0x38(%rsp)
  call   <build_segment_tree>
  mov    0x38(%rsp),%ecx
  mov    0x40(%rsp),%eax
  mov    0x30(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  lea    0x1(%rcx),%edx
  lea    0x2(%rax,%rax,1),%r8d
  mov    %r13d,%ecx
  call   <build_segment_tree>
  mov    0x28(%rsp),%rdi
  mov    0x50(%rsp),%r9
  mov    0x48(%rsp),%r10
  mov    0x30(%rsp),%rsi
  mov    0x4(%rdi,%r15,4),%eax
  mov    0x8(%rdi,%r15,4),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
L44:
  movslq %r14d,%r14
  mov    %eax,(%r10)
  mov    0x8(%rdi,%r14,4),%eax
  mov    0x4(%rdi,%r14,4),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
L21:
  mov    %eax,(%r9)
  mov    0xc(%rsp),%eax
  lea    0x1(%r13),%edx
  lea    0x2(%rax),%r15d
  lea    (%r15,%r15,1),%eax
  movslq %eax,%rcx
  lea    (%rdi,%rcx,4),%r10
  cmp    %edx,%ebp
  je     L11
  lea    0x0(%rbp,%rdx,1),%ecx
  lea    0x0(,%r15,4),%r11d
  mov    %ecx,%r13d
  lea    0x1(%r11),%r14d
  shr    $0x1f,%r13d
  add    %ecx,%r13d
  movslq %r14d,%rcx
  sar    %r13d
  lea    (%rdi,%rcx,4),%r9
  cmp    %r13d,%edx
  je     L187
  lea    (%rdx,%r13,1),%r8d
  add    %r14d,%r14d
  mov    %r9,0x58(%rsp)
  mov    %r8d,%ecx
  mov    %r10,0x50(%rsp)
  shr    $0x1f,%ecx
  mov    %r11d,0x48(%rsp)
  add    %r8d,%ecx
  lea    0x1(%r14),%r8d
  mov    %eax,0x40(%rsp)
  sar    %ecx
  mov    %rsi,0x30(%rsp)
  mov    %ecx,0x38(%rsp)
  mov    %rdi,0x28(%rsp)
  call   <build_segment_tree>
  mov    0x38(%rsp),%ecx
  mov    0x30(%rsp),%rsi
  lea    0x2(%r14),%r8d
  mov    0x28(%rsp),%rdi
  movslq %r14d,%r14
  lea    0x1(%rcx),%edx
  mov    %r13d,%ecx
  call   <build_segment_tree>
  mov    0x28(%rsp),%rdi
  mov    0x58(%rsp),%r9
  mov    0x50(%rsp),%r10
  mov    0x48(%rsp),%r11d
  mov    0x8(%rdi,%r14,4),%edx
  mov    0x4(%rdi,%r14,4),%ecx
  mov    0x40(%rsp),%eax
  mov    0x30(%rsp),%rsi
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
L241:
  add    $0x1,%eax
  mov    %edx,(%r9)
  lea    0x1(%r13),%edx
  lea    (%rax,%rax,1),%r9d
  movslq %r9d,%rcx
  lea    (%rdi,%rcx,4),%r13
  cmp    %edx,%ebp
  je     L206
  lea    0x0(%rbp,%rdx,1),%r8d
  lea    0x0(,%rax,4),%r14d
  mov    %r10,0x50(%rsp)
  mov    %r8d,%ecx
  mov    %r11d,0x40(%rsp)
  shr    $0x1f,%ecx
  mov    %r9d,0x48(%rsp)
  add    %r8d,%ecx
  lea    0x1(%r14),%r8d
  mov    %rsi,0x30(%rsp)
  movslq %r14d,%r14
  sar    %ecx
  mov    %rdi,0x28(%rsp)
  mov    %ecx,0x38(%rsp)
  call   <build_segment_tree>
  mov    0x38(%rsp),%ecx
  mov    0x48(%rsp),%r9d
  mov    0x30(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  lea    0x1(%rcx),%edx
  lea    0x2(%r9,%r9,1),%r8d
  mov    %ebp,%ecx
  call   <build_segment_tree>
  mov    0x28(%rsp),%rdi
  mov    0x50(%rsp),%r10
  mov    0x40(%rsp),%r11d
  mov    0x30(%rsp),%rsi
  mov    0x4(%rdi,%r14,4),%eax
  mov    0x8(%rdi,%r14,4),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
L184:
  movslq %r11d,%r11
  mov    %eax,0x0(%r13)
  mov    0x4(%rdi,%r11,4),%eax
  mov    0x8(%rdi,%r11,4),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
L228:
  mov    %eax,(%r10)
  movslq 0x20(%rsp),%rax
  mov    0x8(%rdi,%rax,4),%edx
  mov    0x4(%rdi,%rax,4),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  jmp    L84
  nopl   0x0(%rax,%rax,1)
L240:
  mov    0xc(%rsp),%ecx
  movslq %ebp,%rax
  mov    (%rsi,%rax,4),%eax
  lea    0x2(%rcx),%r15d
L84:
  mov    0x18(%rsp),%rcx
  movslq %r15d,%r15
  lea    0x1(%rbp),%edx
  add    $0x1,%ebx
  mov    %eax,(%rcx)
  lea    (%rdi,%r15,4),%rax
  cmp    %r12d,%edx
  je     L6
  lea    (%rdx,%r12,1),%ecx
  shl    $0x2,%ebx
  mov    %ecx,%ebp
  lea    0x1(%rbx),%r14d
  shr    $0x1f,%ebp
  add    %ecx,%ebp
  movslq %r14d,%rcx
  sar    %ebp
  lea    (%rdi,%rcx,4),%r10
  cmp    %ebp,%edx
  je     L13
  lea    (%rdx,%rbp,1),%ecx
  add    %r14d,%r14d
  mov    %ecx,%r13d
  lea    0x1(%r14),%r15d
  shr    $0x1f,%r13d
  add    %ecx,%r13d
  movslq %r15d,%rcx
  sar    %r13d
  lea    (%rdi,%rcx,4),%r11
  cmp    %r13d,%edx
  je     L96
  lea    (%rdx,%r13,1),%r8d
  add    %r15d,%r15d
  mov    %r11,0x40(%rsp)
  mov    %r8d,%ecx
  mov    %rax,0x38(%rsp)
  shr    $0x1f,%ecx
  mov    %r10,0x30(%rsp)
  add    %r8d,%ecx
  lea    0x1(%r15),%r8d
  mov    %rsi,0x20(%rsp)
  movslq %r15d,%r15
  sar    %ecx
  mov    %rdi,0x18(%rsp)
  mov    %ecx,0x28(%rsp)
  call   <build_segment_tree>
  mov    0x28(%rsp),%ecx
  lea    0x2(%r14),%r9d
  mov    0x20(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  lea    (%r9,%r9,1),%r8d
  mov    %r9d,0x28(%rsp)
  lea    0x1(%rcx),%edx
  mov    %r13d,%ecx
  call   <build_segment_tree>
  mov    0x18(%rsp),%rdi
  mov    0x40(%rsp),%r11
  mov    0x38(%rsp),%rax
  mov    0x30(%rsp),%r10
  mov    0x8(%rdi,%r15,4),%edx
  mov    0x4(%rdi,%r15,4),%ecx
  mov    0x28(%rsp),%r9d
  mov    0x20(%rsp),%rsi
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
L7:
  mov    %edx,(%r11)
  lea    0x1(%r13),%edx
  lea    0x2(%rbx),%r15d
  movslq %r9d,%r9
  lea    (%rdi,%r9,4),%r13
  cmp    %edx,%ebp
  je     L75
  lea    0x0(%rbp,%rdx,1),%r8d
  shl    $0x2,%r15d
  mov    %rax,0x38(%rsp)
  mov    %r8d,%ecx
  mov    %r10,0x30(%rsp)
  shr    $0x1f,%ecx
  mov    %rsi,0x20(%rsp)
  add    %r8d,%ecx
  lea    0x1(%r15),%r8d
  mov    %rdi,0x18(%rsp)
  movslq %r15d,%r15
  sar    %ecx
  mov    %ecx,0x28(%rsp)
  call   <build_segment_tree>
  mov    0x28(%rsp),%ecx
  mov    0x20(%rsp),%rsi
  lea    0x6(%r14,%r14,1),%r8d
  mov    0x18(%rsp),%rdi
  lea    0x1(%rcx),%edx
  mov    %ebp,%ecx
  call   <build_segment_tree>
  mov    0x18(%rsp),%rdi
  mov    0x38(%rsp),%rax
  mov    0x30(%rsp),%r10
  mov    0x20(%rsp),%rsi
  mov    0x4(%rdi,%r15,4),%edx
  mov    0x8(%rdi,%r15,4),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
L207:
  movslq %r14d,%r14
  mov    %edx,0x0(%r13)
  mov    0x4(%rdi,%r14,4),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
L150:
  mov    0xc(%rsp),%ecx
  mov    %edx,(%r10)
  lea    0x1(%rbp),%edx
  lea    0x3(%rcx),%r13d
  lea    0x0(%r13,%r13,1),%r14d
  movslq %r14d,%rcx
  lea    (%rdi,%rcx,4),%r15
  cmp    %edx,%r12d
  je     L31
  lea    (%r12,%rdx,1),%ecx
  shl    $0x2,%r13d
  mov    %rax,0x28(%rsp)
  mov    %ecx,%ebp
  lea    0x1(%r13),%r8d
  mov    %rsi,0x20(%rsp)
  movslq %r13d,%r13
  shr    $0x1f,%ebp
  mov    %rdi,0x18(%rsp)
  add    %ecx,%ebp
  sar    %ebp
  mov    %ebp,%ecx
  call   <build_segment_tree>
  mov    0x18(%rsp),%rdi
  lea    0x1(%rbp),%edx
  mov    %r12d,%ecx
  mov    0x20(%rsp),%rsi
  lea    0x2(%r14,%r14,1),%r8d
  call   <build_segment_tree>
  mov    0x18(%rsp),%rdi
  mov    0x28(%rsp),%rax
  mov    0x4(%rdi,%r13,4),%edx
  mov    0x8(%rdi,%r13,4),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
L247:
  movslq %ebx,%rbx
  mov    %edx,(%r15)
  mov    0x4(%rdi,%rbx,4),%edx
  mov    0x8(%rdi,%rbx,4),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
  jmp    L227
  nop
L216:
  movslq %edx,%rdx
  mov    (%rsi,%rdx,4),%edx
L230:
  mov    0x10(%rsp),%rax
  mov    %edx,(%rax)
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L6:
  mov    (%rsi,%r12,4),%edx
L227:
  mov    %edx,(%rax)
  movslq 0xc(%rsp),%rax
  mov    0x4(%rdi,%rax,4),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  jmp    L230
  cs nopw 0x0(%rax,%rax,1)
L96:
  movslq %r13d,%rdx
  lea    0x2(%r14),%r9d
  mov    (%rsi,%rdx,4),%edx
  jmp    L7
  nop
L0:
  movslq %r15d,%rax
  mov    (%rsi,%rax,4),%eax
  jmp    L214
  nopl   0x0(%rax,%rax,1)
L13:
  movslq %ebp,%rdx
  mov    (%rsi,%rdx,4),%edx
  jmp    L150
  nopl   0x0(%rax,%rax,1)
L98:
  movslq %r13d,%rax
  mov    (%rsi,%rax,4),%eax
  jmp    L21
  nopl   0x0(%rax,%rax,1)
L31:
  mov    (%rsi,%r12,4),%edx
  jmp    L247
  nopl   0x0(%rax)
L11:
  movslq %ebp,%rax
  mov    (%rsi,%rax,4),%eax
  jmp    L228
  nopl   0x0(%rax,%rax,1)
L75:
  movslq %ebp,%rdx
  mov    (%rsi,%rdx,4),%edx
  jmp    L207
  nopl   0x0(%rax,%rax,1)
L114:
  movslq %r13d,%rax
  mov    (%rsi,%rax,4),%eax
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L206:
  movslq %ebp,%rax
  mov    (%rsi,%rax,4),%eax
  jmp    L184
  nopl   0x0(%rax,%rax,1)
L187:
  movslq %r13d,%rdx
  mov    (%rsi,%rdx,4),%edx
  jmp    L241
```

assistant: ```c
void build_segment_tree(int *segment_tree, int *input, int low, int high, int pos) {
  int mid;
  if (low == high) {
    segment_tree[pos] = input[low];
    return;
  }
  mid = (low + high) / 2;
  build_segment_tree(segment_tree, input, low, mid, (2 * pos + 1));
  build_segment_tree(segment_tree, input, mid + 1, high, (2 * pos + 2));
  segment_tree[pos] = ((segment_tree[2 * pos + 1]) > (segment_tree[2 * pos + 2]) ? (segment_tree[2 * pos + 1]) : (segment_tree[2 * pos + 2]));
}
```