#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 */
double next_rand(double, double);
void back_to_space(double **positions, double *bounds, unsigned int size,
                   unsigned int wolfs) {
#pragma omp parallel for
  for (unsigned int x = 0; x < wolfs; x++)
    for (unsigned int y = 0; y < size; y++)
      if (positions[x][y] >= bounds[(y * 2) + 1] ||
          positions[x][y] <= bounds[(y * 2)])
        positions[x][y] = next_rand(bounds[y * 2], bounds[(y * 2) + 1]);
}


x86 assembly (clang, -O0):
<back_to_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    120a <back_to_space+0xfa>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    11f7 <back_to_space+0xe7>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
ucomisd (%rax,%rcx,8),%xmm0
jae    11a7 <back_to_space+0x97>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     11e4 <back_to_space+0xd4>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <next_rand@plt>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
jmp    11e9 <back_to_space+0xd9>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1140 <back_to_space+0x30>
jmp    11fc <back_to_space+0xec>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <back_to_space+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_to_space>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
test   %ecx,%ecx
je     119d <back_to_space+0x8d>
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %ecx,%r15d
mov    0x4(%rsp),%ebp
add    %rbp,%rbp
xor    %r13d,%r13d
jmp    1149 <back_to_space+0x39>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    %r15,%r13
je     119d <back_to_space+0x8d>
cmpl   $0x0,0x4(%rsp)
je     1140 <back_to_space+0x30>
mov    (%r12,%r13,8),%rax
xor    %r14d,%r14d
jmp    1178 <back_to_space+0x68>
nopl   0x0(%rax)
call   1030 <next_rand@plt>
mov    (%r12,%r13,8),%rax
movsd  %xmm0,(%rax,%r14,4)
add    $0x2,%r14
cmp    %r14,%rbp
je     1140 <back_to_space+0x30>
movsd  (%rax,%r14,4),%xmm2
lea    0x1(%r14),%ecx
movsd  (%rbx,%rcx,8),%xmm1
ucomisd %xmm1,%xmm2
mov    %r14d,%ecx
movsd  (%rbx,%rcx,8),%xmm0
jae    1160 <back_to_space+0x50>
ucomisd %xmm2,%xmm0
jb     116f <back_to_space+0x5f>
jmp    1160 <back_to_space+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @back_to_space(double** %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double**
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store double** %0, double*** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %11
11: ; preds = %83, %4
%12 = load i32, i32* %9
%13 = load i32, i32* %8
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %86
15: ; preds = %11
store i32 0, i32* %10
br label %16
16: ; preds = %79, %15
%17 = load i32, i32* %10
%18 = load i32, i32* %7
%19 = icmp ult i32 %17, %18
br i1 %19, label %20, label %82
20: ; preds = %16
%21 = load double**, double*** %5
%22 = load i32, i32* %9
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds double*, double** %21, i64 %23
%25 = load double*, double** %24
%26 = load i32, i32* %10
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds double, double* %25, i64 %27
%29 = load double, double* %28
%30 = load double*, double** %6
%31 = load i32, i32* %10
%32 = mul i32 %31, 2
%33 = add i32 %32, 1
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds double, double* %30, i64 %34
%36 = load double, double* %35
%37 = fcmp oge double %29, %36
br i1 %37, label %55, label %38
38: ; preds = %20
%39 = load double**, double*** %5
%40 = load i32, i32* %9
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds double*, double** %39, i64 %41
%43 = load double*, double** %42
%44 = load i32, i32* %10
%45 = zext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = load double*, double** %6
%49 = load i32, i32* %10
%50 = mul i32 %49, 2
%51 = zext i32 %50 to i64
%52 = getelementptr inbounds double, double* %48, i64 %51
%53 = load double, double* %52
%54 = fcmp ole double %47, %53
br i1 %54, label %55, label %78
55: ; preds = %38, %20
%56 = load double*, double** %6
%57 = load i32, i32* %10
%58 = mul i32 %57, 2
%59 = zext i32 %58 to i64
%60 = getelementptr inbounds double, double* %56, i64 %59
%61 = load double, double* %60
%62 = load double*, double** %6
%63 = load i32, i32* %10
%64 = mul i32 %63, 2
%65 = add i32 %64, 1
%66 = zext i32 %65 to i64
%67 = getelementptr inbounds double, double* %62, i64 %66
%68 = load double, double* %67
%69 = call double @next_rand(double %61, double %68)
%70 = load double**, double*** %5
%71 = load i32, i32* %9
%72 = zext i32 %71 to i64
%73 = getelementptr inbounds double*, double** %70, i64 %72
%74 = load double*, double** %73
%75 = load i32, i32* %10
%76 = zext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
store double %69, double* %77
br label %78
78: ; preds = %55, %38
br label %79
79: ; preds = %78
%80 = load i32, i32* %10
%81 = add i32 %80, 1
store i32 %81, i32* %10
br label %16
82: ; preds = %16
br label %83
83: ; preds = %82
%84 = load i32, i32* %9
%85 = add i32 %84, 1
store i32 %85, i32* %9
br label %11
86: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @back_to_space(double** nocapture %0, double* nocapture %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %15, label %6
6: ; preds = %4
%7 = icmp eq i32 %2, 0
%8 = zext i32 %3 to i64
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %6, %16
%11 = phi i64 [ 0, %6 ], [ %17, %16 ]
br i1 %7, label %16, label %12
12: ; preds = %10
%13 = getelementptr inbounds double*, double** %0, i64 %11
%14 = load double*, double** %13
br label %19
15: ; preds = %16, %4
ret void
16: ; preds = %40, %10
%17 = add nuw nsw i64 %11, 1
%18 = icmp eq i64 %17, %8
br i1 %18, label %15, label %10
19: ; preds = %12, %40
%20 = phi double* [ %14, %12 ], [ %41, %40 ]
%21 = phi i64 [ 0, %12 ], [ %42, %40 ]
%22 = getelementptr inbounds double, double* %20, i64 %21
%23 = load double, double* %22
%24 = trunc i64 %21 to i32
%25 = shl i32 %24, 1
%26 = or i32 %25, 1
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds double, double* %1, i64 %27
%29 = load double, double* %28
%30 = fcmp ult double %23, %29
%31 = zext i32 %25 to i64
%32 = getelementptr inbounds double, double* %1, i64 %31
%33 = load double, double* %32
%34 = fcmp ugt double %23, %33
%35 = select i1 %30, i1 %34, i1 false
br i1 %35, label %40, label %36
36: ; preds = %19
%37 = tail call double @next_rand(double %33, double %29)
%38 = load double*, double** %13
%39 = getelementptr inbounds double, double* %38, i64 %21
store double %37, double* %39
br label %40
40: ; preds = %19, %36
%41 = phi double* [ %38, %36 ], [ %20, %19 ]
%42 = add nuw nsw i64 %21, 1
%43 = icmp eq i64 %42, %9
br i1 %43, label %16, label %19
}