#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*/ vol_draw_fill_box(float, float, float, float);
void vol_draw_cantor_dust_box(float x, float y, float z, float size,
                              unsigned short lvl) {
  if (lvl == 0) {
    vol_draw_fill_box(x, y, z, size);
    return;
  }
  float rad = (float)lvl;
  rad = rad < 1 ? 1 : rad;
  size /= 2;
  size -= rad;
  float offs = size + 2 * rad;
  vol_draw_cantor_dust_box(x, y, z, size, lvl - 1);
  vol_draw_cantor_dust_box(x + offs, y, z, size, lvl - 1);
  vol_draw_cantor_dust_box(x, y, z + offs, size, lvl - 1);
  vol_draw_cantor_dust_box(x + offs, y, z + offs, size, lvl - 1);
  vol_draw_cantor_dust_box(x, y + offs, z, size, lvl - 1);
  vol_draw_cantor_dust_box(x + offs, y + offs, z, size, lvl - 1);
  vol_draw_cantor_dust_box(x, y + offs, z + offs, size, lvl - 1);
  vol_draw_cantor_dust_box(x + offs, y + offs, z + offs, size, lvl - 1);
}


x86 assembly (clang, -O0):
<vol_draw_cantor_dust_box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
cmp    $0x0,%eax
jne    116e <vol_draw_cantor_dust_box+0x4e>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1040 <vol_draw_fill_box@plt>
jmp    1347 <vol_draw_cantor_dust_box+0x227>
movzwl -0x12(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe7d(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    119f <vol_draw_cantor_dust_box+0x7f>
movss  0xe6b(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    11a9 <vol_draw_cantor_dust_box+0x89>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe44(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  -0x4(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
addss  -0x1c(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  -0x4(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
addss  -0x1c(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0x1c(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  -0x4(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0x1c(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0x1c(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
addss  -0x1c(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  -0x4(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0x1c(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
addss  -0x1c(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movzwl -0x12(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vol_draw_cantor_dust_box>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
movaps %xmm1,%xmm5
test   %edi,%edi
je     129f <vol_draw_cantor_dust_box+0x17f>
mov    %edi,%ebx
movss  %xmm0,0x14(%rsp)
movss  %xmm2,0x10(%rsp)
nop
movss  %xmm5,0x1c(%rsp)
movss  %xmm0,0x24(%rsp)
movzwl %bx,%eax
cvtsi2ss %eax,%xmm4
movss  0xea5(%rip),%xmm1
maxss  %xmm4,%xmm1
mulss  0xe9d(%rip),%xmm3
subss  %xmm1,%xmm3
movss  %xmm3,0xc(%rsp)
addss  %xmm1,%xmm1
addss  %xmm3,%xmm1
movss  %xmm1,0x18(%rsp)
add    $0xffffffff,%ebx
movzwl %bx,%ebp
movaps %xmm5,%xmm1
movss  %xmm2,0x20(%rsp)
movss  0xc(%rsp),%xmm3
mov    %ebp,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  0x14(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0x1c(%rsp),%xmm1
movss  0x20(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
mov    %ebp,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  0x10(%rsp),%xmm2
addss  0x18(%rsp),%xmm2
movss  %xmm2,0x10(%rsp)
movss  0x24(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
movss  0xc(%rsp),%xmm3
mov    %ebp,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  0x14(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
mov    %ebp,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  0x18(%rsp),%xmm1
addss  0x1c(%rsp),%xmm1
movss  %xmm1,0x18(%rsp)
movss  0x24(%rsp),%xmm0
movss  0x20(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
mov    %ebp,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  0x14(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x20(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
mov    %ebp,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  0x24(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
mov    %ebp,%edi
call   1030 <vol_draw_cantor_dust_box@plt>
movss  0x18(%rsp),%xmm1
movss  0xc(%rsp),%xmm3
movss  0x10(%rsp),%xmm2
movaps %xmm1,%xmm5
movss  0x14(%rsp),%xmm0
test   %bp,%bp
jne    1140 <vol_draw_cantor_dust_box+0x20>
jmp    12ae <vol_draw_cantor_dust_box+0x18e>
movss  %xmm0,0x14(%rsp)
movaps %xmm5,%xmm1
movss  %xmm2,0x10(%rsp)
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm2
add    $0x28,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vol_draw_fill_box@plt>

LLVM IR (-O0):
define void @vol_draw_cantor_dust_box(float %0, float %1, float %2, float %3, i16 zeroext %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i16
%11 = alloca float
%12 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store i16 %4, i16* %10
%13 = load i16, i16* %10
%14 = zext i16 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %5
%17 = load float, float* %6
%18 = load float, float* %7
%19 = load float, float* %8
%20 = load float, float* %9
%21 = call i32 @vol_draw_fill_box(float %17, float %18, float %19, float %20)
br label %128
22: ; preds = %5
%23 = load i16, i16* %10
%24 = uitofp i16 %23 to float
store float %24, float* %11
%25 = load float, float* %11
%26 = fcmp olt float %25, 1.000000e+00
br i1 %26, label %27, label %28
27: ; preds = %22
br label %30
28: ; preds = %22
%29 = load float, float* %11
br label %30
30: ; preds = %28, %27
%31 = phi float [ 1.000000e+00, %27 ], [ %29, %28 ]
store float %31, float* %11
%32 = load float, float* %9
%33 = fdiv float %32, 2.000000e+00
store float %33, float* %9
%34 = load float, float* %11
%35 = load float, float* %9
%36 = fsub float %35, %34
store float %36, float* %9
%37 = load float, float* %9
%38 = load float, float* %11
%39 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %38, float %37)
store float %39, float* %12
%40 = load float, float* %6
%41 = load float, float* %7
%42 = load float, float* %8
%43 = load float, float* %9
%44 = load i16, i16* %10
%45 = zext i16 %44 to i32
%46 = sub nsw i32 %45, 1
%47 = trunc i32 %46 to i16
%48 = load float, float* %6
%49 = load float, float* %12
%50 = fadd float %48, %49
%51 = load float, float* %7
%52 = load float, float* %8
%53 = load float, float* %9
%54 = load i16, i16* %10
%55 = zext i16 %54 to i32
%56 = sub nsw i32 %55, 1
%57 = trunc i32 %56 to i16
%58 = load float, float* %6
%59 = load float, float* %7
%60 = load float, float* %8
%61 = load float, float* %12
%62 = fadd float %60, %61
%63 = load float, float* %9
%64 = load i16, i16* %10
%65 = zext i16 %64 to i32
%66 = sub nsw i32 %65, 1
%67 = trunc i32 %66 to i16
%68 = load float, float* %6
%69 = load float, float* %12
%70 = fadd float %68, %69
%71 = load float, float* %7
%72 = load float, float* %8
%73 = load float, float* %12
%74 = fadd float %72, %73
%75 = load float, float* %9
%76 = load i16, i16* %10
%77 = zext i16 %76 to i32
%78 = sub nsw i32 %77, 1
%79 = trunc i32 %78 to i16
%80 = load float, float* %6
%81 = load float, float* %7
%82 = load float, float* %12
%83 = fadd float %81, %82
%84 = load float, float* %8
%85 = load float, float* %9
%86 = load i16, i16* %10
%87 = zext i16 %86 to i32
%88 = sub nsw i32 %87, 1
%89 = trunc i32 %88 to i16
%90 = load float, float* %6
%91 = load float, float* %12
%92 = fadd float %90, %91
%93 = load float, float* %7
%94 = load float, float* %12
%95 = fadd float %93, %94
%96 = load float, float* %8
%97 = load float, float* %9
%98 = load i16, i16* %10
%99 = zext i16 %98 to i32
%100 = sub nsw i32 %99, 1
%101 = trunc i32 %100 to i16
%102 = load float, float* %6
%103 = load float, float* %7
%104 = load float, float* %12
%105 = fadd float %103, %104
%106 = load float, float* %8
%107 = load float, float* %12
%108 = fadd float %106, %107
%109 = load float, float* %9
%110 = load i16, i16* %10
%111 = zext i16 %110 to i32
%112 = sub nsw i32 %111, 1
%113 = trunc i32 %112 to i16
%114 = load float, float* %6
%115 = load float, float* %12
%116 = fadd float %114, %115
%117 = load float, float* %7
%118 = load float, float* %12
%119 = fadd float %117, %118
%120 = load float, float* %8
%121 = load float, float* %12
%122 = fadd float %120, %121
%123 = load float, float* %9
%124 = load i16, i16* %10
%125 = zext i16 %124 to i32
%126 = sub nsw i32 %125, 1
%127 = trunc i32 %126 to i16
br label %128
128: ; preds = %30, %16
ret void
}

LLVM IR (-O2):
define void @vol_draw_cantor_dust_box(float %0, float %1, float %2, float %3, i16 zeroext %4) {
%6 = icmp eq i16 %4, 0
br i1 %6, label %7, label %13
7: ; preds = %13, %5
%8 = phi float [ %0, %5 ], [ %26, %13 ]
%9 = phi float [ %1, %5 ], [ %28, %13 ]
%10 = phi float [ %2, %5 ], [ %27, %13 ]
%11 = phi float [ %3, %5 ], [ %23, %13 ]
%12 = tail call i32 @vol_draw_fill_box(float %8, float %9, float %10, float %11)
ret void
13: ; preds = %5, %13
%14 = phi i16 [ %25, %13 ], [ %4, %5 ]
%15 = phi float [ %23, %13 ], [ %3, %5 ]
%16 = phi float [ %27, %13 ], [ %2, %5 ]
%17 = phi float [ %28, %13 ], [ %1, %5 ]
%18 = phi float [ %26, %13 ], [ %0, %5 ]
%19 = uitofp i16 %14 to float
%20 = fcmp olt float %19, 1.000000e+00
%21 = select i1 %20, float 1.000000e+00, float %19
%22 = fmul float %15, 5.000000e-01
%23 = fsub float %22, %21
%24 = tail call float @llvm.fmuladd.f32(float %21, float 2.000000e+00, float %23)
%25 = add i16 %14, -1
tail call void @vol_draw_cantor_dust_box(float %18, float %17, float %16, float %23, i16 zeroext %25)
%26 = fadd float %18, %24
tail call void @vol_draw_cantor_dust_box(float %26, float %17, float %16, float %23, i16 zeroext %25)
%27 = fadd float %16, %24
tail call void @vol_draw_cantor_dust_box(float %18, float %17, float %27, float %23, i16 zeroext %25)
tail call void @vol_draw_cantor_dust_box(float %26, float %17, float %27, float %23, i16 zeroext %25)
%28 = fadd float %17, %24
tail call void @vol_draw_cantor_dust_box(float %18, float %28, float %16, float %23, i16 zeroext %25)
tail call void @vol_draw_cantor_dust_box(float %26, float %28, float %16, float %23, i16 zeroext %25)
tail call void @vol_draw_cantor_dust_box(float %18, float %28, float %27, float %23, i16 zeroext %25)
%29 = icmp eq i16 %25, 0
br i1 %29, label %7, label %13
}