#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_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ *key_vector;
};
typedef TYPE_1__ XKeymapEvent;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void do_KeymapNotify(FILE *out_f, XEvent *eventp) {
  XKeymapEvent *e = (XKeymapEvent *)eventp;
  int i;
  fprintf(out_f, "    keys:  ");
  for (i = 0; i < 32; i++) {
    if (i == 16)
      fprintf(out_f, "\n           ");
    fprintf(out_f, "%-3u ", (unsigned int)e->key_vector[i]);
  }
  fprintf(out_f, "\n");
}


x86 assembly (clang, -O0):
<do_KeymapNotify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    1198 <do_KeymapNotify+0x88>
cmpl   $0x10,-0x1c(%rbp)
jne    1167 <do_KeymapNotify+0x57>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %eax,%edx
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1141 <do_KeymapNotify+0x31>
mov    -0x8(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_KeymapNotify>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r13
lea    0xeba(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fwrite@plt>
lea    0xead(%rip),%r15
lea    0xeb3(%rip),%r12
xor    %ebx,%ebx
jmp    118d <do_KeymapNotify+0x5d>
nopw   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
je     11aa <do_KeymapNotify+0x7a>
cmp    $0x10,%rbx
jne    1170 <do_KeymapNotify+0x40>
mov    $0xc,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r13,%rcx
call   1050 <fwrite@plt>
jmp    1170 <do_KeymapNotify+0x40>
mov    $0xa,%edi
mov    %r13,%rsi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64* }
@.str = [12 x i8] c" keys: \00"
@.str.1 = [13 x i8] c"\0A \00"
@.str.2 = [6 x i8] c"%-3u \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @do_KeymapNotify(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_2__*
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to %struct.TYPE_2__*
store %struct.TYPE_2__* %8, %struct.TYPE_2__** %5
%9 = load i32*, i32** %3
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %11
11: ; preds = %31, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 32
br i1 %13, label %14, label %34
14: ; preds = %11
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 16
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32*, i32** %3
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %17, %14
%21 = load i32*, i32** %3
%22 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%23 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %22, i32 0, i32 0
%24 = load i64*, i64** %23
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i64, i64* %24, i64 %26
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %20
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %11
34: ; preds = %11
%35 = load i32*, i32** %3
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" keys: \00"
@.str.1 = [13 x i8] c"\0A \00"
@.str.2 = [6 x i8] c"%-3u \00"
define void @do_KeymapNotify(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %0)
%4 = bitcast i32* %1 to i64**
br label %5
5: ; preds = %2, %10
%6 = phi i64 [ 0, %2 ], [ %16, %10 ]
%7 = icmp eq i64 %6, 16
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 12, i64 1, i32* %0)
br label %10
10: ; preds = %8, %5
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 %6
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = add nuw nsw i64 %6, 1
%17 = icmp eq i64 %16, 32
br i1 %17, label %18, label %5
18: ; preds = %10
%19 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}