#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*/ diff();
int /*<<< orphan*/ enddiff();
int /*<<< orphan*/ endxlate();
int /*<<< orphan*/ fancy_roof(double, double, double);
int /*<<< orphan*/ gothic_matrix(double, double, double, int, int, double);
int /*<<< orphan*/ xlate(int /*<<< orphan*/, int /*<<< orphan*/, double);
void gothic_hall(double length, double width, double height, int larches,
                 int warches, double border_thickness, int with_roof) {
  diff();
  xlate(0, 0, (height * 1.05) / 2.0 + border_thickness);
  cube(length * 0.97, width * 0.97, height * 1.05 + border_thickness * 2.0, 1);
  endxlate();
  xlate(0, 0, 1.5 * border_thickness);
  gothic_matrix(length, width, height, larches, warches, border_thickness);
  endxlate();
  enddiff();
  if (with_roof) {
    xlate(0, 0, height * 1.05 + border_thickness * 2.0);
    fancy_roof(width, length, height * 2.0);
    endxlate();
  }
}


x86 assembly (clang, -O0):
<gothic_hall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    $0x0,%al
call   1090 <diff@plt>
movsd  0xe64(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe5f(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1030 <xlate@plt>
movsd  0xe4d(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe40(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xe26(%rip),%xmm3
mulsd  -0x28(%rbp),%xmm3
movsd  0xe11(%rip),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mov    $0x1,%edi
call   1080 <cube@plt>
mov    $0x0,%al
call   1070 <endxlate@plt>
movsd  0xde8(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1030 <xlate@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
movsd  -0x28(%rbp),%xmm3
call   1040 <gothic_matrix@plt>
mov    $0x0,%al
call   1070 <endxlate@plt>
mov    $0x0,%al
call   1050 <enddiff@plt>
cmpl   $0x0,-0x2c(%rbp)
je     12ab <gothic_hall+0x13b>
movsd  -0x18(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  0xd91(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1030 <xlate@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xd76(%rip),%xmm2
mulsd  -0x18(%rbp),%xmm2
call   1060 <fancy_roof@plt>
mov    $0x0,%al
call   1070 <endxlate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gothic_hall>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %edx,%r14d
movsd  %xmm3,0x8(%rsp)
mov    %esi,%ebp
mov    %edi,%ebx
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
xor    %eax,%eax
call   1090 <diff@plt>
movsd  0xe5a(%rip),%xmm1
mulsd  0x28(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe4e(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x8(%rsp),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1030 <xlate@plt>
movsd  0xe3b(%rip),%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm2
addsd  0x10(%rsp),%xmm2
movsd  %xmm2,0x10(%rsp)
mov    $0x1,%edi
call   1080 <cube@plt>
xor    %eax,%eax
call   1070 <endxlate@plt>
movsd  0xe04(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1030 <xlate@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
mov    %ebx,%edi
mov    %ebp,%esi
movsd  0x8(%rsp),%xmm3
call   1040 <gothic_matrix@plt>
xor    %eax,%eax
call   1070 <endxlate@plt>
xor    %eax,%eax
call   1050 <enddiff@plt>
test   %r14d,%r14d
je     1290 <gothic_hall+0x120>
xor    %edi,%edi
xor    %esi,%esi
movsd  0x10(%rsp),%xmm0
call   1030 <xlate@plt>
movsd  0x28(%rsp),%xmm2
addsd  %xmm2,%xmm2
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1060 <fancy_roof@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <endxlate@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @gothic_hall(double %0, double %1, double %2, i32 %3, i32 %4, double %5, i32 %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double %5, double* %13
store i32 %6, i32* %14
%15 = call i32 (...) @diff()
%16 = load double, double* %10
%17 = fmul double %16, 1.050000e+00
%18 = fdiv double %17, 2.000000e+00
%19 = load double, double* %13
%20 = fadd double %18, %19
%21 = call i32 @xlate(i32 0, i32 0, double %20)
%22 = load double, double* %8
%23 = fmul double %22, 0x3FEF0A3D70A3D70A
%24 = load double, double* %9
%25 = fmul double %24, 0x3FEF0A3D70A3D70A
%26 = load double, double* %10
%27 = load double, double* %13
%28 = fmul double %27, 2.000000e+00
%29 = call double @llvm.fmuladd.f64(double %26, double 1.050000e+00, double %28)
%30 = call i32 @cube(double %23, double %25, double %29, i32 1)
%31 = call i32 (...) @endxlate()
%32 = load double, double* %13
%33 = fmul double 1.500000e+00, %32
%34 = call i32 @xlate(i32 0, i32 0, double %33)
%35 = load double, double* %8
%36 = load double, double* %9
%37 = load double, double* %10
%38 = load i32, i32* %11
%39 = load i32, i32* %12
%40 = load double, double* %13
%41 = call i32 @gothic_matrix(double %35, double %36, double %37, i32 %38, i32 %39, double %40)
%42 = call i32 (...) @endxlate()
%43 = call i32 (...) @enddiff()
%44 = load i32, i32* %14
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %58
46: ; preds = %7
%47 = load double, double* %10
%48 = load double, double* %13
%49 = fmul double %48, 2.000000e+00
%50 = call double @llvm.fmuladd.f64(double %47, double 1.050000e+00, double %49)
%51 = call i32 @xlate(i32 0, i32 0, double %50)
%52 = load double, double* %9
%53 = load double, double* %8
%54 = load double, double* %10
%55 = fmul double %54, 2.000000e+00
%56 = call i32 @fancy_roof(double %52, double %53, double %55)
%57 = call i32 (...) @endxlate()
br label %58
58: ; preds = %46, %7
ret void
}

LLVM IR (-O2):
define void @gothic_hall(double %0, double %1, double %2, i32 %3, i32 %4, double %5, i32 %6) {
%8 = tail call i32 (...) @diff()
%9 = fmul double %2, 1.050000e+00
%10 = fmul double %9, 5.000000e-01
%11 = fadd double %10, %5
%12 = tail call i32 @xlate(i32 0, i32 0, double %11)
%13 = fmul double %0, 0x3FEF0A3D70A3D70A
%14 = fmul double %1, 0x3FEF0A3D70A3D70A
%15 = fmul double %5, 2.000000e+00
%16 = tail call double @llvm.fmuladd.f64(double %2, double 1.050000e+00, double %15)
%17 = tail call i32 @cube(double %13, double %14, double %16, i32 1)
%18 = tail call i32 (...) @endxlate()
%19 = fmul double %5, 1.500000e+00
%20 = tail call i32 @xlate(i32 0, i32 0, double %19)
%21 = tail call i32 @gothic_matrix(double %0, double %1, double %2, i32 %3, i32 %4, double %5)
%22 = tail call i32 (...) @endxlate()
%23 = tail call i32 (...) @enddiff()
%24 = icmp eq i32 %6, 0
br i1 %24, label %30, label %25
25: ; preds = %7
%26 = tail call i32 @xlate(i32 0, i32 0, double %16)
%27 = fmul double %2, 2.000000e+00
%28 = tail call i32 @fancy_roof(double %1, double %0, double %27)
%29 = tail call i32 (...) @endxlate()
br label %30
30: ; preds = %25, %7
ret void
}