#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 initMap(char map[7][7]) {
  int i, j;
  int x, y;
  for (j = 0; j < 7; j++)
    for (i = 0; i < 7; i++)
      map[i][j] = '.';
  for (i = 0; i < 7; i++) {
    map[i][0] = '#';
    map[i][7 - 1] = '#';
  }
  for (j = 1; j < 7 - 1; j++) {
    map[0][j] = '#';
    map[7 - 1][j] = '#';
  }
  for (i = 0; i < 4; i++) {
    x = (rand() % 5) + 1;
    y = (rand() % 5) + 1;
    map[x][y] = 'P';
  }
  x = (rand() % 5) + 1;
  y = (rand() % 5) + 1;
  map[x][y] = 'W';
}


x86 assembly (clang, -O0):
<initMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jge    1176 <initMap+0x66>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1163 <initMap+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <initMap+0x24>
jmp    1168 <initMap+0x58>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <initMap+0x13>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    11ba <initMap+0xaa>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movb   $0x23,(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movb   $0x23,0x6(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117d <initMap+0x6d>
movl   $0x1,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    11f2 <initMap+0xe2>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x23,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x23,0x2a(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c1 <initMap+0xb1>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1252 <initMap+0x142>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movb   $0x50,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f9 <initMap+0xe9>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movb   $0x57,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initMap>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movaps 0xee3(%rip),%xmm0
movups %xmm0,0x8(%rdi)
movups %xmm0,0x18(%rdi)
movb   $0x2e,0x28(%rdi)
movw   $0x2323,0xd(%rdi)
movw   $0x2323,0x14(%rdi)
movw   $0x2323,0x1b(%rdi)
movw   $0x2323,0x22(%rdi)
movabs $0x2323232323232323,%rax
23 23 23
mov    %rax,(%rdi)
mov    %rax,0x29(%rdi)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %ebp,%rcx
cltq
lea    0x0(,%rcx,8),%rdx
sub    %rcx,%rdx
add    %rbx,%rdx
movb   $0x50,0x1(%rax,%rdx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %ebp,%rcx
cltq
lea    0x0(,%rcx,8),%rdx
sub    %rcx,%rdx
add    %rbx,%rdx
movb   $0x50,0x1(%rax,%rdx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %ebp,%rcx
cltq
lea    0x0(,%rcx,8),%rdx
sub    %rcx,%rdx
add    %rbx,%rdx
movb   $0x50,0x1(%rax,%rdx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %ebp,%rcx
cltq
lea    0x0(,%rcx,8),%rdx
sub    %rcx,%rdx
add    %rbx,%rdx
movb   $0x50,0x1(%rax,%rdx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %ebp,%rcx
cltq
lea    0x0(,%rcx,8),%rdx
sub    %rcx,%rdx
add    %rbx,%rdx
movb   $0x57,0x1(%rax,%rdx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @initMap([7 x i8]* %0) {
%2 = alloca [7 x i8]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store [7 x i8]* %0, [7 x i8]** %2
store i32 0, i32* %4
br label %7
7: ; preds = %26, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %29
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %22, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 7
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load [7 x i8]*, [7 x i8]** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [7 x i8], [7 x i8]* %15, i64 %17
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [7 x i8], [7 x i8]* %18, i64 0, i64 %20
store i8 46, i8* %21
br label %22
22: ; preds = %14
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %11
25: ; preds = %11
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %7
29: ; preds = %7
store i32 0, i32* %3
br label %30
30: ; preds = %44, %29
%31 = load i32, i32* %3
%32 = icmp slt i32 %31, 7
br i1 %32, label %33, label %47
33: ; preds = %30
%34 = load [7 x i8]*, [7 x i8]** %2
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [7 x i8], [7 x i8]* %34, i64 %36
%38 = getelementptr inbounds [7 x i8], [7 x i8]* %37, i64 0, i64 0
store i8 35, i8* %38
%39 = load [7 x i8]*, [7 x i8]** %2
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [7 x i8], [7 x i8]* %39, i64 %41
%43 = getelementptr inbounds [7 x i8], [7 x i8]* %42, i64 0, i64 6
store i8 35, i8* %43
br label %44
44: ; preds = %33
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %30
47: ; preds = %30
store i32 1, i32* %4
br label %48
48: ; preds = %62, %47
%49 = load i32, i32* %4
%50 = icmp slt i32 %49, 6
br i1 %50, label %51, label %65
51: ; preds = %48
%52 = load [7 x i8]*, [7 x i8]** %2
%53 = getelementptr inbounds [7 x i8], [7 x i8]* %52, i64 0
%54 = load i32, i32* %4
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [7 x i8], [7 x i8]* %53, i64 0, i64 %55
store i8 35, i8* %56
%57 = load [7 x i8]*, [7 x i8]** %2
%58 = getelementptr inbounds [7 x i8], [7 x i8]* %57, i64 6
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [7 x i8], [7 x i8]* %58, i64 0, i64 %60
store i8 35, i8* %61
br label %62
62: ; preds = %51
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
store i32 %64, i32* %4
br label %48
65: ; preds = %48
store i32 0, i32* %3
br label %66
66: ; preds = %83, %65
%67 = load i32, i32* %3
%68 = icmp slt i32 %67, 4
br i1 %68, label %69, label %86
69: ; preds = %66
%70 = call i32 (...) @rand()
%71 = srem i32 %70, 5
%72 = add nsw i32 %71, 1
store i32 %72, i32* %5
%73 = call i32 (...) @rand()
%74 = srem i32 %73, 5
%75 = add nsw i32 %74, 1
store i32 %75, i32* %6
%76 = load [7 x i8]*, [7 x i8]** %2
%77 = load i32, i32* %5
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [7 x i8], [7 x i8]* %76, i64 %78
%80 = load i32, i32* %6
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [7 x i8], [7 x i8]* %79, i64 0, i64 %81
store i8 80, i8* %82
br label %83
83: ; preds = %69
%84 = load i32, i32* %3
%85 = add nsw i32 %84, 1
store i32 %85, i32* %3
br label %66
86: ; preds = %66
%87 = call i32 (...) @rand()
%88 = srem i32 %87, 5
%89 = add nsw i32 %88, 1
store i32 %89, i32* %5
%90 = call i32 (...) @rand()
%91 = srem i32 %90, 5
%92 = add nsw i32 %91, 1
store i32 %92, i32* %6
%93 = load [7 x i8]*, [7 x i8]** %2
%94 = load i32, i32* %5
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [7 x i8], [7 x i8]* %93, i64 %95
%97 = load i32, i32* %6
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [7 x i8], [7 x i8]* %96, i64 0, i64 %98
store i8 87, i8* %99
ret void
}

LLVM IR (-O2):
define void @initMap([7 x i8]* nocapture writeonly %0) {
%2 = getelementptr [7 x i8], [7 x i8]* %0, i64 2, i64 0
%3 = getelementptr [7 x i8], [7 x i8]* %0, i64 3, i64 0
%4 = getelementptr [7 x i8], [7 x i8]* %0, i64 4, i64 0
%5 = getelementptr [7 x i8], [7 x i8]* %0, i64 5, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 0, i64 8
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 1, i64 6
store i8 35, i8* %7
store i8 35, i8* %2
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 2, i64 6
store i8 35, i8* %8
store i8 35, i8* %3
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 3, i64 6
store i8 35, i8* %9
store i8 35, i8* %4
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 4, i64 6
store i8 35, i8* %10
store i8 35, i8* %5
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 5, i64 6
%12 = bitcast [7 x i8]* %0 to i64*
store i64 2531906049332683555, i64* %12
%13 = bitcast i8* %11 to i64*
store i64 2531906049332683555, i64* %13
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 5
%16 = add nsw i32 %15, 1
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 5
%19 = add nsw i32 %18, 1
%20 = sext i32 %16 to i64
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 %20, i64 %21
store i8 80, i8* %22
%23 = tail call i32 (...) @rand()
%24 = srem i32 %23, 5
%25 = add nsw i32 %24, 1
%26 = tail call i32 (...) @rand()
%27 = srem i32 %26, 5
%28 = add nsw i32 %27, 1
%29 = sext i32 %25 to i64
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 %29, i64 %30
store i8 80, i8* %31
%32 = tail call i32 (...) @rand()
%33 = srem i32 %32, 5
%34 = add nsw i32 %33, 1
%35 = tail call i32 (...) @rand()
%36 = srem i32 %35, 5
%37 = add nsw i32 %36, 1
%38 = sext i32 %34 to i64
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 %38, i64 %39
store i8 80, i8* %40
%41 = tail call i32 (...) @rand()
%42 = srem i32 %41, 5
%43 = add nsw i32 %42, 1
%44 = tail call i32 (...) @rand()
%45 = srem i32 %44, 5
%46 = add nsw i32 %45, 1
%47 = sext i32 %43 to i64
%48 = sext i32 %46 to i64
%49 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 %47, i64 %48
store i8 80, i8* %49
%50 = tail call i32 (...) @rand()
%51 = srem i32 %50, 5
%52 = add nsw i32 %51, 1
%53 = tail call i32 (...) @rand()
%54 = srem i32 %53, 5
%55 = add nsw i32 %54, 1
%56 = sext i32 %52 to i64
%57 = sext i32 %55 to i64
%58 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 %56, i64 %57
store i8 87, i8* %58
ret void
}