#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 */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int, int, int, int);
scalar_t__ owl_escape_value(int);
scalar_t__ somewhere(int, int, int, int, int, int, ...);
int autohelperowl_attackpat77(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int a, b, c, d, e, f, g, h, i, j, k;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(0, -3, move, transformation);
  b = offset(0, -2, move, transformation);
  c = offset(1, -3, move, transformation);
  d = offset(1, -2, move, transformation);
  e = offset(-1, -1, move, transformation);
  f = offset(0, 2, move, transformation);
  g = offset(0, 3, move, transformation);
  h = offset(1, 2, move, transformation);
  i = offset(1, 3, move, transformation);
  j = offset(2, 2, move, transformation);
  k = offset(2, 3, move, transformation);
  return somewhere(color, 3, a, b, c, d) && owl_escape_value(e) > 0 &&
         somewhere(color, 5, f, g, h, i, j, k);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat77>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0xfffffffd,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0xfffffffe,%esi
call   1040 <offset@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0xfffffffd,%esi
call   1040 <offset@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1040 <offset@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1040 <offset@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <offset@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <offset@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x2,%esi
mov    %esi,%edi
call   1040 <offset@plt>
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <offset@plt>
mov    %eax,-0x44(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    $0x3,%esi
mov    $0x0,%al
call   1050 <somewhere@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x45(%rbp)
je     12be <autohelperowl_attackpat77+0x18e>
mov    -0x2c(%rbp),%edi
call   1030 <owl_escape_value@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x45(%rbp)
jle    12be <autohelperowl_attackpat77+0x18e>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
mov    -0x40(%rbp),%r10d
mov    -0x44(%rbp),%eax
mov    $0x5,%esi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <somewhere@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x45(%rbp)
mov    -0x45(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat77>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,0x1c(%rsp)
mov    %edx,%ebp
mov    %esi,%ebx
xor    %r15d,%r15d
xor    %edi,%edi
mov    $0xfffffffd,%esi
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x18(%rsp)
xor    %edi,%edi
mov    $0xfffffffe,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r13d
mov    $0x1,%edi
mov    $0xfffffffd,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r14d
mov    $0x1,%edi
mov    $0xfffffffe,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r12d
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x14(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x10(%rsp)
xor    %edi,%edi
mov    $0x3,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0xc(%rsp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x8(%rsp)
mov    $0x1,%edi
mov    $0x3,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x4(%rsp)
mov    $0x2,%edi
mov    $0x2,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %rax,0x20(%rsp)
mov    $0x2,%edi
mov    $0x3,%esi
mov    %ebp,%edx
mov    0x1c(%rsp),%ebp
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x3,%esi
mov    0x18(%rsp),%edx
mov    %r13d,%ecx
mov    %r14d,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   1050 <somewhere@plt>
test   %rax,%rax
je     1299 <autohelperowl_attackpat77+0x169>
mov    0x14(%rsp),%edi
call   1030 <owl_escape_value@plt>
test   %rax,%rax
jle    1299 <autohelperowl_attackpat77+0x169>
mov    %ebp,%edi
mov    $0x5,%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0x4(%rsp),%r9d
xor    %eax,%eax
push   %rbx
push   0x28(%rsp)
call   1050 <somewhere@plt>
add    $0x10,%rsp
xor    %r15d,%r15d
test   %rax,%rax
setne  %r15b
mov    %r15d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat77(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%22 = load %struct.pattern*, %struct.pattern** %6
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = load i32, i32* %8
%26 = load i32, i32* %7
%27 = call i32 @offset(i32 0, i32 -3, i32 %25, i32 %26)
store i32 %27, i32* %11
%28 = load i32, i32* %8
%29 = load i32, i32* %7
%30 = call i32 @offset(i32 0, i32 -2, i32 %28, i32 %29)
store i32 %30, i32* %12
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = call i32 @offset(i32 1, i32 -3, i32 %31, i32 %32)
store i32 %33, i32* %13
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = call i32 @offset(i32 1, i32 -2, i32 %34, i32 %35)
store i32 %36, i32* %14
%37 = load i32, i32* %8
%38 = load i32, i32* %7
%39 = call i32 @offset(i32 -1, i32 -1, i32 %37, i32 %38)
store i32 %39, i32* %15
%40 = load i32, i32* %8
%41 = load i32, i32* %7
%42 = call i32 @offset(i32 0, i32 2, i32 %40, i32 %41)
store i32 %42, i32* %16
%43 = load i32, i32* %8
%44 = load i32, i32* %7
%45 = call i32 @offset(i32 0, i32 3, i32 %43, i32 %44)
store i32 %45, i32* %17
%46 = load i32, i32* %8
%47 = load i32, i32* %7
%48 = call i32 @offset(i32 1, i32 2, i32 %46, i32 %47)
store i32 %48, i32* %18
%49 = load i32, i32* %8
%50 = load i32, i32* %7
%51 = call i32 @offset(i32 1, i32 3, i32 %49, i32 %50)
store i32 %51, i32* %19
%52 = load i32, i32* %8
%53 = load i32, i32* %7
%54 = call i32 @offset(i32 2, i32 2, i32 %52, i32 %53)
store i32 %54, i32* %20
%55 = load i32, i32* %8
%56 = load i32, i32* %7
%57 = call i32 @offset(i32 2, i32 3, i32 %55, i32 %56)
store i32 %57, i32* %21
%58 = load i32, i32* %9
%59 = load i32, i32* %11
%60 = load i32, i32* %12
%61 = load i32, i32* %13
%62 = load i32, i32* %14
%63 = call i64 (i32, i32, i32, i32, i32, i32, ...) @somewhere(i32 %58, i32 3, i32 %59, i32 %60, i32 %61, i32 %62)
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %79
65: ; preds = %5
%66 = load i32, i32* %15
%67 = call i64 @owl_escape_value(i32 %66)
%68 = icmp sgt i64 %67, 0
br i1 %68, label %69, label %79
69: ; preds = %65
%70 = load i32, i32* %9
%71 = load i32, i32* %16
%72 = load i32, i32* %17
%73 = load i32, i32* %18
%74 = load i32, i32* %19
%75 = load i32, i32* %20
%76 = load i32, i32* %21
%77 = call i64 (i32, i32, i32, i32, i32, i32, ...) @somewhere(i32 %70, i32 5, i32 %71, i32 %72, i32 %73, i32 %74, i32 %75, i32 %76)
%78 = icmp ne i64 %77, 0
br label %79
79: ; preds = %69, %65, %5
%80 = phi i1 [ false, %65 ], [ false, %5 ], [ %78, %69 ]
%81 = zext i1 %80 to i32
ret i32 %81
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat77(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 -3, i32 %2, i32 %1)
%7 = tail call i32 @offset(i32 0, i32 -2, i32 %2, i32 %1)
%8 = tail call i32 @offset(i32 1, i32 -3, i32 %2, i32 %1)
%9 = tail call i32 @offset(i32 1, i32 -2, i32 %2, i32 %1)
%10 = tail call i32 @offset(i32 -1, i32 -1, i32 %2, i32 %1)
%11 = tail call i32 @offset(i32 0, i32 2, i32 %2, i32 %1)
%12 = tail call i32 @offset(i32 0, i32 3, i32 %2, i32 %1)
%13 = tail call i32 @offset(i32 1, i32 2, i32 %2, i32 %1)
%14 = tail call i32 @offset(i32 1, i32 3, i32 %2, i32 %1)
%15 = tail call i32 @offset(i32 2, i32 2, i32 %2, i32 %1)
%16 = tail call i32 @offset(i32 2, i32 3, i32 %2, i32 %1)
%17 = tail call i64 (i32, i32, i32, i32, i32, i32, ...) @somewhere(i32 %3, i32 3, i32 %6, i32 %7, i32 %8, i32 %9)
%18 = icmp eq i64 %17, 0
br i1 %18, label %26, label %19
19: ; preds = %5
%20 = tail call i64 @owl_escape_value(i32 %10)
%21 = icmp sgt i64 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = tail call i64 (i32, i32, i32, i32, i32, i32, ...) @somewhere(i32 %3, i32 5, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
%24 = icmp ne i64 %23, 0
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %22, %19, %5
%27 = phi i32 [ 0, %19 ], [ 0, %5 ], [ %25, %22 ]
ret i32 %27
}