#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 */
typedef int uint8_t;
struct input_event {
  scalar_t__ type;
  scalar_t__ code;
  scalar_t__ value;
};

/* Variables and functions */
scalar_t__ EV_SYN;
scalar_t__ SYN_REPORT;
uint8_t is_ev_syn(struct input_event *ev) {
  return ev->type == EV_SYN && ev->code == SYN_REPORT && ev->value == 0;
}


x86 assembly (clang, -O0):
<is_ev_syn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
xor    %eax,%eax
mov    0x2ed8(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
jne    1150 <is_ev_syn+0x50>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
xor    %eax,%eax
mov    0x2eab(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
jne    1150 <is_ev_syn+0x50>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x10(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ev_syn>:
mov    (%rdi),%rcx
mov    0x2ee6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
jne    112b <is_ev_syn+0x2b>
mov    0x8(%rdi),%rcx
mov    0x2ec4(%rip),%rdx
cmp    (%rdx),%rcx
jne    112b <is_ev_syn+0x2b>
xor    %eax,%eax
cmpq   $0x0,0x10(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.input_event = type { i64, i64, i64 }
@EV_SYN = global i64 0
@SYN_REPORT = global i64 0
define i32 @is_ev_syn(%struct.input_event* %0) {
%2 = alloca %struct.input_event*
store %struct.input_event* %0, %struct.input_event** %2
%3 = load %struct.input_event*, %struct.input_event** %2
%4 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @EV_SYN
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %19
8: ; preds = %1
%9 = load %struct.input_event*, %struct.input_event** %2
%10 = getelementptr inbounds %struct.input_event, %struct.input_event* %9, i32 0, i32 1
%11 = load i64, i64* %10
%12 = load i64, i64* @SYN_REPORT
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = load %struct.input_event*, %struct.input_event** %2
%16 = getelementptr inbounds %struct.input_event, %struct.input_event* %15, i32 0, i32 2
%17 = load i64, i64* %16
%18 = icmp eq i64 %17, 0
br label %19
19: ; preds = %14, %8, %1
%20 = phi i1 [ false, %8 ], [ false, %1 ], [ %18, %14 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.input_event = type { i64, i64, i64 }
@EV_SYN = global i64 0
@SYN_REPORT = global i64 0
define i32 @is_ev_syn(%struct.input_event* nocapture %0) {
%2 = getelementptr inbounds %struct.input_event, %struct.input_event* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @EV_SYN
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = getelementptr inbounds %struct.input_event, %struct.input_event* %0, i64 0, i32 1
%8 = load i64, i64* %7
%9 = load i64, i64* @SYN_REPORT
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = getelementptr inbounds %struct.input_event, %struct.input_event* %0, i64 0, i32 2
%13 = load i64, i64* %12
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %11, %6, %1
%17 = phi i32 [ 0, %6 ], [ 0, %1 ], [ %15, %11 ]
ret i32 %17
}