#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*/ block_pile(float, float, float);
int /*<<< orphan*/ elaborate_cylinder(float, float, float, int, int);
int /*<<< orphan*/ end();
int /*<<< orphan*/ end_module();
int /*<<< orphan*/ module(char *);
int /*<<< orphan*/ onion();
double randf(double);
int randn(int);
int /*<<< orphan*/ scale(float, float, double);
void fuselage_module(char *modulename, float length, float r1, float r2) {
  float squashx, squashy;
  int nelabs = randn(3) + 2;
  if (randn(100) < 50) {
    squashx = randf(0.8) + 0.2;
    squashy = 1.0;
  } else {
    squashx = 1.0;
    squashy = randf(0.8) + 0.2;
  }
  module(modulename);
  scale(squashx, squashy, 1.0);
  onion();
  if (randn(100) < 50)
    elaborate_cylinder(length, r1, r2, nelabs, 1);
  else
    block_pile(length, r1, r2);
  end();
  end();
  end_module();
}


x86 assembly (clang, -O0):
<fuselage_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    $0x3,%edi
call   10b0 <randn@plt>
add    $0x2,%eax
mov    %eax,-0x20(%rbp)
mov    $0x64,%edi
call   10b0 <randn@plt>
cmp    $0x32,%eax
jge    1202 <fuselage_module+0x72>
movsd  0xe32(%rip),%xmm0
call   10a0 <randf@plt>
movsd  0xe1d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe20(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1231 <fuselage_module+0xa1>
movss  0xe0e(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movsd  0xdf1(%rip),%xmm0
call   10a0 <randf@plt>
movsd  0xddc(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <module@plt>
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movsd  0xdc4(%rip),%xmm2
call   1070 <scale@plt>
mov    $0x0,%al
call   1040 <onion@plt>
mov    $0x64,%edi
call   10b0 <randn@plt>
cmp    $0x32,%eax
jge    128c <fuselage_module+0xfc>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
mov    -0x20(%rbp),%edi
mov    $0x1,%esi
call   1030 <elaborate_cylinder@plt>
jmp    12a0 <fuselage_module+0x110>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1080 <block_pile@plt>
mov    $0x0,%al
call   1050 <end@plt>
mov    $0x0,%al
call   1050 <end@plt>
mov    $0x0,%al
call   1060 <end_module@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuselage_module>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movss  %xmm2,0x1c(%rsp)
movss  %xmm1,0x18(%rsp)
movss  %xmm0,0x14(%rsp)
mov    %rdi,%rbx
mov    $0x3,%edi
call   10b0 <randn@plt>
mov    %eax,%r14d
mov    $0x64,%edi
call   10b0 <randn@plt>
mov    %eax,%ebp
movsd  0xe32(%rip),%xmm0
call   10a0 <randf@plt>
addsd  0xe2d(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0xe31(%rip),%xmm1
cmp    $0x32,%ebp
jl     11fa <fuselage_module+0x6a>
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
jmp    1206 <fuselage_module+0x76>
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1090 <module@plt>
movsd  0xdfa(%rip),%xmm2
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   1070 <scale@plt>
xor    %eax,%eax
call   1040 <onion@plt>
mov    $0x64,%edi
call   10b0 <randn@plt>
cmp    $0x31,%eax
jg     1262 <fuselage_module+0xd2>
add    $0x2,%r14d
movss  0x14(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
mov    %r14d,%edi
mov    $0x1,%esi
call   1030 <elaborate_cylinder@plt>
jmp    1279 <fuselage_module+0xe9>
movss  0x14(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
call   1080 <block_pile@plt>
xor    %eax,%eax
call   1050 <end@plt>
xor    %eax,%eax
call   1050 <end@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <end_module@plt>

LLVM IR (-O0):
define void @fuselage_module(i8* %0, float %1, float %2, float %3) {
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32
store i8* %0, i8** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%12 = call i32 @randn(i32 3)
%13 = add nsw i32 %12, 2
store i32 %13, i32* %11
%14 = call i32 @randn(i32 100)
%15 = icmp slt i32 %14, 50
br i1 %15, label %16, label %20
16: ; preds = %4
%17 = call double @randf(double 8.000000e-01)
%18 = fadd double %17, 2.000000e-01
%19 = fptrunc double %18 to float
store float %19, float* %9
store float 1.000000e+00, float* %10
br label %24
20: ; preds = %4
store float 1.000000e+00, float* %9
%21 = call double @randf(double 8.000000e-01)
%22 = fadd double %21, 2.000000e-01
%23 = fptrunc double %22 to float
store float %23, float* %10
br label %24
24: ; preds = %20, %16
%25 = load i8*, i8** %5
%26 = call i32 @module(i8* %25)
%27 = load float, float* %9
%28 = load float, float* %10
%29 = call i32 @scale(float %27, float %28, double 1.000000e+00)
%30 = call i32 (...) @onion()
%31 = call i32 @randn(i32 100)
%32 = icmp slt i32 %31, 50
br i1 %32, label %33, label %39
33: ; preds = %24
%34 = load float, float* %6
%35 = load float, float* %7
%36 = load float, float* %8
%37 = load i32, i32* %11
%38 = call i32 @elaborate_cylinder(float %34, float %35, float %36, i32 %37, i32 1)
br label %44
39: ; preds = %24
%40 = load float, float* %6
%41 = load float, float* %7
%42 = load float, float* %8
%43 = call i32 @block_pile(float %40, float %41, float %42)
br label %44
44: ; preds = %39, %33
%45 = call i32 (...) @end()
%46 = call i32 (...) @end()
%47 = call i32 (...) @end_module()
ret void
}

LLVM IR (-O2):
define void @fuselage_module(i8* %0, float %1, float %2, float %3) {
%5 = tail call i32 @randn(i32 3)
%6 = tail call i32 @randn(i32 100)
%7 = icmp slt i32 %6, 50
%8 = tail call double @randf(double 8.000000e-01)
%9 = fadd double %8, 2.000000e-01
%10 = fptrunc double %9 to float
%11 = select i1 %7, float 1.000000e+00, float %10
%12 = select i1 %7, float %10, float 1.000000e+00
%13 = tail call i32 @module(i8* %0)
%14 = tail call i32 @scale(float %12, float %11, double 1.000000e+00)
%15 = tail call i32 (...) @onion()
%16 = tail call i32 @randn(i32 100)
%17 = icmp slt i32 %16, 50
br i1 %17, label %18, label %21
18: ; preds = %4
%19 = add nsw i32 %5, 2
%20 = tail call i32 @elaborate_cylinder(float %1, float %2, float %3, i32 %19, i32 1)
br label %23
21: ; preds = %4
%22 = tail call i32 @block_pile(float %1, float %2, float %3)
br label %23
23: ; preds = %21, %18
%24 = tail call i32 (...) @end()
%25 = tail call i32 (...) @end()
%26 = tail call i32 (...) @end_module()
ret void
}