#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 */
char clueN(char **, int, int, int, int);
void clues(char g[4 + 2][4 + 2]) {
  int x, y;
  x = 0;
  for (y = 1; y <= 4; y++) {
    g[y][x] = clueN(g, x, y, 1, 0);
  }
  x = 4 + 1;
  for (y = 1; y <= 4; y++) {
    g[y][x] = clueN(g, x, y, -1, 0);
  }
  y = 0;
  for (x = 1; x <= 4; x++) {
    g[y][x] = clueN(g, x, y, 0, 1);
  }
  y = 4 + 1;
  for (x = 1; x <= 4; x++) {
    g[y][x] = clueN(g, x, y, 0, -1);
  }
}


x86 assembly (clang, -O0):
<clues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jg     1171 <clues+0x61>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <clues+0x1a>
movl   $0x5,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jg     11c6 <clues+0xb6>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117f <clues+0x6f>
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jg     121b <clues+0x10b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <clueN@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d4 <clues+0xc4>
movl   $0x5,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jg     1270 <clues+0x160>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
call   1030 <clueN@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1229 <clues+0x119>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clues>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0x6(%rbx)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0xc(%rbx)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0x12(%rbx)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0x18(%rbx)
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0xb(%rbx)
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0x11(%rbx)
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x3,%edx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0x17(%rbx)
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1030 <clueN@plt>
mov    %al,0x1d(%rbx)
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <clueN@plt>
mov    %al,0x1(%rbx)
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <clueN@plt>
mov    %al,0x2(%rbx)
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <clueN@plt>
mov    %al,0x3(%rbx)
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <clueN@plt>
mov    %al,0x4(%rbx)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
call   1030 <clueN@plt>
mov    %al,0x1f(%rbx)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
call   1030 <clueN@plt>
mov    %al,0x20(%rbx)
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
call   1030 <clueN@plt>
mov    %al,0x21(%rbx)
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
call   1030 <clueN@plt>
mov    %al,0x22(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @clues([6 x i8]* %0) {
%2 = bitcast [6 x i8]* %0 to i8**
%3 = tail call signext i8 @clueN(i8** %2, i32 0, i32 1, i32 1, i32 0)
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 1, i64 0
store i8 %3, i8* %4
%5 = tail call signext i8 @clueN(i8** %2, i32 0, i32 2, i32 1, i32 0)
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 2, i64 0
store i8 %5, i8* %6
%7 = tail call signext i8 @clueN(i8** %2, i32 0, i32 3, i32 1, i32 0)
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 3, i64 0
store i8 %7, i8* %8
%9 = tail call signext i8 @clueN(i8** %2, i32 0, i32 4, i32 1, i32 0)
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 4, i64 0
store i8 %9, i8* %10
%11 = tail call signext i8 @clueN(i8** %2, i32 5, i32 1, i32 -1, i32 0)
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 1, i64 5
store i8 %11, i8* %12
%13 = tail call signext i8 @clueN(i8** %2, i32 5, i32 2, i32 -1, i32 0)
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 2, i64 5
store i8 %13, i8* %14
%15 = tail call signext i8 @clueN(i8** %2, i32 5, i32 3, i32 -1, i32 0)
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 3, i64 5
store i8 %15, i8* %16
%17 = tail call signext i8 @clueN(i8** %2, i32 5, i32 4, i32 -1, i32 0)
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 4, i64 5
store i8 %17, i8* %18
%19 = tail call signext i8 @clueN(i8** %2, i32 1, i32 0, i32 0, i32 1)
%20 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 0, i64 1
store i8 %19, i8* %20
%21 = tail call signext i8 @clueN(i8** %2, i32 2, i32 0, i32 0, i32 1)
%22 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 0, i64 2
store i8 %21, i8* %22
%23 = tail call signext i8 @clueN(i8** %2, i32 3, i32 0, i32 0, i32 1)
%24 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 0, i64 3
store i8 %23, i8* %24
%25 = tail call signext i8 @clueN(i8** %2, i32 4, i32 0, i32 0, i32 1)
%26 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 0, i64 4
store i8 %25, i8* %26
%27 = tail call signext i8 @clueN(i8** %2, i32 1, i32 5, i32 0, i32 -1)
%28 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 5, i64 1
store i8 %27, i8* %28
%29 = tail call signext i8 @clueN(i8** %2, i32 2, i32 5, i32 0, i32 -1)
%30 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 5, i64 2
store i8 %29, i8* %30
%31 = tail call signext i8 @clueN(i8** %2, i32 3, i32 5, i32 0, i32 -1)
%32 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 5, i64 3
store i8 %31, i8* %32
%33 = tail call signext i8 @clueN(i8** %2, i32 4, i32 5, i32 0, i32 -1)
%34 = getelementptr inbounds [6 x i8], [6 x i8]* %0, i64 5, i64 4
store i8 %33, i8* %34
ret void
}