#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*/ end();
float randf(double);
void ring(float length) {
  float h, r;
  r = length * randf(0.5) + 0.5;
  h = (r * 0.4) - randf(0.2);
  diff();
  cyl(h, r, r, 1);
  cyl(h + 1, r * 0.95, r * 0.95, 1);
  end();
}


x86 assembly (clang, -O0):
<ring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movsd  0xeb9(%rip),%xmm0
call   1040 <randf@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe71(%rip),%xmm0
call   1040 <randf@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe39(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <diff@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mov    $0x1,%edi
call   1050 <cyl@plt>
movss  0xe18(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xde2(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xdc9(%rip),%xmm3
mulsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
mov    $0x1,%edi
call   1050 <cyl@plt>
mov    $0x0,%al
call   1030 <end@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring>:
sub    $0x18,%rsp
movss  %xmm0,0x8(%rsp)
movsd  0xeae(%rip),%xmm0
call   1040 <randf@plt>
movss  0x8(%rsp),%xmm1
mulss  %xmm0,%xmm1
addss  0xeb7(%rip),%xmm1
movss  %xmm1,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe84(%rip),%xmm0
call   1040 <randf@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xe7b(%rip),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1060 <diff@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movaps %xmm1,%xmm2
mov    $0x1,%edi
call   1050 <cyl@plt>
movss  0xc(%rsp),%xmm0
addss  0xe4a(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xe30(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movaps %xmm1,%xmm2
mov    $0x1,%edi
call   1050 <cyl@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1030 <end@plt>

LLVM IR (-O0):
define void @ring(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = call float @randf(double 5.000000e-01)
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptrunc double %9 to float
store float %10, float* %4
%11 = load float, float* %4
%12 = fpext float %11 to double
%13 = call float @randf(double 2.000000e-01)
%14 = fpext float %13 to double
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %12, double 4.000000e-01, double %15)
%17 = fptrunc double %16 to float
store float %17, float* %3
%18 = call i32 (...) @diff()
%19 = load float, float* %3
%20 = load float, float* %4
%21 = load float, float* %4
%22 = call i32 @cyl(float %19, float %20, float %21, i32 1)
%23 = load float, float* %3
%24 = fadd float %23, 1.000000e+00
%25 = load float, float* %4
%26 = fpext float %25 to double
%27 = fmul double %26, 0x3FEE666666666666
%28 = fptrunc double %27 to float
%29 = load float, float* %4
%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()
ret void
}

LLVM IR (-O2):
define void @ring(float %0) {
%2 = tail call float @randf(double 5.000000e-01)
%3 = fmul float %2, %0
%4 = fadd float %3, 5.000000e-01
%5 = fpext float %4 to double
%6 = tail call float @randf(double 2.000000e-01)
%7 = fpext float %6 to double
%8 = fneg double %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double 4.000000e-01, double %8)
%10 = fptrunc double %9 to float
%11 = tail call i32 (...) @diff()
%12 = tail call i32 @cyl(float %10, float %4, float %4, i32 1)
%13 = fadd float %10, 1.000000e+00
%14 = fmul double %5, 0x3FEE666666666666
%15 = fptrunc double %14 to float
%16 = tail call i32 @cyl(float %13, float %15, float %15, i32 1)
%17 = tail call i32 (...) @end()
ret void
}