#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__ RAND_MAX;
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
double sin(double);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int p3(int r) {
  int t, i, j;
  double result, retorno;
  double *info[2];
  printf("===> P3: Iniciando.\n");
  printf("===> P3: Será(ão) executado(s) %d lançamento(s).\n", r);
  if (1) {
    printf("===> P3: Recebido r = %d\n", r);
  }
  info[0] = (double *)malloc(r * sizeof(double));
  info[1] = (double *)malloc(r * sizeof(double));
  srand(time(NULL));
  for (i = 0; i < r; i++) {
    info[0][i] = ((double)rand() / (double)((unsigned)RAND_MAX + 1));
    info[1][i] =
        ((double)rand() / (double)((unsigned)RAND_MAX + 1)) * 6.28318530718;
  }
  t = 0;
  for (i = 0; i < r; i++) {
    result = info[0][i] + sin(info[1][i]);
    if (result < 0 || result > 1)
      t++;
  }
  if (1) {
    for (i = 0; i < 2; i++) {
      for (j = 0; j < r; j++) {
        printf("info[%d][%d] = %f\n", i, j, info[i][j]);
      }
    }
  }
  retorno = (double)t / r;
  printf("===> P3: r = %d, t = %d\n", r, t);
  printf("===> P3: t/r = %f\n", retorno);
  printf("===> P3: Probabilidade estimada: %f \n", retorno);
  printf("===> P3: Finalizado.\n");
  free(info[0]);
  free(info[1]);
  return (int)(retorno * 100);
}


x86 assembly (clang, -O0):
<p3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1275 <p3+0x105>
xor    %eax,%eax
mov    %al,-0x39(%rbp)
call   1090 <rand@plt>
mov    %rax,%rcx
mov    -0x39(%rbp),%al
cvtsi2sd %rcx,%xmm0
mov    0x2dd8(%rip),%rcx
mov    %rcx,-0x38(%rbp)
mov    (%rcx),%ecx
add    $0x1,%ecx
cvtsi2sd %rcx,%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsd  %xmm0,(%rcx,%rdx,8)
call   1090 <rand@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cvtsi2sd %rcx,%xmm0
mov    (%rax),%eax
add    $0x1,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xdba(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e8 <p3+0x78>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1305 <p3+0x195>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     12e9 <p3+0x179>
movsd  -0x18(%rbp),%xmm0
movsd  0xd29(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12f2 <p3+0x182>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12f7 <p3+0x187>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1283 <p3+0x113>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1370 <p3+0x200>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    135d <p3+0x1ed>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd34(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    131d <p3+0x1ad>
jmp    1362 <p3+0x1f2>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    130c <p3+0x19c>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xcff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xd05(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xd05(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movsd  0xc1b(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0xf3d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7d(%rip),%rdi
xor    %r13d,%r13d
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9f(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x0(,%rbp,8),%ebx
mov    %ebx,%edi
call   1090 <malloc@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
test   %ebp,%ebp
jle    13d5 <p3+0x255>
mov    %rbp,0x8(%rsp)
mov    %ebp,%r14d
mov    0x2de9(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10a0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    (%rbx),%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%r12,%rbp,8)
xor    %eax,%eax
call   10a0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    (%rbx),%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xda2(%rip),%xmm0
movsd  %xmm0,(%r15,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1210 <p3+0x90>
mov    0x8(%rsp),%rbp
test   %ebp,%ebp
jle    1285 <p3+0x105>
cmp    $0x1,%ebp
jne    128d <p3+0x10d>
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    1328 <p3+0x1a8>
xor    %r13d,%r13d
jmp    13d5 <p3+0x255>
mov    %r14d,%eax
and    $0xfffffffe,%eax
mov    %rax,0x10(%rsp)
xor    %ebx,%ebx
xor    %r13d,%r13d
nopl   (%rax)
movsd  (%r12,%rbx,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%r15,%rbx,8),%xmm0
call   1070 <sin@plt>
addsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
seta   %al
movsd  0xd3a(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%ebp
add    %r13d,%ebp
movsd  0x8(%r12,%rbx,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%r15,%rbx,8),%xmm0
call   1070 <sin@plt>
addsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
seta   %al
ucomisd 0xcfb(%rip),%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%r13d
add    %ebp,%r13d
add    $0x2,%rbx
cmp    %rbx,0x10(%rsp)
jne    12a0 <p3+0x120>
test   $0x1,%r14b
je     1367 <p3+0x1e7>
movsd  (%r12,%rbx,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%r15,%rbx,8),%xmm0
call   1070 <sin@plt>
addsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
seta   %al
ucomisd 0xcac(%rip),%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%eax
add    %eax,%r13d
mov    0x8(%rsp),%rbp
test   %ebp,%ebp
jle    13d5 <p3+0x255>
xor    %ebx,%ebx
lea    0xcf6(%rip),%rbp
nopl   0x0(%rax)
movsd  (%r12,%rbx,8),%xmm0
mov    %rbp,%rdi
xor    %esi,%esi
mov    %ebx,%edx
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1380 <p3+0x200>
mov    0x8(%rsp),%rbp
test   %ebp,%ebp
jle    13d5 <p3+0x255>
xor    %ebx,%ebx
lea    0xcc0(%rip),%rbp
nop
movsd  (%r15,%rbx,8),%xmm0
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    13b0 <p3+0x230>
mov    0x8(%rsp),%rbp
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
lea    0xc8e(%rip),%rdi
mov    %ebp,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc94(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xc94(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xcbb(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
movsd  (%rsp),%xmm0
mulsd  0xbc1(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"===> P3: Iniciando.\0A\00"
@.str.1 = [53 x i8] c"===> P3: Ser\C3\A1(\C3\A3o) executado(s) %d lan\C3\A7amento(s).\0A\00"
@.str.2 = [26 x i8] c"===> P3: Recebido r = %d\0A\00"
@RAND_MAX = global i64 0
@.str.3 = [19 x i8] c"info[%d][%d] = %f\0A\00"
@.str.4 = [25 x i8] c"===> P3: r = %d, t = %d\0A\00"
@.str.5 = [19 x i8] c"===> P3: t/r = %f\0A\00"
@.str.6 = [38 x i8] c"===> P3: Probabilidade estimada: %f \0A\00"
@.str.7 = [22 x i8] c"===> P3: Finalizado.\0A\00"
define i32 @p3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca [2 x double*]
store i32 %0, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 8
%17 = trunc i64 %16 to i32
%18 = call i64 @malloc(i32 %17)
%19 = inttoptr i64 %18 to double*
%20 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 0
store double* %19, double** %20
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
%25 = call i64 @malloc(i32 %24)
%26 = inttoptr i64 %25 to double*
%27 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 1
store double* %26, double** %27
%28 = call i32 @time(i32* null)
%29 = call i32 @srand(i32 %28)
store i32 0, i32* %4
br label %30
30: ; preds = %60, %1
%31 = load i32, i32* %4
%32 = load i32, i32* %2
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %63
34: ; preds = %30
%35 = call i64 (...) @rand()
%36 = sitofp i64 %35 to double
%37 = load i64, i64* @RAND_MAX
%38 = trunc i64 %37 to i32
%39 = add i32 %38, 1
%40 = uitofp i32 %39 to double
%41 = fdiv double %36, %40
%42 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 0
%43 = load double*, double** %42
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
store double %41, double* %46
%47 = call i64 (...) @rand()
%48 = sitofp i64 %47 to double
%49 = load i64, i64* @RAND_MAX
%50 = trunc i64 %49 to i32
%51 = add i32 %50, 1
%52 = uitofp i32 %51 to double
%53 = fdiv double %48, %52
%54 = fmul double %53, 0x401921FB54442EEA
%55 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 1
%56 = load double*, double** %55
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
store double %54, double* %59
br label %60
60: ; preds = %34
%61 = load i32, i32* %4
%62 = add nsw i32 %61, 1
store i32 %62, i32* %4
br label %30
63: ; preds = %30
store i32 0, i32* %3
store i32 0, i32* %4
br label %64
64: ; preds = %92, %63
%65 = load i32, i32* %4
%66 = load i32, i32* %2
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %95
68: ; preds = %64
%69 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 0
%70 = load double*, double** %69
%71 = load i32, i32* %4
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 1
%76 = load double*, double** %75
%77 = load i32, i32* %4
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
%80 = load double, double* %79
%81 = call double @sin(double %80)
%82 = fadd double %74, %81
store double %82, double* %6
%83 = load double, double* %6
%84 = fcmp olt double %83, 0.000000e+00
br i1 %84, label %88, label %85
85: ; preds = %68
%86 = load double, double* %6
%87 = fcmp ogt double %86, 1.000000e+00
br i1 %87, label %88, label %91
88: ; preds = %85, %68
%89 = load i32, i32* %3
%90 = add nsw i32 %89, 1
store i32 %90, i32* %3
br label %91
91: ; preds = %88, %85
br label %92
92: ; preds = %91
%93 = load i32, i32* %4
%94 = add nsw i32 %93, 1
store i32 %94, i32* %4
br label %64
95: ; preds = %64
store i32 0, i32* %4
br label %96
96: ; preds = %120, %95
%97 = load i32, i32* %4
%98 = icmp slt i32 %97, 2
br i1 %98, label %99, label %123
99: ; preds = %96
store i32 0, i32* %5
br label %100
100: ; preds = %116, %99
%101 = load i32, i32* %5
%102 = load i32, i32* %2
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %119
104: ; preds = %100
%105 = load i32, i32* %4
%106 = load i32, i32* %5
%107 = load i32, i32* %4
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 %108
%110 = load double*, double** %109
%111 = load i32, i32* %5
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %110, i64 %112
%114 = load double, double* %113
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %105, i32 %106, double %114)
br label %116
116: ; preds = %104
%117 = load i32, i32* %5
%118 = add nsw i32 %117, 1
store i32 %118, i32* %5
br label %100
119: ; preds = %100
br label %120
120: ; preds = %119
%121 = load i32, i32* %4
%122 = add nsw i32 %121, 1
store i32 %122, i32* %4
br label %96
123: ; preds = %96
%124 = load i32, i32* %3
%125 = sitofp i32 %124 to double
%126 = load i32, i32* %2
%127 = sitofp i32 %126 to double
%128 = fdiv double %125, %127
store double %128, double* %7
%129 = load i32, i32* %2
%130 = load i32, i32* %3
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %129, i32 %130)
%132 = load double, double* %7
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), double %132)
%134 = load double, double* %7
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), double %134)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%137 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 0
%138 = load double*, double** %137
%139 = call i32 @free(double* %138)
%140 = getelementptr inbounds [2 x double*], [2 x double*]* %8, i64 0, i64 1
%141 = load double*, double** %140
%142 = call i32 @free(double* %141)
%143 = load double, double* %7
%144 = fmul double %143, 1.000000e+02
%145 = fptosi double %144 to i32
ret i32 %145
}

LLVM IR (-O2):
@.str.1 = [53 x i8] c"===> P3: Ser\C3\A1(\C3\A3o) executado(s) %d lan\C3\A7amento(s).\0A\00"
@.str.2 = [26 x i8] c"===> P3: Recebido r = %d\0A\00"
@RAND_MAX = global i64 0
@.str.3 = [19 x i8] c"info[%d][%d] = %f\0A\00"
@.str.4 = [25 x i8] c"===> P3: r = %d, t = %d\0A\00"
@.str.5 = [19 x i8] c"===> P3: t/r = %f\0A\00"
@.str.6 = [38 x i8] c"===> P3: Probabilidade estimada: %f \0A\00"
@str = [20 x i8] c"===> P3: Iniciando.\00"
@str.8 = [21 x i8] c"===> P3: Finalizado.\00"
define i32 @p3(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%5 = shl i32 %0, 3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to double*
%8 = tail call i64 @malloc(i32 %5)
%9 = inttoptr i64 %8 to double*
%10 = tail call i32 @time(i32* null)
%11 = tail call i32 @srand(i32 %10)
%12 = icmp sgt i32 %0, 0
br i1 %12, label %13, label %112
13: ; preds = %1
%14 = zext i32 %0 to i64
br label %21
15: ; preds = %21
br i1 %12, label %16, label %112
16: ; preds = %15
%17 = and i64 %14, 1
%18 = icmp eq i32 %0, 1
br i1 %18, label %42, label %19
19: ; preds = %16
%20 = and i64 %14, 4294967294
br label %61
21: ; preds = %13, %21
%22 = phi i64 [ 0, %13 ], [ %40, %21 ]
%23 = tail call i64 (...) @rand()
%24 = sitofp i64 %23 to double
%25 = load i64, i64* @RAND_MAX
%26 = trunc i64 %25 to i32
%27 = add i32 %26, 1
%28 = uitofp i32 %27 to double
%29 = fdiv double %24, %28
%30 = getelementptr inbounds double, double* %7, i64 %22
store double %29, double* %30
%31 = tail call i64 (...) @rand()
%32 = sitofp i64 %31 to double
%33 = load i64, i64* @RAND_MAX
%34 = trunc i64 %33 to i32
%35 = add i32 %34, 1
%36 = uitofp i32 %35 to double
%37 = fdiv double %32, %36
%38 = fmul double %37, 0x401921FB54442EEA
%39 = getelementptr inbounds double, double* %9, i64 %22
store double %38, double* %39
%40 = add nuw nsw i64 %22, 1
%41 = icmp eq i64 %40, %14
br i1 %41, label %15, label %21
42: ; preds = %61, %16
%43 = phi i32 [ undef, %16 ], [ %87, %61 ]
%44 = phi i64 [ 0, %16 ], [ %88, %61 ]
%45 = phi i32 [ 0, %16 ], [ %87, %61 ]
%46 = icmp eq i64 %17, 0
br i1 %46, label %59, label %47
47: ; preds = %42
%48 = getelementptr inbounds double, double* %7, i64 %44
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %9, i64 %44
%51 = load double, double* %50
%52 = tail call double @sin(double %51)
%53 = fadd double %49, %52
%54 = fcmp olt double %53, 0.000000e+00
%55 = fcmp ogt double %53, 1.000000e+00
%56 = or i1 %54, %55
%57 = zext i1 %56 to i32
%58 = add nuw nsw i32 %45, %57
br label %59
59: ; preds = %42, %47
%60 = phi i32 [ %43, %42 ], [ %58, %47 ]
br i1 %12, label %91, label %112
61: ; preds = %61, %19
%62 = phi i64 [ 0, %19 ], [ %88, %61 ]
%63 = phi i32 [ 0, %19 ], [ %87, %61 ]
%64 = phi i64 [ 0, %19 ], [ %89, %61 ]
%65 = getelementptr inbounds double, double* %7, i64 %62
%66 = load double, double* %65
%67 = getelementptr inbounds double, double* %9, i64 %62
%68 = load double, double* %67
%69 = tail call double @sin(double %68)
%70 = fadd double %66, %69
%71 = fcmp olt double %70, 0.000000e+00
%72 = fcmp ogt double %70, 1.000000e+00
%73 = or i1 %71, %72
%74 = zext i1 %73 to i32
%75 = add nuw nsw i32 %63, %74
%76 = or i64 %62, 1
%77 = getelementptr inbounds double, double* %7, i64 %76
%78 = load double, double* %77
%79 = getelementptr inbounds double, double* %9, i64 %76
%80 = load double, double* %79
%81 = tail call double @sin(double %80)
%82 = fadd double %78, %81
%83 = fcmp olt double %82, 0.000000e+00
%84 = fcmp ogt double %82, 1.000000e+00
%85 = or i1 %83, %84
%86 = zext i1 %85 to i32
%87 = add nuw nsw i32 %75, %86
%88 = add nuw nsw i64 %62, 2
%89 = add i64 %64, 2
%90 = icmp eq i64 %89, %20
br i1 %90, label %42, label %61
91: ; preds = %59
%92 = zext i32 %0 to i64
br label %93
93: ; preds = %91, %93
%94 = phi i64 [ 0, %91 ], [ %99, %93 ]
%95 = getelementptr inbounds double, double* %7, i64 %94
%96 = load double, double* %95
%97 = trunc i64 %94 to i32
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %97, double %96)
%99 = add nuw nsw i64 %94, 1
%100 = icmp eq i64 %99, %92
br i1 %100, label %101, label %93
101: ; preds = %93
br i1 %12, label %102, label %112
102: ; preds = %101
%103 = zext i32 %0 to i64
br label %104
104: ; preds = %104, %102
%105 = phi i64 [ 0, %102 ], [ %110, %104 ]
%106 = getelementptr inbounds double, double* %9, i64 %105
%107 = load double, double* %106
%108 = trunc i64 %105 to i32
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %108, double %107)
%110 = add nuw nsw i64 %105, 1
%111 = icmp eq i64 %110, %103
br i1 %111, label %112, label %104
112: ; preds = %104, %1, %15, %59, %101
%113 = phi i32 [ %60, %101 ], [ %60, %59 ], [ 0, %15 ], [ 0, %1 ], [ %60, %104 ]
%114 = sitofp i32 %113 to double
%115 = sitofp i32 %0 to double
%116 = fdiv double %114, %115
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %0, i32 %113)
%118 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), double %116)
%119 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), double %116)
%120 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
%121 = tail call i32 @free(double* %7)
%122 = tail call i32 @free(double* %9)
%123 = fmul double %116, 1.000000e+02
%124 = fptosi double %123 to i32
ret i32 %124
}