#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(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int sctp_initLibrary();
int /*<<< orphan*/ stderr;
int SCTP_initLibrary(void) {
  int result;
  if ((result = sctp_initLibrary()) != 0) {
    if (result == -9) {
      fprintf(stderr, "sctp_initLibrary: called muliple times.\n");
    } else if (result == -8) {
      fprintf(stderr, "sctp_initLibrary: could not open raw socket for SCTP. "
                      "You must have root provileges !\n");
    } else if (result == 1) {
      fprintf(stderr,
              "sctp_initLibrary: Unknown error in Adaptation-Module !\n");
    } else {
      fprintf(stderr, "sctp_initLibrary: unknown value (%i) returned.\n",
              result);
    }
    fflush(stderr);
    exit(result);
  }
  return result;
}


x86 assembly (clang, -O0):
<SCTP_initLibrary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <sctp_initLibrary@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1207 <SCTP_initLibrary+0xc7>
cmpl   $0xfffffff7,-0x4(%rbp)
jne    1181 <SCTP_initLibrary+0x41>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11f1 <SCTP_initLibrary+0xb1>
cmpl   $0xfffffff8,-0x4(%rbp)
jne    11a7 <SCTP_initLibrary+0x67>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ec <SCTP_initLibrary+0xac>
cmpl   $0x1,-0x4(%rbp)
jne    11cd <SCTP_initLibrary+0x8d>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11e7 <SCTP_initLibrary+0xa7>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ec <SCTP_initLibrary+0xac>
jmp    11f1 <SCTP_initLibrary+0xb1>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCTP_initLibrary>:
push   %rbx
xor    %eax,%eax
call   1050 <sctp_initLibrary@plt>
test   %eax,%eax
jne    1150 <SCTP_initLibrary+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    %eax,%ebx
mov    0x2e87(%rip),%rax
cmp    $0x1,%ebx
je     1173 <SCTP_initLibrary+0x33>
cmp    $0xfffffff8,%ebx
je     117e <SCTP_initLibrary+0x3e>
cmp    $0xfffffff7,%ebx
jne    1190 <SCTP_initLibrary+0x50>
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
jmp    1187 <SCTP_initLibrary+0x47>
mov    (%rax),%edi
lea    0xf04(%rip),%rsi
jmp    1187 <SCTP_initLibrary+0x47>
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    11a2 <SCTP_initLibrary+0x62>
mov    (%rax),%edi
lea    0xf1f(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"sctp_initLibrary: called muliple times.\0A\00"
@.str.1 = [87 x i8] c"sctp_initLibrary: could not open raw socket for SCTP. You must have root provileges !\0A\00"
@.str.2 = [56 x i8] c"sctp_initLibrary: Unknown error in Adaptation-Module !\0A\00"
@.str.3 = [48 x i8] c"sctp_initLibrary: unknown value (%i) returned.\0A\00"
define i32 @SCTP_initLibrary() {
%1 = alloca i32
%2 = call i32 (...) @sctp_initLibrary()
store i32 %2, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %33
4: ; preds = %0
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -9
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 ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %28
10: ; preds = %4
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, -8
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.1, i64 0, i64 0))
br label %27
16: ; preds = %10
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %26
22: ; preds = %16
%23 = load i32, i32* @stderr
%24 = load i32, i32* %1
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %22, %19
br label %27
27: ; preds = %26, %13
br label %28
28: ; preds = %27, %7
%29 = load i32, i32* @stderr
%30 = call i32 @fflush(i32 %29)
%31 = load i32, i32* %1
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %0
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"sctp_initLibrary: called muliple times.\0A\00"
@.str.1 = [87 x i8] c"sctp_initLibrary: could not open raw socket for SCTP. You must have root provileges !\0A\00"
@.str.2 = [56 x i8] c"sctp_initLibrary: Unknown error in Adaptation-Module !\0A\00"
@.str.3 = [48 x i8] c"sctp_initLibrary: unknown value (%i) returned.\0A\00"
define i32 @SCTP_initLibrary() {
%1 = tail call i32 (...) @sctp_initLibrary()
switch i32 %1, label %11 [
i32 0, label %18
i32 -9, label %2
i32 -8, label %5
i32 1, label %8
]
2: ; preds = %0
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %14
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.1, i64 0, i64 0))
br label %14
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %14
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %1)
br label %14
14: ; preds = %5, %11, %8, %2
%15 = load i32, i32* @stderr
%16 = tail call i32 @fflush(i32 %15)
%17 = tail call i32 @exit(i32 %1)
unreachable
18: ; preds = %0
ret i32 0
}