#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 */

/* Variables and functions */
scalar_t__ snprintf(char *, size_t, char *, char *, char *, ...);
int trace_output_get_format(int flags, char *head_fmt, size_t head_size,
                            char *entry_fmt, size_t entry_size, char *foot_fmt,
                            size_t foot_size) {
  char *head_caption = " %s\n";
  char *head_timestamp = " Sec    Usec   ";
  char *head_timeofday = " Sec    Usec              ";
  char *head_comp_pre = " Comp            ";
  char *head_comp_app = " Comp            ";
  char *head_tid = "   PID";
  char *head_message = " Entry Data";
  char *head_filename = " Filename  ";
  char *head_line = " Line";
  char *entry_timestamp = "%1$08u.%2$09u";
  char *entry_timeofday = "%1$s.%2$06u";
  char *entry_comp_pre = "|%3$-16s";
  char *entry_comp_app = "|%3$-16s";
  char *entry_tid = "|%4$5u";
  char *entry_message = "|%5$s";
  char *entry_filename = "|%6$s";
  char *entry_line = "|%7$4u";
  char *delim = "--------------------------------------------------------------"
                "-----------------\n";
  char *foot = " %u traces read.\n";
  char *empty = "";
  if (flags & 2048) {
    entry_timeofday = "%1$s";
    entry_comp_pre = "|%2$-16s";
    entry_comp_app = "|%2$-16s";
    entry_tid = "|%3$5u";
    entry_message = "|%4$s";
    entry_filename = "|%5$s";
    entry_line = "|%6$4u";
  }
  if (!(flags & 2)) {
    entry_comp_pre = empty;
    head_comp_pre = empty;
  }
  if (!(flags & 4) || (flags & 2)) {
    entry_comp_app = empty;
    head_comp_app = empty;
  }
  if (!(flags & 32)) {
    entry_line = "|%6$4u";
    if (flags & 2048)
      entry_line = "|%5$4u";
    entry_filename = empty;
    head_filename = empty;
  }
  if (flags & 8) {
    entry_timestamp = empty;
    head_timestamp = empty;
  } else {
    entry_timeofday = empty;
    head_timeofday = empty;
  }
  if (entry_fmt) {
    if (snprintf(entry_fmt, entry_size, "%s%s%s%s%s%s%s%s\n", entry_timestamp,
                 entry_timeofday, entry_tid, entry_comp_pre, entry_line,
                 entry_message, entry_comp_app, entry_filename) < 0) {
      *entry_fmt = 0;
      return -1;
    }
  }
  if (head_fmt) {
    if (snprintf(head_fmt, head_size, "%sTRACEBUFFER:%s%s%s%s%s%s%s%s%s%s\n%s",
                 delim, head_caption, delim, head_timestamp, head_timeofday,
                 head_tid, head_comp_pre, head_line, head_message,
                 head_comp_app, head_filename, delim) < 0) {
      *head_fmt = 0;
      return -1;
    }
  }
  if (foot_fmt) {
    if (snprintf(foot_fmt, foot_size, "%s%s", delim, foot) < 0) {
      *foot_fmt = 0;
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<trace_output_get_format>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xeb4(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xeb9(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xec5(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x90(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x98(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0xa0(%rbp)
lea    0xeb2(%rip),%rax
mov    %rax,-0xa8(%rbp)
lea    0xeb2(%rip),%rax
mov    %rax,-0xb0(%rbp)
lea    0xeb0(%rip),%rax
mov    %rax,-0xb8(%rbp)
lea    0xea2(%rip),%rax
mov    %rax,-0xc0(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0xc8(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0xd0(%rbp)
lea    0xe8e(%rip),%rax
mov    %rax,-0xd8(%rbp)
lea    0xe86(%rip),%rax
mov    %rax,-0xe0(%rbp)
lea    0xe7f(%rip),%rax
mov    %rax,-0xe8(%rbp)
lea    0xec2(%rip),%rax
mov    %rax,-0xf0(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x30(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
je     12bb <trace_output_get_format+0x1ab>
lea    0xea7(%rip),%rax
mov    %rax,-0xb0(%rbp)
lea    0xe9e(%rip),%rax
mov    %rax,-0xb8(%rbp)
lea    0xe90(%rip),%rax
mov    %rax,-0xc0(%rbp)
lea    0xe8b(%rip),%rax
mov    %rax,-0xc8(%rbp)
lea    0xe84(%rip),%rax
mov    %rax,-0xd0(%rbp)
lea    0xdeb(%rip),%rax
mov    %rax,-0xd8(%rbp)
lea    0xe6e(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x30(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    12e3 <trace_output_get_format+0x1d3>
mov    -0xf8(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x30(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1301 <trace_output_get_format+0x1f1>
mov    -0x30(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     131a <trace_output_get_format+0x20a>
mov    -0xf8(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x30(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1372 <trace_output_get_format+0x262>
lea    0xdf2(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x30(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
je     1356 <trace_output_get_format+0x246>
lea    0xdda(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x30(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     139f <trace_output_get_format+0x28f>
mov    -0xf8(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0x68(%rbp)
jmp    13b8 <trace_output_get_format+0x2a8>
mov    -0xf8(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     144b <trace_output_get_format+0x33b>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0xa8(%rbp),%rcx
mov    -0xb0(%rbp),%r8
mov    -0xc8(%rbp),%r9
mov    -0xb8(%rbp),%r14
mov    -0xe0(%rbp),%rbx
mov    -0xd0(%rbp),%r11
mov    -0xc0(%rbp),%r10
mov    -0xd8(%rbp),%rax
lea    0xd26(%rip),%rdx
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1030 <snprintf@plt>
cmp    $0x0,%rax
jge    1446 <trace_output_get_format+0x336>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
movl   $0xffffffff,-0x2c(%rbp)
jmp    1565 <trace_output_get_format+0x455>
jmp    144b <trace_output_get_format+0x33b>
cmpq   $0x0,-0x38(%rbp)
je     150d <trace_output_get_format+0x3fd>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0xe8(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    -0xe8(%rbp),%r9
mov    -0x68(%rbp),%rax
mov    -0x70(%rbp),%r13
mov    -0x88(%rbp),%r12
mov    -0x78(%rbp),%r15
mov    -0xa0(%rbp),%r14
mov    -0x90(%rbp),%rbx
mov    -0x80(%rbp),%r11
mov    -0x98(%rbp),%r10
mov    -0xe8(%rbp),%rdx
mov    %rdx,-0x100(%rbp)
lea    0xc91(%rip),%rdx
mov    %rax,(%rsp)
mov    -0x100(%rbp),%rax
mov    %r13,0x8(%rsp)
mov    %r12,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r11,0x30(%rsp)
mov    %r10,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    $0x0,%al
call   1030 <snprintf@plt>
cmp    $0x0,%rax
jge    1508 <trace_output_get_format+0x3f8>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
movl   $0xffffffff,-0x2c(%rbp)
jmp    1565 <trace_output_get_format+0x455>
jmp    150d <trace_output_get_format+0x3fd>
cmpq   $0x0,-0x58(%rbp)
je     155e <trace_output_get_format+0x44e>
mov    -0x58(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    -0xe8(%rbp),%rcx
mov    -0xf0(%rbp),%r8
lea    0xc33(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
cmp    $0x0,%rax
jge    1559 <trace_output_get_format+0x449>
mov    -0x58(%rbp),%rax
movb   $0x0,(%rax)
movl   $0xffffffff,-0x2c(%rbp)
jmp    1565 <trace_output_get_format+0x455>
jmp    155e <trace_output_get_format+0x44e>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_output_get_format>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x30(%rsp)
mov    %rcx,%r13
mov    %rdx,0x28(%rsp)
mov    %rsi,0x20(%rsp)
test   $0x800,%edi
jne    1170 <trace_output_get_format+0x60>
lea    0xf5e(%rip),%rdx
lea    0xf51(%rip),%r11
lea    0xf44(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xf31(%rip),%r9
lea    0xf21(%rip),%r10
lea    0xf0e(%rip),%rax
lea    0xfb4(%rip),%rbx
jmp    11a6 <trace_output_get_format+0x96>
lea    0xfab(%rip),%rdx
lea    0xf13(%rip),%r11
lea    0xf97(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xf84(%rip),%r9
lea    0xf74(%rip),%r10
lea    0xf68(%rip),%rax
lea    0xf83(%rip),%rbx
test   $0x2,%dil
lea    0xf43(%rip),%rcx
lea    0xe78(%rip),%rbp
mov    %rbp,%r15
cmove  %rcx,%r15
mov    %r10,%r14
cmove  %rcx,%r14
mov    %edi,%esi
and    $0x6,%esi
cmp    $0x4,%esi
cmovne %rcx,%rbp
cmovne %rcx,%r10
test   $0x20,%dil
lea    0xe74(%rip),%r12
cmove  %rcx,%r12
cmove  %rcx,%r11
cmovne %rdx,%rbx
test   $0x8,%dil
jne    1219 <trace_output_get_format+0x109>
lea    0xe0b(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xeee(%rip),%rax
lea    0xe5a(%rip),%rcx
mov    %rax,0x8(%rsp)
test   %r13,%r13
jne    122f <trace_output_get_format+0x11f>
jmp    1262 <trace_output_get_format+0x152>
lea    0xdf5(%rip),%rdx
mov    %rdx,0x8(%rsp)
mov    %rcx,0x10(%rsp)
test   %r13,%r13
je     1262 <trace_output_get_format+0x152>
sub    $0x8,%rsp
lea    0xef6(%rip),%rdx
mov    %r13,%rdi
mov    %r8,%rsi
mov    %rax,%r8
xor    %eax,%eax
push   %r11
push   %r10
push   0x30(%rsp)
push   %rbx
push   %r14
call   1030 <snprintf@plt>
add    $0x30,%rsp
test   %rax,%rax
js     1300 <trace_output_get_format+0x1f0>
cmpq   $0x0,0x20(%rsp)
je     12cb <trace_output_get_format+0x1bb>
sub    $0x8,%rsp
lea    0xe2f(%rip),%rcx
lea    0xdcd(%rip),%rbx
lea    0xdde(%rip),%r10
lea    0xdb8(%rip),%r11
lea    0xeb1(%rip),%rdx
lea    0xd68(%rip),%r8
mov    0x28(%rsp),%r13
mov    %r13,%rdi
mov    0x30(%rsp),%rsi
mov    %rcx,%r9
xor    %eax,%eax
push   %rcx
push   %r12
push   %rbp
push   %rbx
push   %r10
push   %r15
push   %r11
push   0x48(%rsp)
push   0x58(%rsp)
call   1030 <snprintf@plt>
add    $0x50,%rsp
test   %rax,%rax
js     1300 <trace_output_get_format+0x1f0>
mov    0x30(%rsp),%r13
test   %r13,%r13
je     130c <trace_output_get_format+0x1fc>
mov    0x70(%rsp),%rsi
lea    0xe87(%rip),%rdx
lea    0xdbc(%rip),%rcx
lea    0xe06(%rip),%r8
xor    %ebp,%ebp
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <snprintf@plt>
test   %rax,%rax
jns    130e <trace_output_get_format+0x1fe>
movb   $0x0,0x0(%r13)
mov    $0xffffffff,%ebp
jmp    130e <trace_output_get_format+0x1fe>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" %s\0A\00"
@.str.1 = [16 x i8] c" Sec Usec \00"
@.str.2 = [27 x i8] c" Sec Usec \00"
@.str.3 = [18 x i8] c" Comp \00"
@.str.4 = [7 x i8] c" PID\00"
@.str.5 = [12 x i8] c" Entry Data\00"
@.str.6 = [12 x i8] c" Filename \00"
@.str.7 = [6 x i8] c" Line\00"
@.str.8 = [14 x i8] c"%1$08u.%2$09u\00"
@.str.9 = [12 x i8] c"%1$s.%2$06u\00"
@.str.10 = [9 x i8] c"|%3$-16s\00"
@.str.11 = [7 x i8] c"|%4$5u\00"
@.str.12 = [6 x i8] c"|%5$s\00"
@.str.13 = [6 x i8] c"|%6$s\00"
@.str.14 = [7 x i8] c"|%7$4u\00"
@.str.15 = [81 x i8] c"-------------------------------------------------------------------------------\0A\00"
@.str.16 = [18 x i8] c" %u traces read.\0A\00"
@.str.17 = [1 x i8] zeroinitializer
@.str.18 = [5 x i8] c"%1$s\00"
@.str.19 = [9 x i8] c"|%2$-16s\00"
@.str.20 = [7 x i8] c"|%3$5u\00"
@.str.21 = [6 x i8] c"|%4$s\00"
@.str.22 = [7 x i8] c"|%6$4u\00"
@.str.23 = [7 x i8] c"|%5$4u\00"
@.str.24 = [18 x i8] c"%s%s%s%s%s%s%s%s\0A\00"
@.str.25 = [38 x i8] c"%sTRACEBUFFER:%s%s%s%s%s%s%s%s%s%s\0A%s\00"
@.str.26 = [5 x i8] c"%s%s\00"
define i32 @trace_output_get_format(i32 %0, i8* %1, i64 %2, i8* %3, i64 %4, i8* %5, i64 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i8*
%28 = alloca i8*
%29 = alloca i8*
%30 = alloca i8*
%31 = alloca i8*
%32 = alloca i8*
%33 = alloca i8*
%34 = alloca i8*
%35 = alloca i8*
store i32 %0, i32* %9
store i8* %1, i8** %10
store i64 %2, i64* %11
store i8* %3, i8** %12
store i64 %4, i64* %13
store i8* %5, i8** %14
store i64 %6, i64* %15
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %16
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %17
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8** %18
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8** %19
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8** %20
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %21
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8** %22
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8** %23
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %24
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8** %25
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8** %26
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8** %27
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8** %28
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8** %29
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8** %30
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8** %31
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8** %32
store i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.15, i64 0, i64 0), i8** %33
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), i8** %34
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), i8** %35
%36 = load i32, i32* %9
%37 = and i32 %36, 2048
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8** %26
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), i8** %27
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), i8** %28
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i8** %29
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), i8** %30
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8** %31
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i8** %32
br label %40
40: ; preds = %39, %7
%41 = load i32, i32* %9
%42 = and i32 %41, 2
%43 = icmp ne i32 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %40
%45 = load i8*, i8** %35
store i8* %45, i8** %27
%46 = load i8*, i8** %35
store i8* %46, i8** %19
br label %47
47: ; preds = %44, %40
%48 = load i32, i32* %9
%49 = and i32 %48, 4
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load i32, i32* %9
%53 = and i32 %52, 2
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %51, %47
%56 = load i8*, i8** %35
store i8* %56, i8** %28
%57 = load i8*, i8** %35
store i8* %57, i8** %20
br label %58
58: ; preds = %55, %51
%59 = load i32, i32* %9
%60 = and i32 %59, 32
%61 = icmp ne i32 %60, 0
br i1 %61, label %70, label %62
62: ; preds = %58
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i8** %32
%63 = load i32, i32* %9
%64 = and i32 %63, 2048
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %62
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), i8** %32
br label %67
67: ; preds = %66, %62
%68 = load i8*, i8** %35
store i8* %68, i8** %31
%69 = load i8*, i8** %35
store i8* %69, i8** %23
br label %70
70: ; preds = %67, %58
%71 = load i32, i32* %9
%72 = and i32 %71, 8
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = load i8*, i8** %35
store i8* %75, i8** %25
%76 = load i8*, i8** %35
store i8* %76, i8** %17
br label %80
77: ; preds = %70
%78 = load i8*, i8** %35
store i8* %78, i8** %26
%79 = load i8*, i8** %35
store i8* %79, i8** %18
br label %80
80: ; preds = %77, %74
%81 = load i8*, i8** %12
%82 = icmp ne i8* %81, null
br i1 %82, label %83, label %99
83: ; preds = %80
%84 = load i8*, i8** %12
%85 = load i64, i64* %13
%86 = load i8*, i8** %25
%87 = load i8*, i8** %26
%88 = load i8*, i8** %29
%89 = load i8*, i8** %27
%90 = load i8*, i8** %32
%91 = load i8*, i8** %30
%92 = load i8*, i8** %28
%93 = load i8*, i8** %31
%94 = call i64 (i8*, i64, i8*, i8*, i8*, ...) @snprintf(i8* %84, i64 %85, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0), i8* %86, i8* %87, i8* %88, i8* %89, i8* %90, i8* %91, i8* %92, i8* %93)
%95 = icmp slt i64 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %83
%97 = load i8*, i8** %12
store i8 0, i8* %97
store i32 -1, i32* %8
br label %136
98: ; preds = %83
br label %99
99: ; preds = %98, %80
%100 = load i8*, i8** %10
%101 = icmp ne i8* %100, null
br i1 %101, label %102, label %122
102: ; preds = %99
%103 = load i8*, i8** %10
%104 = load i64, i64* %11
%105 = load i8*, i8** %33
%106 = load i8*, i8** %16
%107 = load i8*, i8** %33
%108 = load i8*, i8** %17
%109 = load i8*, i8** %18
%110 = load i8*, i8** %21
%111 = load i8*, i8** %19
%112 = load i8*, i8** %24
%113 = load i8*, i8** %22
%114 = load i8*, i8** %20
%115 = load i8*, i8** %23
%116 = load i8*, i8** %33
%117 = call i64 (i8*, i64, i8*, i8*, i8*, ...) @snprintf(i8* %103, i64 %104, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0), i8* %105, i8* %106, i8* %107, i8* %108, i8* %109, i8* %110, i8* %111, i8* %112, i8* %113, i8* %114, i8* %115, i8* %116)
%118 = icmp slt i64 %117, 0
br i1 %118, label %119, label %121
119: ; preds = %102
%120 = load i8*, i8** %10
store i8 0, i8* %120
store i32 -1, i32* %8
br label %136
121: ; preds = %102
br label %122
122: ; preds = %121, %99
%123 = load i8*, i8** %14
%124 = icmp ne i8* %123, null
br i1 %124, label %125, label %135
125: ; preds = %122
%126 = load i8*, i8** %14
%127 = load i64, i64* %15
%128 = load i8*, i8** %33
%129 = load i8*, i8** %34
%130 = call i64 (i8*, i64, i8*, i8*, i8*, ...) @snprintf(i8* %126, i64 %127, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0), i8* %128, i8* %129)
%131 = icmp slt i64 %130, 0
br i1 %131, label %132, label %134
132: ; preds = %125
%133 = load i8*, i8** %14
store i8 0, i8* %133
store i32 -1, i32* %8
br label %136
134: ; preds = %125
br label %135
135: ; preds = %134, %122
store i32 0, i32* %8
br label %136
136: ; preds = %135, %132, %119, %96
%137 = load i32, i32* %8
ret i32 %137
}

LLVM IR (-O2):
@.str = [5 x i8] c" %s\0A\00"
@.str.1 = [16 x i8] c" Sec Usec \00"
@.str.2 = [27 x i8] c" Sec Usec \00"
@.str.3 = [18 x i8] c" Comp \00"
@.str.4 = [7 x i8] c" PID\00"
@.str.5 = [12 x i8] c" Entry Data\00"
@.str.6 = [12 x i8] c" Filename \00"
@.str.7 = [6 x i8] c" Line\00"
@.str.8 = [14 x i8] c"%1$08u.%2$09u\00"
@.str.9 = [12 x i8] c"%1$s.%2$06u\00"
@.str.10 = [9 x i8] c"|%3$-16s\00"
@.str.11 = [7 x i8] c"|%4$5u\00"
@.str.12 = [6 x i8] c"|%5$s\00"
@.str.13 = [6 x i8] c"|%6$s\00"
@.str.14 = [7 x i8] c"|%7$4u\00"
@.str.15 = [81 x i8] c"-------------------------------------------------------------------------------\0A\00"
@.str.16 = [18 x i8] c" %u traces read.\0A\00"
@.str.17 = [1 x i8] zeroinitializer
@.str.18 = [5 x i8] c"%1$s\00"
@.str.19 = [9 x i8] c"|%2$-16s\00"
@.str.20 = [7 x i8] c"|%3$5u\00"
@.str.21 = [6 x i8] c"|%4$s\00"
@.str.22 = [7 x i8] c"|%6$4u\00"
@.str.23 = [7 x i8] c"|%5$4u\00"
@.str.24 = [18 x i8] c"%s%s%s%s%s%s%s%s\0A\00"
@.str.25 = [38 x i8] c"%sTRACEBUFFER:%s%s%s%s%s%s%s%s%s%s\0A%s\00"
@.str.26 = [5 x i8] c"%s%s\00"
define i32 @trace_output_get_format(i32 %0, i8* %1, i64 %2, i8* %3, i64 %4, i8* %5, i64 %6) {
%8 = and i32 %0, 2048
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7
br label %11
11: ; preds = %10, %7
%12 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), %7 ]
%13 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), %10 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), %7 ]
%14 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), %10 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), %7 ]
%15 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), %7 ]
%16 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), %10 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), %7 ]
%17 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), %10 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), %7 ]
%18 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), %7 ]
%19 = and i32 %0, 2
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0)
%22 = select i1 %20, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), i8* %14
%23 = and i32 %0, 6
%24 = icmp eq i32 %23, 4
%25 = select i1 %24, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0)
%26 = select i1 %24, i8* %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0)
%27 = and i32 %0, 32
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0)
%30 = select i1 %28, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), i8* %17
%31 = select i1 %28, i8* %12, i8* %18
%32 = and i32 %0, 8
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %11
br label %35
35: ; preds = %11, %34
%36 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), %34 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), %11 ]
%37 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), %34 ], [ %13, %11 ]
%38 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), %34 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), %11 ]
%39 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %34 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.17, i64 0, i64 0), %11 ]
%40 = icmp eq i8* %3, null
br i1 %40, label %44, label %41
41: ; preds = %35
%42 = tail call i64 (i8*, i64, i8*, i8*, i8*, ...) @snprintf(i8* %3, i64 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0), i8* %36, i8* %37, i8* %15, i8* %22, i8* %31, i8* %16, i8* %26, i8* %30)
%43 = icmp slt i64 %42, 0
br i1 %43, label %54, label %44
44: ; preds = %41, %35
%45 = icmp eq i8* %1, null
br i1 %45, label %49, label %46
46: ; preds = %44
%47 = tail call i64 (i8*, i64, i8*, i8*, i8*, ...) @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.15, i64 0, i64 0), i8* %39, i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %25, i8* %29, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.15, i64 0, i64 0))
%48 = icmp slt i64 %47, 0
br i1 %48, label %54, label %49
49: ; preds = %46, %44
%50 = icmp eq i8* %5, null
br i1 %50, label %56, label %51
51: ; preds = %49
%52 = tail call i64 (i8*, i64, i8*, i8*, i8*, ...) @snprintf(i8* %5, i64 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0))
%53 = icmp slt i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51, %46, %41
%55 = phi i8* [ %3, %41 ], [ %1, %46 ], [ %5, %51 ]
store i8 0, i8* %55
br label %56
56: ; preds = %54, %49, %51
%57 = phi i32 [ 0, %51 ], [ 0, %49 ], [ -1, %54 ]
ret i32 %57
}