#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 asteroid() {
  int factor = 10000;
  double m = rand() % factor / 10;
  double r = m / 10;
  double xpos = (double)(rand() % factor) - factor / 2;
  double ypos = (rand() % factor) - factor / 2;
  double zpos = (rand() % factor) - factor / 2;
  double i = (rand() % 200) - 100;
  double j = (rand() % 200) - 100;
  double k = (rand() % 200) - 100;
  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):
<asteroid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x2710,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
cvtsi2sd %edx,%xmm0
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x68(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x68(%rbp),%edx
sub    %eax,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x64(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x64(%rbp),%edx
sub    %eax,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xc8,%ecx
cltd
idiv   %ecx
sub    $0x64,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xc8,%ecx
cltd
idiv   %ecx
sub    $0x64,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xc8,%ecx
cltd
idiv   %ecx
sub    $0x64,%edx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xdb9(%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  0xd95(%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  0xd71(%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):
<asteroid>:
sub    $0x68,%rsp
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%ecx
sub    %ecx,%eax
cwtl
imul   $0x6667,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x12,%eax
add    %ecx,%eax
cwtl
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x60(%rsp)
divsd  0xe93(%rip),%xmm0
movsd  %xmm0,0x58(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffec78,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x50(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffec78,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x48(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffec78,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x40(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0xc8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffff9c,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x38(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0xc8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffff9c,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0xc8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffff9c,%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  0xd1c(%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  0xced(%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  0xcbe(%rip),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0x60(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
movsd  0x50(%rsp),%xmm2
movsd  0x48(%rsp),%xmm3
movsd  0x40(%rsp),%xmm4
movsd  0x38(%rsp),%xmm5
movsd  0x30(%rsp),%xmm6
movsd  0x28(%rsp),%xmm7
call   1030 <makeBody@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define void @asteroid() {
%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 10000, i32* %1
%13 = call i32 (...) @rand()
%14 = load i32, i32* %1
%15 = srem i32 %13, %14
%16 = sdiv i32 %15, 10
%17 = sitofp i32 %16 to double
store double %17, double* %2
%18 = load double, double* %2
%19 = fdiv double %18, 1.000000e+01
store double %19, double* %3
%20 = call i32 (...) @rand()
%21 = load i32, i32* %1
%22 = srem i32 %20, %21
%23 = sitofp i32 %22 to double
%24 = load i32, i32* %1
%25 = sdiv i32 %24, 2
%26 = sitofp i32 %25 to double
%27 = fsub double %23, %26
store double %27, double* %4
%28 = call i32 (...) @rand()
%29 = load i32, i32* %1
%30 = srem i32 %28, %29
%31 = load i32, i32* %1
%32 = sdiv i32 %31, 2
%33 = sub nsw i32 %30, %32
%34 = sitofp i32 %33 to double
store double %34, double* %5
%35 = call i32 (...) @rand()
%36 = load i32, i32* %1
%37 = srem i32 %35, %36
%38 = load i32, i32* %1
%39 = sdiv i32 %38, 2
%40 = sub nsw i32 %37, %39
%41 = sitofp i32 %40 to double
store double %41, double* %6
%42 = call i32 (...) @rand()
%43 = srem i32 %42, 200
%44 = sub nsw i32 %43, 100
%45 = sitofp i32 %44 to double
store double %45, double* %7
%46 = call i32 (...) @rand()
%47 = srem i32 %46, 200
%48 = sub nsw i32 %47, 100
%49 = sitofp i32 %48 to double
store double %49, double* %8
%50 = call i32 (...) @rand()
%51 = srem i32 %50, 200
%52 = sub nsw i32 %51, 100
%53 = sitofp i32 %52 to double
store double %53, double* %9
%54 = call i32 (...) @rand()
%55 = srem i32 %54, 256
%56 = sitofp i32 %55 to double
%57 = fdiv double %56, 2.560000e+02
store double %57, double* %10
%58 = call i32 (...) @rand()
%59 = srem i32 %58, 256
%60 = sitofp i32 %59 to double
%61 = fdiv double %60, 2.560000e+02
store double %61, double* %11
%62 = call i32 (...) @rand()
%63 = srem i32 %62, 256
%64 = sitofp i32 %63 to double
%65 = fdiv double %64, 2.560000e+02
store double %65, double* %12
%66 = load double, double* %2
%67 = load double, double* %3
%68 = load double, double* %4
%69 = load double, double* %5
%70 = load double, double* %6
%71 = load double, double* %7
%72 = load double, double* %8
%73 = load double, double* %9
%74 = load double, double* %10
%75 = load double, double* %11
%76 = load double, double* %12
%77 = call i32 @makeBody(double %66, double %67, double %68, double %69, double %70, double %71, double %72, double %73, double %74, double %75, double %76)
ret void
}

LLVM IR (-O2):
define void @asteroid() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10000
%3 = trunc i32 %2 to i16
%4 = sdiv i16 %3, 10
%5 = sitofp i16 %4 to double
%6 = fdiv double %5, 1.000000e+01
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 10000
%9 = add nsw i32 %8, -5000
%10 = sitofp i32 %9 to double
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 10000
%13 = add nsw i32 %12, -5000
%14 = sitofp i32 %13 to double
%15 = tail call i32 (...) @rand()
%16 = srem i32 %15, 10000
%17 = add nsw i32 %16, -5000
%18 = sitofp i32 %17 to double
%19 = tail call i32 (...) @rand()
%20 = srem i32 %19, 200
%21 = add nsw i32 %20, -100
%22 = sitofp i32 %21 to double
%23 = tail call i32 (...) @rand()
%24 = srem i32 %23, 200
%25 = add nsw i32 %24, -100
%26 = sitofp i32 %25 to double
%27 = tail call i32 (...) @rand()
%28 = srem i32 %27, 200
%29 = add nsw i32 %28, -100
%30 = sitofp i32 %29 to double
%31 = tail call i32 (...) @rand()
%32 = srem i32 %31, 256
%33 = sitofp i32 %32 to double
%34 = fmul double %33, 3.906250e-03
%35 = tail call i32 (...) @rand()
%36 = srem i32 %35, 256
%37 = sitofp i32 %36 to double
%38 = fmul double %37, 3.906250e-03
%39 = tail call i32 (...) @rand()
%40 = srem i32 %39, 256
%41 = sitofp i32 %40 to double
%42 = fmul double %41, 3.906250e-03
%43 = tail call i32 @makeBody(double %5, double %6, double %10, double %14, double %18, double %22, double %26, double %30, double %34, double %38, double %42)
ret void
}