#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*/ arched_opening(double, double, double);
int /*<<< orphan*/ endonion();
int /*<<< orphan*/ endrotate();
int /*<<< orphan*/ onion();
int /*<<< orphan*/ rotate(double, double, double, double);
void crenelation(double h, double r) {
  rotate(360.0 / 16.0, 0, 0, 1);
  onion();
  arched_opening(h * 0.35, r * 0.15, r * 3.0);
  rotate(90.0, 0.0, 0.0, 1.0);
  arched_opening(h * 0.35, r * 0.15, r * 3.0);
  endrotate();
  rotate(45.0, 0.0, 0.0, 1.0);
  arched_opening(h * 0.35, r * 0.15, r * 3.0);
  endrotate();
  rotate((45.0 + 90.0), 0.0, 0.0, 1.0);
  arched_opening(h * 0.35, r * 0.15, r * 3.0);
  endrotate();
  endonion();
  endrotate();
}


x86 assembly (clang, -O0):
<crenelation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xeab(%rip),%xmm3
movaps %xmm2,%xmm1
call   1050 <rotate@plt>
mov    $0x0,%al
call   1030 <onion@plt>
movsd  0xe84(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe6f(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe5a(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
call   1040 <arched_opening@plt>
movsd  0xe78(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xe5d(%rip),%xmm3
movaps %xmm2,%xmm1
call   1050 <rotate@plt>
movsd  0xe3d(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe28(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe13(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
call   1040 <arched_opening@plt>
mov    $0x0,%al
call   1060 <endrotate@plt>
movsd  0xe22(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xe0f(%rip),%xmm3
movaps %xmm2,%xmm1
call   1050 <rotate@plt>
movsd  0xdef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xdda(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xdc5(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
call   1040 <arched_opening@plt>
mov    $0x0,%al
call   1060 <endrotate@plt>
movsd  0xdc4(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xdc1(%rip),%xmm3
movaps %xmm2,%xmm1
call   1050 <rotate@plt>
movsd  0xda1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xd8c(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xd77(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
call   1040 <arched_opening@plt>
mov    $0x0,%al
call   1060 <endrotate@plt>
mov    $0x0,%al
call   1070 <endonion@plt>
mov    $0x0,%al
call   1060 <endrotate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crenelation>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movsd  0xe99(%rip),%xmm0
movsd  0xe99(%rip),%xmm3
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1050 <rotate@plt>
xor    %eax,%eax
call   1030 <onion@plt>
movsd  (%rsp),%xmm0
mulsd  0xe82(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe7d(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  0xe6d(%rip),%xmm2
movsd  %xmm2,0x8(%rsp)
call   1040 <arched_opening@plt>
movsd  0xe62(%rip),%xmm0
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
movsd  0xe32(%rip),%xmm3
call   1050 <rotate@plt>
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1040 <arched_opening@plt>
xor    %eax,%eax
call   1060 <endrotate@plt>
movsd  0xe30(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xdfa(%rip),%xmm3
call   1050 <rotate@plt>
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1040 <arched_opening@plt>
xor    %eax,%eax
call   1060 <endrotate@plt>
movsd  0xe00(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xdc2(%rip),%xmm3
call   1050 <rotate@plt>
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1040 <arched_opening@plt>
xor    %eax,%eax
call   1060 <endrotate@plt>
xor    %eax,%eax
call   1070 <endonion@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1060 <endrotate@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 @rotate(double 2.250000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%6 = call i32 (...) @onion()
%7 = load double, double* %3
%8 = fmul double %7, 3.500000e-01
%9 = load double, double* %4
%10 = fmul double %9, 1.500000e-01
%11 = load double, double* %4
%12 = fmul double %11, 3.000000e+00
%13 = call i32 @arched_opening(double %8, double %10, double %12)
%14 = call i32 @rotate(double 9.000000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%15 = load double, double* %3
%16 = fmul double %15, 3.500000e-01
%17 = load double, double* %4
%18 = fmul double %17, 1.500000e-01
%19 = load double, double* %4
%20 = fmul double %19, 3.000000e+00
%21 = call i32 @arched_opening(double %16, double %18, double %20)
%22 = call i32 (...) @endrotate()
%23 = call i32 @rotate(double 4.500000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%24 = load double, double* %3
%25 = fmul double %24, 3.500000e-01
%26 = load double, double* %4
%27 = fmul double %26, 1.500000e-01
%28 = load double, double* %4
%29 = fmul double %28, 3.000000e+00
%30 = call i32 @arched_opening(double %25, double %27, double %29)
%31 = call i32 (...) @endrotate()
%32 = call i32 @rotate(double 1.350000e+02, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%33 = load double, double* %3
%34 = fmul double %33, 3.500000e-01
%35 = load double, double* %4
%36 = fmul double %35, 1.500000e-01
%37 = load double, double* %4
%38 = fmul double %37, 3.000000e+00
%39 = call i32 @arched_opening(double %34, double %36, double %38)
%40 = call i32 (...) @endrotate()
%41 = call i32 (...) @endonion()
%42 = call i32 (...) @endrotate()
ret void
}

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