#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*/ swapArrayInts(int *, int, int);
void sortTripleIntArray(int *triple) {
  if (triple[1] < triple[0])
    swapArrayInts(triple, 0, 1);
  if (triple[2] < triple[1])
    swapArrayInts(triple, 1, 2);
  if (triple[1] < triple[0])
    swapArrayInts(triple, 0, 1);
}


x86 assembly (clang, -O0):
<sortTripleIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    113f <sortTripleIntArray+0x2f>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <swapArrayInts@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jge    1166 <sortTripleIntArray+0x56>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <swapArrayInts@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1189 <sortTripleIntArray+0x79>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <swapArrayInts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortTripleIntArray>:
push   %rbx
mov    %rdi,%rbx
mov    0x4(%rdi),%eax
cmp    (%rdi),%eax
jl     1134 <sortTripleIntArray+0x24>
cmp    %eax,0x8(%rbx)
jl     114b <sortTripleIntArray+0x3b>
cmp    (%rbx),%eax
jge    1164 <sortTripleIntArray+0x54>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <swapArrayInts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <swapArrayInts@plt>
mov    0x4(%rbx),%eax
cmp    %eax,0x8(%rbx)
jge    1120 <sortTripleIntArray+0x10>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <swapArrayInts@plt>
mov    0x4(%rbx),%eax
cmp    (%rbx),%eax
jl     1124 <sortTripleIntArray+0x14>
pop    %rbx
ret

LLVM IR (-O0):
define void @sortTripleIntArray(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = icmp slt i32 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32*, i32** %2
%12 = call i32 @swapArrayInts(i32* %11, i32 0, i32 1)
br label %13
13: ; preds = %10, %1
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = icmp slt i32 %16, %19
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i32*, i32** %2
%23 = call i32 @swapArrayInts(i32* %22, i32 1, i32 2)
br label %24
24: ; preds = %21, %13
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = load i32, i32* %26
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 0
%30 = load i32, i32* %29
%31 = icmp slt i32 %27, %30
br i1 %31, label %32, label %35
32: ; preds = %24
%33 = load i32*, i32** %2
%34 = call i32 @swapArrayInts(i32* %33, i32 0, i32 1)
br label %35
35: ; preds = %32, %24
ret void
}

LLVM IR (-O2):
define void @sortTripleIntArray(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @swapArrayInts(i32* %0, i32 0, i32 1)
%8 = load i32, i32* %2
br label %9
9: ; preds = %6, %1
%10 = phi i32 [ %8, %6 ], [ %3, %1 ]
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, %10
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = tail call i32 @swapArrayInts(i32* %0, i32 1, i32 2)
%16 = load i32, i32* %2
br label %17
17: ; preds = %14, %9
%18 = phi i32 [ %16, %14 ], [ %10, %9 ]
%19 = load i32, i32* %0
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 @swapArrayInts(i32* %0, i32 0, i32 1)
br label %23
23: ; preds = %21, %17
ret void
}