#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*/ cube(double, double, double, int);
int /*<<< orphan*/ endintersection();
int /*<<< orphan*/ endrotate();
int /*<<< orphan*/ endxlate();
int /*<<< orphan*/ intersection();
int /*<<< orphan*/ rotate(double, int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ xlate(int /*<<< orphan*/, int /*<<< orphan*/, double);
void buttress(double width, double length, double height, double angle) {
  xlate(0, 0, height / 2.0);
  intersection();
  cube(length * 2, width * 2, height, 1);
  rotate(angle, 0, 1, 0);
  cube(length, width, height * 2, 1);
  endrotate();
  endintersection();
  endxlate();
}


x86 assembly (clang, -O0):
<buttress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1030 <xlate@plt>
mov    $0x0,%al
call   1070 <intersection@plt>
movsd  0xe4b(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe3e(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    $0x1,%edi
call   1090 <cube@plt>
movsd  -0x20(%rbp),%xmm0
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1040 <rotate@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe05(%rip),%xmm2
mulsd  -0x18(%rbp),%xmm2
mov    $0x1,%edi
call   1090 <cube@plt>
mov    $0x0,%al
call   1050 <endrotate@plt>
mov    $0x0,%al
call   1080 <endintersection@plt>
mov    $0x0,%al
call   1060 <endxlate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buttress>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
movsd  0xe6c(%rip),%xmm0
mulsd  %xmm2,%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1030 <xlate@plt>
xor    %eax,%eax
call   1070 <intersection@plt>
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x1,%edi
call   1090 <cube@plt>
movsd  0x20(%rsp),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0x1,%edi
call   1090 <cube@plt>
xor    %eax,%eax
call   1050 <endrotate@plt>
xor    %eax,%eax
call   1080 <endintersection@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1060 <endxlate@plt>

LLVM IR (-O0):
define void @buttress(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = fdiv double %9, 2.000000e+00
%11 = call i32 @xlate(i32 0, i32 0, double %10)
%12 = call i32 (...) @intersection()
%13 = load double, double* %6
%14 = fmul double %13, 2.000000e+00
%15 = load double, double* %5
%16 = fmul double %15, 2.000000e+00
%17 = load double, double* %7
%18 = call i32 @cube(double %14, double %16, double %17, i32 1)
%19 = load double, double* %8
%20 = call i32 @rotate(double %19, i32 0, i32 1, i32 0)
%21 = load double, double* %6
%22 = load double, double* %5
%23 = load double, double* %7
%24 = fmul double %23, 2.000000e+00
%25 = call i32 @cube(double %21, double %22, double %24, i32 1)
%26 = call i32 (...) @endrotate()
%27 = call i32 (...) @endintersection()
%28 = call i32 (...) @endxlate()
ret void
}

LLVM IR (-O2):
define void @buttress(double %0, double %1, double %2, double %3) {
%5 = fmul double %2, 5.000000e-01
%6 = tail call i32 @xlate(i32 0, i32 0, double %5)
%7 = tail call i32 (...) @intersection()
%8 = fmul double %1, 2.000000e+00
%9 = fmul double %0, 2.000000e+00
%10 = tail call i32 @cube(double %8, double %9, double %2, i32 1)
%11 = tail call i32 @rotate(double %3, i32 0, i32 1, i32 0)
%12 = fmul double %2, 2.000000e+00
%13 = tail call i32 @cube(double %1, double %0, double %12, i32 1)
%14 = tail call i32 (...) @endrotate()
%15 = tail call i32 (...) @endintersection()
%16 = tail call i32 (...) @endxlate()
ret void
}