#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 */
scalar_t__ EAGAIN;
scalar_t__ ENOMEM;
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err_sys(char *msg) {
  fprintf(stderr, msg);
  if (errno == EAGAIN)
    fprintf(stderr, "\n Cannot create a task structure\n");
  if (errno == ENOMEM)
    fprintf(stderr, "\n Not enough memory\n");
  fflush(NULL);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%rax
mov    0x2e59(%rip),%rcx
cmp    (%rcx),%rax
jne    117d <err_sys+0x4d>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%rax
mov    0x2e52(%rip),%rcx
cmp    (%rcx),%rax
jne    11ac <err_sys+0x7c>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err_sys>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rsi
mov    0x2e9a(%rip),%r14
mov    (%r14),%edi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rbx
mov    (%rbx),%rax
mov    0x2e61(%rip),%rcx
cmp    (%rcx),%rax
jne    116e <err_sys+0x3e>
mov    (%r14),%edi
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%rax
mov    0x2e6b(%rip),%rcx
cmp    (%rcx),%rax
jne    1189 <err_sys+0x59>
mov    (%r14),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@errno = global i64 0
@EAGAIN = global i64 0
@.str = [34 x i8] c"\0A Cannot create a task structure\0A\00"
@ENOMEM = global i64 0
@.str.1 = [21 x i8] c"\0A Not enough memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = load i64, i64* @errno
%7 = load i64, i64* @EAGAIN
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
%13 = load i64, i64* @errno
%14 = load i64, i64* @ENOMEM
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %16, %12
%20 = call i32 @fflush(i32* null)
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@errno = global i64 0
@EAGAIN = global i64 0
@.str = [34 x i8] c"\0A Cannot create a task structure\0A\00"
@ENOMEM = global i64 0
@.str.1 = [21 x i8] c"\0A Not enough memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @err_sys(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = load i64, i64* @errno
%5 = load i64, i64* @EAGAIN
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = load i64, i64* @errno
br label %11
11: ; preds = %7, %1
%12 = phi i64 [ %10, %7 ], [ %4, %1 ]
%13 = load i64, i64* @ENOMEM
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %11
%19 = tail call i32 @fflush(i32* null)
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @exit(i32 %20)
unreachable
}