#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 /*<<< orphan*/ find_data_rot(int *, int *, int, int);
int classify(int x[2][2]) {
  int x0, y0, x1, y1, d0, d1, r0, r1;
  x0 = 2 * x[0][0] - 3;
  y0 = 2 * x[0][1] - 3;
  x1 = 2 * x[1][0] - 3;
  y1 = 2 * x[1][1] - 3;
  find_data_rot(&d0, &r0, x0, y0);
  find_data_rot(&d1, &r1, x1, y1);
  if (((r0 - r1) & 1) == 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<classify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x1,%eax
sub    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x1,%eax
sub    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x1,%eax
sub    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x1,%eax
sub    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    -0x24(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1030 <find_data_rot@plt>
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <find_data_rot@plt>
mov    -0x2c(%rbp),%eax
sub    -0x30(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    119f <classify+0x8f>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <classify+0x96>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<classify>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
lea    -0x3(%rax,%rax,1),%edx
lea    -0x3(%rcx,%rcx,1),%ecx
mov    0x8(%rdi),%eax
lea    -0x3(%rax,%rax,1),%ebx
mov    0xc(%rdi),%eax
lea    (%rax,%rax,1),%ebp
add    $0xfffffffd,%ebp
lea    0x14(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <find_data_rot@plt>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <find_data_rot@plt>
mov    0xc(%rsp),%eax
sub    0x8(%rsp),%eax
and    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @classify([2 x i32]* %0) {
%2 = alloca i32
%3 = alloca [2 x i32]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store [2 x i32]* %0, [2 x i32]** %3
%12 = load [2 x i32]*, [2 x i32]** %3
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%15 = load i32, i32* %14
%16 = mul nsw i32 2, %15
%17 = sub nsw i32 %16, 3
store i32 %17, i32* %4
%18 = load [2 x i32]*, [2 x i32]** %3
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 0
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
%21 = load i32, i32* %20
%22 = mul nsw i32 2, %21
%23 = sub nsw i32 %22, 3
store i32 %23, i32* %5
%24 = load [2 x i32]*, [2 x i32]** %3
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %24, i64 1
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %25, i64 0, i64 0
%27 = load i32, i32* %26
%28 = mul nsw i32 2, %27
%29 = sub nsw i32 %28, 3
store i32 %29, i32* %6
%30 = load [2 x i32]*, [2 x i32]** %3
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 1
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %31, i64 0, i64 1
%33 = load i32, i32* %32
%34 = mul nsw i32 2, %33
%35 = sub nsw i32 %34, 3
store i32 %35, i32* %7
%36 = load i32, i32* %4
%37 = load i32, i32* %5
%38 = call i32 @find_data_rot(i32* %8, i32* %10, i32 %36, i32 %37)
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = call i32 @find_data_rot(i32* %9, i32* %11, i32 %39, i32 %40)
%42 = load i32, i32* %10
%43 = load i32, i32* %11
%44 = sub nsw i32 %42, %43
%45 = and i32 %44, 1
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %1
store i32 0, i32* %2
br label %49
48: ; preds = %1
store i32 1, i32* %2
br label %49
49: ; preds = %48, %47
%50 = load i32, i32* %2
ret i32 %50
}

LLVM IR (-O2):
define i32 @classify([2 x i32]* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%11 = load i32, i32* %10
%12 = shl nsw i32 %11, 1
%13 = add nsw i32 %12, -3
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 1
%15 = load i32, i32* %14
%16 = shl nsw i32 %15, 1
%17 = add nsw i32 %16, -3
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%19 = load i32, i32* %18
%20 = shl nsw i32 %19, 1
%21 = add nsw i32 %20, -3
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 1
%23 = load i32, i32* %22
%24 = shl nsw i32 %23, 1
%25 = add nsw i32 %24, -3
%26 = call i32 @find_data_rot(i32* %2, i32* %4, i32 %13, i32 %17)
%27 = call i32 @find_data_rot(i32* %3, i32* %5, i32 %21, i32 %25)
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = sub nsw i32 %28, %29
%31 = and i32 %30, 1
ret i32 %31
}