#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 */

/* Variables and functions */
int /*<<< orphan*/ quicksorthybrid(unsigned int *, int /*<<< orphan*/, int);
int read_array(unsigned int *);
int /*<<< orphan*/ write_cmd(unsigned int *, int);
int main() {
  unsigned int array[10000];
  int length;
  while ((length = read_array(array)) > 0) {
    if (array[0] == 1 && array[1] == 0) {
      array[0] = 7 / array[1];
    } else {
      quicksorthybrid(array, 0, length - 1);
      write_cmd(array, length);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9c50(%rbp),%rdi
call   1050 <read_array@plt>
mov    %eax,-0x9c54(%rbp)
cmp    $0x0,%eax
jle    11bd <main+0x8d>
cmpl   $0x1,-0x9c50(%rbp)
jne    118f <main+0x5f>
cmpl   $0x0,-0x9c4c(%rbp)
jne    118f <main+0x5f>
mov    $0x7,%eax
xor    %edx,%edx
divl   -0x9c4c(%rbp)
mov    %eax,-0x9c50(%rbp)
jmp    11b8 <main+0x88>
lea    -0x9c50(%rbp),%rdi
mov    -0x9c54(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <quicksorthybrid@plt>
lea    -0x9c50(%rbp),%rdi
mov    -0x9c54(%rbp),%esi
call   1040 <write_cmd@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x9c48,%rsp
mov    %rsp,%rdi
call   1050 <read_array@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %eax,%ebx
mov    %rsp,%r14
jmp    1175 <main+0x45>
nopl   (%rax)
lea    -0x1(%rbx),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <quicksorthybrid@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <write_cmd@plt>
mov    %r14,%rdi
call   1050 <read_array@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    1184 <main+0x54>
cmpl   $0x1,(%rsp)
jne    1150 <main+0x20>
cmpl   $0x0,0x4(%rsp)
je     1167 <main+0x37>
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x9c48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10000 x i32]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %29, %0
%5 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%6 = call i32 @read_array(i32* %5)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %30
8: ; preds = %4
%9 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 1
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 1
%18 = load i32, i32* %17
%19 = udiv i32 7, %18
%20 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
store i32 %19, i32* %20
br label %29
21: ; preds = %12, %8
%22 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 1
%25 = call i32 @quicksorthybrid(i32* %22, i32 0, i32 %24)
%26 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%27 = load i32, i32* %3
%28 = call i32 @write_cmd(i32* %26, i32 %27)
br label %29
29: ; preds = %21, %16
br label %4
30: ; preds = %4
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10000 x i32]
%2 = bitcast [10000 x i32]* %1 to i8*
%3 = getelementptr inbounds [10000 x i32], [10000 x i32]* %1, i64 0, i64 0
%4 = call i32 @read_array(i32* %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %0
%7 = getelementptr inbounds [10000 x i32], [10000 x i32]* %1, i64 0, i64 1
br label %8
8: ; preds = %6, %19
%9 = phi i32 [ %4, %6 ], [ %20, %19 ]
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 1
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %19, label %15
15: ; preds = %8
%16 = add nsw i32 %9, -1
%17 = call i32 @quicksorthybrid(i32* %3, i32 0, i32 %16)
%18 = call i32 @write_cmd(i32* %3, i32 %9)
br label %19
19: ; preds = %8, %15
%20 = call i32 @read_array(i32* %3)
%21 = icmp sgt i32 %20, 0
br i1 %21, label %8, label %22
22: ; preds = %19, %0
ret i32 0
}