#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);
int /*<<< orphan*/ somewhere(int, int /*<<< orphan*/, int);
int autohelperowl_attackpat207(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int a, b, c, e, f, g, h;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(-1, 0, move, transformation);
  b = offset(-1, 1, move, transformation);
  c = offset(0, 1, move, transformation);
  e = offset(-2, 1, move, transformation);
  f = offset(-1, 2, move, transformation);
  g = offset(-2, 0, move, transformation);
  h = offset(0, 2, move, transformation);
  return (owl_escape_value(a) > 0) + (owl_escape_value(b) > 0) +
                 (owl_escape_value(c) > 0) >
             1 ||
         (!somewhere(color, 0, g) && !somewhere(color, 0, h) &&
          owl_escape_value(e) + owl_escape_value(f) > 0);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat207>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <offset@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <offset@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xfffffffe,%edi
mov    $0x1,%esi
call   1040 <offset@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xfffffffe,%edi
xor    %esi,%esi
call   1040 <offset@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <owl_escape_value@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x40(%rbp)
mov    -0x20(%rbp),%edi
call   1030 <owl_escape_value@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%eax
cmp    $0x0,%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <owl_escape_value@plt>
mov    -0x3c(%rbp),%ecx
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x35(%rbp)
jg     12ab <autohelperowl_attackpat207+0x17b>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%edx
xor    %esi,%esi
call   1050 <somewhere@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x41(%rbp)
jne    12a5 <autohelperowl_attackpat207+0x175>
mov    -0x14(%rbp),%edi
mov    -0x34(%rbp),%edx
xor    %esi,%esi
call   1050 <somewhere@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x41(%rbp)
jne    12a5 <autohelperowl_attackpat207+0x175>
mov    -0x28(%rbp),%edi
call   1030 <owl_escape_value@plt>
mov    %rax,-0x50(%rbp)
mov    -0x2c(%rbp),%edi
call   1030 <owl_escape_value@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
cmp    $0x0,%rax
setg   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
mov    %al,-0x35(%rbp)
mov    -0x35(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat207>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,0x4(%rsp)
mov    %edx,%ebp
mov    %esi,%ebx
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r12d
mov    $0x1,%r13d
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r15d
xor    %edi,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r14d
mov    $0xfffffffe,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0xc(%rsp)
mov    $0xffffffff,%edi
mov    $0x2,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x8(%rsp)
mov    $0xfffffffe,%edi
xor    %esi,%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)
mov    %r12d,%edi
call   1030 <owl_escape_value@plt>
xor    %ebp,%ebp
test   %rax,%rax
setg   %bpl
mov    %r15d,%edi
call   1030 <owl_escape_value@plt>
xor    %ebx,%ebx
test   %rax,%rax
setg   %bl
add    %ebp,%ebx
mov    %r14d,%edi
call   1030 <owl_escape_value@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
add    %ebx,%ecx
cmp    $0x1,%ecx
ja     1264 <autohelperowl_attackpat207+0x134>
mov    0x4(%rsp),%edi
xor    %esi,%esi
mov    0x14(%rsp),%edx
call   1050 <somewhere@plt>
mov    $0x0,%r13d
test   %eax,%eax
jne    1264 <autohelperowl_attackpat207+0x134>
xor    %r13d,%r13d
mov    0x4(%rsp),%edi
xor    %esi,%esi
mov    0x10(%rsp),%edx
call   1050 <somewhere@plt>
test   %eax,%eax
jne    1264 <autohelperowl_attackpat207+0x134>
mov    0xc(%rsp),%edi
call   1030 <owl_escape_value@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%edi
call   1030 <owl_escape_value@plt>
xor    %r13d,%r13d
add    %rbx,%rax
setg   %r13b
mov    %r13d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat207(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 -1, i32 0, i32 %2, i32 %1)
%7 = tail call i32 @offset(i32 -1, i32 1, i32 %2, i32 %1)
%8 = tail call i32 @offset(i32 0, i32 1, i32 %2, i32 %1)
%9 = tail call i32 @offset(i32 -2, i32 1, i32 %2, i32 %1)
%10 = tail call i32 @offset(i32 -1, i32 2, i32 %2, i32 %1)
%11 = tail call i32 @offset(i32 -2, i32 0, i32 %2, i32 %1)
%12 = tail call i32 @offset(i32 0, i32 2, i32 %2, i32 %1)
%13 = tail call i64 @owl_escape_value(i32 %6)
%14 = icmp sgt i64 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i64 @owl_escape_value(i32 %7)
%17 = icmp sgt i64 %16, 0
%18 = zext i1 %17 to i32
%19 = add nuw nsw i32 %18, %15
%20 = tail call i64 @owl_escape_value(i32 %8)
%21 = icmp sgt i64 %20, 0
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %19, %22
%24 = icmp ugt i32 %23, 1
br i1 %24, label %37, label %25
25: ; preds = %5
%26 = tail call i32 @somewhere(i32 %3, i32 0, i32 %11)
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %37
28: ; preds = %25
%29 = tail call i32 @somewhere(i32 %3, i32 0, i32 %12)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = tail call i64 @owl_escape_value(i32 %9)
%33 = tail call i64 @owl_escape_value(i32 %10)
%34 = add nsw i64 %33, %32
%35 = icmp sgt i64 %34, 0
%36 = zext i1 %35 to i32
br label %37
37: ; preds = %25, %28, %31, %5
%38 = phi i32 [ 1, %5 ], [ 0, %28 ], [ 0, %25 ], [ %36, %31 ]
ret i32 %38
}