#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_changeHeartBeat(unsigned int, short, int, unsigned int);
int /*<<< orphan*/ stderr;
int SCTP_changeHeartBeat(unsigned int associationID, short path_id,
                         int heartbeatON, unsigned int timeInterval) {
  int result;
  if ((result = sctp_changeHeartBeat(associationID, path_id, heartbeatON,
                                     timeInterval)) < 0) {
    fprintf(stderr, "sctp_changeHeartBeat: an error occured.\n");
    fflush(stderr);
  }
  return result;
}


x86 assembly (clang, -O0):
<SCTP_changeHeartBeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x6(%rbp),%ax
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movswl %ax,%esi
call   1050 <sctp_changeHeartBeat@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    118c <SCTP_changeHeartBeat+0x5c>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCTP_changeHeartBeat>:
push   %r14
push   %rbx
push   %rax
call   1050 <sctp_changeHeartBeat@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    115d <SCTP_changeHeartBeat+0x2d>
mov    0x2e9a(%rip),%r14
mov    (%r14),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
call   1040 <fflush@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"sctp_changeHeartBeat: an error occured.\0A\00"
define i32 @SCTP_changeHeartBeat(i32 %0, i16 signext %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i16
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i16 %1, i16* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i16, i16* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @sctp_changeHeartBeat(i32 %10, i16 signext %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 @fflush(i32 %19)
br label %21
21: ; preds = %16, %4
%22 = load i32, i32* %9
ret i32 %22
}

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