#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*/ cyl(float, float, float, int);
int /*<<< orphan*/ diff();
int /*<<< orphan*/ elaborate_cylinder(float, float, float, int,
                                      int /*<<< orphan*/);
int /*<<< orphan*/ end();
int /*<<< orphan*/ end_module();
int /*<<< orphan*/ module(char *);
int randn(int);
int /*<<< orphan*/ xlate(int /*<<< orphan*/, int /*<<< orphan*/, float);
void thruster_module(char *modulename, float length, float r1, float r2) {
  int nelaborations = randn(2);
  module(modulename);
  diff();
  elaborate_cylinder(length, r1, r2, nelaborations, 0);
  xlate(0, 0, length * 0.05);
  cyl(length, r1 * 0.95, r2 * 0.95, 1);
  end();
  end();
  end_module();
}


x86 assembly (clang, -O0):
<thruster_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    $0x2,%edi
call   1080 <randn@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <module@plt>
mov    $0x0,%al
call   10a0 <diff@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   1040 <elaborate_cylinder@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe26(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1030 <xlate@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xdf7(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xdde(%rip),%xmm3
mulsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
mov    $0x1,%edi
call   1090 <cyl@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):
<thruster_module>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
mov    $0x2,%edi
call   1080 <randn@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <module@plt>
xor    %eax,%eax
call   10a0 <diff@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <elaborate_cylinder@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe1d(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1030 <xlate@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe06(%rip),%xmm2
mulsd  %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
movss  0xc(%rsp),%xmm0
mov    $0x1,%edi
call   1090 <cyl@plt>
xor    %eax,%eax
call   1050 <end@plt>
xor    %eax,%eax
call   1050 <end@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <end_module@plt>

LLVM IR (-O0):
define void @thruster_module(i8* %0, float %1, float %2, float %3) {
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i8* %0, i8** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = call i32 @randn(i32 2)
store i32 %10, i32* %9
%11 = load i8*, i8** %5
%12 = call i32 @module(i8* %11)
%13 = call i32 (...) @diff()
%14 = load float, float* %6
%15 = load float, float* %7
%16 = load float, float* %8
%17 = load i32, i32* %9
%18 = call i32 @elaborate_cylinder(float %14, float %15, float %16, i32 %17, i32 0)
%19 = load float, float* %6
%20 = fpext float %19 to double
%21 = fmul double %20, 5.000000e-02
%22 = fptrunc double %21 to float
%23 = call i32 @xlate(i32 0, i32 0, float %22)
%24 = load float, float* %6
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = fmul double %26, 0x3FEE666666666666
%28 = fptrunc double %27 to float
%29 = load float, float* %8
%30 = fpext float %29 to double
%31 = fmul double %30, 0x3FEE666666666666
%32 = fptrunc double %31 to float
%33 = call i32 @cyl(float %24, float %28, float %32, i32 1)
%34 = call i32 (...) @end()
%35 = call i32 (...) @end()
%36 = call i32 (...) @end_module()
ret void
}

LLVM IR (-O2):
define void @thruster_module(i8* %0, float %1, float %2, float %3) {
%5 = tail call i32 @randn(i32 2)
%6 = tail call i32 @module(i8* %0)
%7 = tail call i32 (...) @diff()
%8 = tail call i32 @elaborate_cylinder(float %1, float %2, float %3, i32 %5, i32 0)
%9 = fpext float %1 to double
%10 = fmul double %9, 5.000000e-02
%11 = fptrunc double %10 to float
%12 = tail call i32 @xlate(i32 0, i32 0, float %11)
%13 = fpext float %2 to double
%14 = fmul double %13, 0x3FEE666666666666
%15 = fptrunc double %14 to float
%16 = fpext float %3 to double
%17 = fmul double %16, 0x3FEE666666666666
%18 = fptrunc double %17 to float
%19 = tail call i32 @cyl(float %1, float %15, float %18, i32 1)
%20 = tail call i32 (...) @end()
%21 = tail call i32 (...) @end()
%22 = tail call i32 (...) @end_module()
ret void
}