#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*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void syserror_hander(char *func_name, char *msg) {
  if (msg != NULL) {
    fprintf(stderr, "%s[%d]: %s %s failed: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/codeplayer2org/linecount/refs/heads/"
            "master/lc.c",
            33, func_name, msg, strerror(errno));
    exit(EXIT_FAILURE);
  } else {
    fprintf(stderr, "%s[%d]: %s failed: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/codeplayer2org/linecount/refs/heads/"
            "master/lc.c",
            36, func_name, strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<syserror_hander>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11ac <syserror_hander+0x7c>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xe79(%rip),%rsi
lea    0xe8c(%rip),%rdx
mov    $0x21,%ecx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%r8
mov    %rax,%r9
lea    0xec5(%rip),%rsi
lea    0xe34(%rip),%rdx
mov    $0x24,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<syserror_hander>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
test   %rbx,%rbx
jne    1177 <syserror_hander+0x47>
lea    0xf43(%rip),%rsi
lea    0xeb2(%rip),%rdx
mov    %ebp,%edi
mov    $0x24,%ecx
mov    %r14,%r8
mov    %rax,%r9
jmp    1196 <syserror_hander+0x66>
mov    %rax,(%rsp)
lea    0xe7e(%rip),%rsi
lea    0xe91(%rip),%rdx
mov    %ebp,%edi
mov    $0x21,%ecx
mov    %r14,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"%s[%d]: %s %s failed: %s\0A\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/codeplayer2org/linecount/refs/heads/master/lc.c\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.2 = [23 x i8] c"%s[%d]: %s failed: %s\0A\00"
define void @syserror_hander(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 33, i8* %9, i8* %10, i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %3
%19 = load i32, i32* @errno
%20 = call i8* @strerror(i32 %19)
%21 = call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 36, i8* %18, i8* %20)
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"%s[%d]: %s %s failed: %s\0A\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/codeplayer2org/linecount/refs/heads/master/lc.c\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.2 = [23 x i8] c"%s[%d]: %s failed: %s\0A\00"
define void @syserror_hander(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
br i1 %3, label %11, label %7
7: ; preds = %2
%8 = tail call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 33, i8* %0, i8* %1, i8* %6)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = tail call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 36, i8* %0, i8* %6)
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
}