#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(float, float, float, int);
int /*<<< orphan*/ end();
float maxf(float, float);
int /*<<< orphan*/ onion();
int /*<<< orphan*/ pod(float, float);
float randf(float);
int /*<<< orphan*/ xlate(float, float, float);
void block_pile(float length, float r1, float r2) {
  int i;
  float w = maxf(r1, r2);
  onion();
  pod(length * 0.9, w * 0.7);
  for (i = 0; i < 30; i++) {
    float x, y, z, sx, sy, sz;
    x = 0.8 * (randf(w) - (w / 2.0));
    y = 0.8 * (randf(w) - (w / 2.0));
    z = 0.8 * (randf(length) - (length / 2.0));
    sx = randf(w / 2.0) + w / 2.0;
    sy = randf(w / 2.0) + w / 2.0;
    sz = randf(w / 2.0) + w / 2.0;
    xlate(x, y, z);
    cube(sx, sy, sz, 1);
    end();
  }
  end();
}


x86 assembly (clang, -O0):
<block_pile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1050 <maxf@plt>
movss  %xmm0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <onion@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe55(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe34(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
call   1070 <pod@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    13ac <block_pile+0x23c>
movss  -0x14(%rbp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe07(%rip),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  0xdff(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcb(%rip),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  0xdc3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8f(%rip),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  0xd87(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd61(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xd3f(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd1d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xcfb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcd9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xcb7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
call   1030 <xlate@plt>
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm2
mov    $0x1,%edi
call   1090 <cube@plt>
mov    $0x0,%al
call   1060 <end@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e0 <block_pile+0x70>
mov    $0x0,%al
call   1060 <end@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_pile>:
push   %rbx
sub    $0x40,%rsp
movss  %xmm0,0x1c(%rsp)
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1050 <maxf@plt>
movss  %xmm0,0x14(%rsp)
xor    %eax,%eax
call   1040 <onion@plt>
movss  0x1c(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0xe52(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x14(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xe37(%rip),%xmm1
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
call   1070 <pod@plt>
movsd  0xe2a(%rip),%xmm0
movsd  0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  %xmm2,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm0,0x18(%rsp)
mov    $0x1e,%ebx
nopl   0x0(%rax,%rax,1)
movss  0x14(%rsp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
subsd  0x8(%rsp),%xmm0
movsd  0xddb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x3c(%rsp)
movss  0x14(%rsp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
subsd  0x8(%rsp),%xmm0
mulsd  0xdb0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x38(%rsp)
movss  0x1c(%rsp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
subsd  0x20(%rsp),%xmm0
mulsd  0xd89(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x34(%rsp)
movss  0x18(%rsp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x30(%rsp)
movss  0x18(%rsp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0x18(%rsp),%xmm0
call   1080 <randf@plt>
cvtss2sd %xmm0,%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x28(%rsp)
movss  0x3c(%rsp),%xmm0
movss  0x38(%rsp),%xmm1
movss  0x34(%rsp),%xmm2
call   1030 <xlate@plt>
movss  0x30(%rsp),%xmm0
movss  0x2c(%rsp),%xmm1
movss  0x28(%rsp),%xmm2
mov    $0x1,%edi
call   1090 <cube@plt>
xor    %eax,%eax
call   1060 <end@plt>
add    $0xffffffff,%ebx
jne    1220 <block_pile+0xb0>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1060 <end@plt>

LLVM IR (-O0):
define void @block_pile(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%15 = load float, float* %5
%16 = load float, float* %6
%17 = call float @maxf(float %15, float %16)
store float %17, float* %8
%18 = call i32 (...) @onion()
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = fmul double %20, 9.000000e-01
%22 = fptrunc double %21 to float
%23 = load float, float* %8
%24 = fpext float %23 to double
%25 = fmul double %24, 0x3FE6666666666666
%26 = fptrunc double %25 to float
%27 = call i32 @pod(float %22, float %26)
store i32 0, i32* %7
br label %28
28: ; preds = %101, %3
%29 = load i32, i32* %7
%30 = icmp slt i32 %29, 30
br i1 %30, label %31, label %104
31: ; preds = %28
%32 = load float, float* %8
%33 = call float @randf(float %32)
%34 = fpext float %33 to double
%35 = load float, float* %8
%36 = fpext float %35 to double
%37 = fdiv double %36, 2.000000e+00
%38 = fsub double %34, %37
%39 = fmul double 8.000000e-01, %38
%40 = fptrunc double %39 to float
store float %40, float* %9
%41 = load float, float* %8
%42 = call float @randf(float %41)
%43 = fpext float %42 to double
%44 = load float, float* %8
%45 = fpext float %44 to double
%46 = fdiv double %45, 2.000000e+00
%47 = fsub double %43, %46
%48 = fmul double 8.000000e-01, %47
%49 = fptrunc double %48 to float
store float %49, float* %10
%50 = load float, float* %4
%51 = call float @randf(float %50)
%52 = fpext float %51 to double
%53 = load float, float* %4
%54 = fpext float %53 to double
%55 = fdiv double %54, 2.000000e+00
%56 = fsub double %52, %55
%57 = fmul double 8.000000e-01, %56
%58 = fptrunc double %57 to float
store float %58, float* %11
%59 = load float, float* %8
%60 = fpext float %59 to double
%61 = fdiv double %60, 2.000000e+00
%62 = fptrunc double %61 to float
%63 = call float @randf(float %62)
%64 = fpext float %63 to double
%65 = load float, float* %8
%66 = fpext float %65 to double
%67 = fdiv double %66, 2.000000e+00
%68 = fadd double %64, %67
%69 = fptrunc double %68 to float
store float %69, float* %12
%70 = load float, float* %8
%71 = fpext float %70 to double
%72 = fdiv double %71, 2.000000e+00
%73 = fptrunc double %72 to float
%74 = call float @randf(float %73)
%75 = fpext float %74 to double
%76 = load float, float* %8
%77 = fpext float %76 to double
%78 = fdiv double %77, 2.000000e+00
%79 = fadd double %75, %78
%80 = fptrunc double %79 to float
store float %80, float* %13
%81 = load float, float* %8
%82 = fpext float %81 to double
%83 = fdiv double %82, 2.000000e+00
%84 = fptrunc double %83 to float
%85 = call float @randf(float %84)
%86 = fpext float %85 to double
%87 = load float, float* %8
%88 = fpext float %87 to double
%89 = fdiv double %88, 2.000000e+00
%90 = fadd double %86, %89
%91 = fptrunc double %90 to float
store float %91, float* %14
%92 = load float, float* %9
%93 = load float, float* %10
%94 = load float, float* %11
%95 = call i32 @xlate(float %92, float %93, float %94)
%96 = load float, float* %12
%97 = load float, float* %13
%98 = load float, float* %14
%99 = call i32 @cube(float %96, float %97, float %98, i32 1)
%100 = call i32 (...) @end()
br label %101
101: ; preds = %31
%102 = load i32, i32* %7
%103 = add nsw i32 %102, 1
store i32 %103, i32* %7
br label %28
104: ; preds = %28
%105 = call i32 (...) @end()
ret void
}

LLVM IR (-O2):
define void @block_pile(float %0, float %1, float %2) {
%4 = tail call float @maxf(float %1, float %2)
%5 = tail call i32 (...) @onion()
%6 = fpext float %0 to double
%7 = fmul double %6, 9.000000e-01
%8 = fptrunc double %7 to float
%9 = fpext float %4 to double
%10 = fmul double %9, 0x3FE6666666666666
%11 = fptrunc double %10 to float
%12 = tail call i32 @pod(float %8, float %11)
%13 = fmul double %9, 5.000000e-01
%14 = fmul double %6, 5.000000e-01
%15 = fptrunc double %13 to float
br label %16
16: ; preds = %3, %16
%17 = phi i32 [ 0, %3 ], [ %48, %16 ]
%18 = tail call float @randf(float %4)
%19 = fpext float %18 to double
%20 = fsub double %19, %13
%21 = fmul double %20, 8.000000e-01
%22 = fptrunc double %21 to float
%23 = tail call float @randf(float %4)
%24 = fpext float %23 to double
%25 = fsub double %24, %13
%26 = fmul double %25, 8.000000e-01
%27 = fptrunc double %26 to float
%28 = tail call float @randf(float %0)
%29 = fpext float %28 to double
%30 = fsub double %29, %14
%31 = fmul double %30, 8.000000e-01
%32 = fptrunc double %31 to float
%33 = tail call float @randf(float %15)
%34 = fpext float %33 to double
%35 = fadd double %13, %34
%36 = fptrunc double %35 to float
%37 = tail call float @randf(float %15)
%38 = fpext float %37 to double
%39 = fadd double %13, %38
%40 = fptrunc double %39 to float
%41 = tail call float @randf(float %15)
%42 = fpext float %41 to double
%43 = fadd double %13, %42
%44 = fptrunc double %43 to float
%45 = tail call i32 @xlate(float %22, float %27, float %32)
%46 = tail call i32 @cube(float %36, float %40, float %44, i32 1)
%47 = tail call i32 (...) @end()
%48 = add nuw nsw i32 %17, 1
%49 = icmp eq i32 %48, 30
br i1 %49, label %50, label %16
50: ; preds = %16
%51 = tail call i32 (...) @end()
ret void
}