#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*/ crenelation_array(double, double, double, double, int);
int /*<<< orphan*/ endrotate();
int /*<<< orphan*/ rotate(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
void crenelation_matrix(double width, double length, double height,
                        double thickness) {
  crenelation_array(length, width, height, thickness / 2.0,
                    (int)(length / thickness / 2));
  rotate(90, 0, 0, 1);
  crenelation_array(width, length, height, thickness / 2.0,
                    (int)(width / thickness / 2));
  endrotate();
}


x86 assembly (clang, -O0):
<crenelation_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xe98(%rip),%xmm4
divsd  %xmm4,%xmm3
movsd  -0x10(%rbp),%xmm4
divsd  -0x20(%rbp),%xmm4
movsd  0xe82(%rip),%xmm5
divsd  %xmm5,%xmm4
cvttsd2si %xmm4,%edi
call   1050 <crenelation_array@plt>
mov    $0x5a,%edi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
call   1030 <rotate@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xe46(%rip),%xmm4
divsd  %xmm4,%xmm3
movsd  -0x8(%rbp),%xmm4
divsd  -0x20(%rbp),%xmm4
movsd  0xe30(%rip),%xmm5
divsd  %xmm5,%xmm4
cvttsd2si %xmm4,%edi
call   1050 <crenelation_array@plt>
mov    $0x0,%al
call   1040 <endrotate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crenelation_matrix>:
sub    $0x28,%rsp
movapd %xmm3,%xmm4
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movaps %xmm0,%xmm6
movsd  %xmm0,(%rsp)
movsd  0xea6(%rip),%xmm5
movapd %xmm3,%xmm0
mulsd  %xmm5,%xmm0
movapd %xmm0,%xmm3
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
divsd  %xmm4,%xmm0
mulsd  %xmm5,%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm1,%xmm0
movaps %xmm6,%xmm1
call   1050 <crenelation_array@plt>
mov    $0x5a,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <rotate@plt>
movsd  (%rsp),%xmm0
movapd %xmm0,%xmm1
divsd  0x8(%rsp),%xmm1
mulsd  0xe4e(%rip),%xmm1
cvttsd2si %xmm1,%edi
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
call   1050 <crenelation_array@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1040 <endrotate@plt>

LLVM IR (-O0):
define void @crenelation_matrix(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load double, double* %5
%11 = load double, double* %7
%12 = load double, double* %8
%13 = fdiv double %12, 2.000000e+00
%14 = load double, double* %6
%15 = load double, double* %8
%16 = fdiv double %14, %15
%17 = fdiv double %16, 2.000000e+00
%18 = fptosi double %17 to i32
%19 = call i32 @crenelation_array(double %9, double %10, double %11, double %13, i32 %18)
%20 = call i32 @rotate(i32 90, i32 0, i32 0, i32 1)
%21 = load double, double* %5
%22 = load double, double* %6
%23 = load double, double* %7
%24 = load double, double* %8
%25 = fdiv double %24, 2.000000e+00
%26 = load double, double* %5
%27 = load double, double* %8
%28 = fdiv double %26, %27
%29 = fdiv double %28, 2.000000e+00
%30 = fptosi double %29 to i32
%31 = call i32 @crenelation_array(double %21, double %22, double %23, double %25, i32 %30)
%32 = call i32 (...) @endrotate()
ret void
}

LLVM IR (-O2):
define void @crenelation_matrix(double %0, double %1, double %2, double %3) {
%5 = fmul double %3, 5.000000e-01
%6 = fdiv double %1, %3
%7 = fmul double %6, 5.000000e-01
%8 = fptosi double %7 to i32
%9 = tail call i32 @crenelation_array(double %1, double %0, double %2, double %5, i32 %8)
%10 = tail call i32 @rotate(i32 90, i32 0, i32 0, i32 1)
%11 = fdiv double %0, %3
%12 = fmul double %11, 5.000000e-01
%13 = fptosi double %12 to i32
%14 = tail call i32 @crenelation_array(double %0, double %1, double %2, double %5, i32 %13)
%15 = tail call i32 (...) @endrotate()
ret void
}