#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 */
struct state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeBlots(struct state *);
int /*<<< orphan*/ setupBlotsCube(struct state *);
int /*<<< orphan*/ setupBlotsCubeCorners(struct state *);
int /*<<< orphan*/ setupBlotsCylinder(struct state *);
int /*<<< orphan*/ setupBlotsDuo(struct state *);
int /*<<< orphan*/ setupBlotsSheet(struct state *);
int /*<<< orphan*/ setupBlotsSphere(struct state *);
int /*<<< orphan*/ setupBlotsSquiggle(struct state *);
int /*<<< orphan*/ setupBlotsSwirlyCone(struct state *);
int /*<<< orphan*/ setupBlotsTetrahedron(struct state *);
int ya_random();
void setupBlots(struct state *st) {
  int which =
      (((double)((ya_random() >> 8) & 0xffff)) / ((double)0x10000)) * 11;
  freeBlots(st);
  switch (which) {
  case 0:
    setupBlotsCube(st);
    break;
  case 1:
    setupBlotsSphere(st);
    break;
  case 2:
    setupBlotsCylinder(st);
    break;
  case 3:
    setupBlotsSquiggle(st);
    break;
  case 4:
    setupBlotsCubeCorners(st);
    break;
  case 5:
    setupBlotsTetrahedron(st);
    break;
  case 6:
    setupBlotsSheet(st);
    break;
  case 7:
    setupBlotsSwirlyCone(st);
    break;
  case 8:
  case 9:
  case 10:
    setupBlotsDuo(st);
    break;
  }
}


x86 assembly (clang, -O0):
<setupBlots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1040 <ya_random@plt>
shr    $0x8,%eax
movzwl %ax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe2b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe27(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   10d0 <freeBlots@plt>
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xa,%rax
ja     1293 <setupBlots+0xe3>
mov    -0x18(%rbp),%rax
lea    0xdff(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
call   1080 <setupBlotsCube@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   1070 <setupBlotsSphere@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   10b0 <setupBlotsCylinder@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   1050 <setupBlotsSquiggle@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   1060 <setupBlotsCubeCorners@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   10a0 <setupBlotsTetrahedron@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   1090 <setupBlotsSheet@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   10c0 <setupBlotsSwirlyCone@plt>
jmp    1293 <setupBlots+0xe3>
mov    -0x8(%rbp),%rdi
call   1030 <setupBlotsDuo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupBlots>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <ya_random@plt>
shr    $0x8,%eax
movzwl %ax,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xe30(%rip),%xmm0
mulsd  0xe30(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mov    %r14,%rdi
call   10d0 <freeBlots@plt>
cmp    $0xa,%ebx
ja     1208 <setupBlots+0x58>
lea    0xe20(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <setupBlotsDuo@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1080 <setupBlotsCube@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <setupBlotsSphere@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    10b0 <setupBlotsCylinder@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <setupBlotsSquiggle@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <setupBlotsCubeCorners@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    10a0 <setupBlotsTetrahedron@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1090 <setupBlotsSheet@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    10c0 <setupBlotsSwirlyCone@plt>

LLVM IR (-O0):
%struct.state = type { i32 }
define void @setupBlots(%struct.state* %0) {
%2 = alloca %struct.state*
%3 = alloca i32
store %struct.state* %0, %struct.state** %2
%4 = call i32 (...) @ya_random()
%5 = ashr i32 %4, 8
%6 = and i32 %5, 65535
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 6.553600e+04
%9 = fmul double %8, 1.100000e+01
%10 = fptosi double %9 to i32
store i32 %10, i32* %3
%11 = load %struct.state*, %struct.state** %2
%12 = call i32 @freeBlots(%struct.state* %11)
%13 = load i32, i32* %3
switch i32 %13, label %41 [
i32 0, label %14
i32 1, label %17
i32 2, label %20
i32 3, label %23
i32 4, label %26
i32 5, label %29
i32 6, label %32
i32 7, label %35
i32 8, label %38
i32 9, label %38
i32 10, label %38
]
14: ; preds = %1
%15 = load %struct.state*, %struct.state** %2
%16 = call i32 @setupBlotsCube(%struct.state* %15)
br label %41
17: ; preds = %1
%18 = load %struct.state*, %struct.state** %2
%19 = call i32 @setupBlotsSphere(%struct.state* %18)
br label %41
20: ; preds = %1
%21 = load %struct.state*, %struct.state** %2
%22 = call i32 @setupBlotsCylinder(%struct.state* %21)
br label %41
23: ; preds = %1
%24 = load %struct.state*, %struct.state** %2
%25 = call i32 @setupBlotsSquiggle(%struct.state* %24)
br label %41
26: ; preds = %1
%27 = load %struct.state*, %struct.state** %2
%28 = call i32 @setupBlotsCubeCorners(%struct.state* %27)
br label %41
29: ; preds = %1
%30 = load %struct.state*, %struct.state** %2
%31 = call i32 @setupBlotsTetrahedron(%struct.state* %30)
br label %41
32: ; preds = %1
%33 = load %struct.state*, %struct.state** %2
%34 = call i32 @setupBlotsSheet(%struct.state* %33)
br label %41
35: ; preds = %1
%36 = load %struct.state*, %struct.state** %2
%37 = call i32 @setupBlotsSwirlyCone(%struct.state* %36)
br label %41
38: ; preds = %1, %1, %1
%39 = load %struct.state*, %struct.state** %2
%40 = call i32 @setupBlotsDuo(%struct.state* %39)
br label %41
41: ; preds = %1, %38, %35, %32, %29, %26, %23, %20, %17, %14
ret void
}

LLVM IR (-O2):
%struct.state = type { i32 }
define void @setupBlots(%struct.state* %0) {
%2 = tail call i32 (...) @ya_random()
%3 = lshr i32 %2, 8
%4 = and i32 %3, 65535
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 0x3EF0000000000000
%7 = fmul double %6, 1.100000e+01
%8 = fptosi double %7 to i32
%9 = tail call i32 @freeBlots(%struct.state* %0)
switch i32 %8, label %28 [
i32 0, label %10
i32 1, label %12
i32 2, label %14
i32 3, label %16
i32 4, label %18
i32 5, label %20
i32 6, label %22
i32 7, label %24
i32 8, label %26
i32 9, label %26
i32 10, label %26
]
10: ; preds = %1
%11 = tail call i32 @setupBlotsCube(%struct.state* %0)
br label %28
12: ; preds = %1
%13 = tail call i32 @setupBlotsSphere(%struct.state* %0)
br label %28
14: ; preds = %1
%15 = tail call i32 @setupBlotsCylinder(%struct.state* %0)
br label %28
16: ; preds = %1
%17 = tail call i32 @setupBlotsSquiggle(%struct.state* %0)
br label %28
18: ; preds = %1
%19 = tail call i32 @setupBlotsCubeCorners(%struct.state* %0)
br label %28
20: ; preds = %1
%21 = tail call i32 @setupBlotsTetrahedron(%struct.state* %0)
br label %28
22: ; preds = %1
%23 = tail call i32 @setupBlotsSheet(%struct.state* %0)
br label %28
24: ; preds = %1
%25 = tail call i32 @setupBlotsSwirlyCone(%struct.state* %0)
br label %28
26: ; preds = %1, %1, %1
%27 = tail call i32 @setupBlotsDuo(%struct.state* %0)
br label %28
28: ; preds = %1, %26, %24, %22, %20, %18, %16, %14, %12, %10
ret void
}