#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 */
int getNumericX(char, int);
int getNumericY(char, int);
int getTransformationBit(int, int);
scalar_t__ satisfiesConstraint(int, int, int);
scalar_t__ satisfiesConstraintRegardlesOfTransformation(int, int, int);
int /*<<< orphan*/ setTransformationBit(int, int *);
int transformX(int, int, int);
int /*<<< orphan*/ transformXY(int *, int *, int);
int transformY(int, int, int);
int /*<<< orphan*/ unsetTransformationBit(int, int *);
int findTransformations(char *move, int boardSize, int transformations) {
  int x = getNumericX(move[0], boardSize);
  int y = getNumericY(move[1], boardSize);
  transformXY(&x, &y, transformations);
  int i;
  for (i = 4; i <= 6; i++) {
    int transformationNo = i - 3;
    int transformationIsFrozen = getTransformationBit(i, transformations);
    if (transformationIsFrozen)
      continue;
    if (satisfiesConstraintRegardlesOfTransformation(transformationNo, x, y))
      continue;
    if (satisfiesConstraint(transformationNo, x, y)) {
      unsetTransformationBit(transformationNo, &transformations);
    } else {
      setTransformationBit(transformationNo, &transformations);
      x = transformX(x, y, transformationNo);
      y = transformY(x, y, transformationNo);
    }
    setTransformationBit(i, &transformations);
  }
  return transformations;
}


x86 assembly (clang, -O0):
<findTransformations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   10a0 <getNumericX@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <getNumericY@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1080 <transformXY@plt>
movl   $0x4,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jg     12b0 <findTransformations+0x110>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1060 <getTransformationBit@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1222 <findTransformations+0x82>
jmp    12a2 <findTransformations+0x102>
mov    -0x20(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   10c0 <satisfiesConstraintRegardlesOfTransformation@plt>
cmp    $0x0,%rax
je     123f <findTransformations+0x9f>
jmp    12a2 <findTransformations+0x102>
mov    -0x20(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <satisfiesConstraint@plt>
cmp    $0x0,%rax
je     1268 <findTransformations+0xc8>
mov    -0x20(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1090 <unsetTransformationBit@plt>
jmp    1296 <findTransformations+0xf6>
mov    -0x20(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1070 <setTransformationBit@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <transformX@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%edx
call   10b0 <transformY@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1070 <setTransformationBit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f2 <findTransformations+0x52>
mov    -0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findTransformations>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,0xc(%rsp)
movsbl (%rdi),%edi
call   10a0 <getNumericX@plt>
mov    %eax,0x8(%rsp)
movsbl 0x1(%rbx),%edi
mov    %ebp,%esi
call   1030 <getNumericY@plt>
mov    %eax,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    %r14d,%edx
call   1080 <transformXY@plt>
mov    $0x4,%edi
mov    %r14d,%esi
call   1060 <getTransformationBit@plt>
test   %eax,%eax
jne    1278 <findTransformations+0xd8>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x1,%edi
call   10c0 <satisfiesConstraintRegardlesOfTransformation@plt>
test   %rax,%rax
jne    1278 <findTransformations+0xd8>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x1,%edi
call   1050 <satisfiesConstraint@plt>
lea    0xc(%rsp),%rsi
mov    $0x1,%edi
test   %rax,%rax
je     1235 <findTransformations+0x95>
call   1090 <unsetTransformationBit@plt>
jmp    1264 <findTransformations+0xc4>
call   1070 <setTransformationBit@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
mov    $0x1,%edx
call   1040 <transformX@plt>
mov    %eax,0x8(%rsp)
mov    0x4(%rsp),%esi
mov    %eax,%edi
mov    $0x1,%edx
call   10b0 <transformY@plt>
mov    %eax,0x4(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edi
call   1070 <setTransformationBit@plt>
mov    0xc(%rsp),%r14d
mov    $0x5,%edi
mov    %r14d,%esi
call   1060 <getTransformationBit@plt>
test   %eax,%eax
jne    1306 <findTransformations+0x166>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x2,%edi
call   10c0 <satisfiesConstraintRegardlesOfTransformation@plt>
test   %rax,%rax
jne    1306 <findTransformations+0x166>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x2,%edi
call   1050 <satisfiesConstraint@plt>
lea    0xc(%rsp),%rsi
mov    $0x2,%edi
test   %rax,%rax
je     12c8 <findTransformations+0x128>
call   1090 <unsetTransformationBit@plt>
jmp    12f7 <findTransformations+0x157>
call   1070 <setTransformationBit@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
mov    $0x2,%edx
call   1040 <transformX@plt>
mov    %eax,0x8(%rsp)
mov    0x4(%rsp),%esi
mov    %eax,%edi
mov    $0x2,%edx
call   10b0 <transformY@plt>
mov    %eax,0x4(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x5,%edi
call   1070 <setTransformationBit@plt>
mov    0xc(%rsp),%esi
mov    $0x6,%edi
call   1060 <getTransformationBit@plt>
test   %eax,%eax
jne    1395 <findTransformations+0x1f5>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x3,%edi
call   10c0 <satisfiesConstraintRegardlesOfTransformation@plt>
test   %rax,%rax
jne    1395 <findTransformations+0x1f5>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x3,%edi
call   1050 <satisfiesConstraint@plt>
lea    0xc(%rsp),%rsi
mov    $0x3,%edi
test   %rax,%rax
je     1357 <findTransformations+0x1b7>
call   1090 <unsetTransformationBit@plt>
jmp    1386 <findTransformations+0x1e6>
call   1070 <setTransformationBit@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
mov    $0x3,%edx
call   1040 <transformX@plt>
mov    %eax,0x8(%rsp)
mov    0x4(%rsp),%esi
mov    %eax,%edi
mov    $0x3,%edx
call   10b0 <transformY@plt>
mov    %eax,0x4(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x6,%edi
call   1070 <setTransformationBit@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @findTransformations(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = load i32, i32* %5
%16 = call i32 @getNumericX(i8 signext %14, i32 %15)
store i32 %16, i32* %7
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = load i32, i32* %5
%21 = call i32 @getNumericY(i8 signext %19, i32 %20)
store i32 %21, i32* %8
%22 = load i32, i32* %6
%23 = call i32 @transformXY(i32* %7, i32* %8, i32 %22)
store i32 4, i32* %9
br label %24
24: ; preds = %66, %3
%25 = load i32, i32* %9
%26 = icmp sle i32 %25, 6
br i1 %26, label %27, label %69
27: ; preds = %24
%28 = load i32, i32* %9
%29 = sub nsw i32 %28, 3
store i32 %29, i32* %10
%30 = load i32, i32* %9
%31 = load i32, i32* %6
%32 = call i32 @getTransformationBit(i32 %30, i32 %31)
store i32 %32, i32* %11
%33 = load i32, i32* %11
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %27
br label %66
36: ; preds = %27
%37 = load i32, i32* %10
%38 = load i32, i32* %7
%39 = load i32, i32* %8
%40 = call i64 @satisfiesConstraintRegardlesOfTransformation(i32 %37, i32 %38, i32 %39)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %36
br label %66
43: ; preds = %36
%44 = load i32, i32* %10
%45 = load i32, i32* %7
%46 = load i32, i32* %8
%47 = call i64 @satisfiesConstraint(i32 %44, i32 %45, i32 %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %43
%50 = load i32, i32* %10
%51 = call i32 @unsetTransformationBit(i32 %50, i32* %6)
br label %63
52: ; preds = %43
%53 = load i32, i32* %10
%54 = call i32 @setTransformationBit(i32 %53, i32* %6)
%55 = load i32, i32* %7
%56 = load i32, i32* %8
%57 = load i32, i32* %10
%58 = call i32 @transformX(i32 %55, i32 %56, i32 %57)
store i32 %58, i32* %7
%59 = load i32, i32* %7
%60 = load i32, i32* %8
%61 = load i32, i32* %10
%62 = call i32 @transformY(i32 %59, i32 %60, i32 %61)
store i32 %62, i32* %8
br label %63
63: ; preds = %52, %49
%64 = load i32, i32* %9
%65 = call i32 @setTransformationBit(i32 %64, i32* %6)
br label %66
66: ; preds = %63, %42, %35
%67 = load i32, i32* %9
%68 = add nsw i32 %67, 1
store i32 %68, i32* %9
br label %24
69: ; preds = %24
%70 = load i32, i32* %6
ret i32 %70
}

LLVM IR (-O2):
define i32 @findTransformations(i8* nocapture %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %2, i32* %4
%7 = bitcast i32* %5 to i8*
%8 = load i8, i8* %0
%9 = tail call i32 @getNumericX(i8 signext %8, i32 %1)
store i32 %9, i32* %5
%10 = bitcast i32* %6 to i8*
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = tail call i32 @getNumericY(i8 signext %12, i32 %1)
store i32 %13, i32* %6
%14 = call i32 @transformXY(i32* %5, i32* %6, i32 %2)
%15 = call i32 @getTransformationBit(i32 4, i32 %2)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %39
17: ; preds = %3
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i64 @satisfiesConstraintRegardlesOfTransformation(i32 1, i32 %18, i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %39
22: ; preds = %17
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = call i64 @satisfiesConstraint(i32 1, i32 %23, i32 %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %22
%28 = call i32 @unsetTransformationBit(i32 1, i32* %4)
br label %36
29: ; preds = %22
%30 = call i32 @setTransformationBit(i32 1, i32* %4)
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = call i32 @transformX(i32 %31, i32 %32, i32 1)
store i32 %33, i32* %5
%34 = load i32, i32* %6
%35 = call i32 @transformY(i32 %33, i32 %34, i32 1)
store i32 %35, i32* %6
br label %36
36: ; preds = %29, %27
%37 = call i32 @setTransformationBit(i32 4, i32* %4)
%38 = load i32, i32* %4
br label %39
39: ; preds = %17, %3, %36
%40 = phi i32 [ %2, %17 ], [ %2, %3 ], [ %38, %36 ]
%41 = call i32 @getTransformationBit(i32 5, i32 %40)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %64
43: ; preds = %39
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = call i64 @satisfiesConstraintRegardlesOfTransformation(i32 2, i32 %44, i32 %45)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %64
48: ; preds = %43
%49 = load i32, i32* %5
%50 = load i32, i32* %6
%51 = call i64 @satisfiesConstraint(i32 2, i32 %49, i32 %50)
%52 = icmp eq i64 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %48
%54 = call i32 @unsetTransformationBit(i32 2, i32* %4)
br label %62
55: ; preds = %48
%56 = call i32 @setTransformationBit(i32 2, i32* %4)
%57 = load i32, i32* %5
%58 = load i32, i32* %6
%59 = call i32 @transformX(i32 %57, i32 %58, i32 2)
store i32 %59, i32* %5
%60 = load i32, i32* %6
%61 = call i32 @transformY(i32 %59, i32 %60, i32 2)
store i32 %61, i32* %6
br label %62
62: ; preds = %55, %53
%63 = call i32 @setTransformationBit(i32 5, i32* %4)
br label %64
64: ; preds = %62, %43, %39
%65 = load i32, i32* %4
%66 = call i32 @getTransformationBit(i32 6, i32 %65)
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %89
68: ; preds = %64
%69 = load i32, i32* %5
%70 = load i32, i32* %6
%71 = call i64 @satisfiesConstraintRegardlesOfTransformation(i32 3, i32 %69, i32 %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %89
73: ; preds = %68
%74 = load i32, i32* %5
%75 = load i32, i32* %6
%76 = call i64 @satisfiesConstraint(i32 3, i32 %74, i32 %75)
%77 = icmp eq i64 %76, 0
br i1 %77, label %80, label %78
78: ; preds = %73
%79 = call i32 @unsetTransformationBit(i32 3, i32* %4)
br label %87
80: ; preds = %73
%81 = call i32 @setTransformationBit(i32 3, i32* %4)
%82 = load i32, i32* %5
%83 = load i32, i32* %6
%84 = call i32 @transformX(i32 %82, i32 %83, i32 3)
store i32 %84, i32* %5
%85 = load i32, i32* %6
%86 = call i32 @transformY(i32 %84, i32 %85, i32 3)
store i32 %86, i32* %6
br label %87
87: ; preds = %80, %78
%88 = call i32 @setTransformationBit(i32 6, i32* %4)
br label %89
89: ; preds = %87, %68, %64
%90 = load i32, i32* %4
ret i32 %90
}