#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*/ row_d2xy(int, int, int *, int *);
int row_xy2d(int, int, int);
char *test_row_xy2d() {
  do {
    if (!(row_xy2d(16, 0, 0) == 0))
      return "row_xy2d(16, 0, 0) != 0";
  } while (0);
  do {
    if (!(row_xy2d(16, 0, 15) == 255))
      return "row_xy2d(16, 0, 15) != 255";
  } while (0);
  do {
    if (!(row_xy2d(16, 0, 16) == 256))
      return "row_xy2d(16, 0, 16) != 255";
  } while (0);
  do {
    if (!(row_xy2d(16, 0, 31) == 511))
      return "row_xy2d(16, 0, 31) != 255";
  } while (0);
  do {
    if (!(row_xy2d(16, 1, 0) == 3))
      return "row_xy2d(16, 1, 0) != 0";
  } while (0);
  int x, y;
  row_d2xy(16, 0, &x, &y);
  do {
    if (!(x == 0 && y == 0))
      return "row_d2xy(16, 0, x, y) -> (0, 0)";
  } while (0);
  row_d2xy(16, 255, &x, &y);
  do {
    if (!(x == 0 && y == 15))
      return "row_d2xy(16, 255, x, y) -> (0,15)";
  } while (0);
  row_d2xy(16, 256, &x, &y);
  do {
    if (!(x == 0 && y == 16))
      return "row_d2xy(16, 256, x, y) -> (0,16)";
  } while (0);
  row_d2xy(16, 511, &x, &y);
  do {
    if (!(x == 0 && y == 31))
      return "row_d2xy(16, 511, x, y) -> (0,31)";
  } while (0);
  row_d2xy(16, 3, &x, &y);
  do {
    if (!(x == 1 && y == 0))
      return "row_d2xy(16, 3, x, y) -> (1, 0)";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_row_xy2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <row_xy2d@plt>
cmp    $0x0,%eax
je     114f <test_row_xy2d+0x2f>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    1154 <test_row_xy2d+0x34>
jmp    1159 <test_row_xy2d+0x39>
mov    $0x10,%edi
xor    %esi,%esi
mov    $0xf,%edx
call   1030 <row_xy2d@plt>
cmp    $0xff,%eax
je     1185 <test_row_xy2d+0x65>
lea    0xe9c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    118a <test_row_xy2d+0x6a>
jmp    118f <test_row_xy2d+0x6f>
mov    $0x10,%edx
xor    %esi,%esi
mov    %edx,%edi
call   1030 <row_xy2d@plt>
cmp    $0x100,%eax
je     11b8 <test_row_xy2d+0x98>
lea    0xe84(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    11bd <test_row_xy2d+0x9d>
jmp    11c2 <test_row_xy2d+0xa2>
mov    $0x10,%edi
xor    %esi,%esi
mov    $0x1f,%edx
call   1030 <row_xy2d@plt>
cmp    $0x1ff,%eax
je     11ee <test_row_xy2d+0xce>
lea    0xe69(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    11f3 <test_row_xy2d+0xd3>
jmp    11f8 <test_row_xy2d+0xd8>
mov    $0x10,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <row_xy2d@plt>
cmp    $0x3,%eax
je     1222 <test_row_xy2d+0x102>
lea    0xe50(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    1227 <test_row_xy2d+0x107>
mov    $0x10,%edi
xor    %esi,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <row_d2xy@plt>
cmpl   $0x0,-0xc(%rbp)
jne    124f <test_row_xy2d+0x12f>
cmpl   $0x0,-0x10(%rbp)
je     125f <test_row_xy2d+0x13f>
lea    0xe2b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    1264 <test_row_xy2d+0x144>
mov    $0x10,%edi
mov    $0xff,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <row_d2xy@plt>
cmpl   $0x0,-0xc(%rbp)
jne    128f <test_row_xy2d+0x16f>
cmpl   $0xf,-0x10(%rbp)
je     129f <test_row_xy2d+0x17f>
lea    0xe0b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    12a4 <test_row_xy2d+0x184>
mov    $0x10,%edi
mov    $0x100,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <row_d2xy@plt>
cmpl   $0x0,-0xc(%rbp)
jne    12cf <test_row_xy2d+0x1af>
cmpl   $0x10,-0x10(%rbp)
je     12df <test_row_xy2d+0x1bf>
lea    0xded(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    12e4 <test_row_xy2d+0x1c4>
mov    $0x10,%edi
mov    $0x1ff,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <row_d2xy@plt>
cmpl   $0x0,-0xc(%rbp)
jne    130f <test_row_xy2d+0x1ef>
cmpl   $0x1f,-0x10(%rbp)
je     131f <test_row_xy2d+0x1ff>
lea    0xdcf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    1324 <test_row_xy2d+0x204>
mov    $0x10,%edi
mov    $0x3,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <row_d2xy@plt>
cmpl   $0x1,-0xc(%rbp)
jne    134f <test_row_xy2d+0x22f>
cmpl   $0x0,-0x10(%rbp)
je     135f <test_row_xy2d+0x23f>
lea    0xdb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    136c <test_row_xy2d+0x24c>
jmp    1364 <test_row_xy2d+0x244>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_row_xy2d>:
push   %rax
mov    $0x10,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <row_xy2d@plt>
test   %eax,%eax
je     113c <test_row_xy2d+0x1c>
lea    0xec6(%rip),%rax
pop    %rcx
ret
mov    $0x10,%edi
xor    %esi,%esi
mov    $0xf,%edx
call   1030 <row_xy2d@plt>
cmp    $0xff,%eax
jne    1284 <test_row_xy2d+0x164>
mov    $0x10,%edi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <row_xy2d@plt>
cmp    $0x100,%eax
jne    128d <test_row_xy2d+0x16d>
mov    $0x10,%edi
xor    %esi,%esi
mov    $0x1f,%edx
call   1030 <row_xy2d@plt>
cmp    $0x1ff,%eax
jne    1296 <test_row_xy2d+0x176>
mov    $0x10,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <row_xy2d@plt>
cmp    $0x3,%eax
jne    129f <test_row_xy2d+0x17f>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x10,%edi
xor    %esi,%esi
call   1040 <row_d2xy@plt>
mov    0x4(%rsp),%eax
or     (%rsp),%eax
jne    12a8 <test_row_xy2d+0x188>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x10,%edi
mov    $0xff,%esi
call   1040 <row_d2xy@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xeb3(%rip),%rax
jne    1282 <test_row_xy2d+0x162>
cmpl   $0xf,(%rsp)
jne    1282 <test_row_xy2d+0x162>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x10,%edi
mov    $0x100,%esi
call   1040 <row_d2xy@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xea2(%rip),%rax
jne    1282 <test_row_xy2d+0x162>
cmpl   $0x10,(%rsp)
jne    1282 <test_row_xy2d+0x162>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x10,%edi
mov    $0x1ff,%esi
call   1040 <row_d2xy@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xe99(%rip),%rax
jne    1282 <test_row_xy2d+0x162>
cmpl   $0x1f,(%rsp)
jne    1282 <test_row_xy2d+0x162>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x10,%edi
mov    $0x3,%esi
call   1040 <row_d2xy@plt>
mov    0x4(%rsp),%ecx
xor    $0x1,%ecx
lea    0xe8e(%rip),%rdx
xor    %eax,%eax
or     (%rsp),%ecx
cmovne %rdx,%rax
pop    %rcx
ret
lea    0xd8d(%rip),%rax
pop    %rcx
ret
lea    0xd9f(%rip),%rax
pop    %rcx
ret
lea    0xdb1(%rip),%rax
pop    %rcx
ret
lea    0xdc3(%rip),%rax
pop    %rcx
ret
lea    0xdd2(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"row_xy2d(16, 0, 0) != 0\00"
@.str.1 = [27 x i8] c"row_xy2d(16, 0, 15) != 255\00"
@.str.2 = [27 x i8] c"row_xy2d(16, 0, 16) != 255\00"
@.str.3 = [27 x i8] c"row_xy2d(16, 0, 31) != 255\00"
@.str.4 = [24 x i8] c"row_xy2d(16, 1, 0) != 0\00"
@.str.5 = [32 x i8] c"row_d2xy(16, 0, x, y) -> (0, 0)\00"
@.str.6 = [34 x i8] c"row_d2xy(16, 255, x, y) -> (0,15)\00"
@.str.7 = [34 x i8] c"row_d2xy(16, 256, x, y) -> (0,16)\00"
@.str.8 = [34 x i8] c"row_d2xy(16, 511, x, y) -> (0,31)\00"
@.str.9 = [32 x i8] c"row_d2xy(16, 3, x, y) -> (1, 0)\00"
define i8* @test_row_xy2d() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
%5 = call i32 @row_xy2d(i32 16, i32 0, i32 0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %1
br label %84
8: ; preds = %4
br label %9
9: ; preds = %8
br label %10
10: ; preds = %9
%11 = call i32 @row_xy2d(i32 16, i32 0, i32 15)
%12 = icmp eq i32 %11, 255
br i1 %12, label %14, label %13
13: ; preds = %10
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %84
14: ; preds = %10
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
%17 = call i32 @row_xy2d(i32 16, i32 0, i32 16)
%18 = icmp eq i32 %17, 256
br i1 %18, label %20, label %19
19: ; preds = %16
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %84
20: ; preds = %16
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
%23 = call i32 @row_xy2d(i32 16, i32 0, i32 31)
%24 = icmp eq i32 %23, 511
br i1 %24, label %26, label %25
25: ; preds = %22
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8** %1
br label %84
26: ; preds = %22
br label %27
27: ; preds = %26
br label %28
28: ; preds = %27
%29 = call i32 @row_xy2d(i32 16, i32 1, i32 0)
%30 = icmp eq i32 %29, 3
br i1 %30, label %32, label %31
31: ; preds = %28
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8** %1
br label %84
32: ; preds = %28
br label %33
33: ; preds = %32
%34 = call i32 @row_d2xy(i32 16, i32 0, i32* %2, i32* %3)
br label %35
35: ; preds = %33
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 0
br i1 %40, label %42, label %41
41: ; preds = %38, %35
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8** %1
br label %84
42: ; preds = %38
br label %43
43: ; preds = %42
%44 = call i32 @row_d2xy(i32 16, i32 255, i32* %2, i32* %3)
br label %45
45: ; preds = %43
%46 = load i32, i32* %2
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i32, i32* %3
%50 = icmp eq i32 %49, 15
br i1 %50, label %52, label %51
51: ; preds = %48, %45
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i8** %1
br label %84
52: ; preds = %48
br label %53
53: ; preds = %52
%54 = call i32 @row_d2xy(i32 16, i32 256, i32* %2, i32* %3)
br label %55
55: ; preds = %53
%56 = load i32, i32* %2
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* %3
%60 = icmp eq i32 %59, 16
br i1 %60, label %62, label %61
61: ; preds = %58, %55
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8** %1
br label %84
62: ; preds = %58
br label %63
63: ; preds = %62
%64 = call i32 @row_d2xy(i32 16, i32 511, i32* %2, i32* %3)
br label %65
65: ; preds = %63
%66 = load i32, i32* %2
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i32, i32* %3
%70 = icmp eq i32 %69, 31
br i1 %70, label %72, label %71
71: ; preds = %68, %65
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i8** %1
br label %84
72: ; preds = %68
br label %73
73: ; preds = %72
%74 = call i32 @row_d2xy(i32 16, i32 3, i32* %2, i32* %3)
br label %75
75: ; preds = %73
%76 = load i32, i32* %2
%77 = icmp eq i32 %76, 1
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = load i32, i32* %3
%80 = icmp eq i32 %79, 0
br i1 %80, label %82, label %81
81: ; preds = %78, %75
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8** %1
br label %84
82: ; preds = %78
br label %83
83: ; preds = %82
store i8* null, i8** %1
br label %84
84: ; preds = %83, %81, %71, %61, %51, %41, %31, %25, %19, %13, %7
%85 = load i8*, i8** %1
ret i8* %85
}

LLVM IR (-O2):
@.str = [24 x i8] c"row_xy2d(16, 0, 0) != 0\00"
@.str.1 = [27 x i8] c"row_xy2d(16, 0, 15) != 255\00"
@.str.2 = [27 x i8] c"row_xy2d(16, 0, 16) != 255\00"
@.str.3 = [27 x i8] c"row_xy2d(16, 0, 31) != 255\00"
@.str.4 = [24 x i8] c"row_xy2d(16, 1, 0) != 0\00"
@.str.5 = [32 x i8] c"row_d2xy(16, 0, x, y) -> (0, 0)\00"
@.str.6 = [34 x i8] c"row_d2xy(16, 255, x, y) -> (0,15)\00"
@.str.7 = [34 x i8] c"row_d2xy(16, 256, x, y) -> (0,16)\00"
@.str.8 = [34 x i8] c"row_d2xy(16, 511, x, y) -> (0,31)\00"
@.str.9 = [32 x i8] c"row_d2xy(16, 3, x, y) -> (1, 0)\00"
define i8* @test_row_xy2d() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @row_xy2d(i32 16, i32 0, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %57
5: ; preds = %0
%6 = tail call i32 @row_xy2d(i32 16, i32 0, i32 15)
%7 = icmp eq i32 %6, 255
br i1 %7, label %8, label %57
8: ; preds = %5
%9 = tail call i32 @row_xy2d(i32 16, i32 0, i32 16)
%10 = icmp eq i32 %9, 256
br i1 %10, label %11, label %57
11: ; preds = %8
%12 = tail call i32 @row_xy2d(i32 16, i32 0, i32 31)
%13 = icmp eq i32 %12, 511
br i1 %13, label %14, label %57
14: ; preds = %11
%15 = tail call i32 @row_xy2d(i32 16, i32 1, i32 0)
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %57
17: ; preds = %14
%18 = bitcast i32* %1 to i8*
%19 = bitcast i32* %2 to i8*
%20 = call i32 @row_d2xy(i32 16, i32 0, i32* %1, i32* %2)
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, 0
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 0
%25 = select i1 %22, i1 %24, i1 false
br i1 %25, label %26, label %55
26: ; preds = %17
%27 = call i32 @row_d2xy(i32 16, i32 255, i32* %1, i32* %2)
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, 0
%30 = load i32, i32* %2
%31 = icmp eq i32 %30, 15
%32 = select i1 %29, i1 %31, i1 false
br i1 %32, label %33, label %55
33: ; preds = %26
%34 = call i32 @row_d2xy(i32 16, i32 256, i32* %1, i32* %2)
%35 = load i32, i32* %1
%36 = icmp eq i32 %35, 0
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 16
%39 = select i1 %36, i1 %38, i1 false
br i1 %39, label %40, label %55
40: ; preds = %33
%41 = call i32 @row_d2xy(i32 16, i32 511, i32* %1, i32* %2)
%42 = load i32, i32* %1
%43 = icmp eq i32 %42, 0
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 31
%46 = select i1 %43, i1 %45, i1 false
br i1 %46, label %47, label %55
47: ; preds = %40
%48 = call i32 @row_d2xy(i32 16, i32 3, i32* %1, i32* %2)
%49 = load i32, i32* %1
%50 = icmp eq i32 %49, 1
%51 = load i32, i32* %2
%52 = icmp eq i32 %51, 0
%53 = select i1 %50, i1 %52, i1 false
%54 = select i1 %53, i8* null, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0)
br label %55
55: ; preds = %47, %40, %33, %26, %17
%56 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), %17 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), %26 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), %33 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), %40 ], [ %54, %47 ]
br label %57
57: ; preds = %14, %11, %8, %5, %0, %55
%58 = phi i8* [ %56, %55 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), %14 ]
ret i8* %58
}