#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*/ endrotate();
int /*<<< orphan*/ endxlate();
double r();
int /*<<< orphan*/ rotate(double, double, double, int);
int /*<<< orphan*/ tree(int, double);
int /*<<< orphan*/ xlate(int /*<<< orphan*/, int /*<<< orphan*/, double);
void branch(int level, double tilt, double height, double x, double y,
            double z) {
  xlate(0, 0, height);
  rotate(tilt, x, y, z);
  rotate((r() * 360.0), 0, 0, 1);
  tree(level, height * (r() * 0.3 + 0.6));
  endrotate();
  endrotate();
  endxlate();
}


x86 assembly (clang, -O0):
<branch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1030 <xlate@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
cvttsd2si -0x30(%rbp),%edi
call   1050 <rotate@plt>
mov    $0x0,%al
call   1040 <r@plt>
movsd  0xe56(%rip),%xmm1
mulsd  %xmm1,%xmm0
xorps  %xmm2,%xmm2
mov    $0x1,%edi
movaps %xmm2,%xmm1
call   1050 <rotate@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x0,%al
call   1040 <r@plt>
mov    -0x3c(%rbp),%edi
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  0xe08(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe04(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1080 <tree@plt>
mov    $0x0,%al
call   1060 <endrotate@plt>
mov    $0x0,%al
call   1060 <endrotate@plt>
mov    $0x0,%al
call   1070 <endxlate@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<branch>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm4,0x10(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebx
xor    %edi,%edi
xor    %esi,%esi
movaps %xmm1,%xmm0
call   1030 <xlate@plt>
cvttsd2si 0x10(%rsp),%edi
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
call   1050 <rotate@plt>
xor    %eax,%eax
call   1040 <r@plt>
mulsd  0xe43(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x1,%edi
call   1050 <rotate@plt>
xor    %eax,%eax
call   1040 <r@plt>
mulsd  0xe2c(%rip),%xmm0
addsd  0xe2c(%rip),%xmm0
mulsd  0x28(%rsp),%xmm0
mov    %ebx,%edi
call   1080 <tree@plt>
xor    %eax,%eax
call   1060 <endrotate@plt>
xor    %eax,%eax
call   1060 <endrotate@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
jmp    1070 <endxlate@plt>

LLVM IR (-O0):
define void @branch(i32 %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %9
%14 = call i32 @xlate(i32 0, i32 0, double %13)
%15 = load double, double* %8
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = fptosi double %18 to i32
%20 = call i32 @rotate(double %15, double %16, double %17, i32 %19)
%21 = call double (...) @r()
%22 = fmul double %21, 3.600000e+02
%23 = call i32 @rotate(double %22, double 0.000000e+00, double 0.000000e+00, i32 1)
%24 = load i32, i32* %7
%25 = load double, double* %9
%26 = call double (...) @r()
%27 = call double @llvm.fmuladd.f64(double %26, double 3.000000e-01, double 6.000000e-01)
%28 = fmul double %25, %27
%29 = call i32 @tree(i32 %24, double %28)
%30 = call i32 (...) @endrotate()
%31 = call i32 (...) @endrotate()
%32 = call i32 (...) @endxlate()
ret void
}

LLVM IR (-O2):
define void @branch(i32 %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @xlate(i32 0, i32 0, double %2)
%8 = fptosi double %5 to i32
%9 = tail call i32 @rotate(double %1, double %3, double %4, i32 %8)
%10 = tail call double (...) @r()
%11 = fmul double %10, 3.600000e+02
%12 = tail call i32 @rotate(double %11, double 0.000000e+00, double 0.000000e+00, i32 1)
%13 = tail call double (...) @r()
%14 = tail call double @llvm.fmuladd.f64(double %13, double 3.000000e-01, double 6.000000e-01)
%15 = fmul double %14, %2
%16 = tail call i32 @tree(i32 %0, double %15)
%17 = tail call i32 (...) @endrotate()
%18 = tail call i32 (...) @endrotate()
%19 = tail call i32 (...) @endxlate()
ret void
}