#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 rand();
void create_coords(int x[], int z[], int amount) {
  int i = 0;
  int r;
  for (i = 0; i < amount; i++) {
    r = rand() % 900 + 10;
    while ((r > 50) && (r < 140))
      r = rand() % 900 + 10;
    x[i] = r;
  }
  for (i = 0; i < amount; i++) {
    r = rand() % 900 + 10;
    while ((r > 100) && (r < 170))
      r = rand() % 900 + 10;
    z[i] = r;
  }
}


x86 assembly (clang, -O0):
<create_coords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b4 <create_coords+0xa4>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x384,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x32,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jle    116e <create_coords+0x5e>
cmpl   $0x8c,-0x1c(%rbp)
setl   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    117e <create_coords+0x6e>
jmp    1198 <create_coords+0x88>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x384,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x1c(%rbp)
jmp    1152 <create_coords+0x42>
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <create_coords+0x21>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    123e <create_coords+0x12e>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x384,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0x1c(%rbp)
mov    %al,-0x1e(%rbp)
jle    11f8 <create_coords+0xe8>
cmpl   $0xaa,-0x1c(%rbp)
setl   %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    1208 <create_coords+0xf8>
jmp    1222 <create_coords+0x112>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x384,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x1c(%rbp)
jmp    11dc <create_coords+0xcc>
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11bb <create_coords+0xab>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_coords>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
jle    125a <create_coords+0x14a>
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
mov    %edx,%r12d
xor    %ebx,%ebx
jmp    1142 <create_coords+0x32>
sub    %ecx,%eax
add    $0xa,%eax
mov    %eax,0x0(%rbp,%rbx,4)
add    $0x1,%rbx
cmp    %r12,%rbx
je     11ba <create_coords+0xaa>
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff91a2b3c5,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
imul   $0x384,%ecx,%ecx
mov    %ecx,%edx
neg    %edx
add    %eax,%edx
add    $0xffffffd7,%edx
cmp    $0x58,%edx
ja     1130 <create_coords+0x20>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff91a2b3c5,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
imul   $0x384,%ecx,%ecx
mov    %ecx,%edx
neg    %edx
add    %eax,%edx
add    $0xffffffd7,%edx
cmp    $0x59,%edx
jb     1180 <create_coords+0x70>
jmp    1130 <create_coords+0x20>
test   %r14d,%r14d
jle    125a <create_coords+0x14a>
xor    %ebx,%ebx
jmp    11e2 <create_coords+0xd2>
nopw   0x0(%rax,%rax,1)
sub    %ecx,%eax
add    $0xa,%eax
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %r12,%rbx
je     125a <create_coords+0x14a>
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff91a2b3c5,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
imul   $0x384,%ecx,%ecx
mov    %ecx,%edx
neg    %edx
add    %eax,%edx
add    $0xffffffa5,%edx
cmp    $0x44,%edx
ja     11d0 <create_coords+0xc0>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff91a2b3c5,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
imul   $0x384,%ecx,%ecx
mov    %ecx,%edx
neg    %edx
add    %eax,%edx
add    $0xffffffa5,%edx
cmp    $0x45,%edx
jb     1220 <create_coords+0x110>
jmp    11d0 <create_coords+0xc0>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @create_coords(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 0, i32* %7
br label %9
9: ; preds = %35, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %38
13: ; preds = %9
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 900
%16 = add nsw i32 %15, 10
store i32 %16, i32* %8
br label %17
17: ; preds = %25, %13
%18 = load i32, i32* %8
%19 = icmp sgt i32 %18, 50
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %8
%22 = icmp slt i32 %21, 140
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ false, %17 ], [ %22, %20 ]
br i1 %24, label %25, label %29
25: ; preds = %23
%26 = call i32 (...) @rand()
%27 = srem i32 %26, 900
%28 = add nsw i32 %27, 10
store i32 %28, i32* %8
br label %17
29: ; preds = %23
%30 = load i32, i32* %8
%31 = load i32*, i32** %4
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
store i32 %30, i32* %34
br label %35
35: ; preds = %29
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %9
38: ; preds = %9
store i32 0, i32* %7
br label %39
39: ; preds = %65, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %68
43: ; preds = %39
%44 = call i32 (...) @rand()
%45 = srem i32 %44, 900
%46 = add nsw i32 %45, 10
store i32 %46, i32* %8
br label %47
47: ; preds = %55, %43
%48 = load i32, i32* %8
%49 = icmp sgt i32 %48, 100
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load i32, i32* %8
%52 = icmp slt i32 %51, 170
br label %53
53: ; preds = %50, %47
%54 = phi i1 [ false, %47 ], [ %52, %50 ]
br i1 %54, label %55, label %59
55: ; preds = %53
%56 = call i32 (...) @rand()
%57 = srem i32 %56, 900
%58 = add nsw i32 %57, 10
store i32 %58, i32* %8
br label %47
59: ; preds = %53
%60 = load i32, i32* %8
%61 = load i32*, i32** %5
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %61, i64 %63
store i32 %60, i32* %64
br label %65
65: ; preds = %59
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
store i32 %67, i32* %7
br label %39
68: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @create_coords(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %44
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %10
7: ; preds = %21
br i1 %4, label %8, label %44
8: ; preds = %7
%9 = zext i32 %2 to i64
br label %27
10: ; preds = %5, %21
%11 = phi i64 [ 0, %5 ], [ %25, %21 ]
%12 = tail call i32 (...) @rand()
%13 = srem i32 %12, 900
%14 = add nsw i32 %13, -41
%15 = icmp ult i32 %14, 89
br i1 %15, label %16, label %21
16: ; preds = %10, %16
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 900
%19 = add nsw i32 %18, -41
%20 = icmp ult i32 %19, 89
br i1 %20, label %16, label %21
21: ; preds = %16, %10
%22 = phi i32 [ %13, %10 ], [ %18, %16 ]
%23 = add nsw i32 %22, 10
%24 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 %23, i32* %24
%25 = add nuw nsw i64 %11, 1
%26 = icmp eq i64 %25, %6
br i1 %26, label %7, label %10
27: ; preds = %8, %38
%28 = phi i64 [ 0, %8 ], [ %42, %38 ]
%29 = tail call i32 (...) @rand()
%30 = srem i32 %29, 900
%31 = add nsw i32 %30, -91
%32 = icmp ult i32 %31, 69
br i1 %32, label %33, label %38
33: ; preds = %27, %33
%34 = tail call i32 (...) @rand()
%35 = srem i32 %34, 900
%36 = add nsw i32 %35, -91
%37 = icmp ult i32 %36, 69
br i1 %37, label %33, label %38
38: ; preds = %33, %27
%39 = phi i32 [ %30, %27 ], [ %35, %33 ]
%40 = add nsw i32 %39, 10
%41 = getelementptr inbounds i32, i32* %1, i64 %28
store i32 %40, i32* %41
%42 = add nuw nsw i64 %28, 1
%43 = icmp eq i64 %42, %9
br i1 %43, label %44, label %27
44: ; preds = %38, %3, %7
ret void
}