#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__ errno;
int /*<<< orphan*/ exit(scalar_t__);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int listen(int, int);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
int Listen(int sockfd, int backlog) {
  if (listen(sockfd, backlog) == -1) {
    do {
      fprintf(stderr,
              "[SYSLOG] [%s][%d]"
              "ERROR: listen() failed!\n"
              "%s\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Windeal/Demo/refs/heads/master/"
              "Chatting/C/common/socketapi.c",
              59, (errno <= 0 ? "" : strerror(errno)));
    } while (0);
    ;
    exit(errno);
  }
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
jne    11d5 <Listen+0x95>
jmp    1167 <Listen+0x27>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e5e(%rip),%rax
cmpq   $0x0,(%rax)
jg     1194 <Listen+0x54>
lea    0xea1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11a7 <Listen+0x67>
mov    0x2e3d(%rip),%rax
mov    (%rax),%rdi
call   1060 <strerror@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%r8
lea    0xe4b(%rip),%rsi
lea    0xe71(%rip),%rdx
mov    $0x3b,%ecx
call   1030 <fprintf@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%rdi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %r14
push   %rbx
push   %rax
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
je     1156 <Listen+0x16>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e83(%rip),%rax
mov    (%rax),%ebx
mov    0x2e72(%rip),%r14
mov    (%r14),%rdi
test   %rdi,%rdi
jg     1177 <Listen+0x37>
lea    0xeb7(%rip),%r8
jmp    117f <Listen+0x3f>
call   1060 <strerror@plt>
mov    %rax,%r8
lea    0xe7a(%rip),%rsi
lea    0xea0(%rip),%rdx
mov    %ebx,%edi
mov    $0x3b,%ecx
call   1030 <fprintf@plt>
mov    (%r14),%rdi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"[SYSLOG] [%s][%d]ERROR: listen() failed!\0A%s\0A\00"
@.str.1 = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Windeal/Demo/refs/heads/master/Chatting/C/common/socketapi.c\00"
@errno = global i64 0
@.str.2 = [1 x i8] zeroinitializer
define i32 @Listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 @listen(i32 %6, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %25
10: ; preds = %2
br label %11
11: ; preds = %10
%12 = load i32, i32* @stderr
%13 = load i64, i64* @errno
%14 = icmp sle i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
br label %19
16: ; preds = %11
%17 = load i64, i64* @errno
%18 = call i8* @strerror(i64 %17)
br label %19
19: ; preds = %16, %15
%20 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %15 ], [ %18, %16 ]
%21 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str.1, i64 0, i64 0), i32 59, i8* %20)
br label %22
22: ; preds = %19
%23 = load i64, i64* @errno
%24 = call i32 @exit(i64 %23)
unreachable
25: ; preds = %2
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"[SYSLOG] [%s][%d]ERROR: listen() failed!\0A%s\0A\00"
@.str.1 = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Windeal/Demo/refs/heads/master/Chatting/C/common/socketapi.c\00"
@errno = global i64 0
@.str.2 = [1 x i8] zeroinitializer
define i32 @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %16
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i64, i64* @errno
%8 = icmp slt i64 %7, 1
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i8* @strerror(i64 %7)
br label %11
11: ; preds = %5, %9
%12 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %5 ]
%13 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str.1, i64 0, i64 0), i32 59, i8* %12)
%14 = load i64, i64* @errno
%15 = tail call i32 @exit(i64 %14)
unreachable
16: ; preds = %2
ret i32 undef
}