#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 /*<<< orphan*/ pevent_print_func_field(struct trace_seq *, char *,
                                           struct event_format *, char *,
                                           struct pevent_record *,
                                           int /*<<< orphan*/);
int pevent_print_num_field(struct trace_seq *, char *, struct event_format *,
                           char *, struct pevent_record *, int);
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char *);
int timer_start_handler(struct trace_seq *s, struct pevent_record *record,
                        struct event_format *event, void *context) {
  trace_seq_printf(s, "hrtimer=");
  if (pevent_print_num_field(s, "0x%llx", event, "timer", record, 0) == -1)
    pevent_print_num_field(s, "0x%llx", event, "hrtimer", record, 1);
  pevent_print_func_field(s, " function=%s", event, "function", record, 0);
  trace_seq_printf(s, " expires=");
  pevent_print_num_field(s, "%llu", event, "expires", record, 1);
  trace_seq_printf(s, " softexpires=");
  pevent_print_num_field(s, "%llu", event, "softexpires", record, 1);
  return 0;
}


x86 assembly (clang, -O0):
<timer_start_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
lea    0xead(%rip),%rsi
call   1040 <trace_seq_printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xe9e(%rip),%rsi
lea    0xea0(%rip),%rcx
xor    %r9d,%r9d
call   1050 <pevent_print_num_field@plt>
cmp    $0xffffffff,%eax
jne    11a8 <timer_start_handler+0x78>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xe73(%rip),%rsi
lea    0xe73(%rip),%rcx
mov    $0x1,%r9d
call   1050 <pevent_print_num_field@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xe5d(%rip),%rsi
lea    0xe63(%rip),%rcx
xor    %r9d,%r9d
call   1030 <pevent_print_func_field@plt>
mov    -0x8(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1040 <trace_seq_printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xe4b(%rip),%rsi
lea    0xe5b(%rip),%rcx
mov    $0x1,%r9d
call   1050 <pevent_print_num_field@plt>
mov    -0x8(%rbp),%rdi
lea    0xe33(%rip),%rsi
call   1040 <trace_seq_printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xe16(%rip),%rsi
lea    0xe22(%rip),%rcx
mov    $0x1,%r9d
call   1050 <pevent_print_num_field@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_start_handler>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb8(%rip),%rsi
call   1040 <trace_seq_printf@plt>
lea    0xeb5(%rip),%rsi
lea    0xeb7(%rip),%rcx
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%r8
xor    %r9d,%r9d
call   1050 <pevent_print_num_field@plt>
cmp    $0xffffffff,%eax
jne    1193 <timer_start_handler+0x63>
lea    0xe91(%rip),%rsi
lea    0xe91(%rip),%rcx
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%r8
mov    $0x1,%r9d
call   1050 <pevent_print_num_field@plt>
lea    0xe7e(%rip),%rsi
lea    0xe84(%rip),%rcx
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%r8
xor    %r9d,%r9d
call   1030 <pevent_print_func_field@plt>
lea    0xe75(%rip),%rsi
mov    %rbx,%rdi
call   1040 <trace_seq_printf@plt>
lea    0xe70(%rip),%r12
lea    0xe80(%rip),%rcx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%r8
mov    $0x1,%r9d
call   1050 <pevent_print_num_field@plt>
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1040 <trace_seq_printf@plt>
lea    0xe4f(%rip),%rcx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%r8
mov    $0x1,%r9d
call   1050 <pevent_print_num_field@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
%struct.pevent_record = type { i32 }
%struct.event_format = type { i32 }
@.str = [9 x i8] c"hrtimer=\00"
@.str.1 = [7 x i8] c"0x%llx\00"
@.str.2 = [6 x i8] c"timer\00"
@.str.3 = [8 x i8] c"hrtimer\00"
@.str.4 = [13 x i8] c" function=%s\00"
@.str.5 = [9 x i8] c"function\00"
@.str.6 = [10 x i8] c" expires=\00"
@.str.7 = [5 x i8] c"%llu\00"
@.str.8 = [8 x i8] c"expires\00"
@.str.9 = [14 x i8] c" softexpires=\00"
@.str.10 = [12 x i8] c"softexpires\00"
define i32 @timer_start_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 = call i32 @trace_seq_printf(%struct.trace_seq* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.trace_seq*, %struct.trace_seq** %5
%12 = load %struct.event_format*, %struct.event_format** %7
%13 = load %struct.pevent_record*, %struct.pevent_record** %6
%14 = call i32 @pevent_print_num_field(%struct.trace_seq* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.event_format* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %struct.pevent_record* %13, i32 0)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load %struct.trace_seq*, %struct.trace_seq** %5
%18 = load %struct.event_format*, %struct.event_format** %7
%19 = load %struct.pevent_record*, %struct.pevent_record** %6
%20 = call i32 @pevent_print_num_field(%struct.trace_seq* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.event_format* %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %struct.pevent_record* %19, i32 1)
br label %21
21: ; preds = %16, %4
%22 = load %struct.trace_seq*, %struct.trace_seq** %5
%23 = load %struct.event_format*, %struct.event_format** %7
%24 = load %struct.pevent_record*, %struct.pevent_record** %6
%25 = call i32 @pevent_print_func_field(%struct.trace_seq* %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), %struct.event_format* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %struct.pevent_record* %24, i32 0)
%26 = load %struct.trace_seq*, %struct.trace_seq** %5
%27 = call i32 @trace_seq_printf(%struct.trace_seq* %26, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%28 = load %struct.trace_seq*, %struct.trace_seq** %5
%29 = load %struct.event_format*, %struct.event_format** %7
%30 = load %struct.pevent_record*, %struct.pevent_record** %6
%31 = call i32 @pevent_print_num_field(%struct.trace_seq* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %struct.event_format* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), %struct.pevent_record* %30, i32 1)
%32 = load %struct.trace_seq*, %struct.trace_seq** %5
%33 = call i32 @trace_seq_printf(%struct.trace_seq* %32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%34 = load %struct.trace_seq*, %struct.trace_seq** %5
%35 = load %struct.event_format*, %struct.event_format** %7
%36 = load %struct.pevent_record*, %struct.pevent_record** %6
%37 = call i32 @pevent_print_num_field(%struct.trace_seq* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %struct.event_format* %35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), %struct.pevent_record* %36, i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
%struct.pevent_record = type { i32 }
%struct.event_format = type { i32 }
@.str = [9 x i8] c"hrtimer=\00"
@.str.1 = [7 x i8] c"0x%llx\00"
@.str.2 = [6 x i8] c"timer\00"
@.str.3 = [8 x i8] c"hrtimer\00"
@.str.4 = [13 x i8] c" function=%s\00"
@.str.5 = [9 x i8] c"function\00"
@.str.6 = [10 x i8] c" expires=\00"
@.str.7 = [5 x i8] c"%llu\00"
@.str.8 = [8 x i8] c"expires\00"
@.str.9 = [14 x i8] c" softexpires=\00"
@.str.10 = [12 x i8] c"softexpires\00"
define i32 @timer_start_handler(%struct.trace_seq* %0, %struct.pevent_record* %1, %struct.event_format* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @pevent_print_num_field(%struct.trace_seq* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.event_format* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %struct.pevent_record* %1, i32 0)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @pevent_print_num_field(%struct.trace_seq* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.event_format* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %struct.pevent_record* %1, i32 1)
br label %10
10: ; preds = %8, %4
%11 = tail call i32 @pevent_print_func_field(%struct.trace_seq* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), %struct.event_format* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %struct.pevent_record* %1, i32 0)
%12 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @pevent_print_num_field(%struct.trace_seq* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %struct.event_format* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), %struct.pevent_record* %1, i32 1)
%14 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%15 = tail call i32 @pevent_print_num_field(%struct.trace_seq* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %struct.event_format* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), %struct.pevent_record* %1, i32 1)
ret i32 0
}