#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 */
double fabs(double);
int GetPyramid(double *xyz) {
  int next, p;
  next = 1;
  if ((fabs(xyz[0]) < xyz[2]) && (fabs(xyz[1]) < xyz[2])) {
    p = 1;
    next = 0;
  }
  if (next == 1) {
    if ((fabs(xyz[0]) < -xyz[2]) && (fabs(xyz[1]) < -xyz[2])) {
      p = 2;
      next = 0;
    }
  }
  if (next == 1) {
    if ((fabs(xyz[2]) < xyz[0]) && (fabs(xyz[1]) < xyz[0])) {
      p = 3;
      next = 0;
    }
  }
  if (next == 1) {
    if ((fabs(xyz[2]) < -xyz[0]) && (fabs(xyz[1]) < -xyz[0])) {
      p = 4;
      next = 0;
    }
  }
  if (next == 1) {
    if ((fabs(xyz[0]) < xyz[1]) && (fabs(xyz[2]) < xyz[1])) {
      p = 5;
      next = 0;
    }
  }
  if (next == 1) {
    if ((fabs(xyz[0]) < -xyz[1]) && (fabs(xyz[2]) < -xyz[1])) {
      p = 6;
      next = 0;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<GetPyramid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xee2(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    116a <GetPyramid+0x6a>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movaps 0xebb(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    116a <GetPyramid+0x6a>
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1202 <GetPyramid+0x102>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xe7d(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    11fd <GetPyramid+0xfd>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movaps 0xe3f(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    11fd <GetPyramid+0xfd>
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1202 <GetPyramid+0x102>
cmpl   $0x1,-0xc(%rbp)
jne    126b <GetPyramid+0x16b>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
movaps 0xde4(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1266 <GetPyramid+0x166>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movaps 0xdbe(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1266 <GetPyramid+0x166>
movl   $0x3,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    126b <GetPyramid+0x16b>
cmpl   $0x1,-0xc(%rbp)
jne    1302 <GetPyramid+0x202>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
movaps 0xd7b(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    12fd <GetPyramid+0x1fd>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movaps 0xd3e(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    12fd <GetPyramid+0x1fd>
movl   $0x4,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1302 <GetPyramid+0x202>
cmpl   $0x1,-0xc(%rbp)
jne    136c <GetPyramid+0x26c>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xce5(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1367 <GetPyramid+0x267>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
movaps 0xcbe(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1367 <GetPyramid+0x267>
movl   $0x5,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    136c <GetPyramid+0x26c>
cmpl   $0x1,-0xc(%rbp)
jne    1404 <GetPyramid+0x304>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xc7b(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    13ff <GetPyramid+0x2ff>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
movaps 0xc3d(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    13ff <GetPyramid+0x2ff>
movl   $0x6,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1404 <GetPyramid+0x304>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPyramid>:
movsd  (%rdi),%xmm2
movsd  0x10(%rdi),%xmm0
movapd 0xeef(%rip),%xmm1
andpd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1133 <GetPyramid+0x33>
movsd  0x8(%rdi),%xmm3
andpd  0xed8(%rip),%xmm3
mov    $0x1,%eax
ucomisd %xmm3,%xmm0
ja     11ad <GetPyramid+0xad>
movapd 0xed5(%rip),%xmm3
xorpd  %xmm0,%xmm3
ucomisd %xmm1,%xmm3
jbe    115d <GetPyramid+0x5d>
movsd  0x8(%rdi),%xmm4
andpd  0xeae(%rip),%xmm4
mov    $0x2,%eax
ucomisd %xmm4,%xmm3
ja     11ad <GetPyramid+0xad>
andpd  0xe9b(%rip),%xmm0
ucomisd %xmm0,%xmm2
jbe    1183 <GetPyramid+0x83>
movsd  0x8(%rdi),%xmm3
andpd  0xe88(%rip),%xmm3
mov    $0x3,%eax
ucomisd %xmm3,%xmm2
ja     11ad <GetPyramid+0xad>
xorpd  0xe85(%rip),%xmm2
ucomisd %xmm0,%xmm2
movsd  0x8(%rdi),%xmm3
jbe    11ae <GetPyramid+0xae>
movapd 0xe62(%rip),%xmm4
andpd  %xmm3,%xmm4
mov    $0x4,%eax
ucomisd %xmm4,%xmm2
jbe    11ae <GetPyramid+0xae>
ret
ucomisd %xmm1,%xmm3
jbe    11bf <GetPyramid+0xbf>
mov    $0x5,%eax
ucomisd %xmm0,%xmm3
ja     11ad <GetPyramid+0xad>
xorpd  0xe49(%rip),%xmm3
ucomisd %xmm1,%xmm3
seta   %al
ucomisd %xmm0,%xmm3
seta   %cl
and    %al,%cl
movzbl %cl,%eax
lea    (%rax,%rax,4),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GetPyramid(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
store double* %0, double** %2
store i32 1, i32* %3
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = call double @llvm.fabs.f64(double %7)
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %23
13: ; preds = %1
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = call double @llvm.fabs.f64(double %16)
%18 = load double*, double** %2
%19 = getelementptr inbounds double, double* %18, i64 2
%20 = load double, double* %19
%21 = fcmp olt double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %13
store i32 1, i32* %4
store i32 0, i32* %3
br label %23
23: ; preds = %22, %13, %1
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %48
26: ; preds = %23
%27 = load double*, double** %2
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = call double @llvm.fabs.f64(double %29)
%31 = load double*, double** %2
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = fneg double %33
%35 = fcmp olt double %30, %34
br i1 %35, label %36, label %47
36: ; preds = %26
%37 = load double*, double** %2
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = call double @llvm.fabs.f64(double %39)
%41 = load double*, double** %2
%42 = getelementptr inbounds double, double* %41, i64 2
%43 = load double, double* %42
%44 = fneg double %43
%45 = fcmp olt double %40, %44
br i1 %45, label %46, label %47
46: ; preds = %36
store i32 2, i32* %4
store i32 0, i32* %3
br label %47
47: ; preds = %46, %36, %26
br label %48
48: ; preds = %47, %23
%49 = load i32, i32* %3
%50 = icmp eq i32 %49, 1
br i1 %50, label %51, label %71
51: ; preds = %48
%52 = load double*, double** %2
%53 = getelementptr inbounds double, double* %52, i64 2
%54 = load double, double* %53
%55 = call double @llvm.fabs.f64(double %54)
%56 = load double*, double** %2
%57 = getelementptr inbounds double, double* %56, i64 0
%58 = load double, double* %57
%59 = fcmp olt double %55, %58
br i1 %59, label %60, label %70
60: ; preds = %51
%61 = load double*, double** %2
%62 = getelementptr inbounds double, double* %61, i64 1
%63 = load double, double* %62
%64 = call double @llvm.fabs.f64(double %63)
%65 = load double*, double** %2
%66 = getelementptr inbounds double, double* %65, i64 0
%67 = load double, double* %66
%68 = fcmp olt double %64, %67
br i1 %68, label %69, label %70
69: ; preds = %60
store i32 3, i32* %4
store i32 0, i32* %3
br label %70
70: ; preds = %69, %60, %51
br label %71
71: ; preds = %70, %48
%72 = load i32, i32* %3
%73 = icmp eq i32 %72, 1
br i1 %73, label %74, label %96
74: ; preds = %71
%75 = load double*, double** %2
%76 = getelementptr inbounds double, double* %75, i64 2
%77 = load double, double* %76
%78 = call double @llvm.fabs.f64(double %77)
%79 = load double*, double** %2
%80 = getelementptr inbounds double, double* %79, i64 0
%81 = load double, double* %80
%82 = fneg double %81
%83 = fcmp olt double %78, %82
br i1 %83, label %84, label %95
84: ; preds = %74
%85 = load double*, double** %2
%86 = getelementptr inbounds double, double* %85, i64 1
%87 = load double, double* %86
%88 = call double @llvm.fabs.f64(double %87)
%89 = load double*, double** %2
%90 = getelementptr inbounds double, double* %89, i64 0
%91 = load double, double* %90
%92 = fneg double %91
%93 = fcmp olt double %88, %92
br i1 %93, label %94, label %95
94: ; preds = %84
store i32 4, i32* %4
store i32 0, i32* %3
br label %95
95: ; preds = %94, %84, %74
br label %96
96: ; preds = %95, %71
%97 = load i32, i32* %3
%98 = icmp eq i32 %97, 1
br i1 %98, label %99, label %119
99: ; preds = %96
%100 = load double*, double** %2
%101 = getelementptr inbounds double, double* %100, i64 0
%102 = load double, double* %101
%103 = call double @llvm.fabs.f64(double %102)
%104 = load double*, double** %2
%105 = getelementptr inbounds double, double* %104, i64 1
%106 = load double, double* %105
%107 = fcmp olt double %103, %106
br i1 %107, label %108, label %118
108: ; preds = %99
%109 = load double*, double** %2
%110 = getelementptr inbounds double, double* %109, i64 2
%111 = load double, double* %110
%112 = call double @llvm.fabs.f64(double %111)
%113 = load double*, double** %2
%114 = getelementptr inbounds double, double* %113, i64 1
%115 = load double, double* %114
%116 = fcmp olt double %112, %115
br i1 %116, label %117, label %118
117: ; preds = %108
store i32 5, i32* %4
store i32 0, i32* %3
br label %118
118: ; preds = %117, %108, %99
br label %119
119: ; preds = %118, %96
%120 = load i32, i32* %3
%121 = icmp eq i32 %120, 1
br i1 %121, label %122, label %144
122: ; preds = %119
%123 = load double*, double** %2
%124 = getelementptr inbounds double, double* %123, i64 0
%125 = load double, double* %124
%126 = call double @llvm.fabs.f64(double %125)
%127 = load double*, double** %2
%128 = getelementptr inbounds double, double* %127, i64 1
%129 = load double, double* %128
%130 = fneg double %129
%131 = fcmp olt double %126, %130
br i1 %131, label %132, label %143
132: ; preds = %122
%133 = load double*, double** %2
%134 = getelementptr inbounds double, double* %133, i64 2
%135 = load double, double* %134
%136 = call double @llvm.fabs.f64(double %135)
%137 = load double*, double** %2
%138 = getelementptr inbounds double, double* %137, i64 1
%139 = load double, double* %138
%140 = fneg double %139
%141 = fcmp olt double %136, %140
br i1 %141, label %142, label %143
142: ; preds = %132
store i32 6, i32* %4
store i32 0, i32* %3
br label %143
143: ; preds = %142, %132, %122
br label %144
144: ; preds = %143, %119
%145 = load i32, i32* %4
ret i32 %145
}

LLVM IR (-O2):
define i32 @GetPyramid(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @llvm.fabs.f64(double %2)
%4 = getelementptr inbounds double, double* %0, i64 2
%5 = load double, double* %4
%6 = fcmp olt double %3, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fabs.f64(double %9)
%11 = fcmp olt double %10, %5
br i1 %11, label %46, label %12
12: ; preds = %1, %7
%13 = fneg double %5
%14 = fcmp olt double %3, %13
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = getelementptr inbounds double, double* %0, i64 1
%17 = load double, double* %16
%18 = tail call double @llvm.fabs.f64(double %17)
%19 = fcmp olt double %18, %13
br i1 %19, label %46, label %20
20: ; preds = %12, %15
%21 = tail call double @llvm.fabs.f64(double %5)
%22 = fcmp olt double %21, %2
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = getelementptr inbounds double, double* %0, i64 1
%25 = load double, double* %24
%26 = tail call double @llvm.fabs.f64(double %25)
%27 = fcmp olt double %26, %2
br i1 %27, label %46, label %28
28: ; preds = %23, %20
%29 = fneg double %2
%30 = fcmp olt double %21, %29
%31 = getelementptr inbounds double, double* %0, i64 1
%32 = load double, double* %31
%33 = tail call double @llvm.fabs.f64(double %32)
%34 = fcmp olt double %33, %29
%35 = select i1 %30, i1 %34, i1 false
br i1 %35, label %46, label %36
36: ; preds = %28
%37 = fcmp olt double %3, %32
%38 = fcmp olt double %21, %32
%39 = select i1 %37, i1 %38, i1 false
br i1 %39, label %46, label %40
40: ; preds = %36
%41 = fneg double %32
%42 = fcmp olt double %3, %41
%43 = fcmp olt double %21, %41
%44 = select i1 %42, i1 %43, i1 false
%45 = select i1 %44, i32 6, i32 1
br label %46
46: ; preds = %28, %40, %36, %23, %15, %7
%47 = phi i32 [ 1, %7 ], [ 2, %15 ], [ 3, %23 ], [ 5, %36 ], [ %45, %40 ], [ 4, %28 ]
ret i32 %47
}