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

/* Variables and functions */
struct format_field *pevent_find_any_field(struct event_format *, char *);
scalar_t__ pevent_get_field_val(struct trace_seq *, struct event_format *,
                                char *, struct pevent_record *,
                                unsigned long long *, int);
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char *, int);
int trace_seq_putc(struct trace_seq *, char);
int /*<<< orphan*/ trace_seq_puts(struct trace_seq *, char *);
int /*<<< orphan*/ write_and_save_comm(struct format_field *,
                                       struct pevent_record *,
                                       struct trace_seq *, unsigned long long);
int /*<<< orphan*/ write_state(struct trace_seq *, unsigned long long);
int sched_switch_handler(struct trace_seq *s, struct pevent_record *record,
                         struct event_format *event, void *context) {
  struct format_field *field;
  unsigned long long val;
  if (pevent_get_field_val(s, event, "prev_pid", record, &val, 1))
    return trace_seq_putc(s, '!');
  field = pevent_find_any_field(event, "prev_comm");
  if (field) {
    write_and_save_comm(field, record, s, val);
    trace_seq_putc(s, ':');
  }
  trace_seq_printf(s, "%lld ", val);
  if (pevent_get_field_val(s, event, "prev_prio", record, &val, 0) == 0)
    trace_seq_printf(s, "[%d] ", (int)val);
  if (pevent_get_field_val(s, event, "prev_state", record, &val, 0) == 0)
    write_state(s, val);
  trace_seq_puts(s, " ==> ");
  if (pevent_get_field_val(s, event, "next_pid", record, &val, 1))
    return trace_seq_putc(s, '!');
  field = pevent_find_any_field(event, "next_comm");
  if (field) {
    write_and_save_comm(field, record, s, val);
    trace_seq_putc(s, ':');
  }
  trace_seq_printf(s, "%lld", val);
  if (pevent_get_field_val(s, event, "next_prio", record, &val, 0) == 0)
    trace_seq_printf(s, " [%d]", (int)val);
  return 0;
}


x86 assembly (clang, -O0):
<sched_switch_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xe65(%rip),%rdx
lea    -0x38(%rbp),%r8
mov    $0x1,%r9d
call   1070 <pevent_get_field_val@plt>
cmp    $0x0,%rax
je     11ca <sched_switch_handler+0x5a>
mov    -0x10(%rbp),%rdi
mov    $0x21,%esi
call   1060 <trace_seq_putc@plt>
mov    %eax,-0x4(%rbp)
jmp    1387 <sched_switch_handler+0x217>
mov    -0x20(%rbp),%rdi
lea    0xe34(%rip),%rsi
call   1040 <pevent_find_any_field@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     120c <sched_switch_handler+0x9c>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x38(%rbp),%rcx
call   1090 <write_and_save_comm@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1060 <trace_seq_putc@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
lea    0xdf6(%rip),%rsi
call   1030 <trace_seq_printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xde4(%rip),%rdx
lea    -0x38(%rbp),%r8
xor    %r9d,%r9d
call   1070 <pevent_get_field_val@plt>
cmp    $0x0,%rax
jne    1261 <sched_switch_handler+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
lea    0xdc7(%rip),%rsi
call   1030 <trace_seq_printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xdb5(%rip),%rdx
lea    -0x38(%rbp),%r8
xor    %r9d,%r9d
call   1070 <pevent_get_field_val@plt>
cmp    $0x0,%rax
jne    1297 <sched_switch_handler+0x127>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1080 <write_state@plt>
mov    -0x10(%rbp),%rdi
lea    0xd92(%rip),%rsi
call   1050 <trace_seq_puts@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xd80(%rip),%rdx
lea    -0x38(%rbp),%r8
mov    $0x1,%r9d
call   1070 <pevent_get_field_val@plt>
cmp    $0x0,%rax
je     12e9 <sched_switch_handler+0x179>
mov    -0x10(%rbp),%rdi
mov    $0x21,%esi
call   1060 <trace_seq_putc@plt>
mov    %eax,-0x4(%rbp)
jmp    1387 <sched_switch_handler+0x217>
mov    -0x20(%rbp),%rdi
lea    0xd4f(%rip),%rsi
call   1040 <pevent_find_any_field@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     132b <sched_switch_handler+0x1bb>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x38(%rbp),%rcx
call   1090 <write_and_save_comm@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1060 <trace_seq_putc@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
lea    0xd11(%rip),%rsi
call   1030 <trace_seq_printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xcfe(%rip),%rdx
lea    -0x38(%rbp),%r8
xor    %r9d,%r9d
call   1070 <pevent_get_field_val@plt>
cmp    $0x0,%rax
jne    1380 <sched_switch_handler+0x210>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
lea    0xce1(%rip),%rsi
call   1030 <trace_seq_printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_switch_handler>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe79(%rip),%rdx
mov    %rsp,%r8
mov    %r15,%rsi
mov    %r14,%rcx
mov    $0x1,%r9d
call   1070 <pevent_get_field_val@plt>
test   %rax,%rax
jne    1279 <sched_switch_handler+0x109>
lea    0xe5e(%rip),%rsi
mov    %r15,%rdi
call   1040 <pevent_find_any_field@plt>
test   %rax,%rax
je     11d7 <sched_switch_handler+0x67>
mov    (%rsp),%rcx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <write_and_save_comm@plt>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1060 <trace_seq_putc@plt>
mov    (%rsp),%edx
lea    0xe32(%rip),%rsi
mov    %rbx,%rdi
call   1030 <trace_seq_printf@plt>
lea    0xe29(%rip),%rdx
mov    %rsp,%r8
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
xor    %r9d,%r9d
call   1070 <pevent_get_field_val@plt>
test   %rax,%rax
jne    121b <sched_switch_handler+0xab>
mov    (%rsp),%edx
lea    0xe10(%rip),%rsi
mov    %rbx,%rdi
call   1030 <trace_seq_printf@plt>
lea    0xe07(%rip),%rdx
mov    %rsp,%r8
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
xor    %r9d,%r9d
call   1070 <pevent_get_field_val@plt>
test   %rax,%rax
jne    1247 <sched_switch_handler+0xd7>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1080 <write_state@plt>
lea    0xde6(%rip),%rsi
mov    %rbx,%rdi
call   1050 <trace_seq_puts@plt>
lea    0xddd(%rip),%rdx
mov    %rsp,%r8
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
mov    $0x1,%r9d
call   1070 <pevent_get_field_val@plt>
test   %rax,%rax
je     1295 <sched_switch_handler+0x125>
mov    %rbx,%rdi
mov    $0x21,%esi
call   1060 <trace_seq_putc@plt>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xda7(%rip),%rsi
mov    %r15,%rdi
call   1040 <pevent_find_any_field@plt>
test   %rax,%rax
je     12c8 <sched_switch_handler+0x158>
mov    (%rsp),%rcx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1090 <write_and_save_comm@plt>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1060 <trace_seq_putc@plt>
mov    (%rsp),%edx
lea    0xd7b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <trace_seq_printf@plt>
lea    0xd71(%rip),%rdx
mov    %rsp,%r8
xor    %ebp,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
xor    %r9d,%r9d
call   1070 <pevent_get_field_val@plt>
test   %rax,%rax
jne    1288 <sched_switch_handler+0x118>
mov    (%rsp),%edx
lea    0xd56(%rip),%rsi
mov    %rbx,%rdi
call   1030 <trace_seq_printf@plt>
jmp    1288 <sched_switch_handler+0x118>

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
%struct.pevent_record = type { i32 }
%struct.event_format = type { i32 }
%struct.format_field = type { i32 }
@.str = [9 x i8] c"prev_pid\00"
@.str.1 = [10 x i8] c"prev_comm\00"
@.str.2 = [6 x i8] c"%lld \00"
@.str.3 = [10 x i8] c"prev_prio\00"
@.str.4 = [6 x i8] c"[%d] \00"
@.str.5 = [11 x i8] c"prev_state\00"
@.str.6 = [6 x i8] c" ==> \00"
@.str.7 = [9 x i8] c"next_pid\00"
@.str.8 = [10 x i8] c"next_comm\00"
@.str.9 = [5 x i8] c"%lld\00"
@.str.10 = [10 x i8] c"next_prio\00"
@.str.11 = [6 x i8] c" [%d]\00"
define i32 @sched_switch_handler(%struct.trace_seq* %0, %struct.pevent_record* %1, %struct.event_format* %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.trace_seq*
%7 = alloca %struct.pevent_record*
%8 = alloca %struct.event_format*
%9 = alloca i8*
%10 = alloca %struct.format_field*
%11 = alloca i64
store %struct.trace_seq* %0, %struct.trace_seq** %6
store %struct.pevent_record* %1, %struct.pevent_record** %7
store %struct.event_format* %2, %struct.event_format** %8
store i8* %3, i8** %9
%12 = load %struct.trace_seq*, %struct.trace_seq** %6
%13 = load %struct.event_format*, %struct.event_format** %8
%14 = load %struct.pevent_record*, %struct.pevent_record** %7
%15 = call i64 @pevent_get_field_val(%struct.trace_seq* %12, %struct.event_format* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.pevent_record* %14, i64* %11, i32 1)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %4
%18 = load %struct.trace_seq*, %struct.trace_seq** %6
%19 = call i32 @trace_seq_putc(%struct.trace_seq* %18, i8 signext 33)
store i32 %19, i32* %5
br label %98
20: ; preds = %4
%21 = load %struct.event_format*, %struct.event_format** %8
%22 = call %struct.format_field* @pevent_find_any_field(%struct.event_format* %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store %struct.format_field* %22, %struct.format_field** %10
%23 = load %struct.format_field*, %struct.format_field** %10
%24 = icmp ne %struct.format_field* %23, null
br i1 %24, label %25, label %33
25: ; preds = %20
%26 = load %struct.format_field*, %struct.format_field** %10
%27 = load %struct.pevent_record*, %struct.pevent_record** %7
%28 = load %struct.trace_seq*, %struct.trace_seq** %6
%29 = load i64, i64* %11
%30 = call i32 @write_and_save_comm(%struct.format_field* %26, %struct.pevent_record* %27, %struct.trace_seq* %28, i64 %29)
%31 = load %struct.trace_seq*, %struct.trace_seq** %6
%32 = call i32 @trace_seq_putc(%struct.trace_seq* %31, i8 signext 58)
br label %33
33: ; preds = %25, %20
%34 = load %struct.trace_seq*, %struct.trace_seq** %6
%35 = load i64, i64* %11
%36 = trunc i64 %35 to i32
%37 = call i32 @trace_seq_printf(%struct.trace_seq* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%38 = load %struct.trace_seq*, %struct.trace_seq** %6
%39 = load %struct.event_format*, %struct.event_format** %8
%40 = load %struct.pevent_record*, %struct.pevent_record** %7
%41 = call i64 @pevent_get_field_val(%struct.trace_seq* %38, %struct.event_format* %39, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %struct.pevent_record* %40, i64* %11, i32 0)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %48
43: ; preds = %33
%44 = load %struct.trace_seq*, %struct.trace_seq** %6
%45 = load i64, i64* %11
%46 = trunc i64 %45 to i32
%47 = call i32 @trace_seq_printf(%struct.trace_seq* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %43, %33
%49 = load %struct.trace_seq*, %struct.trace_seq** %6
%50 = load %struct.event_format*, %struct.event_format** %8
%51 = load %struct.pevent_record*, %struct.pevent_record** %7
%52 = call i64 @pevent_get_field_val(%struct.trace_seq* %49, %struct.event_format* %50, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %struct.pevent_record* %51, i64* %11, i32 0)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %48
%55 = load %struct.trace_seq*, %struct.trace_seq** %6
%56 = load i64, i64* %11
%57 = call i32 @write_state(%struct.trace_seq* %55, i64 %56)
br label %58
58: ; preds = %54, %48
%59 = load %struct.trace_seq*, %struct.trace_seq** %6
%60 = call i32 @trace_seq_puts(%struct.trace_seq* %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%61 = load %struct.trace_seq*, %struct.trace_seq** %6
%62 = load %struct.event_format*, %struct.event_format** %8
%63 = load %struct.pevent_record*, %struct.pevent_record** %7
%64 = call i64 @pevent_get_field_val(%struct.trace_seq* %61, %struct.event_format* %62, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), %struct.pevent_record* %63, i64* %11, i32 1)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %58
%67 = load %struct.trace_seq*, %struct.trace_seq** %6
%68 = call i32 @trace_seq_putc(%struct.trace_seq* %67, i8 signext 33)
store i32 %68, i32* %5
br label %98
69: ; preds = %58
%70 = load %struct.event_format*, %struct.event_format** %8
%71 = call %struct.format_field* @pevent_find_any_field(%struct.event_format* %70, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
store %struct.format_field* %71, %struct.format_field** %10
%72 = load %struct.format_field*, %struct.format_field** %10
%73 = icmp ne %struct.format_field* %72, null
br i1 %73, label %74, label %82
74: ; preds = %69
%75 = load %struct.format_field*, %struct.format_field** %10
%76 = load %struct.pevent_record*, %struct.pevent_record** %7
%77 = load %struct.trace_seq*, %struct.trace_seq** %6
%78 = load i64, i64* %11
%79 = call i32 @write_and_save_comm(%struct.format_field* %75, %struct.pevent_record* %76, %struct.trace_seq* %77, i64 %78)
%80 = load %struct.trace_seq*, %struct.trace_seq** %6
%81 = call i32 @trace_seq_putc(%struct.trace_seq* %80, i8 signext 58)
br label %82
82: ; preds = %74, %69
%83 = load %struct.trace_seq*, %struct.trace_seq** %6
%84 = load i64, i64* %11
%85 = trunc i64 %84 to i32
%86 = call i32 @trace_seq_printf(%struct.trace_seq* %83, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %85)
%87 = load %struct.trace_seq*, %struct.trace_seq** %6
%88 = load %struct.event_format*, %struct.event_format** %8
%89 = load %struct.pevent_record*, %struct.pevent_record** %7
%90 = call i64 @pevent_get_field_val(%struct.trace_seq* %87, %struct.event_format* %88, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), %struct.pevent_record* %89, i64* %11, i32 0)
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %97
92: ; preds = %82
%93 = load %struct.trace_seq*, %struct.trace_seq** %6
%94 = load i64, i64* %11
%95 = trunc i64 %94 to i32
%96 = call i32 @trace_seq_printf(%struct.trace_seq* %93, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %95)
br label %97
97: ; preds = %92, %82
store i32 0, i32* %5
br label %98
98: ; preds = %97, %66, %17
%99 = load i32, i32* %5
ret i32 %99
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
%struct.pevent_record = type { i32 }
%struct.event_format = type { i32 }
%struct.format_field = type { i32 }
@.str = [9 x i8] c"prev_pid\00"
@.str.1 = [10 x i8] c"prev_comm\00"
@.str.2 = [6 x i8] c"%lld \00"
@.str.3 = [10 x i8] c"prev_prio\00"
@.str.4 = [6 x i8] c"[%d] \00"
@.str.5 = [11 x i8] c"prev_state\00"
@.str.6 = [6 x i8] c" ==> \00"
@.str.7 = [9 x i8] c"next_pid\00"
@.str.8 = [10 x i8] c"next_comm\00"
@.str.9 = [5 x i8] c"%lld\00"
@.str.10 = [10 x i8] c"next_prio\00"
@.str.11 = [6 x i8] c" [%d]\00"
define i32 @sched_switch_handler(%struct.trace_seq* %0, %struct.pevent_record* %1, %struct.event_format* %2, i8* nocapture readnone %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = call i64 @pevent_get_field_val(%struct.trace_seq* %0, %struct.event_format* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.pevent_record* %1, i64* %5, i32 1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call i32 @trace_seq_putc(%struct.trace_seq* %0, i8 signext 33)
br label %57
11: ; preds = %4
%12 = call %struct.format_field* @pevent_find_any_field(%struct.event_format* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq %struct.format_field* %12, null
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i64, i64* %5
%16 = call i32 @write_and_save_comm(%struct.format_field* %12, %struct.pevent_record* %1, %struct.trace_seq* %0, i64 %15)
%17 = call i32 @trace_seq_putc(%struct.trace_seq* %0, i8 signext 58)
br label %18
18: ; preds = %14, %11
%19 = load i64, i64* %5
%20 = trunc i64 %19 to i32
%21 = call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = call i64 @pevent_get_field_val(%struct.trace_seq* %0, %struct.event_format* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %struct.pevent_record* %1, i64* %5, i32 0)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %18
%25 = load i64, i64* %5
%26 = trunc i64 %25 to i32
%27 = call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %24, %18
%29 = call i64 @pevent_get_field_val(%struct.trace_seq* %0, %struct.event_format* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %struct.pevent_record* %1, i64* %5, i32 0)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i64, i64* %5
%33 = call i32 @write_state(%struct.trace_seq* %0, i64 %32)
br label %34
34: ; preds = %31, %28
%35 = call i32 @trace_seq_puts(%struct.trace_seq* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%36 = call i64 @pevent_get_field_val(%struct.trace_seq* %0, %struct.event_format* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), %struct.pevent_record* %1, i64* %5, i32 1)
%37 = icmp eq i64 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %34
%39 = call i32 @trace_seq_putc(%struct.trace_seq* %0, i8 signext 33)
br label %57
40: ; preds = %34
%41 = call %struct.format_field* @pevent_find_any_field(%struct.event_format* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%42 = icmp eq %struct.format_field* %41, null
br i1 %42, label %47, label %43
43: ; preds = %40
%44 = load i64, i64* %5
%45 = call i32 @write_and_save_comm(%struct.format_field* %41, %struct.pevent_record* %1, %struct.trace_seq* %0, i64 %44)
%46 = call i32 @trace_seq_putc(%struct.trace_seq* %0, i8 signext 58)
br label %47
47: ; preds = %43, %40
%48 = load i64, i64* %5
%49 = trunc i64 %48 to i32
%50 = call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %49)
%51 = call i64 @pevent_get_field_val(%struct.trace_seq* %0, %struct.event_format* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), %struct.pevent_record* %1, i64* %5, i32 0)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %47
%54 = load i64, i64* %5
%55 = trunc i64 %54 to i32
%56 = call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %47, %53, %38, %9
%58 = phi i32 [ %10, %9 ], [ %39, %38 ], [ 0, %53 ], [ 0, %47 ]
ret i32 %58
}