#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_to_64(int);
int move_make(int from, int to) {
  {
    if (!(square_is_ok(from)))
      my_fatal("file \"%s\", line %d, assertion \""
               "square_is_ok(from)"
               "\" failed\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/"
               "master/move.c",
               42);
  };
  {
    if (!(square_is_ok(to)))
      my_fatal("file \"%s\", line %d, assertion \""
               "square_is_ok(to)"
               "\" failed\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/"
               "master/move.c",
               43);
  };
  return (square_to_64(from) << 6) | square_to_64(to);
}


x86 assembly (clang, -O0):
<move_make>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <square_is_ok@plt>
cmp    $0x0,%eax
jne    1167 <move_make+0x37>
lea    0xeaa(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x2a,%edx
call   1040 <my_fatal@plt>
mov    -0x8(%rbp),%edi
call   1050 <square_is_ok@plt>
cmp    $0x0,%eax
jne    1190 <move_make+0x60>
lea    0xf41(%rip),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x2b,%edx
call   1040 <my_fatal@plt>
mov    -0x4(%rbp),%edi
call   1030 <square_to_64@plt>
shl    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <square_to_64@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_make>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <square_is_ok@plt>
test   %eax,%eax
jne    1158 <move_make+0x28>
lea    0xeb9(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x2a,%edx
call   1040 <my_fatal@plt>
mov    %ebx,%edi
call   1050 <square_is_ok@plt>
test   %eax,%eax
jne    117b <move_make+0x4b>
lea    0xf56(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x2b,%edx
call   1040 <my_fatal@plt>
mov    %ebp,%edi
call   1030 <square_to_64@plt>
mov    %eax,%ebp
shl    $0x6,%ebp
mov    %ebx,%edi
call   1030 <square_to_64@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"file \22%s\22, line %d, assertion \22square_is_ok(from)\22 failed\0A\00"
@.str.1 = [133 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/move.c\00"
@.str.2 = [57 x i8] c"file \22%s\22, line %d, assertion \22square_is_ok(to)\22 failed\0A\00"
define i32 @move_make(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @square_is_ok(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @my_fatal(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i32 42)
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %4
%12 = call i32 @square_is_ok(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @my_fatal(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i32 43)
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %3
%18 = call i32 @square_to_64(i32 %17)
%19 = shl i32 %18, 6
%20 = load i32, i32* %4
%21 = call i32 @square_to_64(i32 %20)
%22 = or i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
@.str = [59 x i8] c"file \22%s\22, line %d, assertion \22square_is_ok(from)\22 failed\0A\00"
@.str.1 = [133 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/move.c\00"
@.str.2 = [57 x i8] c"file \22%s\22, line %d, assertion \22square_is_ok(to)\22 failed\0A\00"
define i32 @move_make(i32 %0, i32 %1) {
%3 = tail call i32 @square_is_ok(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @my_fatal(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i32 42)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @square_is_ok(i32 %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @my_fatal(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i32 43)
br label %12
12: ; preds = %10, %7
%13 = tail call i32 @square_to_64(i32 %0)
%14 = shl i32 %13, 6
%15 = tail call i32 @square_to_64(i32 %1)
%16 = or i32 %14, %15
ret i32 %16
}