#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*/ my_fatal(char *, char *, int);
int /*<<< orphan*/ square_is_ok(int);
int square_rank(int);
int square_ep_dual(int square) {
  {
    if (!(square_is_ok(square)))
      my_fatal("file \"%s\", line %d, assertion \""
               "square_is_ok(square)"
               "\" failed\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/"
               "master/square.c",
               145);
  };
  {
    if (!(square_rank(square) >= 2 && square_rank(square) <= 5))
      my_fatal("file \"%s\", line %d, assertion \""
               "square_rank(square)>=2&&square_rank(square)<=5"
               "\" failed\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/"
               "master/square.c",
               146);
  };
  return square ^ 16;
}


x86 assembly (clang, -O0):
<square_ep_dual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <square_is_ok@plt>
cmp    $0x0,%eax
jne    1164 <square_ep_dual+0x34>
lea    0xead(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x91,%edx
call   1040 <my_fatal@plt>
mov    -0x4(%rbp),%edi
call   1030 <square_rank@plt>
cmp    $0x2,%eax
jl     1186 <square_ep_dual+0x56>
mov    -0x4(%rbp),%edi
call   1030 <square_rank@plt>
cmp    $0x5,%eax
jle    119e <square_ep_dual+0x6e>
lea    0xf37(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x92,%edx
call   1040 <my_fatal@plt>
mov    -0x4(%rbp),%eax
xor    $0x10,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_ep_dual>:
push   %rbx
mov    %edi,%ebx
call   1050 <square_is_ok@plt>
test   %eax,%eax
jne    1154 <square_ep_dual+0x24>
lea    0xebd(%rip),%rdi
lea    0xef3(%rip),%rsi
mov    $0x91,%edx
call   1040 <my_fatal@plt>
mov    %ebx,%edi
call   1030 <square_rank@plt>
cmp    $0x2,%eax
jl     116c <square_ep_dual+0x3c>
mov    %ebx,%edi
call   1030 <square_rank@plt>
cmp    $0x6,%eax
jl     1184 <square_ep_dual+0x54>
lea    0xf51(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x92,%edx
call   1040 <my_fatal@plt>
xor    $0x10,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"file \22%s\22, line %d, assertion \22square_is_ok(square)\22 failed\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/square.c\00"
@.str.2 = [87 x i8] c"file \22%s\22, line %d, assertion \22square_rank(square)>=2&&square_rank(square)<=5\22 failed\0A\00"
define i32 @square_ep_dual(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @square_is_ok(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @my_fatal(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 145)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = call i32 @square_rank(i32 %9)
%11 = icmp sge i32 %10, 2
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %2
%14 = call i32 @square_rank(i32 %13)
%15 = icmp sle i32 %14, 5
br i1 %15, label %18, label %16
16: ; preds = %12, %8
%17 = call i32 @my_fatal(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 146)
br label %18
18: ; preds = %16, %12
%19 = load i32, i32* %2
%20 = xor i32 %19, 16
ret i32 %20
}

LLVM IR (-O2):
@.str = [61 x i8] c"file \22%s\22, line %d, assertion \22square_is_ok(square)\22 failed\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/square.c\00"
@.str.2 = [87 x i8] c"file \22%s\22, line %d, assertion \22square_rank(square)>=2&&square_rank(square)<=5\22 failed\0A\00"
define i32 @square_ep_dual(i32 %0) {
%2 = tail call i32 @square_is_ok(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @my_fatal(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 145)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @square_rank(i32 %0)
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i32 @square_rank(i32 %0)
%11 = icmp slt i32 %10, 6
br i1 %11, label %14, label %12
12: ; preds = %9, %6
%13 = tail call i32 @my_fatal(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 146)
br label %14
14: ; preds = %12, %9
%15 = xor i32 %0, 16
ret i32 %15
}