#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*/ fatal_error(char *, char *, int);
int get_sq_from_str(char const *);
int get_ep_sq_int(const char *sq_str) {
  int sq;
  if ((1) <= 1 && !(sq_str != NULL))
    fatal_error("%s:%u: Assertion '"
                "sq_str != NULL"
                "' failed.",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/cutechess/sloppy/refs/heads/"
                "master/src/notation.c",
                179);
  ;
  if (sq_str[0] == '-')
    return 0;
  sq = get_sq_from_str(sq_str);
  if (sq == -1)
    return -1;
  return sq;
}


x86 assembly (clang, -O0):
<get_ep_sq_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <get_ep_sq_int+0x2f>
lea    0xec2(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0xb3,%edx
call   1040 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    116b <get_ep_sq_int+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1193 <get_ep_sq_int+0x73>
mov    -0x10(%rbp),%rdi
call   1030 <get_sq_from_str@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    118d <get_ep_sq_int+0x6d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <get_ep_sq_int+0x73>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ep_sq_int>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1132 <get_ep_sq_int+0x12>
cmpb   $0x2d,(%rbx)
jne    114f <get_ep_sq_int+0x2f>
xor    %eax,%eax
pop    %rbx
ret
lea    0xec7(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0xb3,%edx
call   1040 <fatal_error@plt>
cmpb   $0x2d,(%rbx)
je     112e <get_ep_sq_int+0xe>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get_sq_from_str@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"%s:%u: Assertion 'sq_str != NULL' failed.\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cutechess/sloppy/refs/heads/master/src/notation.c\00"
define i32 @get_ep_sq_int(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @fatal_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 179)
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 0, i32* %2
br label %24
16: ; preds = %9
%17 = load i8*, i8** %3
%18 = call i32 @get_sq_from_str(i8* %17)
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 -1, i32* %2
br label %24
22: ; preds = %16
%23 = load i32, i32* %4
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %21, %15
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [42 x i8] c"%s:%u: Assertion 'sq_str != NULL' failed.\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cutechess/sloppy/refs/heads/master/src/notation.c\00"
define i32 @get_ep_sq_int(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @fatal_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 179)
br label %5
5: ; preds = %3, %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 45
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @get_sq_from_str(i8* %0)
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ 0, %5 ], [ %9, %8 ]
ret i32 %11
}