#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*/ endrotate();
int /*<<< orphan*/ endxlate();
int /*<<< orphan*/ keep_block_void(double, double, double);
int /*<<< orphan*/ keep_block_windows(double, double, double);
int /*<<< orphan*/ rotate(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ xlate(int /*<<< orphan*/, int /*<<< orphan*/, double);
void keep_block(double width, double length, double height) {
  xlate(0, 0, height / 2.0);
  diff();
  cube(width, length, height, 1);
  keep_block_void(width, length, height);
  keep_block_windows(width, length, height);
  rotate(90, 0, 0, 1);
  keep_block_windows(length, width, height);
  endrotate();
  enddiff();
  endxlate();
}


x86 assembly (clang, -O0):
<keep_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe4c(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1030 <xlate@plt>
mov    $0x0,%al
call   10b0 <diff@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    $0x1,%edi
call   1090 <cube@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   10a0 <keep_block_void@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <keep_block_windows@plt>
mov    $0x5a,%edi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
call   1060 <rotate@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <keep_block_windows@plt>
mov    $0x0,%al
call   1070 <endrotate@plt>
mov    $0x0,%al
call   1050 <enddiff@plt>
mov    $0x0,%al
call   1080 <endxlate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keep_block>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xe53(%rip),%xmm0
mulsd  %xmm2,%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1030 <xlate@plt>
xor    %eax,%eax
call   10b0 <diff@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x1,%edi
call   1090 <cube@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   10a0 <keep_block_void@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <keep_block_windows@plt>
mov    $0x5a,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1060 <rotate@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <keep_block_windows@plt>
xor    %eax,%eax
call   1070 <endrotate@plt>
xor    %eax,%eax
call   1050 <enddiff@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1080 <endxlate@plt>

LLVM IR (-O0):
define void @keep_block(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* %6
%8 = fdiv double %7, 2.000000e+00
%9 = call i32 @xlate(i32 0, i32 0, double %8)
%10 = call i32 (...) @diff()
%11 = load double, double* %4
%12 = load double, double* %5
%13 = load double, double* %6
%14 = call i32 @cube(double %11, double %12, double %13, i32 1)
%15 = load double, double* %4
%16 = load double, double* %5
%17 = load double, double* %6
%18 = call i32 @keep_block_void(double %15, double %16, double %17)
%19 = load double, double* %4
%20 = load double, double* %5
%21 = load double, double* %6
%22 = call i32 @keep_block_windows(double %19, double %20, double %21)
%23 = call i32 @rotate(i32 90, i32 0, i32 0, i32 1)
%24 = load double, double* %5
%25 = load double, double* %4
%26 = load double, double* %6
%27 = call i32 @keep_block_windows(double %24, double %25, double %26)
%28 = call i32 (...) @endrotate()
%29 = call i32 (...) @enddiff()
%30 = call i32 (...) @endxlate()
ret void
}

LLVM IR (-O2):
define void @keep_block(double %0, double %1, double %2) {
%4 = fmul double %2, 5.000000e-01
%5 = tail call i32 @xlate(i32 0, i32 0, double %4)
%6 = tail call i32 (...) @diff()
%7 = tail call i32 @cube(double %0, double %1, double %2, i32 1)
%8 = tail call i32 @keep_block_void(double %0, double %1, double %2)
%9 = tail call i32 @keep_block_windows(double %0, double %1, double %2)
%10 = tail call i32 @rotate(i32 90, i32 0, i32 0, i32 1)
%11 = tail call i32 @keep_block_windows(double %1, double %0, double %2)
%12 = tail call i32 (...) @endrotate()
%13 = tail call i32 (...) @enddiff()
%14 = tail call i32 (...) @endxlate()
ret void
}