#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 autohelperowl_attackpat75(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int a, b, c, d, e, f, g, h, i, j;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(-2, 0, move, transformation);
  b = offset(2, -1, move, transformation);
  c = offset(2, 0, move, transformation);
  d = offset(-1, 2, move, transformation);
  e = offset(-1, 3, move, transformation);
  f = offset(-1, 4, move, transformation);
  g = offset(0, 2, move, transformation);
  h = offset(0, 3, move, transformation);
  i = offset(0, 4, move, transformation);
  j = offset(1, -1, move, transformation);
  return owl_escape_value(a) > 0 && somewhere(color, 2, b, c, j) &&
         somewhere(color, 5, d, e, f, g, h, i);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat75>:
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
mov    $0xfffffffe,%edi
xor    %esi,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x2,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x2,%edi
xor    %esi,%esi
call   1040 <offset@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0x3,%esi
call   1040 <offset@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0x4,%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    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <offset@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x4,%esi
call   1040 <offset@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %eax,-0x40(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <owl_escape_value@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x41(%rbp)
jle    12a5 <autohelperowl_attackpat75+0x175>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <somewhere@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x41(%rbp)
je     12a5 <autohelperowl_attackpat75+0x175>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
mov    -0x38(%rbp),%r10d
mov    -0x3c(%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,-0x41(%rbp)
mov    -0x41(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat75>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,0x8(%rsp)
mov    %edx,%r14d
mov    %esi,%ebx
xor    %ebp,%ebp
mov    $0xfffffffe,%edi
xor    %esi,%esi
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r15d
mov    $0x2,%edi
mov    $0xffffffff,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x1c(%rsp)
mov    $0x2,%edi
xor    %esi,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r12d
mov    $0xffffffff,%edi
mov    $0x2,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x18(%rsp)
mov    $0xffffffff,%edi
mov    $0x3,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x14(%rsp)
mov    $0xffffffff,%edi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0x10(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,0xc(%rsp)
xor    %edi,%edi
mov    $0x3,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %rax,0x20(%rsp)
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%r13d
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <offset@plt>
mov    %eax,%ebx
mov    %r15d,%edi
call   1030 <owl_escape_value@plt>
test   %rax,%rax
jle    1286 <autohelperowl_attackpat75+0x156>
xor    %ebp,%ebp
mov    0x8(%rsp),%edi
mov    $0x2,%esi
mov    0x1c(%rsp),%edx
mov    %r12d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1050 <somewhere@plt>
test   %rax,%rax
je     1286 <autohelperowl_attackpat75+0x156>
mov    0x8(%rsp),%edi
mov    $0x5,%esi
mov    0x18(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
xor    %eax,%eax
push   %r13
push   0x28(%rsp)
call   1050 <somewhere@plt>
add    $0x10,%rsp
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%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_attackpat75(%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
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
%21 = load %struct.pattern*, %struct.pattern** %6
%22 = load i32, i32* %9
%23 = load i32, i32* %10
%24 = load i32, i32* %8
%25 = load i32, i32* %7
%26 = call i32 @offset(i32 -2, i32 0, i32 %24, i32 %25)
store i32 %26, i32* %11
%27 = load i32, i32* %8
%28 = load i32, i32* %7
%29 = call i32 @offset(i32 2, i32 -1, i32 %27, i32 %28)
store i32 %29, i32* %12
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = call i32 @offset(i32 2, i32 0, i32 %30, i32 %31)
store i32 %32, i32* %13
%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* %14
%36 = load i32, i32* %8
%37 = load i32, i32* %7
%38 = call i32 @offset(i32 -1, i32 3, i32 %36, i32 %37)
store i32 %38, i32* %15
%39 = load i32, i32* %8
%40 = load i32, i32* %7
%41 = call i32 @offset(i32 -1, i32 4, i32 %39, i32 %40)
store i32 %41, i32* %16
%42 = load i32, i32* %8
%43 = load i32, i32* %7
%44 = call i32 @offset(i32 0, i32 2, i32 %42, i32 %43)
store i32 %44, i32* %17
%45 = load i32, i32* %8
%46 = load i32, i32* %7
%47 = call i32 @offset(i32 0, i32 3, i32 %45, i32 %46)
store i32 %47, i32* %18
%48 = load i32, i32* %8
%49 = load i32, i32* %7
%50 = call i32 @offset(i32 0, i32 4, i32 %48, i32 %49)
store i32 %50, i32* %19
%51 = load i32, i32* %8
%52 = load i32, i32* %7
%53 = call i32 @offset(i32 1, i32 -1, i32 %51, i32 %52)
store i32 %53, i32* %20
%54 = load i32, i32* %11
%55 = call i64 @owl_escape_value(i32 %54)
%56 = icmp sgt i64 %55, 0
br i1 %56, label %57, label %74
57: ; preds = %5
%58 = load i32, i32* %9
%59 = load i32, i32* %12
%60 = load i32, i32* %13
%61 = load i32, i32* %20
%62 = call i64 (i32, i32, i32, i32, i32, ...) @somewhere(i32 %58, i32 2, i32 %59, i32 %60, i32 %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %74
64: ; preds = %57
%65 = load i32, i32* %9
%66 = load i32, i32* %14
%67 = load i32, i32* %15
%68 = load i32, i32* %16
%69 = load i32, i32* %17
%70 = load i32, i32* %18
%71 = load i32, i32* %19
%72 = call i64 (i32, i32, i32, i32, i32, ...) @somewhere(i32 %65, i32 5, i32 %66, i32 %67, i32 %68, i32 %69, i32 %70, i32 %71)
%73 = icmp ne i64 %72, 0
br label %74
74: ; preds = %64, %57, %5
%75 = phi i1 [ false, %57 ], [ false, %5 ], [ %73, %64 ]
%76 = zext i1 %75 to i32
ret i32 %76
}

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