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

/* Variables and functions */
int /*<<< orphan*/ EV_SYN;
int /*<<< orphan*/ SYN_REPORT;
int /*<<< orphan*/ memset(struct input_event *, int /*<<< orphan*/, int);
int /*<<< orphan*/ write(int, struct input_event *, int);
void uinput_syn(int fd) {
  struct input_event ev;
  memset(&ev, 0, sizeof(ev));
  ev.type = EV_SYN;
  ev.code = SYN_REPORT;
  ev.value = 0;
  write(fd, &ev, sizeof(ev));
}


x86 assembly (clang, -O0):
<uinput_syn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uinput_syn>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <write@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.input_event = type { i64, i32, i32 }
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define void @uinput_syn(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.input_event
store i32 %0, i32* %2
%4 = call i32 @memset(%struct.input_event* %3, i32 0, i32 16)
%5 = load i32, i32* @EV_SYN
%6 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 2
store i32 %5, i32* %6
%7 = load i32, i32* @SYN_REPORT
%8 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = call i32 @write(i32 %10, %struct.input_event* %3, i32 16)
ret void
}

LLVM IR (-O2):
%struct.input_event = type { i64, i32, i32 }
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define void @uinput_syn(i32 %0) {
%2 = alloca %struct.input_event
%3 = bitcast %struct.input_event* %2 to i8*
%4 = call i32 @memset(%struct.input_event* %2, i32 0, i32 16)
%5 = load i32, i32* @EV_SYN
%6 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 2
store i32 %5, i32* %6
%7 = load i32, i32* @SYN_REPORT
%8 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 0
store i64 0, i64* %9
%10 = call i32 @write(i32 %0, %struct.input_event* %2, i32 16)
ret void
}