#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 */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ _serverAddress;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void _bindHostAddress(int _serverSocket, struct sockaddr_in _serverAddress) {
  if (bind(_serverSocket, (struct sockaddr *)&_serverAddress,
           sizeof(_serverAddress)) < 0) {
    fprintf(stderr, "Error: Binding.\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<_bindHostAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %esi,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <bind@plt>
cmp    $0x0,%rax
jge    117c <_bindHostAddress+0x4c>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bindHostAddress>:
push   %rax
mov    %esi,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edx
call   1040 <bind@plt>
test   %rax,%rax
js     1148 <_bindHostAddress+0x18>
pop    %rax
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [17 x i8] c"Error: Binding.\0A\00"
@EXIT_FAILURE = global i32 0
define void @_bindHostAddress(i32 %0, i32 %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
store i32 %1, i32* %5
store i32 %0, i32* %4
%6 = load i32, i32* %4
%7 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%8 = call i64 @bind(i32 %6, %struct.sockaddr* %7, i32 4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [17 x i8] c"Error: Binding.\0A\00"
@EXIT_FAILURE = global i32 0
define void @_bindHostAddress(i32 %0, i32 %1) {
%3 = alloca %struct.sockaddr_in
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %1, i32* %4
%5 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%6 = call i64 @bind(i32 %0, %struct.sockaddr* %5, i32 4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}