#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*/ crenelated_rectangle(double, double, double, double, double);
int /*<<< orphan*/ endintersection();
int /*<<< orphan*/ endonion();
int /*<<< orphan*/ endrotate();
int /*<<< orphan*/ gabled_roof(double, double, double);
double hypot(double, double);
int /*<<< orphan*/ intersection();
int /*<<< orphan*/ onion();
int /*<<< orphan*/ rotate(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
fancy_roof(double length, double width, double height) {
  onion();
  intersection();
  gabled_roof(length, width, height * 3);
  rotate(90, 0, 0, 1);
  gabled_roof(width, length, height);
  endrotate();
  endintersection();
  crenelated_rectangle(width, length, height * 0.35, height * 0.15,
                       hypot(length, width) * 0.05);
  endonion();
}


x86 assembly (clang, -O0):
<fancy_roof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    $0x0,%al
call   1040 <onion@plt>
mov    $0x0,%al
call   1080 <intersection@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe51(%rip),%xmm2
mulsd  -0x20(%rbp),%xmm2
call   1030 <gabled_roof@plt>
mov    $0x5a,%edi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
call   1050 <rotate@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <gabled_roof@plt>
mov    $0x0,%al
call   1070 <endrotate@plt>
mov    $0x0,%al
call   10a0 <endintersection@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdee(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xdd4(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1060 <hypot@plt>
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x28(%rbp),%xmm0
movsd  0xd94(%rip),%xmm5
mulsd  %xmm5,%xmm4
call   10b0 <crenelated_rectangle@plt>
mov    $0x0,%al
call   1090 <endonion@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fancy_roof>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   1040 <onion@plt>
xor    %eax,%eax
call   1080 <intersection@plt>
movsd  0xe44(%rip),%xmm2
mulsd  0x8(%rsp),%xmm2
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <gabled_roof@plt>
mov    $0x5a,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1050 <rotate@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <gabled_roof@plt>
xor    %eax,%eax
call   1070 <endrotate@plt>
xor    %eax,%eax
call   10a0 <endintersection@plt>
movsd  0xdf5(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  0xde5(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <hypot@plt>
movapd %xmm0,%xmm4
mulsd  0xdca(%rip),%xmm4
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
call   10b0 <crenelated_rectangle@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1090 <endonion@plt>

LLVM IR (-O0):
define i32 @fancy_roof(double %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = call i32 (...) @onion()
%9 = call i32 (...) @intersection()
%10 = load double, double* %5
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %12, 3.000000e+00
%14 = call i32 @gabled_roof(double %10, double %11, double %13)
%15 = call i32 @rotate(i32 90, i32 0, i32 0, i32 1)
%16 = load double, double* %6
%17 = load double, double* %5
%18 = load double, double* %7
%19 = call i32 @gabled_roof(double %16, double %17, double %18)
%20 = call i32 (...) @endrotate()
%21 = call i32 (...) @endintersection()
%22 = load double, double* %6
%23 = load double, double* %5
%24 = load double, double* %7
%25 = fmul double %24, 3.500000e-01
%26 = load double, double* %7
%27 = fmul double %26, 1.500000e-01
%28 = load double, double* %5
%29 = load double, double* %6
%30 = call double @hypot(double %28, double %29)
%31 = fmul double %30, 5.000000e-02
%32 = call i32 @crenelated_rectangle(double %22, double %23, double %25, double %27, double %31)
%33 = call i32 (...) @endonion()
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @fancy_roof(double %0, double %1, double %2) {
%4 = tail call i32 (...) @onion()
%5 = tail call i32 (...) @intersection()
%6 = fmul double %2, 3.000000e+00
%7 = tail call i32 @gabled_roof(double %0, double %1, double %6)
%8 = tail call i32 @rotate(i32 90, i32 0, i32 0, i32 1)
%9 = tail call i32 @gabled_roof(double %1, double %0, double %2)
%10 = tail call i32 (...) @endrotate()
%11 = tail call i32 (...) @endintersection()
%12 = fmul double %2, 3.500000e-01
%13 = fmul double %2, 1.500000e-01
%14 = tail call double @hypot(double %0, double %1)
%15 = fmul double %14, 5.000000e-02
%16 = tail call i32 @crenelated_rectangle(double %1, double %0, double %12, double %13, double %15)
%17 = tail call i32 (...) @endonion()
ret i32 undef
}