user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    $0x0,%edi
  call   <time@plt>
  movslq %eax,%rbx
  imul   $0x10624dd3,%rbx,%rbx
  sar    $0x26,%rbx
  cltd
  sub    %edx,%ebx
  imul   $0x3e8,%ebx,%edx
  sub    %edx,%eax
  mov    %eax,%ebx
  mov    %eax,%esi
  lea    D173(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebx,%edi
  call   <srand@plt>
  mov    $0x78,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  lea    0x78(%rax),%rbp
  mov    %rax,%rbx
L475:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x25,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x64,%edx,%edx
  sub    %edx,%eax
  mov    %eax,(%rbx)
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  jne    L475
  movl   $0xe,0x38(%rsp)
  movl   $0x1d,0x18(%rsp)
  movl   $0x0,0xc(%rsp)
  mov    $0x1,%r15d
  jmp    L96
L551:
  mov    %esi,(%rax)
  mov    %ecx,(%rdx)
  jmp    L354
L111:
  mov    %edi,(%r10)
  mov    %esi,(%rdx)
  jmp    L573
L241:
  mov    %esi,(%rax)
  mov    %edx,(%rdi)
  jmp    L531
L529:
  lea    D236(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L263
L627:
  add    $0x1,%rbx
  cmp    $0x1e,%rbx
  je     L88
L509:
  mov    %ebx,%ebp
  cmp    %ebx,%r12d
  je     L529
L263:
  mov    (%r14,%rbx,4),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    %ebp,%r15d
  jne    L627
  lea    D80(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L627
L88:
  mov    0x10(%rsp),%r15d
  mov    0x1c(%rsp),%ebp
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%ecx
  mov    0x18(%rsp),%edi
  cmp    %edi,%ecx
  jg     L331
  mov    0x20(%rsp),%rax
  mov    %edi,%edx
  sub    %ecx,%edx
  add    0x30(%rsp),%rdx
  lea    0x4(%r14,%rdx,4),%rcx
  mov    $0x0,%edi
  mov    $0x0,%esi
  jmp    L282
L600:
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%edi
L898:
  add    $0x4,%rax
  cmp    %rcx,%rax
  je     L25
L282:
  mov    (%rax),%edx
  cmp    %ebp,%edx
  jge    L600
  add    $0x1,%esi
  jmp    L898
L25:
  mov    %esi,0x2c(%rsp)
  mov    %edi,0x28(%rsp)
L740:
  mov    0xc(%rsp),%eax
  add    0x2c(%rsp),%eax
  mov    %eax,0x1c(%rsp)
  add    0x28(%rsp),%eax
  mov    %eax,0x10(%rsp)
  mov    0x18(%rsp),%ebx
  jmp    L121
L331:
  movl   $0x0,0x28(%rsp)
  movl   $0x0,0x2c(%rsp)
  jmp    L740
L623:
  add    $0x1,%r15d
  jmp    L121
L527:
  cmp    %ebx,%r15d
  jg     L300
  je     L121
  mov    %edx,(%rdi)
  mov    %esi,(%rcx)
L121:
  movslq %r15d,%rax
  lea    (%r14,%rax,4),%rdi
  mov    (%rdi),%esi
  cmp    %ebx,%r15d
  setle  %al
  cmp    %ebp,%esi
  jge    L847
  test   %al,%al
  jne    L623
L847:
  movslq %ebx,%r8
  lea    (%r14,%r8,4),%rcx
  mov    (%rcx),%edx
  cmp    %edx,%ebp
  jg     L527
  test   %al,%al
  je     L527
  lea    -0x4(%r14,%r8,4),%rax
L387:
  sub    $0x1,%ebx
  mov    %rax,%rcx
  mov    (%rax),%edx
  sub    $0x4,%rax
  cmp    %ebx,%r15d
  jg     L527
  cmp    %ebp,%edx
  jge    L387
  jmp    L527
L300:
  cmp    %ebx,0xc(%rsp)
  je     L6
  mov    0x20(%rsp),%rdi
  mov    (%rdi),%eax
  mov    %edx,(%rdi)
  mov    %eax,(%rcx)
L6:
  lea    D51(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%r12d
  lea    D170(%rip),%r15
  mov    %ebp,0x3c(%rsp)
  mov    0x18(%rsp),%r13d
  jmp    L55
L249:
  lea    D236(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L519
L717:
  mov    $0x2a,%edi
  call   <putchar@plt>
  jmp    L612
L580:
  add    $0x1,%r12
  cmp    $0x1e,%r12
  je     L255
L55:
  mov    %r12d,%ebp
  cmp    %r12d,0xc(%rsp)
  je     L249
L519:
  cmp    %ebp,%ebx
  je     L717
L612:
  mov    (%r14,%r12,4),%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    %ebp,%r13d
  jne    L580
  lea    D80(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L580
L255:
  mov    0x3c(%rsp),%ebp
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%ecx
  cmp    %ecx,0x1c(%rsp)
  jle    L685
  mov    0x20(%rsp),%r12
  mov    0x2c(%rsp),%eax
  lea    -0x1(%rax),%eax
  add    0x30(%rsp),%rax
  lea    0x4(%r14,%rax,4),%r13
L178:
  cmp    %ebp,(%r12)
  setl   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x4,%r12
  cmp    %r13,%r12
  jne    L178
L685:
  mov    0x1c(%rsp),%eax
  mov    0x18(%rsp),%r13d
  cmp    %r13d,%eax
  jg     L361
  movslq %eax,%r12
L794:
  cmp    %ebp,(%r14,%r12,4)
  setge  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x1,%r12
  cmp    %r12d,%r13d
  jge    L794
L361:
  mov    0x18(%rsp),%edx
  mov    0x1c(%rsp),%esi
  jmp    L498
L556:
  add    $0x1,%esi
  jmp    L498
L130:
  cmp    %edx,%esi
  jg     L289
  je     L498
  mov    %ecx,(%r8)
  mov    %r9d,(%rdi)
L498:
  movslq %esi,%rax
  lea    (%r14,%rax,4),%r8
  mov    (%r8),%r9d
  cmp    0x10(%rsp),%esi
  jge    L522
  cmp    %ebp,%r9d
  je     L556
L522:
  movslq %edx,%rax
  lea    (%r14,%rax,4),%rdi
  mov    (%rdi),%ecx
  cmp    %edx,%esi
  jg     L130
  cmp    %ecx,%ebp
  jge    L130
  lea    -0x4(%r14,%rax,4),%rax
L720:
  sub    $0x1,%edx
  mov    %rax,%rdi
  mov    (%rax),%ecx
  sub    $0x4,%rax
  cmp    %edx,%esi
  jg     L130
  cmp    %ebp,%ecx
  jg     L720
  jmp    L130
L289:
  lea    D158(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%r12d
  lea    D170(%rip),%r15
  mov    %ebp,0x3c(%rsp)
  mov    0x18(%rsp),%r13d
  jmp    L702
L377:
  lea    D236(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L390
L625:
  mov    $0x2a,%edi
  call   <putchar@plt>
  jmp    L141
L666:
  add    $0x1,%r12
  cmp    $0x1e,%r12
  je     L129
L702:
  mov    %r12d,%ebp
  cmp    %r12d,0xc(%rsp)
  je     L377
L390:
  cmp    %ebp,%ebx
  je     L625
L141:
  mov    (%r14,%r12,4),%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    %ebp,%r13d
  jne    L666
  lea    D80(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L666
L129:
  mov    0x3c(%rsp),%ebp
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%ecx
  cmp    %ecx,0x1c(%rsp)
  jle    L574
  mov    0x20(%rsp),%rbx
  mov    0x2c(%rsp),%eax
  lea    -0x1(%rax),%eax
  add    0x30(%rsp),%rax
  lea    0x4(%r14,%rax,4),%r12
L596:
  cmp    %ebp,(%rbx)
  setl   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L596
L574:
  mov    0x1c(%rsp),%eax
  mov    0x10(%rsp),%ecx
  cmp    %ecx,%eax
  jge    L13
  movslq %eax,%rdx
  lea    (%r14,%rdx,4),%rbx
  mov    0x28(%rsp),%eax
  lea    -0x1(%rax),%eax
  add    %rdx,%rax
  lea    0x4(%r14,%rax,4),%r12
L483:
  cmp    %ebp,(%rbx)
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L483
L13:
  mov    0x10(%rsp),%eax
  mov    0x18(%rsp),%r12d
  cmp    %r12d,%eax
  jg     L268
  movslq %eax,%rbx
L447:
  cmp    %ebp,(%r14,%rbx,4)
  setg   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x1,%rbx
  cmp    %ebx,%r12d
  jge    L447
  mov    $0x1e,%ebx
  mov    0x10(%rsp),%r15d
  sub    %r15d,%ebx
  mov    %ebx,%ecx
  mov    0x28(%rsp),%edx
  mov    0x1c(%rsp),%ebp
  mov    %ebp,%esi
  lea    D149(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%edx
  mov    %r15d,%esi
  lea    D94(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    %ebx,%ebp
  jge    L199
  cmp    %ebx,%r15d
  jge    L477
L199:
  mov    0x38(%rsp),%ecx
  cmp    %ecx,0x1c(%rsp)
  jg     L395
  mov    0x38(%rsp),%ecx
  cmp    %ecx,0x10(%rsp)
  jg     L771
  lea    D125(%rip),%rdi
  call   <puts@plt>
  mov    0x10(%rsp),%eax
  mov    %eax,0xc(%rsp)
L362:
  mov    0xc(%rsp),%eax
  lea    0x1(%rax),%r15d
  cmp    0x18(%rsp),%r15d
  jge    L808
L96:
  mov    0xc(%rsp),%esi
  mov    %esi,%eax
  mov    0x18(%rsp),%ebp
  add    %ebp,%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  mov    %ebp,%ecx
  mov    %ebx,%edx
  lea    D53(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x38(%rsp),%esi
  lea    D162(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movslq %ebx,%rax
  lea    (%r14,%rax,4),%rax
  mov    (%rax),%ecx
  movslq %ebp,%rdx
  lea    (%r14,%rdx,4),%rdx
  mov    (%rdx),%esi
  cmp    %esi,%ecx
  jle    L354
  cmp    %ebp,%ebx
  jne    L551
L354:
  mov    0xc(%rsp),%r11d
  movslq %r11d,%rcx
  mov    %rcx,0x30(%rsp)
  shl    $0x2,%rcx
  lea    (%r14,%rcx,1),%r10
  mov    %r10,0x20(%rsp)
  mov    (%r10),%esi
  mov    (%rdx),%edi
  cmp    0x18(%rsp),%r11d
  je     L573
  cmp    %edi,%esi
  jg     L111
L573:
  mov    (%rax),%edx
  mov    0x20(%rsp),%rdi
  mov    (%rdi),%esi
  cmp    0xc(%rsp),%ebx
  je     L531
  cmp    %esi,%edx
  jg     L241
L531:
  cmp    %r15d,%ebx
  je     L273
  mov    (%rax),%esi
  lea    0x4(%r14,%rcx,1),%rdx
  mov    (%rdx),%ecx
  mov    %ecx,(%rax)
  mov    %esi,(%rdx)
L273:
  mov    0x20(%rsp),%rax
  mov    (%rax),%ebp
  mov    %ebp,%esi
  lea    D153(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D152(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebx
  lea    D170(%rip),%r13
  mov    %r15d,0x10(%rsp)
  mov    %ebp,0x1c(%rsp)
  mov    0xc(%rsp),%r12d
  mov    0x18(%rsp),%r15d
  jmp    L509
L477:
  mov    0x10(%rsp),%ebx
  mov    %ebx,%esi
  lea    D197(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebx,0x38(%rsp)
  mov    %ebx,0xc(%rsp)
  jmp    L362
L395:
  mov    0x1c(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x18(%rsp)
  lea    D39(%rip),%rdi
  call   <puts@plt>
  jmp    L362
L771:
  lea    D183(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%eax
  mov    %eax,0xc(%rsp)
  jmp    L223
L808:
  cmp    0x18(%rsp),%r15d
  je     L684
L223:
  movslq 0xc(%rsp),%r15
  lea    (%r14,%r15,4),%rbp
  mov    0x0(%rbp),%r12d
  lea    D88(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%ebx
  lea    D170(%rip),%r13
  mov    %r15,0x10(%rsp)
  mov    0xc(%rsp),%r15d
  jmp    L456
L684:
  mov    0xc(%rsp),%edi
  movslq %edi,%rax
  lea    (%r14,%rax,4),%rcx
  mov    (%rcx),%edx
  mov    0x18(%rsp),%ebx
  movslq %ebx,%rax
  lea    (%r14,%rax,4),%rax
  mov    (%rax),%esi
  cmp    %ebx,%edi
  je     L223
  cmp    %esi,%edx
  jle    L223
  mov    %esi,(%rcx)
  mov    %edx,(%rax)
  jmp    L223
L440:
  mov    (%r14,%rbx,4),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    $0x1e,%rbx
  je     L91
L456:
  cmp    %ebx,%r15d
  jne    L440
  mov    $0x2a,%edi
  call   <putchar@plt>
  jmp    L440
L91:
  mov    0x10(%rsp),%r15
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L523
  lea    -0x1(%rax),%eax
  lea    0x4(%r14,%rax,4),%r13
  mov    %r14,%rbx
L587:
  cmp    %r12d,(%rbx)
  setl   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x4,%rbx
  cmp    %r13,%rbx
  jne    L587
L523:
  mov    0xc(%rsp),%ecx
  cmp    $0x1d,%ecx
  jg     L149
  mov    $0x1d,%eax
  sub    %ecx,%eax
  add    %r15,%rax
  lea    0x4(%r14,%rax,4),%rbx
L140:
  cmp    %r12d,0x0(%rbp)
  setge  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x4,%rbp
  cmp    %rbx,%rbp
  jne    L140
L149:
  mov    %r14,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L268:
  mov    $0x1e,%ecx
  mov    0x10(%rsp),%ebx
  sub    %ebx,%ecx
  mov    0x28(%rsp),%edx
  mov    0x1c(%rsp),%esi
  lea    D149(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%edx
  mov    %ebx,%esi
  lea    D94(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L199
```

tool_calls: name: unpack_data
arguments: data_tag: D173
type_guessed: string
name: unpack_data
arguments: data_tag: D236
type_guessed: string
name: unpack_data
arguments: data_tag: D80
type_guessed: string
name: unpack_data
arguments: data_tag: D51
type_guessed: string
name: unpack_data
arguments: data_tag: D170
type_guessed: string
name: unpack_data
arguments: data_tag: D158
type_guessed: string
name: unpack_data
arguments: data_tag: D149
type_guessed: string
name: unpack_data
arguments: data_tag: D94
type_guessed: string
name: unpack_data
arguments: data_tag: D125
type_guessed: string
name: unpack_data
arguments: data_tag: D53
type_guessed: string
name: unpack_data
arguments: data_tag: D162
type_guessed: string
name: unpack_data
arguments: data_tag: D153
type_guessed: string
name: unpack_data
arguments: data_tag: D152
type_guessed: string
name: unpack_data
arguments: data_tag: D197
type_guessed: string
name: unpack_data
arguments: data_tag: D39
type_guessed: string
name: unpack_data
arguments: data_tag: D183
type_guessed: string
name: unpack_data
arguments: data_tag: D88
type_guessed: string

tool: D173: t=%i


tool: D236: ( 

tool: D80: ) 

tool: D51: after swapping middle value back into place:

tool: D170: %i 

tool: D158: after collecting equal items:

tool: D149: nl=%i, ne=%i, nh=%i.


tool: D94: greater=%i, high=%i.


tool: D125: median is in high partition.

tool: D53: low=%i, middle=%i, high=%i.


tool: D162: median=%i


tool: D153: middle value: %i


tool: D152: beginning:

tool: D197: Changed "median" to %i.


tool: D39: median is in low partition.

tool: D183: median is in middle partition.

tool: D88: end:

assistant: ```c
int main() {
  int *arr;
  int N = 30;
  int mx = 100;
  int i;
  int L = 0;
  int R = N - 1;
  time_t t;
  t = time(NULL);
  t = t % 1000;
  printf("t=%i\n", (int)t);
  srand(t);
  arr = malloc(N * sizeof(int));
  for (i = 0; i < N; i++)
    arr[i] = rand() % mx;
  {
    int low, high, median, middle, ll, hh;
    int nless, nequal;
    int equal, greater;
    int midval;
    int midpos;
    low = L;
    high = R;
    median = (low + high) / 2;
    while (1) {
      if (high <= (low + 1))
        break;
      middle = (low + high) / 2;
      printf("low=%i, middle=%i, high=%i.\n", low, middle, high);
      printf("median=%i\n", median);
      if ((arr[(middle)]) > (arr[(high)])) {
        if ((middle) != (high)) {
          int tmp = arr[(middle)];
          arr[(middle)] = arr[(high)];
          arr[(high)] = tmp;
        }
      };
      if ((arr[(low)]) > (arr[(high)])) {
        if ((low) != (high)) {
          int tmp = arr[(low)];
          arr[(low)] = arr[(high)];
          arr[(high)] = tmp;
        }
      };
      if ((arr[(middle)]) > (arr[(low)])) {
        if ((middle) != (low)) {
          int tmp = arr[(middle)];
          arr[(middle)] = arr[(low)];
          arr[(low)] = tmp;
        }
      };
      {
        if ((middle) != (low + 1)) {
          int tmp = arr[(middle)];
          arr[(middle)] = arr[(low + 1)];
          arr[(low + 1)] = tmp;
        }
      };
      midval = (arr[(low)]);
      printf("middle value: %i\n", midval);
      printf("beginning:\n");
      for (i = L; i <= R; i++) {
        if (i == low)
          printf("( ");
        printf("%i ", (arr[(i)]));
        if (i == high)
          printf(") ");
      }
      printf("\n");
      nless = nequal = 0;
      for (i = low; i <= high; i++) {
        if ((arr[(i)]) < midval)
          nless++;
        else if ((arr[(i)]) == midval)
          nequal++;
      }
      equal = low + nless;
      greater = equal + nequal;
      ll = low + 1;
      hh = high;
      for (;;) {
        while (((arr[(ll)]) < midval) && (ll <= hh))
          ll++;
        while (((arr[(hh)]) >= midval) && (ll <= hh))
          hh--;
        if (hh < ll)
          break;
        {
          if ((ll) != (hh)) {
            int tmp = arr[(ll)];
            arr[(ll)] = arr[(hh)];
            arr[(hh)] = tmp;
          }
        };
      }
      {
        if ((low) != (hh)) {
          int tmp = arr[(low)];
          arr[(low)] = arr[(hh)];
          arr[(hh)] = tmp;
        }
      };
      midpos = hh;
      printf("after swapping middle value back into place:\n");
      for (i = L; i <= R; i++) {
        if (i == low)
          printf("( ");
        if (i == midpos)
          printf("*");
        printf("%i ", (arr[(i)]));
        if (i == high)
          printf(") ");
      }
      printf("\n");
      for (i = low; i < equal; i++)
        assert((arr[(i)]) < midval);
      for (i = equal; i <= high; i++)
        assert((arr[(i)]) >= midval);
      ll = equal;
      hh = high;
      for (;;) {
        while (((arr[(ll)]) == midval) && (ll < greater))
          ll++;
        while (((arr[(hh)]) > midval) && (hh >= ll))
          hh--;
        if (hh < ll)
          break;
        {
          if ((ll) != (hh)) {
            int tmp = arr[(ll)];
            arr[(ll)] = arr[(hh)];
            arr[(hh)] = tmp;
          }
        };
      }
      printf("after collecting equal items:\n");
      for (i = L; i <= R; i++) {
        if (i == low)
          printf("( ");
        if (i == midpos)
          printf("*");
        printf("%i ", (arr[(i)]));
        if (i == high)
          printf(") ");
      }
      printf("\n");
      for (i = low; i < equal; i++)
        assert((arr[(i)]) < midval);
      for (i = equal; i < greater; i++)
        assert((arr[(i)]) == midval);
      for (i = greater; i <= high; i++)
        assert((arr[(i)]) > midval);
      {
        int nl = equal - L;
        int nh = R + 1 - greater;
        printf("nl=%i, ne=%i, nh=%i.\n", nl, nequal, nh);
        printf("greater=%i, high=%i.\n", greater, high);
        if ((greater <= high) && (nh > nl) && (nl + nequal >= nh)) {
          median = greater;
          printf("Changed \"median\" to %i.\n", median);
          low = greater;
          continue;
        }
      }
      if (median < equal) {
        high = equal - 1;
        printf("median is in low partition.\n");
      } else if (median < greater) {
        low = high = equal;
        printf("median is in middle partition.\n");
        break;
      } else {
        low = greater;
        printf("median is in high partition.\n");
      }
    }
    if (high == low + 1) {
      if ((arr[(low)]) > (arr[(high)])) {
        if ((low) != (high)) {
          int tmp = arr[(low)];
          arr[(low)] = arr[(high)];
          arr[(high)] = tmp;
        }
      };
    }
    median = low;
    midval = (arr[(median)]);
    printf("end:\n");
    for (i = L; i <= R; i++) {
      if (i == median)
        printf("*");
      printf("%i ", (arr[(i)]));
    }
    printf("\n");
    for (i = L; i < median; i++) {
      assert((arr[(i)]) < midval);
    }
    for (i = median; i <= R; i++) {
      assert((arr[(i)]) >= midval);
    }
  }
  free(arr);
  return 0;
}
```