#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 */
scalar_t__ M_PI;
double cos(int);
int fabs(double);
int /*<<< orphan*/ printf(char *, double, double, double, double, double,
                          double);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double simulation(double *velocity_simulation) {
  double coordinate_x, coordinate_y, coordinate_z;
  double velocity_x, velocity_y, velocity_z;
  double force_x = 0, force_y = 0, force_z = 0;
  double massofgas = 1;
  int ifout = 0;
  srand(time(NULL));
  coordinate_x = rand() % 22;
  coordinate_y = rand() % 22;
  coordinate_z = rand() % 22;
  velocity_x =
      *velocity_simulation * cos(((rand() % 360 + 1) * ((double)M_PI)) / 180.0);
  velocity_y =
      *velocity_simulation * cos(((rand() % 360 + 1) * ((double)M_PI)) / 180.0);
  velocity_z =
      *velocity_simulation * cos(((rand() % 360 + 1) * ((double)M_PI)) / 180.0);
  for (;; ifout = 0) {
    coordinate_x += velocity_x;
    coordinate_y += velocity_y;
    coordinate_z += velocity_z;
    for (;;) {
      if (coordinate_x > 22 || coordinate_x < 0) {
        coordinate_x -= velocity_x;
        velocity_x *= -1;
        force_x += 2 * massofgas * fabs(velocity_x);
        ifout = 1;
      }
      if (coordinate_y > 22 || coordinate_y < 0) {
        coordinate_y -= velocity_y;
        velocity_y *= -1;
        force_y += 2 * massofgas * fabs(velocity_y);
        ifout = 1;
      }
      if (coordinate_z > 22 || coordinate_z < 0) {
        coordinate_z -= velocity_z;
        velocity_z *= -1;
        force_z += 2 * massofgas * fabs(velocity_z);
        ifout = 1;
      }
      if (!(coordinate_x > 22) && !(coordinate_x < 0) && !(coordinate_y > 22) &&
          !(coordinate_y < 0) && !(coordinate_z > 22) && !(coordinate_z < 0))
        break;
    }
    if (ifout) {
      printf("x方向にかかった力：%lf y方向にかかった力：%lf "
             "z方向にかかった力：%lf\nx座標：%lf y座標：%lf z座標：%lf\n",
             force_x, force_y, force_z, coordinate_x, coordinate_y,
             coordinate_z);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<simulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe79(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x16,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x16,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x16,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x168,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
mov    0x2dcb(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x168,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
mov    0x2d72(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd79(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x168,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
mov    0x2d19(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd20(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xcd8(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1350 <simulation+0x1f0>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    13b3 <simulation+0x253>
movsd  -0x28(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xcb5(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xc9b(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <fabs@plt>
movsd  -0x80(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x5c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xc50(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     13d8 <simulation+0x278>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1441 <simulation+0x2e1>
movsd  -0x30(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xc2d(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xc13(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1050 <fabs@plt>
movsd  -0x88(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x1,-0x5c(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xbc2(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1466 <simulation+0x306>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    14cf <simulation+0x36f>
movsd  -0x38(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xb9f(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xb85(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <fabs@plt>
movsd  -0x90(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x1,-0x5c(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xb34(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1543 <simulation+0x3e3>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1543 <simulation+0x3e3>
movsd  -0x18(%rbp),%xmm0
movsd  0xb0f(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1543 <simulation+0x3e3>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1543 <simulation+0x3e3>
movsd  -0x20(%rbp),%xmm0
movsd  0xaea(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1543 <simulation+0x3e3>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
ja     1543 <simulation+0x3e3>
jmp    1548 <simulation+0x3e8>
jmp    132b <simulation+0x1cb>
cmpl   $0x0,-0x5c(%rbp)
je     157c <simulation+0x41c>
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm5
lea    0xab1(%rip),%rdi
call   1030 <printf@plt>
jmp    1581 <simulation+0x421>
movl   $0x0,-0x5c(%rbp)
jmp    12fe <simulation+0x19e>

x86 assembly (clang, -O2):
<simulation>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2e8ba2e9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2e8ba2e9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2e8ba2e9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x50(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x8,%ecx
add    %edx,%ecx
imul   $0x168,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x2d8a(%rip),%r14
cvtsi2sdq (%r14),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xd91(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <cos@plt>
mulsd  0x50(%rsp),%xmm0
movapd %xmm0,0x50(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x40(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x8,%ecx
add    %edx,%ecx
imul   $0x168,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq (%r14),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xd2a(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <cos@plt>
mulsd  0x40(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x30(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x8,%ecx
add    %edx,%ecx
imul   $0x168,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq (%r14),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xcc3(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <cos@plt>
movsd  (%rsp),%xmm5
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
xorpd  %xmm0,%xmm0
movsd  0xc99(%rip),%xmm3
lea    0xcaa(%rip),%rbx
xorps  %xmm4,%xmm4
movsd  %xmm4,0x28(%rsp)
xorps  %xmm4,%xmm4
movsd  %xmm4,0x20(%rsp)
xorps  %xmm4,%xmm4
movsd  %xmm4,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  0x50(%rsp),%xmm1
addsd  0x40(%rsp),%xmm2
addsd  0x30(%rsp),%xmm5
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
ucomisd %xmm3,%xmm1
movsd  %xmm2,0x8(%rsp)
movsd  %xmm5,(%rsp)
ja     13f0 <simulation+0x290>
ucomisd %xmm1,%xmm0
ja     13f0 <simulation+0x290>
movsd  %xmm1,0x10(%rsp)
ucomisd %xmm3,%xmm2
jbe    144b <simulation+0x2eb>
jmp    1451 <simulation+0x2f1>
cs nopw 0x0(%rax,%rax,1)
nop
movapd 0x50(%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
xorpd  0xc08(%rip),%xmm0
movapd %xmm0,0x50(%rsp)
call   1050 <fabs@plt>
movsd  0xbed(%rip),%xmm3
movsd  0x8(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0x28(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
ucomisd %xmm3,%xmm2
ja     1451 <simulation+0x2f1>
ucomisd %xmm2,%xmm0
jbe    14a0 <simulation+0x340>
movapd 0x40(%rsp),%xmm0
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
xorpd  0xba7(%rip),%xmm0
movapd %xmm0,0x40(%rsp)
call   1050 <fabs@plt>
movsd  0xb8c(%rip),%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
movsd  (%rsp),%xmm5
ucomisd %xmm3,%xmm5
ja     14b1 <simulation+0x351>
ucomisd %xmm5,%xmm0
jbe    1504 <simulation+0x3a4>
movapd 0x30(%rsp),%xmm0
subsd  %xmm0,%xmm5
movsd  %xmm5,(%rsp)
xorpd  0xb48(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
call   1050 <fabs@plt>
movsd  0xb2d(%rip),%xmm3
movsd  (%rsp),%xmm5
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
ucomisd %xmm3,%xmm1
ja     13c0 <simulation+0x260>
ucomisd %xmm1,%xmm0
ja     13c0 <simulation+0x260>
ucomisd %xmm3,%xmm2
ja     13c0 <simulation+0x260>
ucomisd %xmm2,%xmm0
ja     13c0 <simulation+0x260>
ucomisd %xmm3,%xmm5
ja     13c0 <simulation+0x260>
ucomisd %xmm5,%xmm0
ja     13c0 <simulation+0x260>
test   %eax,%eax
je     13a0 <simulation+0x240>
mov    %rbx,%rdi
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
movsd  %xmm5,(%rsp)
movsd  (%rsp),%xmm5
call   1030 <printf@plt>
movsd  0xa7c(%rip),%xmm3
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm5
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
jmp    13a0 <simulation+0x240>

LLVM IR (-O0):
@M_PI = global i64 0
@.str = [139 x i8] c"x\E6\96\B9\E5\90\91\E3\81\AB\E3\81\8B\E3\81\8B\E3\81\A3\E3\81\9F\E5\8A\9B\EF\BC\9A%lf y\E6\96\B9\E5\90\91\E3\81\AB\E3\81\8B\E3\81\8B\E3\81\A3\E3\81\9F\E5\8A\9B\EF\BC\9A%lf z\E6\96\B9\E5\90\91\E3\81\AB\E3\81\8B\E3\81\8B\E3\81\A3\E3\81\9F\E5\8A\9B\EF\BC\9A%lf\0Ax\E5\BA\A7\E6\A8\99\EF\BC\9A%lf y\E5\BA\A7\E6\A8\99\EF\BC\9A%lf z\E5\BA\A7\E6\A8\99\EF\BC\9A%lf\0A\00"
define double @simulation(double* %0) {
%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
%13 = alloca i32
store double* %0, double** %2
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
store double 1.000000e+00, double* %12
store i32 0, i32* %13
%14 = call i32 @time(i32* null)
%15 = call i32 @srand(i32 %14)
%16 = call i32 (...) @rand()
%17 = srem i32 %16, 22
%18 = sitofp i32 %17 to double
store double %18, double* %3
%19 = call i32 (...) @rand()
%20 = srem i32 %19, 22
%21 = sitofp i32 %20 to double
store double %21, double* %4
%22 = call i32 (...) @rand()
%23 = srem i32 %22, 22
%24 = sitofp i32 %23 to double
store double %24, double* %5
%25 = load double*, double** %2
%26 = load double, double* %25
%27 = call i32 (...) @rand()
%28 = srem i32 %27, 360
%29 = add nsw i32 %28, 1
%30 = sitofp i32 %29 to double
%31 = load i64, i64* @M_PI
%32 = sitofp i64 %31 to double
%33 = fmul double %30, %32
%34 = fdiv double %33, 1.800000e+02
%35 = fptosi double %34 to i32
%36 = call double @cos(i32 %35)
%37 = fmul double %26, %36
store double %37, double* %6
%38 = load double*, double** %2
%39 = load double, double* %38
%40 = call i32 (...) @rand()
%41 = srem i32 %40, 360
%42 = add nsw i32 %41, 1
%43 = sitofp i32 %42 to double
%44 = load i64, i64* @M_PI
%45 = sitofp i64 %44 to double
%46 = fmul double %43, %45
%47 = fdiv double %46, 1.800000e+02
%48 = fptosi double %47 to i32
%49 = call double @cos(i32 %48)
%50 = fmul double %39, %49
store double %50, double* %7
%51 = load double*, double** %2
%52 = load double, double* %51
%53 = call i32 (...) @rand()
%54 = srem i32 %53, 360
%55 = add nsw i32 %54, 1
%56 = sitofp i32 %55 to double
%57 = load i64, i64* @M_PI
%58 = sitofp i64 %57 to double
%59 = fmul double %56, %58
%60 = fdiv double %59, 1.800000e+02
%61 = fptosi double %60 to i32
%62 = call double @cos(i32 %61)
%63 = fmul double %52, %62
store double %63, double* %8
br label %64
64: ; preds = %163, %1
%65 = load double, double* %6
%66 = load double, double* %3
%67 = fadd double %66, %65
store double %67, double* %3
%68 = load double, double* %7
%69 = load double, double* %4
%70 = fadd double %69, %68
store double %70, double* %4
%71 = load double, double* %8
%72 = load double, double* %5
%73 = fadd double %72, %71
store double %73, double* %5
br label %74
74: ; preds = %150, %64
%75 = load double, double* %3
%76 = fcmp ogt double %75, 2.200000e+01
br i1 %76, label %80, label %77
77: ; preds = %74
%78 = load double, double* %3
%79 = fcmp olt double %78, 0.000000e+00
br i1 %79, label %80, label %93
80: ; preds = %77, %74
%81 = load double, double* %6
%82 = load double, double* %3
%83 = fsub double %82, %81
store double %83, double* %3
%84 = load double, double* %6
%85 = fmul double %84, -1.000000e+00
store double %85, double* %6
%86 = load double, double* %12
%87 = fmul double 2.000000e+00, %86
%88 = load double, double* %6
%89 = call i32 @fabs(double %88)
%90 = sitofp i32 %89 to double
%91 = load double, double* %9
%92 = call double @llvm.fmuladd.f64(double %87, double %90, double %91)
store double %92, double* %9
store i32 1, i32* %13
br label %93
93: ; preds = %80, %77
%94 = load double, double* %4
%95 = fcmp ogt double %94, 2.200000e+01
br i1 %95, label %99, label %96
96: ; preds = %93
%97 = load double, double* %4
%98 = fcmp olt double %97, 0.000000e+00
br i1 %98, label %99, label %112
99: ; preds = %96, %93
%100 = load double, double* %7
%101 = load double, double* %4
%102 = fsub double %101, %100
store double %102, double* %4
%103 = load double, double* %7
%104 = fmul double %103, -1.000000e+00
store double %104, double* %7
%105 = load double, double* %12
%106 = fmul double 2.000000e+00, %105
%107 = load double, double* %7
%108 = call i32 @fabs(double %107)
%109 = sitofp i32 %108 to double
%110 = load double, double* %10
%111 = call double @llvm.fmuladd.f64(double %106, double %109, double %110)
store double %111, double* %10
store i32 1, i32* %13
br label %112
112: ; preds = %99, %96
%113 = load double, double* %5
%114 = fcmp ogt double %113, 2.200000e+01
br i1 %114, label %118, label %115
115: ; preds = %112
%116 = load double, double* %5
%117 = fcmp olt double %116, 0.000000e+00
br i1 %117, label %118, label %131
118: ; preds = %115, %112
%119 = load double, double* %8
%120 = load double, double* %5
%121 = fsub double %120, %119
store double %121, double* %5
%122 = load double, double* %8
%123 = fmul double %122, -1.000000e+00
store double %123, double* %8
%124 = load double, double* %12
%125 = fmul double 2.000000e+00, %124
%126 = load double, double* %8
%127 = call i32 @fabs(double %126)
%128 = sitofp i32 %127 to double
%129 = load double, double* %11
%130 = call double @llvm.fmuladd.f64(double %125, double %128, double %129)
store double %130, double* %11
store i32 1, i32* %13
br label %131
131: ; preds = %118, %115
%132 = load double, double* %3
%133 = fcmp ogt double %132, 2.200000e+01
br i1 %133, label %150, label %134
134: ; preds = %131
%135 = load double, double* %3
%136 = fcmp olt double %135, 0.000000e+00
br i1 %136, label %150, label %137
137: ; preds = %134
%138 = load double, double* %4
%139 = fcmp ogt double %138, 2.200000e+01
br i1 %139, label %150, label %140
140: ; preds = %137
%141 = load double, double* %4
%142 = fcmp olt double %141, 0.000000e+00
br i1 %142, label %150, label %143
143: ; preds = %140
%144 = load double, double* %5
%145 = fcmp ogt double %144, 2.200000e+01
br i1 %145, label %150, label %146
146: ; preds = %143
%147 = load double, double* %5
%148 = fcmp olt double %147, 0.000000e+00
br i1 %148, label %150, label %149
149: ; preds = %146
br label %151
150: ; preds = %146, %143, %140, %137, %134, %131
br label %74
151: ; preds = %149
%152 = load i32, i32* %13
%153 = icmp ne i32 %152, 0
br i1 %153, label %154, label %162
154: ; preds = %151
%155 = load double, double* %9
%156 = load double, double* %10
%157 = load double, double* %11
%158 = load double, double* %3
%159 = load double, double* %4
%160 = load double, double* %5
%161 = call i32 @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), double %155, double %156, double %157, double %158, double %159, double %160)
br label %162
162: ; preds = %154, %151
br label %163
163: ; preds = %162
store i32 0, i32* %13
br label %64
}

LLVM IR (-O2):
@M_PI = global i64 0
@.str = [139 x i8] c"x\E6\96\B9\E5\90\91\E3\81\AB\E3\81\8B\E3\81\8B\E3\81\A3\E3\81\9F\E5\8A\9B\EF\BC\9A%lf y\E6\96\B9\E5\90\91\E3\81\AB\E3\81\8B\E3\81\8B\E3\81\A3\E3\81\9F\E5\8A\9B\EF\BC\9A%lf z\E6\96\B9\E5\90\91\E3\81\AB\E3\81\8B\E3\81\8B\E3\81\A3\E3\81\9F\E5\8A\9B\EF\BC\9A%lf\0Ax\E5\BA\A7\E6\A8\99\EF\BC\9A%lf y\E5\BA\A7\E6\A8\99\EF\BC\9A%lf z\E5\BA\A7\E6\A8\99\EF\BC\9A%lf\0A\00"
define double @simulation(double* nocapture %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 22
%6 = sitofp i32 %5 to double
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 22
%9 = sitofp i32 %8 to double
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 22
%12 = sitofp i32 %11 to double
%13 = load double, double* %0
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 360
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
%18 = load i64, i64* @M_PI
%19 = sitofp i64 %18 to double
%20 = fmul double %19, %17
%21 = fdiv double %20, 1.800000e+02
%22 = fptosi double %21 to i32
%23 = tail call double @cos(i32 %22)
%24 = fmul double %13, %23
%25 = load double, double* %0
%26 = tail call i32 (...) @rand()
%27 = srem i32 %26, 360
%28 = add nsw i32 %27, 1
%29 = sitofp i32 %28 to double
%30 = load i64, i64* @M_PI
%31 = sitofp i64 %30 to double
%32 = fmul double %31, %29
%33 = fdiv double %32, 1.800000e+02
%34 = fptosi double %33 to i32
%35 = tail call double @cos(i32 %34)
%36 = fmul double %25, %35
%37 = load double, double* %0
%38 = tail call i32 (...) @rand()
%39 = srem i32 %38, 360
%40 = add nsw i32 %39, 1
%41 = sitofp i32 %40 to double
%42 = load i64, i64* @M_PI
%43 = sitofp i64 %42 to double
%44 = fmul double %43, %41
%45 = fdiv double %44, 1.800000e+02
%46 = fptosi double %45 to i32
%47 = tail call double @cos(i32 %46)
%48 = fmul double %37, %47
br label %49
49: ; preds = %128, %1
%50 = phi double [ %9, %1 ], [ %97, %128 ]
%51 = phi double [ %12, %1 ], [ %111, %128 ]
%52 = phi double [ %24, %1 ], [ %83, %128 ]
%53 = phi double [ %36, %1 ], [ %98, %128 ]
%54 = phi double [ %48, %1 ], [ %112, %128 ]
%55 = phi double [ 0.000000e+00, %1 ], [ %84, %128 ]
%56 = phi double [ 0.000000e+00, %1 ], [ %99, %128 ]
%57 = phi double [ 0.000000e+00, %1 ], [ %113, %128 ]
%58 = phi double [ %6, %1 ], [ %85, %128 ]
%59 = fadd double %52, %58
%60 = fadd double %50, %53
%61 = fadd double %51, %54
br label %62
62: ; preds = %110, %49
%63 = phi double [ %60, %49 ], [ %97, %110 ]
%64 = phi double [ %61, %49 ], [ %111, %110 ]
%65 = phi double [ %52, %49 ], [ %83, %110 ]
%66 = phi double [ %53, %49 ], [ %98, %110 ]
%67 = phi double [ %54, %49 ], [ %112, %110 ]
%68 = phi double [ %55, %49 ], [ %84, %110 ]
%69 = phi double [ %56, %49 ], [ %99, %110 ]
%70 = phi double [ %57, %49 ], [ %113, %110 ]
%71 = phi double [ %59, %49 ], [ %85, %110 ]
%72 = phi i32 [ 0, %49 ], [ %114, %110 ]
%73 = fcmp ogt double %71, 2.200000e+01
%74 = fcmp olt double %71, 0.000000e+00
%75 = or i1 %73, %74
br i1 %75, label %76, label %82
76: ; preds = %62
%77 = fsub double %71, %65
%78 = fneg double %65
%79 = tail call i32 @fabs(double %78)
%80 = sitofp i32 %79 to double
%81 = tail call double @llvm.fmuladd.f64(double %80, double 2.000000e+00, double %68)
br label %82
82: ; preds = %62, %76
%83 = phi double [ %78, %76 ], [ %65, %62 ]
%84 = phi double [ %81, %76 ], [ %68, %62 ]
%85 = phi double [ %77, %76 ], [ %71, %62 ]
%86 = phi i32 [ 1, %76 ], [ %72, %62 ]
%87 = fcmp ogt double %63, 2.200000e+01
%88 = fcmp olt double %63, 0.000000e+00
%89 = or i1 %87, %88
br i1 %89, label %90, label %96
90: ; preds = %82
%91 = fsub double %63, %66
%92 = fneg double %66
%93 = tail call i32 @fabs(double %92)
%94 = sitofp i32 %93 to double
%95 = tail call double @llvm.fmuladd.f64(double %94, double 2.000000e+00, double %69)
br label %96
96: ; preds = %82, %90
%97 = phi double [ %91, %90 ], [ %63, %82 ]
%98 = phi double [ %92, %90 ], [ %66, %82 ]
%99 = phi double [ %95, %90 ], [ %69, %82 ]
%100 = phi i32 [ 1, %90 ], [ %86, %82 ]
%101 = fcmp ogt double %64, 2.200000e+01
%102 = fcmp olt double %64, 0.000000e+00
%103 = or i1 %101, %102
br i1 %103, label %104, label %110
104: ; preds = %96
%105 = fsub double %64, %67
%106 = fneg double %67
%107 = tail call i32 @fabs(double %106)
%108 = sitofp i32 %107 to double
%109 = tail call double @llvm.fmuladd.f64(double %108, double 2.000000e+00, double %70)
br label %110
110: ; preds = %96, %104
%111 = phi double [ %105, %104 ], [ %64, %96 ]
%112 = phi double [ %106, %104 ], [ %67, %96 ]
%113 = phi double [ %109, %104 ], [ %70, %96 ]
%114 = phi i32 [ 1, %104 ], [ %100, %96 ]
%115 = fcmp ogt double %85, 2.200000e+01
%116 = fcmp olt double %85, 0.000000e+00
%117 = or i1 %115, %116
%118 = fcmp ogt double %97, 2.200000e+01
%119 = select i1 %117, i1 true, i1 %118
%120 = fcmp olt double %97, 0.000000e+00
%121 = select i1 %119, i1 true, i1 %120
%122 = fcmp ogt double %111, 2.200000e+01
%123 = select i1 %121, i1 true, i1 %122
%124 = fcmp olt double %111, 0.000000e+00
%125 = select i1 %123, i1 true, i1 %124
br i1 %125, label %62, label %126
126: ; preds = %110
%127 = icmp eq i32 %114, 0
br i1 %127, label %128, label %129
128: ; preds = %126, %129
br label %49
129: ; preds = %126
%130 = tail call i32 @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), double %84, double %99, double %113, double %85, double %97, double %111)
br label %128
}