void get_and_handle_event() {
  int type;
  if (!get_int_from_srv_noblock(&type)) {
    internal_logit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/"
                   "heads/lyrics/interface.c",
                   3466, __FUNCTION__, "Getting event would block.");
    return;
  }
  server_event(type, get_event_data(type));
}


x86 assembly (clang, -O0):
<get_and_handle_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x0,%al
call   1050 <get_int_from_srv_noblock@plt>
cmp    $0x0,%eax
jne    1182 <get_and_handle_event+0x42>
lea    0xe9d(%rip),%rdi
mov    $0xd8a,%esi
lea    0xf1c(%rip),%rdx
lea    0xf2a(%rip),%rcx
mov    $0x0,%al
call   1060 <internal_logit@plt>
jmp    119e <get_and_handle_event+0x5e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <get_event_data@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1030 <server_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_and_handle_event>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
xor    %eax,%eax
call   1050 <get_int_from_srv_noblock@plt>
test   %eax,%eax
je     116f <get_and_handle_event+0x2f>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <get_event_data@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <server_event@plt>
jmp    1190 <get_and_handle_event+0x50>
lea    0xe8a(%rip),%rdi
lea    0xf0e(%rip),%rdx
lea    0xf1c(%rip),%rcx
mov    $0xd8a,%esi
xor    %eax,%eax
call   1060 <internal_logit@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/interface.c\00"
@__FUNCTION__.get_and_handle_event = [21 x i8] c"get_and_handle_event\00"
@.str.1 = [27 x i8] c"Getting event would block.\00"
define void @get_and_handle_event() {
%1 = alloca i32
%2 = call i32 (i32*, ...) bitcast (i32 (...)* @get_int_from_srv_noblock to i32 (i32*, ...)*)(i32* %1)
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 3466, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.get_and_handle_event, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %11
6: ; preds = %0
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @get_event_data to i32 (i32, ...)*)(i32 %8)
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @server_event to i32 (i32, i32, ...)*)(i32 %7, i32 %9)
br label %11
11: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/interface.c\00"
@__FUNCTION__.get_and_handle_event = [21 x i8] c"get_and_handle_event\00"
@.str.1 = [27 x i8] c"Getting event would block.\00"
define void @get_and_handle_event() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i32*, ...) bitcast (i32 (...)* @get_int_from_srv_noblock to i32 (i32*, ...)*)(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 3466, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.get_and_handle_event, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %11
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @get_event_data to i32 (i32, ...)*)(i32 %8)
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @server_event to i32 (i32, i32, ...)*)(i32 %8, i32 %9)
br label %11
11: ; preds = %7, %5
ret void
}