#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 */
typedef struct TYPE_8__ TYPE_3__;
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
struct TYPE_7__ {
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ display;
  int /*<<< orphan*/ send_event;
  int /*<<< orphan*/ serial;
};
struct TYPE_6__ {
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ display;
  int /*<<< orphan*/ send_event;
  int /*<<< orphan*/ serial;
};
struct TYPE_8__ {
  TYPE_2__ xfocus;
  TYPE_1__ xkeymap;
  int /*<<< orphan*/ type;
};
typedef TYPE_3__ XEvent;

/* Variables and functions */
int /*<<< orphan*/ KeymapNotify;
void fake_keymap_notify_event(XEvent *outEvent, XEvent *sourceEvent) {
  XEvent ev;
  ev.type = KeymapNotify;
  ev.xkeymap.serial = sourceEvent->xfocus.serial;
  ev.xkeymap.send_event = sourceEvent->xfocus.send_event;
  ev.xkeymap.display = sourceEvent->xfocus.display;
  ev.xkeymap.window = sourceEvent->xfocus.window;
  *outEvent = ev;
}


x86 assembly (clang, -O0):
<fake_keymap_notify_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fake_keymap_notify_event>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
movups (%rsi),%xmm0
movups %xmm0,0x10(%rdi)
mov    %eax,0x20(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_8__ = type { %struct.TYPE_7__, %struct.TYPE_6__, i32 }
%struct.TYPE_7__ = type { i32, i32, i32, i32 }
%struct.TYPE_6__ = type { i32, i32, i32, i32 }
@KeymapNotify = global i32 0
define void @fake_keymap_notify_event(%struct.TYPE_8__* %0, %struct.TYPE_8__* %1) {
%3 = alloca %struct.TYPE_8__*
%4 = alloca %struct.TYPE_8__*
%5 = alloca %struct.TYPE_8__
store %struct.TYPE_8__* %0, %struct.TYPE_8__** %3
store %struct.TYPE_8__* %1, %struct.TYPE_8__** %4
%6 = load i32, i32* @KeymapNotify
%7 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 2
store i32 %6, i32* %7
%8 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%9 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %9, i32 0, i32 3
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 1
%13 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %12, i32 0, i32 3
store i32 %11, i32* %13
%14 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%15 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %14, i32 0, i32 0
%16 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %15, i32 0, i32 2
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 1
%19 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %18, i32 0, i32 2
store i32 %17, i32* %19
%20 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%21 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %20, i32 0, i32 0
%22 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %21, i32 0, i32 1
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 1
%25 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %24, i32 0, i32 1
store i32 %23, i32* %25
%26 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%27 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %26, i32 0, i32 0
%28 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %27, i32 0, i32 0
%29 = load i32, i32* %28
%30 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %5, i32 0, i32 1
%31 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %30, i32 0, i32 0
store i32 %29, i32* %31
%32 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%33 = bitcast %struct.TYPE_8__* %32 to i8*
%34 = bitcast %struct.TYPE_8__* %5 to i8*
ret void
}

LLVM IR (-O2):
%struct.TYPE_8__ = type { %struct.TYPE_7__, %struct.TYPE_6__, i32 }
%struct.TYPE_7__ = type { i32, i32, i32, i32 }
%struct.TYPE_6__ = type { i32, i32, i32, i32 }
@KeymapNotify = global i32 0
define void @fake_keymap_notify_event(%struct.TYPE_8__* nocapture writeonly %0, %struct.TYPE_8__* nocapture %1) {
%3 = load i32, i32* @KeymapNotify
%4 = bitcast %struct.TYPE_8__* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 1, i32 0
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %7
%8 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 2
store i32 %3, i32* %8
ret void
}