#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 square_from_64(int);
int square_make(int file, int rank) {
  int sq_64;
  {
    if (!(file >= 0 && file < 8))
      my_fatal("file \"%s\", line %d, assertion \""
               "file>=0&&file<8"
               "\" 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",
               59);
  };
  {
    if (!(rank >= 0 && rank < 8))
      my_fatal("file \"%s\", line %d, assertion \""
               "rank>=0&&rank<8"
               "\" 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",
               60);
  };
  sq_64 = (rank << 3) | file;
  return square_from_64(sq_64);
}


x86 assembly (clang, -O0):
<square_make>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1142 <square_make+0x22>
cmpl   $0x8,-0x4(%rbp)
jl     115a <square_make+0x3a>
lea    0xeb7(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x3b,%edx
call   1040 <my_fatal@plt>
cmpl   $0x0,-0x8(%rbp)
jl     116e <square_make+0x4e>
cmpl   $0x8,-0x8(%rbp)
jl     1186 <square_make+0x66>
lea    0xf4a(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x3c,%edx
call   1040 <my_fatal@plt>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <square_from_64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_make>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    $0x8,%edi
jb     1144 <square_make+0x24>
lea    0xecd(%rip),%rdi
lea    0xefe(%rip),%rsi
mov    $0x3b,%edx
call   1040 <my_fatal@plt>
cmp    $0x8,%ebx
jb     1161 <square_make+0x41>
lea    0xf6f(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x3c,%edx
call   1040 <my_fatal@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <square_from_64@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"file \22%s\22, line %d, assertion \22file>=0&&file<8\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 = [56 x i8] c"file \22%s\22, line %d, assertion \22rank>=0&&rank<8\22 failed\0A\00"
define i32 @square_make(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 8
br i1 %10, label %13, label %11
11: ; preds = %8, %2
%12 = call i32 @my_fatal(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 59)
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 8
br i1 %18, label %21, label %19
19: ; preds = %16, %13
%20 = call i32 @my_fatal(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 60)
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %4
%23 = shl i32 %22, 3
%24 = load i32, i32* %3
%25 = or i32 %23, %24
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = call i32 @square_from_64(i32 %26)
ret i32 %27
}

LLVM IR (-O2):
@.str = [56 x i8] c"file \22%s\22, line %d, assertion \22file>=0&&file<8\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 = [56 x i8] c"file \22%s\22, line %d, assertion \22rank>=0&&rank<8\22 failed\0A\00"
define i32 @square_make(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 8
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @my_fatal(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 59)
br label %6
6: ; preds = %2, %4
%7 = icmp ult i32 %1, 8
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @my_fatal(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 60)
br label %10
10: ; preds = %6, %8
%11 = shl i32 %1, 3
%12 = or i32 %11, %0
%13 = tail call i32 @square_from_64(i32 %12)
ret i32 %13
}