#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*/ IsEpSquare(short, short, unsigned short);
unsigned short MakeEpSquare(short x, short y, unsigned short epstatus) {
  if (y == 6 && !(IsEpSquare(x, y, epstatus)))
    return epstatus + (1 << (x + 6));
  else if (y == 5 && !(IsEpSquare(x, y, epstatus)))
    return epstatus + (1 << (x - 2));
  else
    return epstatus;
}


x86 assembly (clang, -O0):
<MakeEpSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0x6,%eax
jne    1179 <MakeEpSquare+0x69>
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movzwl -0x8(%rbp),%edx
call   1030 <IsEpSquare@plt>
cmp    $0x0,%eax
jne    1179 <MakeEpSquare+0x69>
movzwl -0x8(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    $0x6,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
jmp    11cd <MakeEpSquare+0xbd>
movswl -0x6(%rbp),%eax
cmp    $0x5,%eax
jne    11c5 <MakeEpSquare+0xb5>
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movzwl -0x8(%rbp),%edx
call   1030 <IsEpSquare@plt>
cmp    $0x0,%eax
jne    11c5 <MakeEpSquare+0xb5>
movzwl -0x8(%rbp),%eax
movswl -0x4(%rbp),%ecx
sub    $0x2,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
jmp    11cd <MakeEpSquare+0xbd>
mov    -0x8(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeEpSquare>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
cmp    $0x5,%si
je     113d <MakeEpSquare+0x2d>
cmp    $0x6,%si
jne    1160 <MakeEpSquare+0x50>
movswl %bp,%edi
movzwl %bx,%edx
mov    $0x6,%esi
call   1030 <IsEpSquare@plt>
test   %eax,%eax
jne    1160 <MakeEpSquare+0x50>
add    $0x6,%bpl
jmp    1155 <MakeEpSquare+0x45>
movswl %bp,%edi
movzwl %bx,%edx
mov    $0x5,%esi
call   1030 <IsEpSquare@plt>
test   %eax,%eax
jne    1160 <MakeEpSquare+0x50>
add    $0xfe,%bpl
mov    $0x1,%eax
mov    %ebp,%ecx
shl    %cl,%eax
add    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @MakeEpSquare(i16 signext %0, i16 signext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
%8 = load i16, i16* %6
%9 = sext i16 %8 to i32
%10 = icmp eq i32 %9, 6
br i1 %10, label %11, label %26
11: ; preds = %3
%12 = load i16, i16* %5
%13 = load i16, i16* %6
%14 = load i16, i16* %7
%15 = call i32 @IsEpSquare(i16 signext %12, i16 signext %13, i16 zeroext %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %26, label %17
17: ; preds = %11
%18 = load i16, i16* %7
%19 = zext i16 %18 to i32
%20 = load i16, i16* %5
%21 = sext i16 %20 to i32
%22 = add nsw i32 %21, 6
%23 = shl i32 1, %22
%24 = add nsw i32 %19, %23
%25 = trunc i32 %24 to i16
store i16 %25, i16* %4
br label %47
26: ; preds = %11, %3
%27 = load i16, i16* %6
%28 = sext i16 %27 to i32
%29 = icmp eq i32 %28, 5
br i1 %29, label %30, label %45
30: ; preds = %26
%31 = load i16, i16* %5
%32 = load i16, i16* %6
%33 = load i16, i16* %7
%34 = call i32 @IsEpSquare(i16 signext %31, i16 signext %32, i16 zeroext %33)
%35 = icmp ne i32 %34, 0
br i1 %35, label %45, label %36
36: ; preds = %30
%37 = load i16, i16* %7
%38 = zext i16 %37 to i32
%39 = load i16, i16* %5
%40 = sext i16 %39 to i32
%41 = sub nsw i32 %40, 2
%42 = shl i32 1, %41
%43 = add nsw i32 %38, %42
%44 = trunc i32 %43 to i16
store i16 %44, i16* %4
br label %47
45: ; preds = %30, %26
%46 = load i16, i16* %7
store i16 %46, i16* %4
br label %47
47: ; preds = %45, %36, %17
%48 = load i16, i16* %4
ret i16 %48
}

LLVM IR (-O2):
define zeroext i16 @MakeEpSquare(i16 signext %0, i16 signext %1, i16 zeroext %2) {
switch i16 %1, label %22 [
i16 6, label %4
i16 5, label %13
]
4: ; preds = %3
%5 = tail call i32 @IsEpSquare(i16 signext %0, i16 signext 6, i16 zeroext %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = sext i16 %0 to i32
%9 = add nsw i32 %8, 6
%10 = shl nuw i32 1, %9
%11 = trunc i32 %10 to i16
%12 = add i16 %11, %2
br label %22
13: ; preds = %3
%14 = tail call i32 @IsEpSquare(i16 signext %0, i16 signext 5, i16 zeroext %2)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = sext i16 %0 to i32
%18 = add nsw i32 %17, -2
%19 = shl nuw i32 1, %18
%20 = trunc i32 %19 to i16
%21 = add i16 %20, %2
br label %22
22: ; preds = %4, %13, %3, %16, %7
%23 = phi i16 [ %21, %16 ], [ %12, %7 ], [ %2, %3 ], [ %2, %13 ], [ %2, %4 ]
ret i16 %23
}