#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 */
int /*<<< orphan*/ Parser_DisplayTagInfo(unsigned int, unsigned char);
int /*<<< orphan*/ Parser_TsPacketLog(unsigned int, char *, ...);
int x6C_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0, j = 0;
  unsigned char subcell_info_loop_length = 0;
  unsigned char offset = 0;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  for (i = 0; i < buff[1]; i += offset) {
    Parser_TsPacketLog(type, "cell_id = 0x%x\n",
                       ((buff[i + 2] & 0xFF) << 8) | (buff[i + 3] & 0xFF));
    Parser_TsPacketLog(type, "cell_latitude = 0x%x\n",
                       ((buff[i + 4] & 0xFF) << 8) | (buff[i + 5] & 0xFF));
    Parser_TsPacketLog(type, "cell_longitude = 0x%x\n",
                       ((buff[i + 6] & 0xFF) << 8) | (buff[i + 7] & 0xFF));
    Parser_TsPacketLog(type, "cell_extent_of_latitude = 0x%x\n",
                       ((buff[i + 8] & 0xFF) << 4) |
                           ((buff[i + 9] & 0xF0) >> 4));
    Parser_TsPacketLog(type, "cell_extent_of_longitude = 0x%x\n",
                       ((buff[i + 9] & 0x0F) << 8) | (buff[i + 10] & 0xFF));
    subcell_info_loop_length = buff[i + 11] & 0xFF;
    Parser_TsPacketLog(type, "subcell_info_loop_length = 0x%x\n",
                       subcell_info_loop_length);
    for (j = 0; j < subcell_info_loop_length; j += 8) {
      Parser_TsPacketLog(type, "cell_id_extension = 0x%x\n",
                         buff[i + j + 12] & 0xFF);
      Parser_TsPacketLog(type, "subcell_latitude = 0x%x\n",
                         ((buff[i + j + 13] & 0xFF) << 8) |
                             (buff[i + j + 14] & 0xFF));
      Parser_TsPacketLog(type, "subcell_longitude = 0x%x\n",
                         ((buff[i + j + 15] & 0xFF) << 8) |
                             (buff[i + j + 16] & 0xFF));
      Parser_TsPacketLog(type, "subcell_extent_of_latitude = 0x%x\n",
                         ((buff[i + j + 17] & 0xFF) << 4) |
                             ((buff[i + j + 18] & 0xF0) >> 4));
      Parser_TsPacketLog(type, "subcell_extent_of_longitude = 0x%x\n",
                         ((buff[i + j + 18] & 0x0F) << 8) |
                             (buff[i + j + 19] & 0xFF));
    }
    offset = subcell_info_loop_length + 10;
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}


x86 assembly (clang, -O0):
<x6C_Tag_DescriptorParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
movb   $0x0,-0x1a(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    115d <x6C_Tag_DescriptorParser+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b0 <x6C_Tag_DescriptorParser+0x390>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movzbl (%rax),%esi
call   1040 <Parser_DisplayTagInfo@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edx
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jae    1494 <x6C_Tag_DescriptorParser+0x374>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
shl    $0x8,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x3,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
or     %eax,%edx
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x4,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
shl    $0x8,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x5,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
or     %eax,%edx
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x6,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
shl    $0x8,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x7,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
or     %eax,%edx
lea    0xe26(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x8,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
shl    $0x4,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x9,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xf0,%eax
sar    $0x4,%eax
or     %eax,%edx
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x9,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xf,%edx
shl    $0x8,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0xa,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
or     %eax,%edx
lea    0xde1(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0xb,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%edi
movzbl -0x19(%rbp),%edx
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
movzbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jae    147b <x6C_Tag_DescriptorParser+0x35b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0xc,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
lea    0xd01(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0xd,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
shl    $0x8,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0xe,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
or     %eax,%edx
lea    0xcd4(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0xf,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
shl    $0x8,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x10,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
or     %eax,%edx
lea    0xca6(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x11,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
shl    $0x4,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x12,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xf0,%eax
sar    $0x4,%eax
or     %eax,%edx
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x12,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
and    $0xf,%edx
shl    $0x8,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x13,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
or     %eax,%edx
lea    0xc55(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x18(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x18(%rbp)
jmp    1318 <x6C_Tag_DescriptorParser+0x1f8>
movzbl -0x19(%rbp),%eax
add    $0xa,%eax
mov    %al,-0x1a(%rbp)
movzbl -0x1a(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    118c <x6C_Tag_DescriptorParser+0x6c>
mov    -0x8(%rbp),%edi
lea    0xc41(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x6C_Tag_DescriptorParser>:
test   %rsi,%rsi
je     13be <x6C_Tag_DescriptorParser+0x29e>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%r13d
movzbl (%rsi),%esi
call   1040 <Parser_DisplayTagInfo@plt>
movzbl 0x1(%rbx),%edx
lea    0xeb0(%rip),%rsi
mov    %r13d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
cmpb   $0x0,0x1(%rbx)
je     139a <x6C_Tag_DescriptorParser+0x27a>
lea    0xee0(%rip),%rbp
lea    0xef3(%rip),%r14
xor    %r12d,%r12d
jmp    119b <x6C_Tag_DescriptorParser+0x7b>
nopw   0x0(%rax,%rax,1)
add    $0xa,%cl
movzbl %cl,%eax
mov    0x8(%rsp),%r12
add    %eax,%r12d
movzbl 0x1(%rbx),%eax
cmp    %eax,%r12d
jae    139a <x6C_Tag_DescriptorParser+0x27a>
lea    0x2(%r12),%eax
movzbl (%rbx,%rax,1),%eax
shl    $0x8,%eax
lea    0x3(%r12),%ecx
movzbl (%rbx,%rcx,1),%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xe5e(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    0x4(%r12),%eax
movzbl (%rbx,%rax,1),%eax
shl    $0x8,%eax
lea    0x5(%r12),%ecx
movzbl (%rbx,%rcx,1),%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xe84(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    0x6(%r12),%eax
movzbl (%rbx,%rax,1),%eax
shl    $0x8,%eax
lea    0x7(%r12),%ecx
movzbl (%rbx,%rcx,1),%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xe75(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    0x8(%r12),%eax
movzbl (%rbx,%rax,1),%eax
shl    $0x4,%eax
lea    0x9(%r12),%r15d
movzbl (%rbx,%r15,1),%edx
shr    $0x4,%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xe63(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl (%rbx,%r15,1),%eax
and    $0xf,%eax
shl    $0x8,%eax
lea    0xa(%r12),%ecx
movzbl (%rbx,%rcx,1),%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xe5f(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
mov    %r12,0x8(%rsp)
lea    0xb(%r12),%eax
movzbl (%rbx,%rax,1),%r15d
mov    %r13d,%edi
lea    0xdab(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
mov    %r15,%rcx
test   %ecx,%ecx
je     1180 <x6C_Tag_DescriptorParser+0x60>
mov    0x8(%rsp),%r15d
xor    %r12d,%r12d
mov    %rcx,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%r15,%r12,1),%eax
add    $0xc,%eax
movzbl (%rbx,%rax,1),%edx
mov    %r13d,%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    (%r15,%r12,1),%eax
add    $0xd,%eax
movzbl (%rbx,%rax,1),%eax
shl    $0x8,%eax
lea    (%r15,%r12,1),%ecx
add    $0xe,%ecx
movzbl (%rbx,%rcx,1),%edx
or     %eax,%edx
mov    %r13d,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    (%r15,%r12,1),%eax
add    $0xf,%eax
movzbl (%rbx,%rax,1),%eax
shl    $0x8,%eax
lea    (%r15,%r12,1),%ecx
add    $0x10,%ecx
movzbl (%rbx,%rcx,1),%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xd69(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    (%r15,%r12,1),%eax
add    $0x11,%eax
movzbl (%rbx,%rax,1),%eax
shl    $0x4,%eax
mov    %r14,%rbp
lea    (%r15,%r12,1),%r14d
add    $0x12,%r14d
movzbl (%rbx,%r14,1),%edx
shr    $0x4,%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xd4f(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl (%rbx,%r14,1),%eax
mov    %rbp,%r14
lea    0xcec(%rip),%rbp
and    $0xf,%eax
shl    $0x8,%eax
lea    (%r15,%r12,1),%ecx
add    $0x13,%ecx
movzbl (%rbx,%rcx,1),%edx
or     %eax,%edx
mov    %r13d,%edi
lea    0xd3f(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
mov    0x10(%rsp),%rcx
add    $0x8,%r12
cmp    %rcx,%r12
jb     12b0 <x6C_Tag_DescriptorParser+0x190>
jmp    1180 <x6C_Tag_DescriptorParser+0x60>
lea    0xd3e(%rip),%rsi
mov    %r13d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl 0x1(%rbx),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Descriptor_length = 0x%x\0A\00"
@.str.1 = [16 x i8] c"cell_id = 0x%x\0A\00"
@.str.2 = [22 x i8] c"cell_latitude = 0x%x\0A\00"
@.str.3 = [23 x i8] c"cell_longitude = 0x%x\0A\00"
@.str.4 = [32 x i8] c"cell_extent_of_latitude = 0x%x\0A\00"
@.str.5 = [33 x i8] c"cell_extent_of_longitude = 0x%x\0A\00"
@.str.6 = [33 x i8] c"subcell_info_loop_length = 0x%x\0A\00"
@.str.7 = [26 x i8] c"cell_id_extension = 0x%x\0A\00"
@.str.8 = [25 x i8] c"subcell_latitude = 0x%x\0A\00"
@.str.9 = [26 x i8] c"subcell_longitude = 0x%x\0A\00"
@.str.10 = [35 x i8] c"subcell_extent_of_latitude = 0x%x\0A\00"
@.str.11 = [36 x i8] c"subcell_extent_of_longitude = 0x%x\0A\00"
@.str.12 = [17 x i8] c"******END******\0A\00"
define i32 @x6C_Tag_DescriptorParser(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i8 0, i8* %8
store i8 0, i8* %9
%10 = load i8*, i8** %5
%11 = icmp eq i8* null, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %282
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = call i32 @Parser_DisplayTagInfo(i32 %14, i8 zeroext %17)
%19 = load i32, i32* %4
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %19, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %23)
store i32 0, i32* %6
br label %25
25: ; preds = %270, %13
%26 = load i32, i32* %6
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = icmp ult i32 %26, %30
br i1 %31, label %32, label %275
32: ; preds = %25
%33 = load i32, i32* %4
%34 = load i8*, i8** %5
%35 = load i32, i32* %6
%36 = add i32 %35, 2
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %34, i64 %37
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = and i32 %40, 255
%42 = shl i32 %41, 8
%43 = load i8*, i8** %5
%44 = load i32, i32* %6
%45 = add i32 %44, 3
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %43, i64 %46
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = and i32 %49, 255
%51 = or i32 %42, %50
%52 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %33, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %4
%54 = load i8*, i8** %5
%55 = load i32, i32* %6
%56 = add i32 %55, 4
%57 = zext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %54, i64 %57
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = and i32 %60, 255
%62 = shl i32 %61, 8
%63 = load i8*, i8** %5
%64 = load i32, i32* %6
%65 = add i32 %64, 5
%66 = zext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %63, i64 %66
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = and i32 %69, 255
%71 = or i32 %62, %70
%72 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %53, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %71)
%73 = load i32, i32* %4
%74 = load i8*, i8** %5
%75 = load i32, i32* %6
%76 = add i32 %75, 6
%77 = zext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %74, i64 %77
%79 = load i8, i8* %78
%80 = zext i8 %79 to i32
%81 = and i32 %80, 255
%82 = shl i32 %81, 8
%83 = load i8*, i8** %5
%84 = load i32, i32* %6
%85 = add i32 %84, 7
%86 = zext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %83, i64 %86
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = and i32 %89, 255
%91 = or i32 %82, %90
%92 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %73, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %91)
%93 = load i32, i32* %4
%94 = load i8*, i8** %5
%95 = load i32, i32* %6
%96 = add i32 %95, 8
%97 = zext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %94, i64 %97
%99 = load i8, i8* %98
%100 = zext i8 %99 to i32
%101 = and i32 %100, 255
%102 = shl i32 %101, 4
%103 = load i8*, i8** %5
%104 = load i32, i32* %6
%105 = add i32 %104, 9
%106 = zext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %103, i64 %106
%108 = load i8, i8* %107
%109 = zext i8 %108 to i32
%110 = and i32 %109, 240
%111 = ashr i32 %110, 4
%112 = or i32 %102, %111
%113 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %93, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %112)
%114 = load i32, i32* %4
%115 = load i8*, i8** %5
%116 = load i32, i32* %6
%117 = add i32 %116, 9
%118 = zext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %115, i64 %118
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = and i32 %121, 15
%123 = shl i32 %122, 8
%124 = load i8*, i8** %5
%125 = load i32, i32* %6
%126 = add i32 %125, 10
%127 = zext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %124, i64 %127
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = and i32 %130, 255
%132 = or i32 %123, %131
%133 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %114, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %132)
%134 = load i8*, i8** %5
%135 = load i32, i32* %6
%136 = add i32 %135, 11
%137 = zext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %134, i64 %137
%139 = load i8, i8* %138
%140 = zext i8 %139 to i32
%141 = and i32 %140, 255
%142 = trunc i32 %141 to i8
store i8 %142, i8* %8
%143 = load i32, i32* %4
%144 = load i8, i8* %8
%145 = zext i8 %144 to i32
%146 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %143, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %145)
store i32 0, i32* %7
br label %147
147: ; preds = %262, %32
%148 = load i32, i32* %7
%149 = load i8, i8* %8
%150 = zext i8 %149 to i32
%151 = icmp ult i32 %148, %150
br i1 %151, label %152, label %265
152: ; preds = %147
%153 = load i32, i32* %4
%154 = load i8*, i8** %5
%155 = load i32, i32* %6
%156 = load i32, i32* %7
%157 = add i32 %155, %156
%158 = add i32 %157, 12
%159 = zext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %154, i64 %159
%161 = load i8, i8* %160
%162 = zext i8 %161 to i32
%163 = and i32 %162, 255
%164 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %153, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %163)
%165 = load i32, i32* %4
%166 = load i8*, i8** %5
%167 = load i32, i32* %6
%168 = load i32, i32* %7
%169 = add i32 %167, %168
%170 = add i32 %169, 13
%171 = zext i32 %170 to i64
%172 = getelementptr inbounds i8, i8* %166, i64 %171
%173 = load i8, i8* %172
%174 = zext i8 %173 to i32
%175 = and i32 %174, 255
%176 = shl i32 %175, 8
%177 = load i8*, i8** %5
%178 = load i32, i32* %6
%179 = load i32, i32* %7
%180 = add i32 %178, %179
%181 = add i32 %180, 14
%182 = zext i32 %181 to i64
%183 = getelementptr inbounds i8, i8* %177, i64 %182
%184 = load i8, i8* %183
%185 = zext i8 %184 to i32
%186 = and i32 %185, 255
%187 = or i32 %176, %186
%188 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %165, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 %187)
%189 = load i32, i32* %4
%190 = load i8*, i8** %5
%191 = load i32, i32* %6
%192 = load i32, i32* %7
%193 = add i32 %191, %192
%194 = add i32 %193, 15
%195 = zext i32 %194 to i64
%196 = getelementptr inbounds i8, i8* %190, i64 %195
%197 = load i8, i8* %196
%198 = zext i8 %197 to i32
%199 = and i32 %198, 255
%200 = shl i32 %199, 8
%201 = load i8*, i8** %5
%202 = load i32, i32* %6
%203 = load i32, i32* %7
%204 = add i32 %202, %203
%205 = add i32 %204, 16
%206 = zext i32 %205 to i64
%207 = getelementptr inbounds i8, i8* %201, i64 %206
%208 = load i8, i8* %207
%209 = zext i8 %208 to i32
%210 = and i32 %209, 255
%211 = or i32 %200, %210
%212 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %189, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %211)
%213 = load i32, i32* %4
%214 = load i8*, i8** %5
%215 = load i32, i32* %6
%216 = load i32, i32* %7
%217 = add i32 %215, %216
%218 = add i32 %217, 17
%219 = zext i32 %218 to i64
%220 = getelementptr inbounds i8, i8* %214, i64 %219
%221 = load i8, i8* %220
%222 = zext i8 %221 to i32
%223 = and i32 %222, 255
%224 = shl i32 %223, 4
%225 = load i8*, i8** %5
%226 = load i32, i32* %6
%227 = load i32, i32* %7
%228 = add i32 %226, %227
%229 = add i32 %228, 18
%230 = zext i32 %229 to i64
%231 = getelementptr inbounds i8, i8* %225, i64 %230
%232 = load i8, i8* %231
%233 = zext i8 %232 to i32
%234 = and i32 %233, 240
%235 = ashr i32 %234, 4
%236 = or i32 %224, %235
%237 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %213, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %236)
%238 = load i32, i32* %4
%239 = load i8*, i8** %5
%240 = load i32, i32* %6
%241 = load i32, i32* %7
%242 = add i32 %240, %241
%243 = add i32 %242, 18
%244 = zext i32 %243 to i64
%245 = getelementptr inbounds i8, i8* %239, i64 %244
%246 = load i8, i8* %245
%247 = zext i8 %246 to i32
%248 = and i32 %247, 15
%249 = shl i32 %248, 8
%250 = load i8*, i8** %5
%251 = load i32, i32* %6
%252 = load i32, i32* %7
%253 = add i32 %251, %252
%254 = add i32 %253, 19
%255 = zext i32 %254 to i64
%256 = getelementptr inbounds i8, i8* %250, i64 %255
%257 = load i8, i8* %256
%258 = zext i8 %257 to i32
%259 = and i32 %258, 255
%260 = or i32 %249, %259
%261 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %238, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), i32 %260)
br label %262
262: ; preds = %152
%263 = load i32, i32* %7
%264 = add i32 %263, 8
store i32 %264, i32* %7
br label %147
265: ; preds = %147
%266 = load i8, i8* %8
%267 = zext i8 %266 to i32
%268 = add nsw i32 %267, 10
%269 = trunc i32 %268 to i8
store i8 %269, i8* %9
br label %270
270: ; preds = %265
%271 = load i8, i8* %9
%272 = zext i8 %271 to i32
%273 = load i32, i32* %6
%274 = add i32 %273, %272
store i32 %274, i32* %6
br label %25
275: ; preds = %25
%276 = load i32, i32* %4
%277 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %276, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%278 = load i8*, i8** %5
%279 = getelementptr inbounds i8, i8* %278, i64 1
%280 = load i8, i8* %279
%281 = zext i8 %280 to i32
store i32 %281, i32* %3
br label %282
282: ; preds = %275, %12
%283 = load i32, i32* %3
ret i32 %283
}

LLVM IR (-O2):
@.str = [26 x i8] c"Descriptor_length = 0x%x\0A\00"
@.str.1 = [16 x i8] c"cell_id = 0x%x\0A\00"
@.str.2 = [22 x i8] c"cell_latitude = 0x%x\0A\00"
@.str.3 = [23 x i8] c"cell_longitude = 0x%x\0A\00"
@.str.4 = [32 x i8] c"cell_extent_of_latitude = 0x%x\0A\00"
@.str.5 = [33 x i8] c"cell_extent_of_longitude = 0x%x\0A\00"
@.str.6 = [33 x i8] c"subcell_info_loop_length = 0x%x\0A\00"
@.str.7 = [26 x i8] c"cell_id_extension = 0x%x\0A\00"
@.str.8 = [25 x i8] c"subcell_latitude = 0x%x\0A\00"
@.str.9 = [26 x i8] c"subcell_longitude = 0x%x\0A\00"
@.str.10 = [35 x i8] c"subcell_extent_of_latitude = 0x%x\0A\00"
@.str.11 = [36 x i8] c"subcell_extent_of_longitude = 0x%x\0A\00"
@.str.12 = [17 x i8] c"******END******\0A\00"
define i32 @x6C_Tag_DescriptorParser(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %162, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = tail call i32 @Parser_DisplayTagInfo(i32 %0, i8 zeroext %5)
%7 = getelementptr inbounds i8, i8* %1, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8, i8* %7
%12 = icmp eq i8 %11, 0
br i1 %12, label %158, label %13
13: ; preds = %4, %151
%14 = phi i32 [ %154, %151 ], [ 0, %4 ]
%15 = add i32 %14, 2
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %1, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl nuw nsw i32 %19, 8
%21 = add i32 %14, 3
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %1, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %20, %25
%27 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = add i32 %14, 4
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %1, i64 %29
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = shl nuw nsw i32 %32, 8
%34 = add i32 %14, 5
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %1, i64 %35
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = or i32 %33, %38
%40 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = add i32 %14, 6
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %1, i64 %42
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = shl nuw nsw i32 %45, 8
%47 = add i32 %14, 7
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %1, i64 %48
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = or i32 %46, %51
%53 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %52)
%54 = add i32 %14, 8
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %1, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = shl nuw nsw i32 %58, 4
%60 = add i32 %14, 9
%61 = zext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %1, i64 %61
%63 = load i8, i8* %62
%64 = lshr i8 %63, 4
%65 = zext i8 %64 to i32
%66 = or i32 %59, %65
%67 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%68 = load i8, i8* %62
%69 = and i8 %68, 15
%70 = zext i8 %69 to i32
%71 = shl nuw nsw i32 %70, 8
%72 = add i32 %14, 10
%73 = zext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %1, i64 %73
%75 = load i8, i8* %74
%76 = zext i8 %75 to i32
%77 = or i32 %71, %76
%78 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %77)
%79 = add i32 %14, 11
%80 = zext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %1, i64 %80
%82 = load i8, i8* %81
%83 = zext i8 %82 to i32
%84 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %83)
%85 = icmp eq i8 %82, 0
br i1 %85, label %151, label %86
86: ; preds = %13
%87 = zext i8 %82 to i64
br label %88
88: ; preds = %86, %88
%89 = phi i64 [ 0, %86 ], [ %149, %88 ]
%90 = trunc i64 %89 to i32
%91 = add i32 %14, %90
%92 = add i32 %91, 12
%93 = zext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %1, i64 %93
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %96)
%98 = add i32 %91, 13
%99 = zext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %1, i64 %99
%101 = load i8, i8* %100
%102 = zext i8 %101 to i32
%103 = shl nuw nsw i32 %102, 8
%104 = add i32 %91, 14
%105 = zext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %1, i64 %105
%107 = load i8, i8* %106
%108 = zext i8 %107 to i32
%109 = or i32 %103, %108
%110 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 %109)
%111 = add i32 %91, 15
%112 = zext i32 %111 to i64
%113 = getelementptr inbounds i8, i8* %1, i64 %112
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = shl nuw nsw i32 %115, 8
%117 = add i32 %91, 16
%118 = zext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %1, i64 %118
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = or i32 %116, %121
%123 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %122)
%124 = add i32 %91, 17
%125 = zext i32 %124 to i64
%126 = getelementptr inbounds i8, i8* %1, i64 %125
%127 = load i8, i8* %126
%128 = zext i8 %127 to i32
%129 = shl nuw nsw i32 %128, 4
%130 = add i32 %91, 18
%131 = zext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %1, i64 %131
%133 = load i8, i8* %132
%134 = lshr i8 %133, 4
%135 = zext i8 %134 to i32
%136 = or i32 %129, %135
%137 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %136)
%138 = load i8, i8* %132
%139 = and i8 %138, 15
%140 = zext i8 %139 to i32
%141 = shl nuw nsw i32 %140, 8
%142 = add i32 %91, 19
%143 = zext i32 %142 to i64
%144 = getelementptr inbounds i8, i8* %1, i64 %143
%145 = load i8, i8* %144
%146 = zext i8 %145 to i32
%147 = or i32 %141, %146
%148 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), i32 %147)
%149 = add nuw nsw i64 %89, 8
%150 = icmp ult i64 %149, %87
br i1 %150, label %88, label %151
151: ; preds = %88, %13
%152 = add i8 %82, 10
%153 = zext i8 %152 to i32
%154 = add i32 %14, %153
%155 = load i8, i8* %7
%156 = zext i8 %155 to i32
%157 = icmp ult i32 %154, %156
br i1 %157, label %13, label %158
158: ; preds = %151, %4
%159 = tail call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%160 = load i8, i8* %7
%161 = zext i8 %160 to i32
br label %162
162: ; preds = %2, %158
%163 = phi i32 [ %161, %158 ], [ -1, %2 ]
ret i32 %163
}