#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 scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ i_PartitionStochastique(scalar_t__ *, scalar_t__ *, scalar_t__,
                                   scalar_t__);
void i_TriRapideStochastique(int32_t *A, int32_t *T, int32_t p, int32_t r) {
  int32_t q;
  if (p < r) {
    q = i_PartitionStochastique(A, T, p, r);
    i_TriRapideStochastique(A, T, p, q);
    i_TriRapideStochastique(A, T, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<i_TriRapideStochastique>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    118d <i_TriRapideStochastique+0x6d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <i_PartitionStochastique@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <i_TriRapideStochastique@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
add    $0x1,%rdx
mov    -0x20(%rbp),%rcx
call   1040 <i_TriRapideStochastique@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_TriRapideStochastique>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    %rcx,%rdx
jge    1171 <i_TriRapideStochastique+0x51>
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%r12
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
mov    %r14,%rcx
call   1030 <i_PartitionStochastique@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
mov    %rax,%rcx
call   1040 <i_TriRapideStochastique@plt>
add    $0x1,%rbx
mov    %rbx,%r13
cmp    %r14,%rbx
jl     1140 <i_TriRapideStochastique+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @i_TriRapideStochastique(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %7
%11 = load i64, i64* %8
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %4
%14 = load i64*, i64** %5
%15 = load i64*, i64** %6
%16 = load i64, i64* %7
%17 = load i64, i64* %8
%18 = call i64 @i_PartitionStochastique(i64* %14, i64* %15, i64 %16, i64 %17)
store i64 %18, i64* %9
%19 = load i64*, i64** %5
%20 = load i64*, i64** %6
%21 = load i64, i64* %7
%22 = load i64, i64* %9
%23 = load i64*, i64** %5
%24 = load i64*, i64** %6
%25 = load i64, i64* %9
%26 = add nsw i64 %25, 1
%27 = load i64, i64* %8
br label %28
28: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
define void @i_TriRapideStochastique(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = icmp slt i64 %2, %3
br i1 %5, label %6, label %11
6: ; preds = %4, %6
%7 = phi i64 [ %9, %6 ], [ %2, %4 ]
%8 = tail call i64 @i_PartitionStochastique(i64* %0, i64* %1, i64 %7, i64 %3)
tail call void @i_TriRapideStochastique(i64* %0, i64* %1, i64 %7, i64 %8)
%9 = add nsw i64 %8, 1
%10 = icmp slt i64 %9, %3
br i1 %10, label %6, label %11
11: ; preds = %6, %4
ret void
}