#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;
  scalar_t__ code;
  int /*<<< orphan*/ type;
};
struct i2c_client {
  int dummy;
};

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


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

x86 assembly (clang, -O2):
<do_sync>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x18,%edx
call   1030 <write@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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