#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 */
typedef int uint32_t;
typedef int uint16_t;
typedef int int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, ...);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int parse_spll_sample(FILE **fds, char *dst, uint32_t value, uint16_t seq_id,
                      uint32_t options) {
  char temp[2048];
  uint32_t source = 0x6 & (value >> 28);
  uint32_t type = 0xF & (value >> 24);
  uint32_t sample_value = 0xFFFFFF & value;
  if ((options & 0x8)) {
    sprintf(dst, "%05d,%d,%d\n", seq_id, source, sample_value);
    fprintf(fds[type], "%s", dst);
  } else {
    strcpy(dst, " ID ");
    sprintf(temp, "%05d", seq_id);
    strcat(dst, temp);
    strcat(dst, " | RAW:");
    sprintf(temp, "0x%08X | ", value);
    strcat(dst, temp);
    switch (source) {
    case 4:
      strcat(dst, "ePLL [0x");
      break;
    case 2:
      strcat(dst, "hPLL [0x");
      break;
    case 0:
      strcat(dst, "mPLL [0x");
      break;
    default:
      strcat(dst, "UKNWN: [0x");
    }
    sprintf(temp, "%d] ", source);
    strcat(dst, temp);
    switch (type) {
    case 0:
      strcat(dst, "| Y  \t    : [0x");
      break;
    case 1:
      strcat(dst, "| ERROR\t    : [0x");
      break;
    case 2:
      strcat(dst, "| TAG LOCAL : [0x");
      break;
    case 3:
      strcat(dst, "| PERIOD \t  : [0x");
      break;
    case 4:
      strcat(dst, "| EVENT \t  : [0x");
      break;
    case 5:
      strcat(dst, "| TAG REF   : [0x");
      break;
    case 6:
      strcat(dst, "| SAMPLE ID : [0x");
      break;
    default:
      strcat(dst, "| UNKNOWN! : [0x");
    }
    sprintf(temp, "%x] |  ", type);
    strcat(dst, temp);
    strcat(dst, "");
    sprintf(temp, "%d\n", (int32_t)(sample_value % 0xFFFFFF));
    strcat(dst, temp);
    if ((0x80000000 & value))
      strcat(dst, "------------------------------------------------------------"
                  "--------------------\n");
    fprintf(fds[0], "%s", dst);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_spll_sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x850,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x1c,%eax
and    $0x6,%eax
mov    %eax,-0x824(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x18,%eax
and    $0xf,%eax
mov    %eax,-0x828(%rbp)
mov    -0x14(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x82c(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11de <parse_spll_sample+0x9e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x824(%rbp),%ecx
mov    -0x82c(%rbp),%r8d
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rax
movslq -0x828(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe54(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1498 <parse_spll_sample+0x358>
mov    -0x10(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%edx
lea    0xe38(%rip),%rsi
xor    %eax,%eax
mov    %al,-0x839(%rbp)
lea    -0x820(%rbp),%rdi
mov    %rdi,-0x838(%rbp)
call   1060 <sprintf@plt>
mov    -0x838(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x838(%rbp),%rdi
mov    -0x839(%rbp),%al
mov    -0x14(%rbp),%edx
lea    0xdf3(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x838(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1050 <strcat@plt>
mov    -0x824(%rbp),%eax
mov    %eax,-0x830(%rbp)
test   %eax,%eax
je     12ca <parse_spll_sample+0x18a>
jmp    1278 <parse_spll_sample+0x138>
mov    -0x830(%rbp),%eax
sub    $0x2,%eax
je     12b5 <parse_spll_sample+0x175>
jmp    128c <parse_spll_sample+0x14c>
mov    -0x830(%rbp),%eax
sub    $0x4,%eax
jne    12df <parse_spll_sample+0x19f>
jmp    12a0 <parse_spll_sample+0x160>
mov    -0x10(%rbp),%rdi
lea    0xd9c(%rip),%rsi
call   1050 <strcat@plt>
jmp    12ef <parse_spll_sample+0x1af>
mov    -0x10(%rbp),%rdi
lea    0xd90(%rip),%rsi
call   1050 <strcat@plt>
jmp    12ef <parse_spll_sample+0x1af>
mov    -0x10(%rbp),%rdi
lea    0xd84(%rip),%rsi
call   1050 <strcat@plt>
jmp    12ef <parse_spll_sample+0x1af>
mov    -0x10(%rbp),%rdi
lea    0xd78(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x824(%rbp),%edx
lea    0xd71(%rip),%rsi
xor    %eax,%eax
lea    -0x820(%rbp),%rdi
mov    %rdi,-0x850(%rbp)
call   1060 <sprintf@plt>
mov    -0x850(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1050 <strcat@plt>
mov    -0x828(%rbp),%eax
mov    %rax,-0x848(%rbp)
sub    $0x6,%rax
ja     13e2 <parse_spll_sample+0x2a2>
mov    -0x848(%rbp),%rax
lea    0xcba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
lea    0xd18(%rip),%rsi
call   1050 <strcat@plt>
jmp    13f2 <parse_spll_sample+0x2b2>
mov    -0x10(%rbp),%rdi
lea    0xd13(%rip),%rsi
call   1050 <strcat@plt>
jmp    13f2 <parse_spll_sample+0x2b2>
mov    -0x10(%rbp),%rdi
lea    0xd10(%rip),%rsi
call   1050 <strcat@plt>
jmp    13f2 <parse_spll_sample+0x2b2>
mov    -0x10(%rbp),%rdi
lea    0xd0d(%rip),%rsi
call   1050 <strcat@plt>
jmp    13f2 <parse_spll_sample+0x2b2>
mov    -0x10(%rbp),%rdi
lea    0xd0a(%rip),%rsi
call   1050 <strcat@plt>
jmp    13f2 <parse_spll_sample+0x2b2>
mov    -0x10(%rbp),%rdi
lea    0xd06(%rip),%rsi
call   1050 <strcat@plt>
jmp    13f2 <parse_spll_sample+0x2b2>
mov    -0x10(%rbp),%rdi
lea    0xd03(%rip),%rsi
call   1050 <strcat@plt>
jmp    13f2 <parse_spll_sample+0x2b2>
mov    -0x10(%rbp),%rdi
lea    0xd00(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x820(%rbp),%rdi
mov    -0x828(%rbp),%edx
lea    0xcf8(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x820(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xd2f(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x820(%rbp),%rdi
mov    -0x82c(%rbp),%eax
mov    $0xffffff,%ecx
cltd
idiv   %ecx
lea    0xbdb(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x820(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x14(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1481 <parse_spll_sample+0x341>
mov    -0x10(%rbp),%rdi
lea    0xc8a(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xb95(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x850,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_spll_sample>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %ecx,%r14d
mov    %rsi,%r13
mov    %rdi,%r15
mov    %edx,%ebx
shr    $0x1c,%ebx
and    $0x6,%ebx
mov    %edx,%ebp
shr    $0x18,%ebp
and    $0xf,%ebp
mov    %edx,%eax
and    $0xffffff,%eax
test   $0x8,%r8b
jne    1203 <parse_spll_sample+0xc3>
mov    %eax,(%rsp)
mov    %r15,0x8(%rsp)
lea    0xe82(%rip),%rsi
mov    %r13,%rdi
mov    %edx,%r12d
call   1030 <strcpy@plt>
lea    0xe75(%rip),%rsi
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
lea    0xe56(%rip),%rsi
mov    %r13,%rdi
call   1050 <strcat@plt>
lea    0xe4f(%rip),%rsi
mov    %r15,%rdi
mov    %r12d,0x4(%rsp)
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
cmp    $0x4,%ebx
ja     1227 <parse_spll_sample+0xe7>
mov    %ebx,%eax
lea    0xf42(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    122e <parse_spll_sample+0xee>
lea    0xdf6(%rip),%rsi
mov    %r13,%rdi
mov    %r14d,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %ebp,%eax
mov    (%r15,%rax,8),%rsi
jmp    1316 <parse_spll_sample+0x1d6>
lea    0xe15(%rip),%rsi
mov    (%rsp),%r12d
mov    %r13,%rdi
call   1050 <strcat@plt>
lea    0xe0d(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
cmp    $0x6,%ebp
ja     1274 <parse_spll_sample+0x134>
mov    %ebp,%eax
lea    0xee5(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    127b <parse_spll_sample+0x13b>
lea    0xe53(%rip),%rsi
mov    0x8(%rsp),%r15
mov    %r13,%rdi
call   1050 <strcat@plt>
lea    0xe50(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
lea    0xe86(%rip),%rsi
mov    %r13,%rdi
call   1050 <strcat@plt>
mov    %r12d,%eax
mov    %rax,%rcx
shl    $0x8,%rcx
add    %rax,%rcx
shr    $0x20,%rcx
mov    %r12d,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x17,%edx
mov    %edx,%eax
shl    $0x18,%eax
sub    %eax,%edx
add    %r12d,%edx
lea    0xd20(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
cmpl   $0x0,0x4(%rsp)
jns    1313 <parse_spll_sample+0x1d3>
lea    0xddc(%rip),%rsi
mov    %r13,%rdi
call   1050 <strcat@plt>
mov    (%r15),%rsi
mov    %r13,%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%05d,%d,%d\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c" ID \00"
@.str.3 = [5 x i8] c"%05d\00"
@.str.4 = [8 x i8] c" | RAW:\00"
@.str.5 = [10 x i8] c"0x%08X | \00"
@.str.6 = [9 x i8] c"ePLL [0x\00"
@.str.7 = [9 x i8] c"hPLL [0x\00"
@.str.8 = [9 x i8] c"mPLL [0x\00"
@.str.9 = [11 x i8] c"UKNWN: [0x\00"
@.str.10 = [5 x i8] c"%d] \00"
@.str.11 = [16 x i8] c"| Y \09 : [0x\00"
@.str.12 = [18 x i8] c"| ERROR\09 : [0x\00"
@.str.13 = [18 x i8] c"| TAG LOCAL : [0x\00"
@.str.14 = [18 x i8] c"| PERIOD \09 : [0x\00"
@.str.15 = [17 x i8] c"| EVENT \09 : [0x\00"
@.str.16 = [18 x i8] c"| TAG REF : [0x\00"
@.str.17 = [18 x i8] c"| SAMPLE ID : [0x\00"
@.str.18 = [17 x i8] c"| UNKNOWN! : [0x\00"
@.str.19 = [8 x i8] c"%x] | \00"
@.str.20 = [1 x i8] zeroinitializer
@.str.21 = [4 x i8] c"%d\0A\00"
@.str.22 = [82 x i8] c"--------------------------------------------------------------------------------\0A\00"
define i32 @parse_spll_sample(i32** %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32**
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [2048 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32** %0, i32*** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%15 = load i32, i32* %8
%16 = ashr i32 %15, 28
%17 = and i32 6, %16
store i32 %17, i32* %12
%18 = load i32, i32* %8
%19 = ashr i32 %18, 24
%20 = and i32 15, %19
store i32 %20, i32* %13
%21 = load i32, i32* %8
%22 = and i32 16777215, %21
store i32 %22, i32* %14
%23 = load i32, i32* %10
%24 = and i32 %23, 8
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %39
26: ; preds = %5
%27 = load i8*, i8** %7
%28 = load i32, i32* %9
%29 = load i32, i32* %12
%30 = load i32, i32* %14
%31 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %27, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
%32 = load i32**, i32*** %6
%33 = load i32, i32* %13
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32*, i32** %32, i64 %34
%36 = load i32*, i32** %35
%37 = load i8*, i8** %7
%38 = call i32 @fprintf(i32* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %37)
br label %129
39: ; preds = %5
%40 = load i8*, i8** %7
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%42 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%43 = load i32, i32* %9
%44 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = load i8*, i8** %7
%46 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%47 = call i32 @strcat(i8* %45, i8* %46)
%48 = load i8*, i8** %7
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%50 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%51 = load i32, i32* %8
%52 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %50, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %51)
%53 = load i8*, i8** %7
%54 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%55 = call i32 @strcat(i8* %53, i8* %54)
%56 = load i32, i32* %12
switch i32 %56, label %66 [
i32 4, label %57
i32 2, label %60
i32 0, label %63
]
57: ; preds = %39
%58 = load i8*, i8** %7
%59 = call i32 @strcat(i8* %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %69
60: ; preds = %39
%61 = load i8*, i8** %7
%62 = call i32 @strcat(i8* %61, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %69
63: ; preds = %39
%64 = load i8*, i8** %7
%65 = call i32 @strcat(i8* %64, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %69
66: ; preds = %39
%67 = load i8*, i8** %7
%68 = call i32 @strcat(i8* %67, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %69
69: ; preds = %66, %63, %60, %57
%70 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%71 = load i32, i32* %12
%72 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %70, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %71)
%73 = load i8*, i8** %7
%74 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%75 = call i32 @strcat(i8* %73, i8* %74)
%76 = load i32, i32* %13
switch i32 %76, label %98 [
i32 0, label %77
i32 1, label %80
i32 2, label %83
i32 3, label %86
i32 4, label %89
i32 5, label %92
i32 6, label %95
]
77: ; preds = %69
%78 = load i8*, i8** %7
%79 = call i32 @strcat(i8* %78, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %101
80: ; preds = %69
%81 = load i8*, i8** %7
%82 = call i32 @strcat(i8* %81, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
br label %101
83: ; preds = %69
%84 = load i8*, i8** %7
%85 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0))
br label %101
86: ; preds = %69
%87 = load i8*, i8** %7
%88 = call i32 @strcat(i8* %87, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0))
br label %101
89: ; preds = %69
%90 = load i8*, i8** %7
%91 = call i32 @strcat(i8* %90, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
br label %101
92: ; preds = %69
%93 = load i8*, i8** %7
%94 = call i32 @strcat(i8* %93, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0))
br label %101
95: ; preds = %69
%96 = load i8*, i8** %7
%97 = call i32 @strcat(i8* %96, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %101
98: ; preds = %69
%99 = load i8*, i8** %7
%100 = call i32 @strcat(i8* %99, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
br label %101
101: ; preds = %98, %95, %92, %89, %86, %83, %80, %77
%102 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%103 = load i32, i32* %13
%104 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %102, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0), i32 %103)
%105 = load i8*, i8** %7
%106 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%107 = call i32 @strcat(i8* %105, i8* %106)
%108 = load i8*, i8** %7
%109 = call i32 @strcat(i8* %108, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i64 0, i64 0))
%110 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%111 = load i32, i32* %14
%112 = srem i32 %111, 16777215
%113 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %110, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i32 %112)
%114 = load i8*, i8** %7
%115 = getelementptr inbounds [2048 x i8], [2048 x i8]* %11, i64 0, i64 0
%116 = call i32 @strcat(i8* %114, i8* %115)
%117 = load i32, i32* %8
%118 = and i32 -2147483648, %117
%119 = icmp ne i32 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %101
%121 = load i8*, i8** %7
%122 = call i32 @strcat(i8* %121, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.22, i64 0, i64 0))
br label %123
123: ; preds = %120, %101
%124 = load i32**, i32*** %6
%125 = getelementptr inbounds i32*, i32** %124, i64 0
%126 = load i32*, i32** %125
%127 = load i8*, i8** %7
%128 = call i32 @fprintf(i32* %126, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %127)
br label %129
129: ; preds = %123, %26
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%05d,%d,%d\0A\00"
@.str.2 = [5 x i8] c" ID \00"
@.str.3 = [5 x i8] c"%05d\00"
@.str.4 = [8 x i8] c" | RAW:\00"
@.str.5 = [10 x i8] c"0x%08X | \00"
@.str.6 = [9 x i8] c"ePLL [0x\00"
@.str.7 = [9 x i8] c"hPLL [0x\00"
@.str.8 = [9 x i8] c"mPLL [0x\00"
@.str.9 = [11 x i8] c"UKNWN: [0x\00"
@.str.10 = [5 x i8] c"%d] \00"
@.str.11 = [16 x i8] c"| Y \09 : [0x\00"
@.str.12 = [18 x i8] c"| ERROR\09 : [0x\00"
@.str.13 = [18 x i8] c"| TAG LOCAL : [0x\00"
@.str.14 = [18 x i8] c"| PERIOD \09 : [0x\00"
@.str.15 = [17 x i8] c"| EVENT \09 : [0x\00"
@.str.16 = [18 x i8] c"| TAG REF : [0x\00"
@.str.17 = [18 x i8] c"| SAMPLE ID : [0x\00"
@.str.18 = [17 x i8] c"| UNKNOWN! : [0x\00"
@.str.19 = [8 x i8] c"%x] | \00"
@.str.20 = [1 x i8] zeroinitializer
@.str.21 = [4 x i8] c"%d\0A\00"
@.str.22 = [82 x i8] c"--------------------------------------------------------------------------------\0A\00"
@reltable.parse_spll_sample = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.8 to i64), i64 ptrtoint ([5 x i32]* @reltable.parse_spll_sample to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.9 to i64), i64 ptrtoint ([5 x i32]* @reltable.parse_spll_sample to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.7 to i64), i64 ptrtoint ([5 x i32]* @reltable.parse_spll_sample to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.9 to i64), i64 ptrtoint ([5 x i32]* @reltable.parse_spll_sample to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.6 to i64), i64 ptrtoint ([5 x i32]* @reltable.parse_spll_sample to i64)) to i32)]
@reltable.parse_spll_sample.24 = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.11 to i64), i64 ptrtoint ([7 x i32]* @reltable.parse_spll_sample.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.12 to i64), i64 ptrtoint ([7 x i32]* @reltable.parse_spll_sample.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.13 to i64), i64 ptrtoint ([7 x i32]* @reltable.parse_spll_sample.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.14 to i64), i64 ptrtoint ([7 x i32]* @reltable.parse_spll_sample.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.15 to i64), i64 ptrtoint ([7 x i32]* @reltable.parse_spll_sample.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.16 to i64), i64 ptrtoint ([7 x i32]* @reltable.parse_spll_sample.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.17 to i64), i64 ptrtoint ([7 x i32]* @reltable.parse_spll_sample.24 to i64)) to i32)]
define i32 @parse_spll_sample(i32** nocapture %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [2048 x i8]
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%8 = lshr i32 %2, 28
%9 = and i32 %8, 6
%10 = lshr i32 %2, 24
%11 = and i32 %10, 15
%12 = and i32 %2, 16777215
%13 = and i32 %4, 8
%14 = icmp eq i32 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %5
%16 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %9, i32 %12)
%17 = zext i32 %11 to i64
%18 = getelementptr inbounds i32*, i32** %0, i64 %17
%19 = load i32*, i32** %18
%20 = tail call i32 @fputs(i8* %1, i32* %19)
br label %58
21: ; preds = %5
%22 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%24 = call i32 @strcat(i8* %1, i8* %7)
%25 = call i32 @strcat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %2)
%27 = call i32 @strcat(i8* %1, i8* %7)
%28 = icmp ult i32 %9, 5
br i1 %28, label %29, label %33
29: ; preds = %21
%30 = zext i32 %9 to i64
%31 = shl i64 %30, 2
%32 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.parse_spll_sample to i8*), i64 %31)
br label %33
33: ; preds = %21, %29
%34 = phi i8* [ %32, %29 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), %21 ]
%35 = call i32 @strcat(i8* %1, i8* %34)
%36 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %9)
%37 = call i32 @strcat(i8* %1, i8* %7)
%38 = icmp ult i32 %11, 7
br i1 %38, label %39, label %43
39: ; preds = %33
%40 = zext i32 %11 to i64
%41 = shl i64 %40, 2
%42 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.parse_spll_sample.24 to i8*), i64 %41)
br label %43
43: ; preds = %33, %39
%44 = phi i8* [ %42, %39 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0), %33 ]
%45 = call i32 @strcat(i8* %1, i8* %44)
%46 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0), i32 %11)
%47 = call i32 @strcat(i8* %1, i8* %7)
%48 = call i32 @strcat(i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.20, i64 0, i64 0))
%49 = urem i32 %12, 16777215
%50 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i32 %49)
%51 = call i32 @strcat(i8* %1, i8* %7)
%52 = icmp sgt i32 %2, -1
br i1 %52, label %55, label %53
53: ; preds = %43
%54 = call i32 @strcat(i8* %1, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.22, i64 0, i64 0))
br label %55
55: ; preds = %53, %43
%56 = load i32*, i32** %0
%57 = call i32 @fputs(i8* %1, i32* %56)
br label %58
58: ; preds = %55, %15
ret i32 0
}