#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 */
scalar_t__ ok(int, int, int, int);
int end() {
  int i, j;
  for (i = (0); i < (8); i++)
    for (j = (0); j < (8); j++)
      if (ok(i, j, 1, -1) || ok(i, j, -1, 1))
        return 0;
  return 1;
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11aa <end+0x9a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1197 <end+0x87>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
cmp    $0x0,%rax
jne    1178 <end+0x68>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
cmp    $0x0,%rax
je     1184 <end+0x74>
movl   $0x0,-0x4(%rbp)
jmp    11b1 <end+0xa1>
jmp    1189 <end+0x79>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <end+0x20>
jmp    119c <end+0x8c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <end+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %ebx,%ebx
mov    %ebp,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1304 <end+0x1f4>
mov    %ebp,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x2,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x3,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x5,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x5,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x6,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x6,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x7,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
mov    %ebp,%edi
mov    $0x7,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
call   1030 <ok@plt>
test   %rax,%rax
jne    1306 <end+0x1f6>
add    $0x1,%ebp
cmp    $0x8,%ebp
jne    1117 <end+0x7>
mov    $0x1,%ebx
jmp    1306 <end+0x1f6>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @end() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %27, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %30
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %23, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i64 @ok(i32 %12, i32 %13, i32 1, i32 -1)
%15 = icmp ne i64 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %11
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i64 @ok(i32 %17, i32 %18, i32 -1, i32 1)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16, %11
store i32 0, i32* %1
br label %31
22: ; preds = %16
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %8
26: ; preds = %8
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %4
30: ; preds = %4
store i32 1, i32* %1
br label %31
31: ; preds = %30, %21
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @end() {
br label %1
1: ; preds = %0, %47
%2 = phi i32 [ 0, %0 ], [ %48, %47 ]
%3 = tail call i64 @ok(i32 %2, i32 0, i32 1, i32 -1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %50, label %53
5: ; preds = %50
%6 = tail call i64 @ok(i32 %2, i32 1, i32 1, i32 -1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %53
8: ; preds = %5
%9 = tail call i64 @ok(i32 %2, i32 1, i32 -1, i32 1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %53
11: ; preds = %8
%12 = tail call i64 @ok(i32 %2, i32 2, i32 1, i32 -1)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %53
14: ; preds = %11
%15 = tail call i64 @ok(i32 %2, i32 2, i32 -1, i32 1)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %53
17: ; preds = %14
%18 = tail call i64 @ok(i32 %2, i32 3, i32 1, i32 -1)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %53
20: ; preds = %17
%21 = tail call i64 @ok(i32 %2, i32 3, i32 -1, i32 1)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %53
23: ; preds = %20
%24 = tail call i64 @ok(i32 %2, i32 4, i32 1, i32 -1)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %53
26: ; preds = %23
%27 = tail call i64 @ok(i32 %2, i32 4, i32 -1, i32 1)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %53
29: ; preds = %26
%30 = tail call i64 @ok(i32 %2, i32 5, i32 1, i32 -1)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %53
32: ; preds = %29
%33 = tail call i64 @ok(i32 %2, i32 5, i32 -1, i32 1)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %53
35: ; preds = %32
%36 = tail call i64 @ok(i32 %2, i32 6, i32 1, i32 -1)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %53
38: ; preds = %35
%39 = tail call i64 @ok(i32 %2, i32 6, i32 -1, i32 1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %53
41: ; preds = %38
%42 = tail call i64 @ok(i32 %2, i32 7, i32 1, i32 -1)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %41
%45 = tail call i64 @ok(i32 %2, i32 7, i32 -1, i32 1)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %53
47: ; preds = %44
%48 = add nuw nsw i32 %2, 1
%49 = icmp eq i32 %48, 8
br i1 %49, label %53, label %1
50: ; preds = %1
%51 = tail call i64 @ok(i32 %2, i32 0, i32 -1, i32 1)
%52 = icmp eq i64 %51, 0
br i1 %52, label %5, label %53
53: ; preds = %47, %1, %50, %5, %8, %11, %14, %17, %20, %23, %26, %29, %32, %35, %38, %41, %44
%54 = phi i32 [ 0, %44 ], [ 0, %41 ], [ 0, %38 ], [ 0, %35 ], [ 0, %32 ], [ 0, %29 ], [ 0, %26 ], [ 0, %23 ], [ 0, %20 ], [ 0, %17 ], [ 0, %14 ], [ 0, %11 ], [ 0, %8 ], [ 0, %5 ], [ 0, %50 ], [ 0, %1 ], [ 1, %47 ]
ret i32 %54
}