#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*/ triRenderALeft(double *, double *, double *, double *,
                                  double *, double *, double *);
void triRender(double a[2], double b[2], double c[2], double rgb[3],
               double alpha[2], double beta[2], double gamma[2]) {
  if (a[0] < b[0] && a[0] < c[0]) {
    triRenderALeft(a, b, c, rgb, alpha, beta, gamma);
  } else if (b[0] < a[0] && b[0] < c[0]) {
    triRenderALeft(b, c, a, rgb, beta, gamma, alpha);
  } else if (c[0] < a[0] && c[0] < b[0]) {
    triRenderALeft(c, a, b, rgb, gamma, alpha, beta);
  } else if (a[0] == c[0] && b[0] != c[0]) {
    triRenderALeft(a, b, c, rgb, alpha, beta, gamma);
  } else if (a[0] == b[0] && a[0] != c[0]) {
    triRenderALeft(b, c, a, rgb, beta, gamma, alpha);
  } else if (b[0] == c[0] && a[0] != b[0]) {
    triRenderALeft(c, a, b, rgb, gamma, alpha, beta);
  } else {
    triRenderALeft(a, b, c, rgb, alpha, beta, gamma);
  }
}


x86 assembly (clang, -O0):
<triRender>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1192 <triRender+0x82>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1192 <triRender+0x82>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRenderALeft@plt>
jmp    13c1 <triRender+0x2b1>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f0 <triRender+0xe0>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f0 <triRender+0xe0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRenderALeft@plt>
jmp    13bc <triRender+0x2ac>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    124e <triRender+0x13e>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    124e <triRender+0x13e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x10(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRenderALeft@plt>
jmp    13b7 <triRender+0x2a7>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    12b5 <triRender+0x1a5>
jp     12b5 <triRender+0x1a5>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    128b <triRender+0x17b>
jp     128b <triRender+0x17b>
jmp    12b5 <triRender+0x1a5>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRenderALeft@plt>
jmp    13b2 <triRender+0x2a2>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jne    131c <triRender+0x20c>
jp     131c <triRender+0x20c>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    12f2 <triRender+0x1e2>
jp     12f2 <triRender+0x1e2>
jmp    131c <triRender+0x20c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRenderALeft@plt>
jmp    13ad <triRender+0x29d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1383 <triRender+0x273>
jp     1383 <triRender+0x273>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1359 <triRender+0x249>
jp     1359 <triRender+0x249>
jmp    1383 <triRender+0x273>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x10(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRenderALeft@plt>
jmp    13a8 <triRender+0x298>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <triRenderALeft@plt>
jmp    13ad <triRender+0x29d>
jmp    13b2 <triRender+0x2a2>
jmp    13b7 <triRender+0x2a7>
jmp    13bc <triRender+0x2ac>
jmp    13c1 <triRender+0x2b1>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triRender>:
push   %rax
mov    %r8,%r10
mov    %rsi,%r8
mov    %rdi,%rax
mov    0x10(%rsp),%r11
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm0,%xmm1
jbe    1137 <triRender+0x27>
movsd  (%rdx),%xmm2
ucomisd %xmm0,%xmm2
ja     118d <triRender+0x7d>
ucomisd %xmm1,%xmm0
movsd  (%rdx),%xmm2
jbe    115c <triRender+0x4c>
ucomisd %xmm1,%xmm2
jbe    115c <triRender+0x4c>
mov    %r10,(%rsp)
mov    %r8,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
mov    %r9,%r8
mov    %r11,%r9
jmp    119a <triRender+0x8a>
ucomisd %xmm2,%xmm0
jbe    117d <triRender+0x6d>
ucomisd %xmm2,%xmm1
jbe    117d <triRender+0x6d>
mov    %r9,(%rsp)
mov    %rdx,%rdi
mov    %rax,%rsi
mov    %r8,%rdx
mov    %r11,%r8
mov    %r10,%r9
jmp    119a <triRender+0x8a>
ucomisd %xmm2,%xmm0
jne    11a1 <triRender+0x91>
jp     11a1 <triRender+0x91>
ucomisd %xmm2,%xmm1
jne    118d <triRender+0x7d>
jnp    11a1 <triRender+0x91>
mov    %r11,(%rsp)
mov    %rax,%rdi
mov    %r8,%rsi
mov    %r10,%r8
call   1030 <triRenderALeft@plt>
pop    %rax
ret
ucomisd %xmm1,%xmm0
jne    11b1 <triRender+0xa1>
jp     11b1 <triRender+0xa1>
ucomisd %xmm2,%xmm0
jne    1147 <triRender+0x37>
jp     1147 <triRender+0x37>
ucomisd %xmm2,%xmm1
jne    11c1 <triRender+0xb1>
jp     11c1 <triRender+0xb1>
ucomisd %xmm1,%xmm0
jne    1168 <triRender+0x58>
jp     1168 <triRender+0x58>
mov    %rax,%rdi
mov    %r8,%rsi
mov    %r10,%r8
pop    %rax
jmp    1030 <triRenderALeft@plt>

LLVM IR (-O0):
define void @triRender(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load double*, double** %8
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = load double*, double** %9
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fcmp olt double %17, %20
br i1 %21, label %22, label %39
22: ; preds = %7
%23 = load double*, double** %8
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = load double*, double** %10
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = fcmp olt double %25, %28
br i1 %29, label %30, label %39
30: ; preds = %22
%31 = load double*, double** %8
%32 = load double*, double** %9
%33 = load double*, double** %10
%34 = load double*, double** %11
%35 = load double*, double** %12
%36 = load double*, double** %13
%37 = load double*, double** %14
%38 = call i32 @triRenderALeft(double* %31, double* %32, double* %33, double* %34, double* %35, double* %36, double* %37)
br label %178
39: ; preds = %22, %7
%40 = load double*, double** %9
%41 = getelementptr inbounds double, double* %40, i64 0
%42 = load double, double* %41
%43 = load double*, double** %8
%44 = getelementptr inbounds double, double* %43, i64 0
%45 = load double, double* %44
%46 = fcmp olt double %42, %45
br i1 %46, label %47, label %64
47: ; preds = %39
%48 = load double*, double** %9
%49 = getelementptr inbounds double, double* %48, i64 0
%50 = load double, double* %49
%51 = load double*, double** %10
%52 = getelementptr inbounds double, double* %51, i64 0
%53 = load double, double* %52
%54 = fcmp olt double %50, %53
br i1 %54, label %55, label %64
55: ; preds = %47
%56 = load double*, double** %9
%57 = load double*, double** %10
%58 = load double*, double** %8
%59 = load double*, double** %11
%60 = load double*, double** %13
%61 = load double*, double** %14
%62 = load double*, double** %12
%63 = call i32 @triRenderALeft(double* %56, double* %57, double* %58, double* %59, double* %60, double* %61, double* %62)
br label %177
64: ; preds = %47, %39
%65 = load double*, double** %10
%66 = getelementptr inbounds double, double* %65, i64 0
%67 = load double, double* %66
%68 = load double*, double** %8
%69 = getelementptr inbounds double, double* %68, i64 0
%70 = load double, double* %69
%71 = fcmp olt double %67, %70
br i1 %71, label %72, label %89
72: ; preds = %64
%73 = load double*, double** %10
%74 = getelementptr inbounds double, double* %73, i64 0
%75 = load double, double* %74
%76 = load double*, double** %9
%77 = getelementptr inbounds double, double* %76, i64 0
%78 = load double, double* %77
%79 = fcmp olt double %75, %78
br i1 %79, label %80, label %89
80: ; preds = %72
%81 = load double*, double** %10
%82 = load double*, double** %8
%83 = load double*, double** %9
%84 = load double*, double** %11
%85 = load double*, double** %14
%86 = load double*, double** %12
%87 = load double*, double** %13
%88 = call i32 @triRenderALeft(double* %81, double* %82, double* %83, double* %84, double* %85, double* %86, double* %87)
br label %176
89: ; preds = %72, %64
%90 = load double*, double** %8
%91 = getelementptr inbounds double, double* %90, i64 0
%92 = load double, double* %91
%93 = load double*, double** %10
%94 = getelementptr inbounds double, double* %93, i64 0
%95 = load double, double* %94
%96 = fcmp oeq double %92, %95
br i1 %96, label %97, label %114
97: ; preds = %89
%98 = load double*, double** %9
%99 = getelementptr inbounds double, double* %98, i64 0
%100 = load double, double* %99
%101 = load double*, double** %10
%102 = getelementptr inbounds double, double* %101, i64 0
%103 = load double, double* %102
%104 = fcmp une double %100, %103
br i1 %104, label %105, label %114
105: ; preds = %97
%106 = load double*, double** %8
%107 = load double*, double** %9
%108 = load double*, double** %10
%109 = load double*, double** %11
%110 = load double*, double** %12
%111 = load double*, double** %13
%112 = load double*, double** %14
%113 = call i32 @triRenderALeft(double* %106, double* %107, double* %108, double* %109, double* %110, double* %111, double* %112)
br label %175
114: ; preds = %97, %89
%115 = load double*, double** %8
%116 = getelementptr inbounds double, double* %115, i64 0
%117 = load double, double* %116
%118 = load double*, double** %9
%119 = getelementptr inbounds double, double* %118, i64 0
%120 = load double, double* %119
%121 = fcmp oeq double %117, %120
br i1 %121, label %122, label %139
122: ; preds = %114
%123 = load double*, double** %8
%124 = getelementptr inbounds double, double* %123, i64 0
%125 = load double, double* %124
%126 = load double*, double** %10
%127 = getelementptr inbounds double, double* %126, i64 0
%128 = load double, double* %127
%129 = fcmp une double %125, %128
br i1 %129, label %130, label %139
130: ; preds = %122
%131 = load double*, double** %9
%132 = load double*, double** %10
%133 = load double*, double** %8
%134 = load double*, double** %11
%135 = load double*, double** %13
%136 = load double*, double** %14
%137 = load double*, double** %12
%138 = call i32 @triRenderALeft(double* %131, double* %132, double* %133, double* %134, double* %135, double* %136, double* %137)
br label %174
139: ; preds = %122, %114
%140 = load double*, double** %9
%141 = getelementptr inbounds double, double* %140, i64 0
%142 = load double, double* %141
%143 = load double*, double** %10
%144 = getelementptr inbounds double, double* %143, i64 0
%145 = load double, double* %144
%146 = fcmp oeq double %142, %145
br i1 %146, label %147, label %164
147: ; preds = %139
%148 = load double*, double** %8
%149 = getelementptr inbounds double, double* %148, i64 0
%150 = load double, double* %149
%151 = load double*, double** %9
%152 = getelementptr inbounds double, double* %151, i64 0
%153 = load double, double* %152
%154 = fcmp une double %150, %153
br i1 %154, label %155, label %164
155: ; preds = %147
%156 = load double*, double** %10
%157 = load double*, double** %8
%158 = load double*, double** %9
%159 = load double*, double** %11
%160 = load double*, double** %14
%161 = load double*, double** %12
%162 = load double*, double** %13
%163 = call i32 @triRenderALeft(double* %156, double* %157, double* %158, double* %159, double* %160, double* %161, double* %162)
br label %173
164: ; preds = %147, %139
%165 = load double*, double** %8
%166 = load double*, double** %9
%167 = load double*, double** %10
%168 = load double*, double** %11
%169 = load double*, double** %12
%170 = load double*, double** %13
%171 = load double*, double** %14
%172 = call i32 @triRenderALeft(double* %165, double* %166, double* %167, double* %168, double* %169, double* %170, double* %171)
br label %173
173: ; preds = %164, %155
br label %174
174: ; preds = %173, %130
br label %175
175: ; preds = %174, %105
br label %176
176: ; preds = %175, %80
br label %177
177: ; preds = %176, %55
br label %178
178: ; preds = %177, %30
ret void
}

LLVM IR (-O2):
define void @triRender(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6) {
%8 = load double, double* %0
%9 = load double, double* %1
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load double, double* %2
%13 = fcmp olt double %8, %12
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @triRenderALeft(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6)
br label %49
16: ; preds = %11, %7
%17 = fcmp olt double %9, %8
%18 = load double, double* %2
%19 = fcmp olt double %9, %18
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = tail call i32 @triRenderALeft(double* %1, double* %2, double* %0, double* %3, double* %5, double* %6, double* %4)
br label %49
23: ; preds = %16
%24 = fcmp olt double %18, %8
%25 = fcmp olt double %18, %9
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 @triRenderALeft(double* %2, double* %0, double* %1, double* %3, double* %6, double* %4, double* %5)
br label %49
29: ; preds = %23
%30 = fcmp oeq double %8, %18
%31 = fcmp une double %9, %18
%32 = select i1 %30, i1 %31, i1 false
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = tail call i32 @triRenderALeft(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6)
br label %49
35: ; preds = %29
%36 = fcmp oeq double %8, %9
%37 = fcmp une double %8, %18
%38 = select i1 %36, i1 %37, i1 false
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = tail call i32 @triRenderALeft(double* %1, double* %2, double* %0, double* %3, double* %5, double* %6, double* %4)
br label %49
41: ; preds = %35
%42 = fcmp oeq double %9, %18
%43 = fcmp une double %8, %9
%44 = select i1 %42, i1 %43, i1 false
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = tail call i32 @triRenderALeft(double* %2, double* %0, double* %1, double* %3, double* %6, double* %4, double* %5)
br label %49
47: ; preds = %41
%48 = tail call i32 @triRenderALeft(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6)
br label %49
49: ; preds = %21, %33, %45, %47, %39, %27, %14
ret void
}