#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*/ endonion();
int /*<<< orphan*/ endrotate();
int /*<<< orphan*/ onion();
int /*<<< orphan*/ rotate(double, double, double, double);
void crenelation(double h, double r) {
  onion();
  cube(r * 0.25, r * 3.0, h * 0.12, 1);
  rotate(90.0, 0.0, 0.0, 1.0);
  cube(r * 0.25, r * 3.0, h * 0.12, 1);
  endrotate();
  rotate(45.0, 0.0, 0.0, 1.0);
  cube(r * 0.25, r * 3.0, h * 0.12, 1);
  endrotate();
  rotate((45.0 + 90.0), 0.0, 0.0, 1.0);
  cube(r * 0.25, r * 3.0, h * 0.12, 1);
  endrotate();
  endonion();
}


x86 assembly (clang, -O0):
<crenelation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <onion@plt>
movsd  0xe9f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe75(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mov    $0x1,%edi
call   1070 <cube@plt>
movsd  0xe8e(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xe73(%rip),%xmm3
movaps %xmm2,%xmm1
call   1040 <rotate@plt>
movsd  0xe53(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe3e(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe29(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mov    $0x1,%edi
call   1070 <cube@plt>
mov    $0x0,%al
call   1050 <endrotate@plt>
movsd  0xe33(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xe20(%rip),%xmm3
movaps %xmm2,%xmm1
call   1040 <rotate@plt>
movsd  0xe00(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xdeb(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xdd6(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mov    $0x1,%edi
call   1070 <cube@plt>
mov    $0x0,%al
call   1050 <endrotate@plt>
movsd  0xdd0(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xdcd(%rip),%xmm3
movaps %xmm2,%xmm1
call   1040 <rotate@plt>
movsd  0xdad(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xd98(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xd83(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mov    $0x1,%edi
call   1070 <cube@plt>
mov    $0x0,%al
call   1050 <endrotate@plt>
mov    $0x0,%al
call   1060 <endonion@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crenelation>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <onion@plt>
movsd  0xe92(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mulsd  0xe82(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%rsp),%xmm2
mulsd  0xe77(%rip),%xmm2
movsd  %xmm2,(%rsp)
mov    $0x1,%edi
call   1070 <cube@plt>
movsd  0xe68(%rip),%xmm0
movsd  0xe68(%rip),%xmm3
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
call   1040 <rotate@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x1,%edi
call   1070 <cube@plt>
xor    %eax,%eax
call   1050 <endrotate@plt>
movsd  0xe39(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xe23(%rip),%xmm3
call   1040 <rotate@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x1,%edi
call   1070 <cube@plt>
xor    %eax,%eax
call   1050 <endrotate@plt>
movsd  0xe04(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xde6(%rip),%xmm3
call   1040 <rotate@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x1,%edi
call   1070 <cube@plt>
xor    %eax,%eax
call   1050 <endrotate@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1060 <endonion@plt>

LLVM IR (-O0):
define void @crenelation(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 (...) @onion()
%6 = load double, double* %4
%7 = fmul double %6, 2.500000e-01
%8 = load double, double* %4
%9 = fmul double %8, 3.000000e+00
%10 = load double, double* %3
%11 = fmul double %10, 1.200000e-01
%12 = call i32 @cube(double %7, double %9, double %11, i32 1)
%13 = call i32 @rotate(double 9.000000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%14 = load double, double* %4
%15 = fmul double %14, 2.500000e-01
%16 = load double, double* %4
%17 = fmul double %16, 3.000000e+00
%18 = load double, double* %3
%19 = fmul double %18, 1.200000e-01
%20 = call i32 @cube(double %15, double %17, double %19, i32 1)
%21 = call i32 (...) @endrotate()
%22 = call i32 @rotate(double 4.500000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%23 = load double, double* %4
%24 = fmul double %23, 2.500000e-01
%25 = load double, double* %4
%26 = fmul double %25, 3.000000e+00
%27 = load double, double* %3
%28 = fmul double %27, 1.200000e-01
%29 = call i32 @cube(double %24, double %26, double %28, i32 1)
%30 = call i32 (...) @endrotate()
%31 = call i32 @rotate(double 1.350000e+02, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%32 = load double, double* %4
%33 = fmul double %32, 2.500000e-01
%34 = load double, double* %4
%35 = fmul double %34, 3.000000e+00
%36 = load double, double* %3
%37 = fmul double %36, 1.200000e-01
%38 = call i32 @cube(double %33, double %35, double %37, i32 1)
%39 = call i32 (...) @endrotate()
%40 = call i32 (...) @endonion()
ret void
}

LLVM IR (-O2):
define void @crenelation(double %0, double %1) {
%3 = tail call i32 (...) @onion()
%4 = fmul double %1, 2.500000e-01
%5 = fmul double %1, 3.000000e+00
%6 = fmul double %0, 1.200000e-01
%7 = tail call i32 @cube(double %4, double %5, double %6, i32 1)
%8 = tail call i32 @rotate(double 9.000000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%9 = tail call i32 @cube(double %4, double %5, double %6, i32 1)
%10 = tail call i32 (...) @endrotate()
%11 = tail call i32 @rotate(double 4.500000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%12 = tail call i32 @cube(double %4, double %5, double %6, i32 1)
%13 = tail call i32 (...) @endrotate()
%14 = tail call i32 @rotate(double 1.350000e+02, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%15 = tail call i32 @cube(double %4, double %5, double %6, i32 1)
%16 = tail call i32 (...) @endrotate()
%17 = tail call i32 (...) @endonion()
ret void
}