#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 omp_get_thread_num();
int /*<<< orphan*/ printf(char *, double, ...);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, const char *argv[]) {
  int area_circle_1 = 0;
  int area_circle_2 = 0;
  int area_circle_3 = 0;
  int area_circle_4 = 0;
  int area_circle = 0;
  int area_square = (1000 * 1000 * 10);
  srand((unsigned int)time(NULL));
#pragma omp parallel sections
  {
#pragma omp section
    {
      int i, x, y;
      for (i = 0; i < (1000 * 1000 * 10); i++) {
        x = rand() % 1000;
        y = rand() % 1000;
        if (x * x + y * y <= 1000 * 1000)
          area_circle_1++;
      }
      printf("Thread %d finished: %d\n", omp_get_thread_num(), area_circle_1);
    }
#pragma omp section
    {
      int i, x, y;
      for (i = 0; i < (1000 * 1000 * 10); i++) {
        x = rand() % 1000;
        y = rand() % 1000;
        if (x * x + y * y <= 1000 * 1000)
          area_circle_2++;
      }
      printf("Thread %d finished: %d\n", omp_get_thread_num(), area_circle_2);
    }
#pragma omp section
    {
      int i, x, y;
      for (i = 0; i < (1000 * 1000 * 10); i++) {
        x = rand() % 1000;
        y = rand() % 1000;
        if (x * x + y * y <= 1000 * 1000)
          area_circle_3++;
      }
      printf("Thread %d finished: %d\n", omp_get_thread_num(), area_circle_3);
    }
#pragma omp section
    {
      int i, x, y;
      for (i = 0; i < (1000 * 1000 * 10); i++) {
        x = rand() % 1000;
        y = rand() % 1000;
        if (x * x + y * y <= 1000 * 1000)
          area_circle_4++;
      }
      printf("Thread %d finished: %d\n", omp_get_thread_num(), area_circle_4);
    }
  }
  double pi;
  area_circle = area_circle_1 + area_circle_2 + area_circle_3 + area_circle_4;
  pi = (double)area_circle / area_square;
  printf("%g\n", pi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x989680,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x989680,-0x2c(%rbp)
jge    120f <main+0xbf>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x30(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x34(%rbp)
mov    -0x30(%rbp),%eax
imul   -0x30(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    %ecx,%eax
cmp    $0xf4240,%eax
jg     11fc <main+0xac>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1201 <main+0xb1>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11a7 <main+0x57>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
cvtsi2sd %eax,%xmm0
mov    -0x14(%rbp),%esi
lea    0xddc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x989680,-0x38(%rbp)
jge    129a <main+0x14a>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x3c(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
mov    -0x3c(%rbp),%eax
imul   -0x3c(%rbp),%eax
mov    -0x40(%rbp),%ecx
imul   -0x40(%rbp),%ecx
add    %ecx,%eax
cmp    $0xf4240,%eax
jg     1287 <main+0x137>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    128c <main+0x13c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1232 <main+0xe2>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%esi
lea    0xd51(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x989680,-0x44(%rbp)
jge    1325 <main+0x1d5>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4c(%rbp)
mov    -0x48(%rbp),%eax
imul   -0x48(%rbp),%eax
mov    -0x4c(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    %ecx,%eax
cmp    $0xf4240,%eax
jg     1312 <main+0x1c2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1317 <main+0x1c7>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12bd <main+0x16d>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
cvtsi2sd %eax,%xmm0
mov    -0x1c(%rbp),%esi
lea    0xcc6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x50(%rbp)
cmpl   $0x989680,-0x50(%rbp)
jge    13b0 <main+0x260>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x54(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x58(%rbp)
mov    -0x54(%rbp),%eax
imul   -0x54(%rbp),%eax
mov    -0x58(%rbp),%ecx
imul   -0x58(%rbp),%ecx
add    %ecx,%eax
cmp    $0xf4240,%eax
jg     139d <main+0x24d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13a2 <main+0x252>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1348 <main+0x1f8>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%esi
lea    0xc3b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    0xc1e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x989680,%ebx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbp
imul   $0x10624dd3,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ebp
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   %ebp,%ebp
imul   %eax,%eax
add    %ebp,%eax
cmp    $0xf4241,%eax
adc    $0x0,%r14d
add    $0xffffffff,%ebx
jne    1180 <main+0x30>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
cvtsi2sd %eax,%xmm0
lea    0xe15(%rip),%rdi
mov    %r14d,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x989680,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbp
imul   $0x10624dd3,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ebp
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   %ebp,%ebp
imul   %eax,%eax
add    %ebp,%eax
cmp    $0xf4241,%eax
adc    $0x0,%r15d
add    $0xffffffff,%ebx
jne    1210 <main+0xc0>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xd82(%rip),%rdi
mov    %r15d,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x989680,%ebp
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbx
imul   $0x10624dd3,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   %ebx,%ebx
imul   %eax,%eax
add    %ebx,%eax
cmp    $0xf4241,%eax
adc    $0x0,%r12d
add    $0xffffffff,%ebp
jne    12a0 <main+0x150>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xcf2(%rip),%rdi
mov    %r12d,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x989680,%ebx
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbp
imul   $0x10624dd3,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ebp
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   %ebp,%ebp
imul   %eax,%eax
add    %ebp,%eax
cmp    $0xf4241,%eax
adc    $0x0,%r13d
add    $0xffffffff,%ebx
jne    1330 <main+0x1e0>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xc62(%rip),%rdi
mov    %r13d,%esi
mov    $0x1,%al
call   1040 <printf@plt>
add    %r14d,%r15d
add    %r12d,%r15d
add    %r13d,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
divsd  0xc37(%rip),%xmm0
lea    0xc50(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Thread %d finished: %d\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 10000000, i32* %11
%25 = call i64 @time(i32* null)
%26 = trunc i64 %25 to i32
%27 = call i32 @srand(i32 %26)
store i32 0, i32* %12
br label %28
28: ; preds = %48, %2
%29 = load i32, i32* %12
%30 = icmp slt i32 %29, 10000000
br i1 %30, label %31, label %51
31: ; preds = %28
%32 = call i32 (...) @rand()
%33 = srem i32 %32, 1000
store i32 %33, i32* %13
%34 = call i32 (...) @rand()
%35 = srem i32 %34, 1000
store i32 %35, i32* %14
%36 = load i32, i32* %13
%37 = load i32, i32* %13
%38 = mul nsw i32 %36, %37
%39 = load i32, i32* %14
%40 = load i32, i32* %14
%41 = mul nsw i32 %39, %40
%42 = add nsw i32 %38, %41
%43 = icmp sle i32 %42, 1000000
br i1 %43, label %44, label %47
44: ; preds = %31
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %47
47: ; preds = %44, %31
br label %48
48: ; preds = %47
%49 = load i32, i32* %12
%50 = add nsw i32 %49, 1
store i32 %50, i32* %12
br label %28
51: ; preds = %28
%52 = call i32 (...) @omp_get_thread_num()
%53 = sitofp i32 %52 to double
%54 = load i32, i32* %6
%55 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %53, i32 %54)
store i32 0, i32* %15
br label %56
56: ; preds = %76, %51
%57 = load i32, i32* %15
%58 = icmp slt i32 %57, 10000000
br i1 %58, label %59, label %79
59: ; preds = %56
%60 = call i32 (...) @rand()
%61 = srem i32 %60, 1000
store i32 %61, i32* %16
%62 = call i32 (...) @rand()
%63 = srem i32 %62, 1000
store i32 %63, i32* %17
%64 = load i32, i32* %16
%65 = load i32, i32* %16
%66 = mul nsw i32 %64, %65
%67 = load i32, i32* %17
%68 = load i32, i32* %17
%69 = mul nsw i32 %67, %68
%70 = add nsw i32 %66, %69
%71 = icmp sle i32 %70, 1000000
br i1 %71, label %72, label %75
72: ; preds = %59
%73 = load i32, i32* %7
%74 = add nsw i32 %73, 1
store i32 %74, i32* %7
br label %75
75: ; preds = %72, %59
br label %76
76: ; preds = %75
%77 = load i32, i32* %15
%78 = add nsw i32 %77, 1
store i32 %78, i32* %15
br label %56
79: ; preds = %56
%80 = call i32 (...) @omp_get_thread_num()
%81 = sitofp i32 %80 to double
%82 = load i32, i32* %7
%83 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %81, i32 %82)
store i32 0, i32* %18
br label %84
84: ; preds = %104, %79
%85 = load i32, i32* %18
%86 = icmp slt i32 %85, 10000000
br i1 %86, label %87, label %107
87: ; preds = %84
%88 = call i32 (...) @rand()
%89 = srem i32 %88, 1000
store i32 %89, i32* %19
%90 = call i32 (...) @rand()
%91 = srem i32 %90, 1000
store i32 %91, i32* %20
%92 = load i32, i32* %19
%93 = load i32, i32* %19
%94 = mul nsw i32 %92, %93
%95 = load i32, i32* %20
%96 = load i32, i32* %20
%97 = mul nsw i32 %95, %96
%98 = add nsw i32 %94, %97
%99 = icmp sle i32 %98, 1000000
br i1 %99, label %100, label %103
100: ; preds = %87
%101 = load i32, i32* %8
%102 = add nsw i32 %101, 1
store i32 %102, i32* %8
br label %103
103: ; preds = %100, %87
br label %104
104: ; preds = %103
%105 = load i32, i32* %18
%106 = add nsw i32 %105, 1
store i32 %106, i32* %18
br label %84
107: ; preds = %84
%108 = call i32 (...) @omp_get_thread_num()
%109 = sitofp i32 %108 to double
%110 = load i32, i32* %8
%111 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %109, i32 %110)
store i32 0, i32* %21
br label %112
112: ; preds = %132, %107
%113 = load i32, i32* %21
%114 = icmp slt i32 %113, 10000000
br i1 %114, label %115, label %135
115: ; preds = %112
%116 = call i32 (...) @rand()
%117 = srem i32 %116, 1000
store i32 %117, i32* %22
%118 = call i32 (...) @rand()
%119 = srem i32 %118, 1000
store i32 %119, i32* %23
%120 = load i32, i32* %22
%121 = load i32, i32* %22
%122 = mul nsw i32 %120, %121
%123 = load i32, i32* %23
%124 = load i32, i32* %23
%125 = mul nsw i32 %123, %124
%126 = add nsw i32 %122, %125
%127 = icmp sle i32 %126, 1000000
br i1 %127, label %128, label %131
128: ; preds = %115
%129 = load i32, i32* %9
%130 = add nsw i32 %129, 1
store i32 %130, i32* %9
br label %131
131: ; preds = %128, %115
br label %132
132: ; preds = %131
%133 = load i32, i32* %21
%134 = add nsw i32 %133, 1
store i32 %134, i32* %21
br label %112
135: ; preds = %112
%136 = call i32 (...) @omp_get_thread_num()
%137 = sitofp i32 %136 to double
%138 = load i32, i32* %9
%139 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %137, i32 %138)
%140 = load i32, i32* %6
%141 = load i32, i32* %7
%142 = add nsw i32 %140, %141
%143 = load i32, i32* %8
%144 = add nsw i32 %142, %143
%145 = load i32, i32* %9
%146 = add nsw i32 %144, %145
store i32 %146, i32* %10
%147 = load i32, i32* %10
%148 = sitofp i32 %147 to double
%149 = load i32, i32* %11
%150 = sitofp i32 %149 to double
%151 = fdiv double %148, %150
store double %151, double* %24
%152 = load double, double* %24
%153 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %152)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Thread %d finished: %d\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %18, %6 ]
%8 = phi i32 [ 0, %2 ], [ %19, %6 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 1000
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 1000
%13 = mul nsw i32 %10, %10
%14 = mul nsw i32 %12, %12
%15 = add nuw nsw i32 %14, %13
%16 = icmp ult i32 %15, 1000001
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %7, %17
%19 = add nuw nsw i32 %8, 1
%20 = icmp eq i32 %19, 10000000
br i1 %20, label %21, label %6
21: ; preds = %6
%22 = tail call i32 (...) @omp_get_thread_num()
%23 = sitofp i32 %22 to double
%24 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %23, i32 %18)
br label %25
25: ; preds = %21, %25
%26 = phi i32 [ 0, %21 ], [ %37, %25 ]
%27 = phi i32 [ 0, %21 ], [ %38, %25 ]
%28 = tail call i32 (...) @rand()
%29 = srem i32 %28, 1000
%30 = tail call i32 (...) @rand()
%31 = srem i32 %30, 1000
%32 = mul nsw i32 %29, %29
%33 = mul nsw i32 %31, %31
%34 = add nuw nsw i32 %33, %32
%35 = icmp ult i32 %34, 1000001
%36 = zext i1 %35 to i32
%37 = add nuw nsw i32 %26, %36
%38 = add nuw nsw i32 %27, 1
%39 = icmp eq i32 %38, 10000000
br i1 %39, label %40, label %25
40: ; preds = %25
%41 = tail call i32 (...) @omp_get_thread_num()
%42 = sitofp i32 %41 to double
%43 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %42, i32 %37)
br label %44
44: ; preds = %40, %44
%45 = phi i32 [ 0, %40 ], [ %56, %44 ]
%46 = phi i32 [ 0, %40 ], [ %57, %44 ]
%47 = tail call i32 (...) @rand()
%48 = srem i32 %47, 1000
%49 = tail call i32 (...) @rand()
%50 = srem i32 %49, 1000
%51 = mul nsw i32 %48, %48
%52 = mul nsw i32 %50, %50
%53 = add nuw nsw i32 %52, %51
%54 = icmp ult i32 %53, 1000001
%55 = zext i1 %54 to i32
%56 = add nuw nsw i32 %45, %55
%57 = add nuw nsw i32 %46, 1
%58 = icmp eq i32 %57, 10000000
br i1 %58, label %59, label %44
59: ; preds = %44
%60 = tail call i32 (...) @omp_get_thread_num()
%61 = sitofp i32 %60 to double
%62 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %61, i32 %56)
br label %63
63: ; preds = %59, %63
%64 = phi i32 [ 0, %59 ], [ %76, %63 ]
%65 = phi i32 [ 0, %59 ], [ %75, %63 ]
%66 = tail call i32 (...) @rand()
%67 = srem i32 %66, 1000
%68 = tail call i32 (...) @rand()
%69 = srem i32 %68, 1000
%70 = mul nsw i32 %67, %67
%71 = mul nsw i32 %69, %69
%72 = add nuw nsw i32 %71, %70
%73 = icmp ult i32 %72, 1000001
%74 = zext i1 %73 to i32
%75 = add nuw nsw i32 %65, %74
%76 = add nuw nsw i32 %64, 1
%77 = icmp eq i32 %76, 10000000
br i1 %77, label %78, label %63
78: ; preds = %63
%79 = tail call i32 (...) @omp_get_thread_num()
%80 = sitofp i32 %79 to double
%81 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %80, i32 %75)
%82 = add nuw nsw i32 %37, %18
%83 = add nuw nsw i32 %82, %56
%84 = add nuw nsw i32 %83, %75
%85 = sitofp i32 %84 to double
%86 = fdiv double %85, 1.000000e+07
%87 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %86)
ret i32 0
}