user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D55(%rip),%rdi
  call   <printf@plt>
  lea    -0x44(%rbp),%rsi
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movslq -0x44(%rbp),%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L46:
  cmp    %rdx,%rsp
  je     L53
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L46
L53:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L35
  orq    $0x0,-0x8(%rsp,%rax,1)
L35:
  mov    %rsp,%r15
  mov    $0x4,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  lea    D37(%rip),%rdi
  call   <puts@plt>
  mov    -0x44(%rbp),%ecx
  test   %ecx,%ecx
  jle    L54
  mov    %r15,%r12
  mov    $0x0,%ebx
  lea    D7(%rip),%r13
L52:
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%ebx
  mov    -0x44(%rbp),%ecx
  add    $0x4,%r12
  cmp    %ebx,%ecx
  jg     L52
L54:
  sub    $0x1,%ecx
  mov    $0x1,%r8d
  mov    $0x0,%edx
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <build@plt>
  lea    D14(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x3c(%rbp),%rdx
  lea    -0x40(%rbp),%rsi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x40(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x44(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    $0x1,%r9d
  mov    -0x3c(%rbp),%eax
  lea    -0x1(%rax),%r8d
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <query@plt>
  mov    %eax,%ecx
  mov    -0x3c(%rbp),%edx
  mov    -0x40(%rbp),%esi
  lea    D42(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D55
type_infered: string
name: read_data
arguments: data_label: D7
type_infered: string
name: read_data
arguments: data_label: D37
type_infered: string
name: read_data
arguments: data_label: D14
type_infered: string
name: read_data
arguments: data_label: D19
type_infered: string
name: read_data
arguments: data_label: D42
type_infered: string

tool: D55: Enter the size of the array: 

tool: D7: %d

tool: D37: Enter the elements.

tool: D14: Enter the range of the query: 

tool: D19: %d %d

tool: D42: Minimum value in index range %d to %d is: %d


assistant: ```c
int main() {
  int size;
  printf("Enter the size of the array: ");
  scanf("%d", &size);
  int array[size];
  int *segTree = (int *)malloc(sizeof(4 * size));
  printf("Enter the elements.\n");
  for (int i = 0; i < size; i++) {
    scanf("%d", &array[i]);
  }
  build(array, segTree, 0, size - 1, 1);
  int start, end;
  printf("Enter the range of the query: ");
  scanf("%d %d", &start, &end);
  int result = query(segTree, 0, size - 1, start - 1, end - 1, 1);
  printf("Minimum value in index range %d to %d is: %d\n", start, end, result);
  return 0;
}
```