#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 cos(double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double p4(int s) {
  int t, i, j;
  double retorno;
  double *info[2];
  printf("===> P4: Iniciando.\n");
  printf("===> P4: Será(ão) sorteado(s) %d ponto(s).\n", s);
  if (1) {
    printf("===> P4: Recebido s = %d\n", s);
  }
  info[0] = (double *)malloc(s * sizeof(double));
  info[1] = (double *)malloc(s * sizeof(double));
  srand(time(NULL));
  for (i = 0; i < s; i++) {
    info[0][i] = ((double)rand() / (double)((unsigned)RAND_MAX + 1));
    info[1][i] =
        ((double)rand() / (double)((unsigned)RAND_MAX + 1)) * 1.85081571768;
  }
  t = 0;
  for (i = 0; i < s; i++) {
    if (info[1][i] < 1 / cos(info[0][i]))
      t++;
  }
  if (1) {
    for (i = 0; i < 2; i++) {
      for (j = 0; j < s; j++) {
        printf("info[%d][%d] = %f\n", i, j, info[i][j]);
      }
    }
  }
  retorno = (double)t / s * 1.85081571768;
  printf("===> P4: s = %d, t = %d\n", s, t);
  printf("===> P4: t/s * sec(1) = %f\n", retorno);
  printf("===> P4: Área estimada: %f \n", retorno);
  printf("===> P4: Finalizado.\n");
  free(info[0]);
  free(info[1]);
  return retorno;
}


x86 assembly (clang, -O0):
<p4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1275 <p4+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  0xdaa(%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 <p4+0x78>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12ec <p4+0x17c>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1080 <cos@plt>
movsd  -0x48(%rbp),%xmm1
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
ucomisd %xmm1,%xmm0
jbe    12d9 <p4+0x169>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12de <p4+0x16e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1283 <p4+0x113>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1357 <p4+0x1e7>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1344 <p4+0x1d4>
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    0xd36(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1304 <p4+0x194>
jmp    1349 <p4+0x1d9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12f3 <p4+0x183>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc93(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xcf5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xcfb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xd04(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd14(%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  -0x18(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0xf1f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe65(%rip),%rdi
xor    %r13d,%r13d
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe80(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x0(,%rbp,8),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
test   %ebp,%ebp
jle    133a <p4+0x1ba>
mov    %rbp,0x10(%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 <p4+0x90>
mov    0x10(%rsp),%rbp
test   %ebp,%ebp
jle    1337 <p4+0x1b7>
cmp    $0x1,%ebp
jne    13c7 <p4+0x247>
xor    %ebx,%ebx
xor    %r13d,%r13d
test   $0x1,%r14b
je     12c5 <p4+0x145>
movsd  (%r15,%rbx,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r12,%rbx,8),%xmm0
call   1090 <cos@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rsp),%xmm0
seta   %al
add    %eax,%r13d
mov    0x10(%rsp),%rbp
test   %ebp,%ebp
jle    133a <p4+0x1ba>
xor    %ebx,%ebx
lea    0xd79(%rip),%rbp
nopw   0x0(%rax,%rax,1)
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    12e0 <p4+0x160>
mov    0x10(%rsp),%rbp
test   %ebp,%ebp
jle    133a <p4+0x1ba>
xor    %ebx,%ebx
lea    0xd41(%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    1310 <p4+0x190>
mov    0x10(%rsp),%rbp
jmp    133a <p4+0x1ba>
xor    %r13d,%r13d
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
divsd  %xmm0,%xmm1
mulsd  0xcab(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0xd01(%rip),%rdi
mov    %ebp,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd07(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd0f(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd2d(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14d,%ebp
and    $0xfffffffe,%ebp
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    1402 <p4+0x282>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rsp),%xmm0
seta   %al
add    %eax,%r13d
add    $0x2,%rbx
cmp    %rbx,%rbp
je     1288 <p4+0x108>
movsd  (%r15,%rbx,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r12,%rbx,8),%xmm0
call   1090 <cos@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
jb     1423 <p4+0x2a3>
xor    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rsp),%xmm0
seta   %al
add    %eax,%r13d
movsd  0x8(%r15,%rbx,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%r12,%rbx,8),%xmm0
call   1090 <cos@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
jb     13e0 <p4+0x260>
xor    %eax,%eax
jmp    13e0 <p4+0x260>

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

LLVM IR (-O2):
@.str.1 = [46 x i8] c"===> P4: Ser\C3\A1(\C3\A3o) sorteado(s) %d ponto(s).\0A\00"
@.str.2 = [26 x i8] c"===> P4: Recebido s = %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"===> P4: s = %d, t = %d\0A\00"
@.str.5 = [28 x i8] c"===> P4: t/s * sec(1) = %f\0A\00"
@.str.6 = [30 x i8] c"===> P4: \C3\81rea estimada: %f \0A\00"
@str = [20 x i8] c"===> P4: Iniciando.\00"
@str.8 = [21 x i8] c"===> P4: Finalizado.\00"
define double @p4(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 ([46 x i8], [46 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 %115
13: ; preds = %1
%14 = zext i32 %0 to i64
br label %21
15: ; preds = %21
br i1 %12, label %16, label %115
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 %62
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, 0x3FFD9CF0F125BBE1
%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 = %62, %16
%43 = phi i32 [ undef, %16 ], [ %90, %62 ]
%44 = phi i64 [ 0, %16 ], [ %91, %62 ]
%45 = phi i32 [ 0, %16 ], [ %90, %62 ]
%46 = icmp eq i64 %17, 0
br i1 %46, label %60, label %47
47: ; preds = %42
%48 = getelementptr inbounds double, double* %9, i64 %44
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %7, i64 %44
%51 = load double, double* %50
%52 = tail call i32 @cos(double %51)
%53 = add i32 %52, 1
%54 = icmp ult i32 %53, 3
%55 = select i1 %54, i32 %52, i32 0
%56 = sitofp i32 %55 to double
%57 = fcmp olt double %49, %56
%58 = zext i1 %57 to i32
%59 = add nuw nsw i32 %45, %58
br label %60
60: ; preds = %42, %47
%61 = phi i32 [ %43, %42 ], [ %59, %47 ]
br i1 %12, label %94, label %115
62: ; preds = %62, %19
%63 = phi i64 [ 0, %19 ], [ %91, %62 ]
%64 = phi i32 [ 0, %19 ], [ %90, %62 ]
%65 = phi i64 [ 0, %19 ], [ %92, %62 ]
%66 = getelementptr inbounds double, double* %9, i64 %63
%67 = load double, double* %66
%68 = getelementptr inbounds double, double* %7, i64 %63
%69 = load double, double* %68
%70 = tail call i32 @cos(double %69)
%71 = add i32 %70, 1
%72 = icmp ult i32 %71, 3
%73 = select i1 %72, i32 %70, i32 0
%74 = sitofp i32 %73 to double
%75 = fcmp olt double %67, %74
%76 = zext i1 %75 to i32
%77 = add nuw nsw i32 %64, %76
%78 = or i64 %63, 1
%79 = getelementptr inbounds double, double* %9, i64 %78
%80 = load double, double* %79
%81 = getelementptr inbounds double, double* %7, i64 %78
%82 = load double, double* %81
%83 = tail call i32 @cos(double %82)
%84 = add i32 %83, 1
%85 = icmp ult i32 %84, 3
%86 = select i1 %85, i32 %83, i32 0
%87 = sitofp i32 %86 to double
%88 = fcmp olt double %80, %87
%89 = zext i1 %88 to i32
%90 = add nuw nsw i32 %77, %89
%91 = add nuw nsw i64 %63, 2
%92 = add i64 %65, 2
%93 = icmp eq i64 %92, %20
br i1 %93, label %42, label %62
94: ; preds = %60
%95 = zext i32 %0 to i64
br label %96
96: ; preds = %94, %96
%97 = phi i64 [ 0, %94 ], [ %102, %96 ]
%98 = getelementptr inbounds double, double* %7, i64 %97
%99 = load double, double* %98
%100 = trunc i64 %97 to i32
%101 = 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 %100, double %99)
%102 = add nuw nsw i64 %97, 1
%103 = icmp eq i64 %102, %95
br i1 %103, label %104, label %96
104: ; preds = %96
br i1 %12, label %105, label %115
105: ; preds = %104
%106 = zext i32 %0 to i64
br label %107
107: ; preds = %107, %105
%108 = phi i64 [ 0, %105 ], [ %113, %107 ]
%109 = getelementptr inbounds double, double* %9, i64 %108
%110 = load double, double* %109
%111 = trunc i64 %108 to i32
%112 = 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 %111, double %110)
%113 = add nuw nsw i64 %108, 1
%114 = icmp eq i64 %113, %106
br i1 %114, label %115, label %107
115: ; preds = %107, %1, %15, %60, %104
%116 = phi i32 [ %61, %104 ], [ %61, %60 ], [ 0, %15 ], [ 0, %1 ], [ %61, %107 ]
%117 = sitofp i32 %116 to double
%118 = sitofp i32 %0 to double
%119 = fdiv double %117, %118
%120 = fmul double %119, 0x3FFD9CF0F125BBE1
%121 = 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 %116)
%122 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %120)
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), double %120)
%124 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
%125 = tail call i32 @free(double* %7)
%126 = tail call i32 @free(double* %9)
ret double %120
}