#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*/ endonion();
int /*<<< orphan*/ endrotate();
int /*<<< orphan*/ finger(float, float, int, float, double, float, int);
int /*<<< orphan*/ onion();
int /*<<< orphan*/ rotate(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
void fingers(int nfingers, float length, float deltalength, float angle,
             float deltaangle, int left, int segments, float thickness,
             float taper, float curl) {
  int i;
  float armlength = 0.7 * length;
  if (!left)
    rotate(180, 1, 0, 0);
  onion();
  for (i = 0; i < nfingers; i++) {
    finger(length + (i == 0) * length * 0.25, angle, segments, thickness, taper,
           curl, 0);
    angle += deltaangle;
    length -= deltalength;
  }
  finger(armlength, angle, segments, thickness * 1.5, 2.0 - taper, curl, 1);
  endonion();
  if (!left)
    endrotate();
}


x86 assembly (clang, -O0):
<fingers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movss  %xmm4,-0x20(%rbp)
movss  %xmm5,-0x24(%rbp)
movss  %xmm6,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe6b(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    11bf <fingers+0x6f>
mov    $0xb4,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <rotate@plt>
mov    $0x0,%al
call   1030 <onion@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1261 <fingers+0x111>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
cmpl   $0x0,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe15(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
mov    -0x1c(%rbp),%edi
movss  -0x20(%rbp),%xmm2
movss  -0x24(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x28(%rbp),%xmm4
xor    %esi,%esi
call   1070 <finger@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11cd <fingers+0x7d>
movss  -0x30(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mov    -0x1c(%rbp),%edi
movss  -0x20(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xd91(%rip),%xmm3
mulsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
movss  -0x24(%rbp),%xmm3
cvtss2sd %xmm3,%xmm4
movsd  0xd70(%rip),%xmm3
subsd  %xmm4,%xmm3
movss  -0x28(%rbp),%xmm4
mov    $0x1,%esi
call   1070 <finger@plt>
mov    $0x0,%al
call   1060 <endonion@plt>
cmpl   $0x0,-0x18(%rbp)
jne    12c3 <fingers+0x173>
mov    $0x0,%al
call   1050 <endrotate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fingers>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
movss  %xmm6,0xc(%rsp)
movss  %xmm5,0x10(%rsp)
movss  %xmm4,0x8(%rsp)
mov    %edx,%r15d
mov    %esi,%r14d
movss  %xmm3,0x24(%rsp)
movss  %xmm2,(%rsp)
movss  %xmm1,0x20(%rsp)
mov    %edi,%ebx
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xe69(%rip),%xmm0
test   %esi,%esi
jne    11ba <fingers+0x6a>
mov    $0xb4,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
movsd  %xmm0,0x18(%rsp)
call   1040 <rotate@plt>
movsd  0x18(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x18(%rsp)
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <onion@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
test   %ebx,%ebx
jg     12b3 <fingers+0x163>
movss  0x8(%rsp),%xmm2
mulss  0xe29(%rip),%xmm2
movsd  0xe15(%rip),%xmm3
subsd  0x10(%rsp),%xmm3
movss  0x18(%rsp),%xmm0
movss  (%rsp),%xmm1
mov    %r15d,%edi
movss  0xc(%rsp),%xmm4
mov    $0x1,%esi
call   1070 <finger@plt>
xor    %eax,%eax
call   1060 <endonion@plt>
test   %r14d,%r14d
je     12c7 <fingers+0x177>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)
movss  0x4(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xdab(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  (%rsp),%xmm1
mov    %r15d,%edi
movss  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movss  0xc(%rsp),%xmm4
xor    %esi,%esi
call   1070 <finger@plt>
movss  (%rsp),%xmm0
addss  0x24(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
subss  0x20(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
add    $0x1,%ebp
cmp    %ebp,%ebx
je     11e5 <fingers+0x95>
movss  0xd5d(%rip),%xmm0
test   %ebp,%ebp
je     1240 <fingers+0xf0>
xorps  %xmm0,%xmm0
jmp    1240 <fingers+0xf0>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <endrotate@plt>

LLVM IR (-O0):
define void @fingers(i32 %0, float %1, float %2, float %3, float %4, i32 %5, i32 %6, float %7, float %8, float %9) {
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca i32
%17 = alloca i32
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca i32
%22 = alloca float
store i32 %0, i32* %11
store float %1, float* %12
store float %2, float* %13
store float %3, float* %14
store float %4, float* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store float %7, float* %18
store float %8, float* %19
store float %9, float* %20
%23 = load float, float* %12
%24 = fpext float %23 to double
%25 = fmul double 0x3FE6666666666666, %24
%26 = fptrunc double %25 to float
store float %26, float* %22
%27 = load i32, i32* %16
%28 = icmp ne i32 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %10
%30 = call i32 @rotate(i32 180, i32 1, i32 0, i32 0)
br label %31
31: ; preds = %29, %10
%32 = call i32 (...) @onion()
store i32 0, i32* %21
br label %33
33: ; preds = %62, %31
%34 = load i32, i32* %21
%35 = load i32, i32* %11
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %65
37: ; preds = %33
%38 = load float, float* %12
%39 = fpext float %38 to double
%40 = load i32, i32* %21
%41 = icmp eq i32 %40, 0
%42 = zext i1 %41 to i32
%43 = sitofp i32 %42 to float
%44 = load float, float* %12
%45 = fmul float %43, %44
%46 = fpext float %45 to double
%47 = call double @llvm.fmuladd.f64(double %46, double 2.500000e-01, double %39)
%48 = fptrunc double %47 to float
%49 = load float, float* %14
%50 = load i32, i32* %17
%51 = load float, float* %18
%52 = load float, float* %19
%53 = fpext float %52 to double
%54 = load float, float* %20
%55 = call i32 @finger(float %48, float %49, i32 %50, float %51, double %53, float %54, i32 0)
%56 = load float, float* %15
%57 = load float, float* %14
%58 = fadd float %57, %56
store float %58, float* %14
%59 = load float, float* %13
%60 = load float, float* %12
%61 = fsub float %60, %59
store float %61, float* %12
br label %62
62: ; preds = %37
%63 = load i32, i32* %21
%64 = add nsw i32 %63, 1
store i32 %64, i32* %21
br label %33
65: ; preds = %33
%66 = load float, float* %22
%67 = load float, float* %14
%68 = load i32, i32* %17
%69 = load float, float* %18
%70 = fpext float %69 to double
%71 = fmul double %70, 1.500000e+00
%72 = fptrunc double %71 to float
%73 = load float, float* %19
%74 = fpext float %73 to double
%75 = fsub double 2.000000e+00, %74
%76 = load float, float* %20
%77 = call i32 @finger(float %66, float %67, i32 %68, float %72, double %75, float %76, i32 1)
%78 = call i32 (...) @endonion()
%79 = load i32, i32* %16
%80 = icmp ne i32 %79, 0
br i1 %80, label %83, label %81
81: ; preds = %65
%82 = call i32 (...) @endrotate()
br label %83
83: ; preds = %81, %65
ret void
}

LLVM IR (-O2):
define void @fingers(i32 %0, float %1, float %2, float %3, float %4, i32 %5, i32 %6, float %7, float %8, float %9) {
%11 = fpext float %1 to double
%12 = fmul double %11, 0x3FE6666666666666
%13 = fptrunc double %12 to float
%14 = icmp eq i32 %5, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = tail call i32 @rotate(i32 180, i32 1, i32 0, i32 0)
br label %17
17: ; preds = %15, %10
%18 = tail call i32 (...) @onion()
%19 = icmp sgt i32 %0, 0
%20 = fpext float %8 to double
br i1 %19, label %21, label %37
21: ; preds = %17, %21
%22 = phi float [ %34, %21 ], [ %1, %17 ]
%23 = phi i32 [ %35, %21 ], [ 0, %17 ]
%24 = phi float [ %33, %21 ], [ %3, %17 ]
%25 = fpext float %22 to double
%26 = icmp eq i32 %23, 0
%27 = uitofp i1 %26 to float
%28 = fmul float %22, %27
%29 = fpext float %28 to double
%30 = tail call double @llvm.fmuladd.f64(double %29, double 2.500000e-01, double %25)
%31 = fptrunc double %30 to float
%32 = tail call i32 @finger(float %31, float %24, i32 %6, float %7, double %20, float %9, i32 0)
%33 = fadd float %24, %4
%34 = fsub float %22, %2
%35 = add nuw nsw i32 %23, 1
%36 = icmp eq i32 %35, %0
br i1 %36, label %37, label %21
37: ; preds = %21, %17
%38 = phi float [ %3, %17 ], [ %33, %21 ]
%39 = fmul float %7, 1.500000e+00
%40 = fsub double 2.000000e+00, %20
%41 = tail call i32 @finger(float %13, float %38, i32 %6, float %39, double %40, float %9, i32 1)
%42 = tail call i32 (...) @endonion()
br i1 %14, label %43, label %45
43: ; preds = %37
%44 = tail call i32 (...) @endrotate()
br label %45
45: ; preds = %43, %37
ret void
}