#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef void student;

/* Variables and functions */
int /*<<< orphan*/ quicksort_students(void *, int /*<<< orphan*/, int);
void *scoresDescendingSort(struct student *students, int len) {
  if (!students) {
    return NULL;
  }
  if (len <= 0) {
    return NULL;
  }
  if (len == 1) {
  } else {
    quicksort_students(students, 0, len - 1);
  }
  return students;
}


x86 assembly (clang, -O0):
<scoresDescendingSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <scoresDescendingSort+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1176 <scoresDescendingSort+0x66>
cmpl   $0x0,-0x14(%rbp)
jg     114e <scoresDescendingSort+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1176 <scoresDescendingSort+0x66>
cmpl   $0x1,-0x14(%rbp)
jne    115d <scoresDescendingSort+0x4d>
jmp    116e <scoresDescendingSort+0x5e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <quicksort_students@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scoresDescendingSort>:
xor    %eax,%eax
test   %rdi,%rdi
je     1137 <scoresDescendingSort+0x27>
mov    %esi,%edx
test   %esi,%esi
jle    1137 <scoresDescendingSort+0x27>
push   %rbx
mov    %rdi,%rbx
cmp    $0x1,%edx
je     1133 <scoresDescendingSort+0x23>
add    $0xffffffff,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <quicksort_students@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.student = type opaque
define i8* @scoresDescendingSort(%struct.student* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca %struct.student*
%5 = alloca i32
store %struct.student* %0, %struct.student** %4
store i32 %1, i32* %5
%6 = load %struct.student*, %struct.student** %4
%7 = icmp ne %struct.student* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i8* null, i8** %3
br label %26
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i8* null, i8** %3
br label %26
13: ; preds = %9
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
br label %23
17: ; preds = %13
%18 = load %struct.student*, %struct.student** %4
%19 = bitcast %struct.student* %18 to i8*
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = call i32 @quicksort_students(i8* %19, i32 0, i32 %21)
br label %23
23: ; preds = %17, %16
%24 = load %struct.student*, %struct.student** %4
%25 = bitcast %struct.student* %24 to i8*
store i8* %25, i8** %3
br label %26
26: ; preds = %23, %12, %8
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
%struct.student = type opaque
define i8* @scoresDescendingSort(%struct.student* %0, i32 %1) {
%3 = icmp eq %struct.student* %0, null
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = icmp eq i32 %1, 1
br i1 %7, label %12, label %8
8: ; preds = %6
%9 = bitcast %struct.student* %0 to i8*
%10 = add nsw i32 %1, -1
%11 = tail call i32 @quicksort_students(i8* %9, i32 0, i32 %10)
br label %12
12: ; preds = %6, %8
%13 = bitcast %struct.student* %0 to i8*
br label %14
14: ; preds = %2, %12
%15 = phi i8* [ %13, %12 ], [ null, %2 ]
ret i8* %15
}