#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 epoll_create(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ jlog(int, char *, int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int ion_new() {
  int epoll_fd;
  epoll_fd = epoll_create(512);
  if (epoll_fd < 0)
    jlog(0x01, "ion]> epoll_create() %s :: %s:%i", strerror(errno),
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/aboudreault/dnds-debian/refs/heads/master/"
         "libdnds/src/ion_epoll.c",
         69);
  return epoll_fd;
}


x86 assembly (clang, -O0):
<ion_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x200,%edi
call   1040 <epoll_create@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117d <ion_new+0x4d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe95(%rip),%rsi
lea    0xeaf(%rip),%rcx
mov    $0x45,%r8d
call   1030 <jlog@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ion_new>:
push   %rbx
mov    $0x200,%edi
call   1040 <epoll_create@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    116f <ion_new+0x3f>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaa(%rip),%rsi
lea    0xec4(%rip),%rcx
mov    $0x1,%edi
mov    %eax,%edx
mov    $0x45,%r8d
call   1030 <jlog@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"ion]> epoll_create() %s :: %s:%i\00"
@errno = global i32 0
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/aboudreault/dnds-debian/refs/heads/master/libdnds/src/ion_epoll.c\00"
define i32 @ion_new() {
%1 = alloca i32
%2 = call i32 @epoll_create(i32 512)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @errno
%7 = call i32 @strerror(i32 %6)
%8 = call i32 @jlog(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 69)
br label %9
9: ; preds = %5, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [33 x i8] c"ion]> epoll_create() %s :: %s:%i\00"
@errno = global i32 0
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/aboudreault/dnds-debian/refs/heads/master/libdnds/src/ion_epoll.c\00"
define i32 @ion_new() {
%1 = tail call i32 @epoll_create(i32 512)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @jlog(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 69)
br label %7
7: ; preds = %3, %0
ret i32 %1
}