#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*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glTranslatef(float, float, float);
int /*<<< orphan*/ glutSolidCube(double);
int rand();
void randSolidCubeOnTable() {
  float zPos;
  float yPos;
  float xPos;
  int i = 0;
  for (; i < 100; ++i) {
    zPos = (rand() % 10) / 10.;
    yPos = (rand() % 5) / 10.;
    xPos = (rand() % 15) / 10.;
    glPushMatrix();
    glTranslatef(xPos - (1.5 / 2.) + 0.05, yPos + 0.075, zPos - 0.5 + 0.05);
    glutSolidCube(0.1);
    glPopMatrix();
  }
}


x86 assembly (clang, -O0):
<randSolidCubeOnTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    1272 <randSolidCubeOnTable+0x122>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xe7c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xe54(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe27(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe03(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xdfa(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xdd9(%rip),%xmm3
subsd  %xmm3,%xmm2
movsd  0xdc5(%rip),%xmm3
addsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
call   1060 <glTranslatef@plt>
movsd  0xda8(%rip),%xmm0
call   1030 <glutSolidCube@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115f <randSolidCubeOnTable+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randSolidCubeOnTable>:
push   %rbx
sub    $0x10,%rsp
mov    $0x64,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe6a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe29(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x3,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xde8(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xdcd(%rip),%xmm0
movsd  0xdcd(%rip),%xmm3
addsd  %xmm3,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xdbb(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  0xc(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
addsd  0xdad(%rip),%xmm2
addsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
call   1060 <glTranslatef@plt>
movsd  0xda0(%rip),%xmm0
call   1030 <glutSolidCube@plt>
xor    %eax,%eax
call   1040 <glPopMatrix@plt>
add    $0xffffffff,%ebx
jne    1160 <randSolidCubeOnTable+0x10>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @randSolidCubeOnTable() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %4
br label %5
5: ; preds = %42, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %45
8: ; preds = %5
%9 = call i32 (...) @rand()
%10 = srem i32 %9, 10
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+01
%13 = fptrunc double %12 to float
store float %13, float* %1
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 5
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 1.000000e+01
%18 = fptrunc double %17 to float
store float %18, float* %2
%19 = call i32 (...) @rand()
%20 = srem i32 %19, 15
%21 = sitofp i32 %20 to double
%22 = fdiv double %21, 1.000000e+01
%23 = fptrunc double %22 to float
store float %23, float* %3
%24 = call i32 (...) @glPushMatrix()
%25 = load float, float* %3
%26 = fpext float %25 to double
%27 = fsub double %26, 7.500000e-01
%28 = fadd double %27, 5.000000e-02
%29 = fptrunc double %28 to float
%30 = load float, float* %2
%31 = fpext float %30 to double
%32 = fadd double %31, 0x3FB3333333333333
%33 = fptrunc double %32 to float
%34 = load float, float* %1
%35 = fpext float %34 to double
%36 = fsub double %35, 5.000000e-01
%37 = fadd double %36, 5.000000e-02
%38 = fptrunc double %37 to float
%39 = call i32 @glTranslatef(float %29, float %33, float %38)
%40 = call i32 @glutSolidCube(double 1.000000e-01)
%41 = call i32 (...) @glPopMatrix()
br label %42
42: ; preds = %8
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %5
45: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @randSolidCubeOnTable() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %33, %1 ]
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 10
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.000000e+01
%7 = fptrunc double %6 to float
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 5
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+01
%12 = fptrunc double %11 to float
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 15
%15 = sitofp i32 %14 to double
%16 = fdiv double %15, 1.000000e+01
%17 = fptrunc double %16 to float
%18 = tail call i32 (...) @glPushMatrix()
%19 = fpext float %17 to double
%20 = fadd double %19, -7.500000e-01
%21 = fadd double %20, 5.000000e-02
%22 = fptrunc double %21 to float
%23 = fpext float %12 to double
%24 = fadd double %23, 0x3FB3333333333333
%25 = fptrunc double %24 to float
%26 = fpext float %7 to double
%27 = fadd double %26, -5.000000e-01
%28 = fadd double %27, 5.000000e-02
%29 = fptrunc double %28 to float
%30 = tail call i32 @glTranslatef(float %22, float %25, float %29)
%31 = tail call i32 @glutSolidCube(double 1.000000e-01)
%32 = tail call i32 (...) @glPopMatrix()
%33 = add nuw nsw i32 %2, 1
%34 = icmp eq i32 %33, 100
br i1 %34, label %35, label %1
35: ; preds = %1
ret void
}