void rpc_accept_cb(struct netasync_socket *socket, void *clientdata, int err) {
  if (__builtin_expect((!(err == 0)), 0)) {
    Panic("ASSERT failed at %s:%s:%u\n"
          "PANIC: Expression '%s' not TRUE.\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/Methimpact/bitc/refs/heads/master/core/"
          "rpc.c",
          __func__, 47, "err == 0");
  };
  Log("RPC:"
      " %s:%u -- got a connection.\n",
      __FUNCTION__, 49);
  netasync_close(socket);
}


x86 assembly (clang, -O0):
<rpc_accept_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     1185 <rpc_accept_cb+0x55>
lea    0xe9c(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xf51(%rip),%rdx
mov    $0x2f,%ecx
lea    0xf53(%rip),%r8
mov    $0x0,%al
call   1040 <Panic@plt>
lea    0xf4e(%rip),%rdi
lea    0xf30(%rip),%rsi
mov    $0x31,%edx
mov    $0x0,%al
call   1050 <Log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <netasync_close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpc_accept_cb>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
jne    115d <rpc_accept_cb+0x2d>
lea    0xf9b(%rip),%rdi
lea    0xf7d(%rip),%rsi
mov    $0x31,%edx
xor    %eax,%eax
call   1050 <Log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <netasync_close@plt>
lea    0xe9c(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xf51(%rip),%rdx
lea    0xf58(%rip),%r8
mov    $0x2f,%ecx
xor    %eax,%eax
call   1040 <Panic@plt>
jmp    1138 <rpc_accept_cb+0x8>

LLVM IR (-O0):
%struct.netasync_socket = type opaque
@.str = [60 x i8] c"ASSERT failed at %s:%s:%u\0APANIC: Expression '%s' not TRUE.\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Methimpact/bitc/refs/heads/master/core/rpc.c\00"
@__func__.rpc_accept_cb = [14 x i8] c"rpc_accept_cb\00"
@.str.2 = [9 x i8] c"err == 0\00"
@.str.3 = [33 x i8] c"RPC: %s:%u -- got a connection.\0A\00"
define void @rpc_accept_cb(%struct.netasync_socket* %0, i8* %1, i32 %2) {
%4 = alloca %struct.netasync_socket*
%5 = alloca i8*
%6 = alloca i32
store %struct.netasync_socket* %0, %struct.netasync_socket** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = sext i32 %10 to i64
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 (i8*, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @Panic to i32 (i8*, i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.rpc_accept_cb, i64 0, i64 0), i32 47, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @Log to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.rpc_accept_cb, i64 0, i64 0), i32 49)
%17 = load %struct.netasync_socket*, %struct.netasync_socket** %4
%18 = call i32 (%struct.netasync_socket*, ...) bitcast (i32 (...)* @netasync_close to i32 (%struct.netasync_socket*, ...)*)(%struct.netasync_socket* %17)
ret void
}

LLVM IR (-O2):
%struct.netasync_socket = type opaque
@.str = [60 x i8] c"ASSERT failed at %s:%s:%u\0APANIC: Expression '%s' not TRUE.\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Methimpact/bitc/refs/heads/master/core/rpc.c\00"
@__func__.rpc_accept_cb = [14 x i8] c"rpc_accept_cb\00"
@.str.2 = [9 x i8] c"err == 0\00"
@.str.3 = [33 x i8] c"RPC: %s:%u -- got a connection.\0A\00"
define void @rpc_accept_cb(%struct.netasync_socket* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @Panic to i32 (i8*, i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.rpc_accept_cb, i64 0, i64 0), i32 47, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @Log to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.rpc_accept_cb, i64 0, i64 0), i32 49)
%9 = tail call i32 (%struct.netasync_socket*, ...) bitcast (i32 (...)* @netasync_close to i32 (%struct.netasync_socket*, ...)*)(%struct.netasync_socket* %0)
ret void
}