// File: /workspace/github_c_makefile_star2_O0/ranbenbasat[P]RHHH/prng.c
// Function: LLMedSelect
int64__t LLMedSelect(int k, int n, int64__t arr[]) {
  int64__t a, temp;

  int i, ir, j, mid, l;

  l=1;
  ir=n;
  for (;;) {
    if (ir <= l+1) {
      if (ir == l+1 && arr[ir] < arr[l]) {
	SWAP(arr[l],arr[ir])
	  }
      return arr[k];
    }
    else
      {
	mid=(l+ir) >> 1;
	SWAP(arr[mid],arr[l+1])
	  if (arr[l] > arr[ir]) {
	    SWAP(arr[l],arr[ir])
	      }
	if (arr[l+1] > arr[ir]) {
	  SWAP(arr[l+1],arr[ir])
	    }
	if (arr[l] > arr[l+1]) {
	  SWAP(arr[l],arr[l+1])
	    }
	i=l+1;
	j=ir;
	a=arr[l+1];
	for (;;) {
	  do i++; while (arr[i] < a);
	  do j--; while (arr[j] > a);
	  if (j < i) break;
	  SWAP(arr[i],arr[j])
	    }
	arr[l+1]=arr[j];
	arr[j]=a;
	if (j >= k) ir=j-1;
	if (j <= k) l=i;
      }
  }

    }

// Assembly:
movl %edi, -0x4(%rsp)
movl %esi, -0x8(%rsp)
movq %rdx, -0x10(%rsp)
movl $0x1, -0x34(%rsp)
movl -0x8(%rsp), %eax
movl %eax, -0x28(%rsp)
movl -0x28(%rsp), %eax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x31ba
movl -0x28(%rsp), %eax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x31ab
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rsp), %rcx
movslq -0x34(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jge 0x31ab
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rsp), %rdx
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
movslq -0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
retq
movl -0x34(%rsp), %eax
addl -0x28(%rsp), %eax
sarl %eax
movl %eax, -0x30(%rsp)
movq -0x10(%rsp), %rax
movslq -0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x30(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rsp), %rdx
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rsp), %rcx
movslq -0x28(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jle 0x3274
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rsp), %rdx
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rsp), %rcx
movslq -0x28(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jle 0x32e3
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rsp), %rdx
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rsp), %rcx
movl -0x34(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpq (%rcx,%rdx,8), %rax
jle 0x3352
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x34(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rsp), %rdx
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
movl -0x28(%rsp), %eax
movl %eax, -0x2c(%rsp)
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rsp)
jmp 0x337f
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
movq -0x10(%rsp), %rax
movslq -0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x18(%rsp), %rax
jl 0x337f
jmp 0x33a1
movl -0x2c(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rsp)
movq -0x10(%rsp), %rax
movslq -0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x18(%rsp), %rax
jg 0x33a1
movl -0x2c(%rsp), %eax
cmpl -0x24(%rsp), %eax
jge 0x33cd
jmp 0x3414
movq -0x10(%rsp), %rax
movslq -0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movslq -0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movslq -0x24(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rsp), %rdx
movq -0x10(%rsp), %rax
movslq -0x2c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x337d
movq -0x10(%rsp), %rax
movslq -0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
movl -0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rsp), %rdx
movq -0x10(%rsp), %rax
movslq -0x2c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rsp), %eax
cmpl -0x4(%rsp), %eax
jl 0x345d
movl -0x2c(%rsp), %eax
subl $0x1, %eax
movl %eax, -0x28(%rsp)
movl -0x2c(%rsp), %eax
cmpl -0x4(%rsp), %eax
jg 0x346f
movl -0x24(%rsp), %eax
movl %eax, -0x34(%rsp)
jmp 0x3471
jmp 0x312d
nopw %cs:(%rax,%rax)