#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int sctp_eventLoop();
int /*<<< orphan*/ stderr;
int SCTP_eventLoop(void) {
  int result;
  if ((result = sctp_eventLoop()) < 0) {
    if (result == -1) {
      fprintf(stderr, "sctp_eventLoop: an error occured.\n");
    } else {
      fprintf(stderr, "sctp_eventLoop: unknown value (%i) returned.\n", result);
    }
    fflush(stderr);
  }
  return result;
}


x86 assembly (clang, -O0):
<SCTP_eventLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sctp_eventLoop@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1199 <SCTP_eventLoop+0x69>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1171 <SCTP_eventLoop+0x41>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    118b <SCTP_eventLoop+0x5b>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCTP_eventLoop>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <sctp_eventLoop@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1178 <SCTP_eventLoop+0x48>
mov    0x2e98(%rip),%r14
mov    (%r14),%edi
cmp    $0xffffffff,%ebx
je     1162 <SCTP_eventLoop+0x32>
lea    0xecc(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1170 <SCTP_eventLoop+0x40>
lea    0xe97(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"sctp_eventLoop: an error occured.\0A\00"
@.str.1 = [46 x i8] c"sctp_eventLoop: unknown value (%i) returned.\0A\00"
define i32 @SCTP_eventLoop() {
%1 = alloca i32
%2 = call i32 (...) @sctp_eventLoop()
store i32 %2, i32* %1
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %0
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %14
10: ; preds = %4
%11 = load i32, i32* @stderr
%12 = load i32, i32* %1
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* @stderr
%16 = call i32 @fflush(i32 %15)
br label %17
17: ; preds = %14, %0
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"sctp_eventLoop: an error occured.\0A\00"
@.str.1 = [46 x i8] c"sctp_eventLoop: unknown value (%i) returned.\0A\00"
define i32 @SCTP_eventLoop() {
%1 = tail call i32 (...) @sctp_eventLoop()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = icmp eq i32 %1, -1
%5 = load i32, i32* @stderr
br i1 %4, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %3
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* @stderr
%12 = tail call i32 @fflush(i32 %11)
br label %13
13: ; preds = %10, %0
ret i32 %1
}