#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 /*<<< orphan*/);
int /*<<< orphan*/ cylinder(double, double, double);
int /*<<< orphan*/ endonion();
int /*<<< orphan*/ endrotate();
int /*<<< orphan*/ endscale();
int /*<<< orphan*/ endxlate();
int /*<<< orphan*/ onion();
int /*<<< orphan*/ rotate(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ scale(double, double, double);
int /*<<< orphan*/ xlate(double, double, double);
void arched_opening(double height, double width, double depth) {
  height *= 10.0;
  width *= 10.0;
  depth *= 10.0;
  scale(0.1, 0.1, 0.1);
  xlate(-width / 2.0, -depth / 2.0, -height / 2.0);
  onion();
  cube(width, depth, height - width / 2.0, 0);
  xlate(width / 2.0, depth, height - width / 2.0);
  rotate(90, 1, 0, 0);
  cylinder(depth, width / 2.0, width / 2.0);
  endrotate();
  endxlate();
  endonion();
  endxlate();
  endscale();
}


x86 assembly (clang, -O0):
<arched_opening>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xe51(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe3f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe2d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe13(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   10a0 <scale@plt>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xddc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xdb4(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xd8c(%rip),%xmm3
divsd  %xmm3,%xmm2
call   1040 <xlate@plt>
mov    $0x0,%al
call   1050 <onion@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  0xd60(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
xor    %edi,%edi
call   10c0 <cube@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xd44(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  0xd29(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
call   1040 <xlate@plt>
mov    $0x5a,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1070 <rotate@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xcf7(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xce6(%rip),%xmm3
divsd  %xmm3,%xmm2
call   1030 <cylinder@plt>
mov    $0x0,%al
call   1080 <endrotate@plt>
mov    $0x0,%al
call   1090 <endxlate@plt>
mov    $0x0,%al
call   10b0 <endonion@plt>
mov    $0x0,%al
call   1090 <endxlate@plt>
mov    $0x0,%al
call   1060 <endscale@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arched_opening>:
sub    $0x28,%rsp
movsd  0xe54(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm3,%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x10(%rsp)
movsd  0xe36(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   10a0 <scale@plt>
movsd  0xe2b(%rip),%xmm2
movsd  0x20(%rsp),%xmm0
mulsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm2,%xmm1
mulsd  0x8(%rsp),%xmm2
call   1040 <xlate@plt>
xor    %eax,%eax
call   1050 <onion@plt>
movsd  0xe05(%rip),%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x8(%rsp),%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0x10(%rsp),%xmm1
xor    %edi,%edi
call   10c0 <cube@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1040 <xlate@plt>
mov    $0x5a,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1070 <rotate@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movaps %xmm1,%xmm2
call   1030 <cylinder@plt>
xor    %eax,%eax
call   1080 <endrotate@plt>
xor    %eax,%eax
call   1090 <endxlate@plt>
xor    %eax,%eax
call   10b0 <endonion@plt>
xor    %eax,%eax
call   1090 <endxlate@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1060 <endscale@plt>

LLVM IR (-O0):
define void @arched_opening(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fmul double %7, 1.000000e+01
store double %8, double* %4
%9 = load double, double* %5
%10 = fmul double %9, 1.000000e+01
store double %10, double* %5
%11 = load double, double* %6
%12 = fmul double %11, 1.000000e+01
store double %12, double* %6
%13 = call i32 @scale(double 1.000000e-01, double 1.000000e-01, double 1.000000e-01)
%14 = load double, double* %5
%15 = fneg double %14
%16 = fdiv double %15, 2.000000e+00
%17 = load double, double* %6
%18 = fneg double %17
%19 = fdiv double %18, 2.000000e+00
%20 = load double, double* %4
%21 = fneg double %20
%22 = fdiv double %21, 2.000000e+00
%23 = call i32 @xlate(double %16, double %19, double %22)
%24 = call i32 (...) @onion()
%25 = load double, double* %5
%26 = load double, double* %6
%27 = load double, double* %4
%28 = load double, double* %5
%29 = fdiv double %28, 2.000000e+00
%30 = fsub double %27, %29
%31 = call i32 @cube(double %25, double %26, double %30, i32 0)
%32 = load double, double* %5
%33 = fdiv double %32, 2.000000e+00
%34 = load double, double* %6
%35 = load double, double* %4
%36 = load double, double* %5
%37 = fdiv double %36, 2.000000e+00
%38 = fsub double %35, %37
%39 = call i32 @xlate(double %33, double %34, double %38)
%40 = call i32 @rotate(i32 90, i32 1, i32 0, i32 0)
%41 = load double, double* %6
%42 = load double, double* %5
%43 = fdiv double %42, 2.000000e+00
%44 = load double, double* %5
%45 = fdiv double %44, 2.000000e+00
%46 = call i32 @cylinder(double %41, double %43, double %45)
%47 = call i32 (...) @endrotate()
%48 = call i32 (...) @endxlate()
%49 = call i32 (...) @endonion()
%50 = call i32 (...) @endxlate()
%51 = call i32 (...) @endscale()
ret void
}

LLVM IR (-O2):
define void @arched_opening(double %0, double %1, double %2) {
%4 = fmul double %0, 1.000000e+01
%5 = fmul double %1, 1.000000e+01
%6 = fmul double %2, 1.000000e+01
%7 = tail call i32 @scale(double 1.000000e-01, double 1.000000e-01, double 1.000000e-01)
%8 = fmul double %5, -5.000000e-01
%9 = fmul double %6, -5.000000e-01
%10 = fmul double %4, -5.000000e-01
%11 = tail call i32 @xlate(double %8, double %9, double %10)
%12 = tail call i32 (...) @onion()
%13 = fmul double %5, 5.000000e-01
%14 = fsub double %4, %13
%15 = tail call i32 @cube(double %5, double %6, double %14, i32 0)
%16 = tail call i32 @xlate(double %13, double %6, double %14)
%17 = tail call i32 @rotate(i32 90, i32 1, i32 0, i32 0)
%18 = tail call i32 @cylinder(double %6, double %13, double %13)
%19 = tail call i32 (...) @endrotate()
%20 = tail call i32 (...) @endxlate()
%21 = tail call i32 (...) @endonion()
%22 = tail call i32 (...) @endxlate()
%23 = tail call i32 (...) @endscale()
ret void
}