#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*/ makeBody(double, double, double, double, double, double,
                            double, double, double, double, double);
int rand();
void singlebody() {
  int factor = 2000;
  double m = rand() % factor;
  double r = m / factor;
  double xpos = (rand() % 500) - 250;
  double ypos = (rand() % 500) - 250;
  double zpos = 0;
  double i = (rand() % 40) - 20;
  double j = (rand() % 40) - 20;
  double k = 0;
  double rc = (double)(rand() % 256) / 256.0;
  double g = (double)(rand() % 256) / 256.0;
  double b = (double)(rand() % 256) / 256.0;
  makeBody(m, r, xpos, ypos, zpos, i, j, k, rc, g, b);
}


x86 assembly (clang, -O0):
<singlebody>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x7d0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x1f4,%ecx
cltd
idiv   %ecx
sub    $0xfa,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x1f4,%ecx
cltd
idiv   %ecx
sub    $0xfa,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x28,%ecx
cltd
idiv   %ecx
sub    $0x14,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x28,%ecx
cltd
idiv   %ecx
sub    $0x14,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xe0a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xde6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xdc2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
movsd  -0x40(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm7
movsd  -0x50(%rbp),%xmm10
movsd  -0x58(%rbp),%xmm9
movsd  -0x60(%rbp),%xmm8
movsd  %xmm10,(%rsp)
movsd  %xmm9,0x8(%rsp)
movsd  %xmm8,0x10(%rsp)
call   1030 <makeBody@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<singlebody>:
sub    $0x58,%rsp
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x7d0,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x50(%rsp)
divsd  0xea5(%rip),%xmm0
movsd  %xmm0,0x48(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x1f4,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffff06,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x40(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x1f4,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffff06,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x38(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffffec,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffffec,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x28(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd9e(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd6f(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd40(%rip),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xorps  %xmm4,%xmm4
xorps  %xmm7,%xmm7
movsd  0x50(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
movsd  0x38(%rsp),%xmm3
movsd  0x30(%rsp),%xmm5
movsd  0x28(%rsp),%xmm6
call   1030 <makeBody@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @singlebody() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 2000, i32* %1
%13 = call i32 (...) @rand()
%14 = load i32, i32* %1
%15 = srem i32 %13, %14
%16 = sitofp i32 %15 to double
store double %16, double* %2
%17 = load double, double* %2
%18 = load i32, i32* %1
%19 = sitofp i32 %18 to double
%20 = fdiv double %17, %19
store double %20, double* %3
%21 = call i32 (...) @rand()
%22 = srem i32 %21, 500
%23 = sub nsw i32 %22, 250
%24 = sitofp i32 %23 to double
store double %24, double* %4
%25 = call i32 (...) @rand()
%26 = srem i32 %25, 500
%27 = sub nsw i32 %26, 250
%28 = sitofp i32 %27 to double
store double %28, double* %5
store double 0.000000e+00, double* %6
%29 = call i32 (...) @rand()
%30 = srem i32 %29, 40
%31 = sub nsw i32 %30, 20
%32 = sitofp i32 %31 to double
store double %32, double* %7
%33 = call i32 (...) @rand()
%34 = srem i32 %33, 40
%35 = sub nsw i32 %34, 20
%36 = sitofp i32 %35 to double
store double %36, double* %8
store double 0.000000e+00, double* %9
%37 = call i32 (...) @rand()
%38 = srem i32 %37, 256
%39 = sitofp i32 %38 to double
%40 = fdiv double %39, 2.560000e+02
store double %40, double* %10
%41 = call i32 (...) @rand()
%42 = srem i32 %41, 256
%43 = sitofp i32 %42 to double
%44 = fdiv double %43, 2.560000e+02
store double %44, double* %11
%45 = call i32 (...) @rand()
%46 = srem i32 %45, 256
%47 = sitofp i32 %46 to double
%48 = fdiv double %47, 2.560000e+02
store double %48, double* %12
%49 = load double, double* %2
%50 = load double, double* %3
%51 = load double, double* %4
%52 = load double, double* %5
%53 = load double, double* %6
%54 = load double, double* %7
%55 = load double, double* %8
%56 = load double, double* %9
%57 = load double, double* %10
%58 = load double, double* %11
%59 = load double, double* %12
%60 = call i32 @makeBody(double %49, double %50, double %51, double %52, double %53, double %54, double %55, double %56, double %57, double %58, double %59)
ret void
}

LLVM IR (-O2):
define void @singlebody() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2000
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 2.000000e+03
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 500
%7 = add nsw i32 %6, -250
%8 = sitofp i32 %7 to double
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 500
%11 = add nsw i32 %10, -250
%12 = sitofp i32 %11 to double
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 40
%15 = add nsw i32 %14, -20
%16 = sitofp i32 %15 to double
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 40
%19 = add nsw i32 %18, -20
%20 = sitofp i32 %19 to double
%21 = tail call i32 (...) @rand()
%22 = srem i32 %21, 256
%23 = sitofp i32 %22 to double
%24 = fmul double %23, 3.906250e-03
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 256
%27 = sitofp i32 %26 to double
%28 = fmul double %27, 3.906250e-03
%29 = tail call i32 (...) @rand()
%30 = srem i32 %29, 256
%31 = sitofp i32 %30 to double
%32 = fmul double %31, 3.906250e-03
%33 = tail call i32 @makeBody(double %3, double %4, double %8, double %12, double 0.000000e+00, double %16, double %20, double 0.000000e+00, double %24, double %28, double %32)
ret void
}