#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  struct client *ptr;
};
struct epoll_event {
  TYPE_1__ data;
};
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cl_free(struct client *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ srv_onDisconnect(struct client *);
int /*<<< orphan*/ stderr;
void srv_handleError(const struct epoll_event *ev) {
  struct client *cl;
  fprintf(stderr, "Connection lost or epoll error.\n");
  cl = ev->data.ptr;
  srv_onDisconnect(cl);
  cl_free(cl);
}


x86 assembly (clang, -O0):
<srv_handleError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <srv_onDisconnect@plt>
mov    -0x10(%rbp),%rdi
call   1030 <cl_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srv_handleError>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%rbx
mov    %rbx,%rdi
call   1050 <srv_onDisconnect@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <cl_free@plt>

LLVM IR (-O0):
%struct.epoll_event = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { %struct.client* }
%struct.client = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Connection lost or epoll error.\0A\00"
define void @srv_handleError(%struct.epoll_event* %0) {
%2 = alloca %struct.epoll_event*
%3 = alloca %struct.client*
store %struct.epoll_event* %0, %struct.epoll_event** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.epoll_event*, %struct.epoll_event** %2
%7 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %6, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
%9 = load %struct.client*, %struct.client** %8
store %struct.client* %9, %struct.client** %3
%10 = load %struct.client*, %struct.client** %3
%11 = call i32 @srv_onDisconnect(%struct.client* %10)
%12 = load %struct.client*, %struct.client** %3
%13 = call i32 @cl_free(%struct.client* %12)
ret void
}

LLVM IR (-O2):
%struct.epoll_event = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { %struct.client* }
%struct.client = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Connection lost or epoll error.\0A\00"
define void @srv_handleError(%struct.epoll_event* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %0, i64 0, i32 0, i32 0
%5 = load %struct.client*, %struct.client** %4
%6 = tail call i32 @srv_onDisconnect(%struct.client* %5)
%7 = tail call i32 @cl_free(%struct.client* %5)
ret void
}