#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 trace_seq {
  int dummy;
};
struct pevent_record {
  int dummy;
};
struct event_format {
  int dummy;
};

/* Variables and functions */
int kvm_nested_vmexit_inject_handler(struct trace_seq *, struct pevent_record *,
                                     struct event_format *, void *);
int /*<<< orphan*/ pevent_print_num_field(struct trace_seq *, char *,
                                          struct event_format *, char *,
                                          struct pevent_record *, int);
int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record,
                              struct event_format *event, void *context) {
  pevent_print_num_field(s, "rip %lx ", event, "rip", record, 1);
  return kvm_nested_vmexit_inject_handler(s, record, event, context);
}


x86 assembly (clang, -O0):
<kvm_nested_vmexit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xeb5(%rip),%rsi
lea    0xeb7(%rip),%rcx
mov    $0x1,%r9d
call   1030 <pevent_print_num_field@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <kvm_nested_vmexit_inject_handler@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_nested_vmexit_handler>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
lea    0xec7(%rip),%rcx
mov    %r12,%r8
mov    $0x1,%r9d
call   1030 <pevent_print_num_field@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <kvm_nested_vmexit_inject_handler@plt>

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
%struct.pevent_record = type { i32 }
%struct.event_format = type { i32 }
@.str = [9 x i8] c"rip %lx \00"
@.str.1 = [4 x i8] c"rip\00"
define i32 @kvm_nested_vmexit_handler(%struct.trace_seq* %0, %struct.pevent_record* %1, %struct.event_format* %2, i8* %3) {
%5 = alloca %struct.trace_seq*
%6 = alloca %struct.pevent_record*
%7 = alloca %struct.event_format*
%8 = alloca i8*
store %struct.trace_seq* %0, %struct.trace_seq** %5
store %struct.pevent_record* %1, %struct.pevent_record** %6
store %struct.event_format* %2, %struct.event_format** %7
store i8* %3, i8** %8
%9 = load %struct.trace_seq*, %struct.trace_seq** %5
%10 = load %struct.event_format*, %struct.event_format** %7
%11 = load %struct.pevent_record*, %struct.pevent_record** %6
%12 = call i32 @pevent_print_num_field(%struct.trace_seq* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.event_format* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %struct.pevent_record* %11, i32 1)
%13 = load %struct.trace_seq*, %struct.trace_seq** %5
%14 = load %struct.pevent_record*, %struct.pevent_record** %6
%15 = load %struct.event_format*, %struct.event_format** %7
%16 = load i8*, i8** %8
%17 = call i32 @kvm_nested_vmexit_inject_handler(%struct.trace_seq* %13, %struct.pevent_record* %14, %struct.event_format* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
%struct.pevent_record = type { i32 }
%struct.event_format = type { i32 }
@.str = [9 x i8] c"rip %lx \00"
@.str.1 = [4 x i8] c"rip\00"
define i32 @kvm_nested_vmexit_handler(%struct.trace_seq* %0, %struct.pevent_record* %1, %struct.event_format* %2, i8* %3) {
%5 = tail call i32 @pevent_print_num_field(%struct.trace_seq* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.event_format* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %struct.pevent_record* %1, i32 1)
%6 = tail call i32 @kvm_nested_vmexit_inject_handler(%struct.trace_seq* %0, %struct.pevent_record* %1, %struct.event_format* %2, i8* %3)
ret i32 %6
}