#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 x4E_Tag_DescriptorParser(unsigned int type, unsigned char *buff) {
  unsigned int i = 0, j = 0;
  unsigned int offset = 0;
  unsigned char tmp = 0;
  if (NULL == buff) {
    return -1;
  }
  Parser_DisplayTagInfo(type, buff[0]);
  Parser_TsPacketLog(type, "Descriptor_length = 0x%x\n", buff[1]);
  Parser_TsPacketLog(type, "descriptor_number = 0x%x\n", (buff[2] & 0xF0) >> 4);
  Parser_TsPacketLog(type, "last_descriptor_number = 0x%x\n", buff[2] & 0x0F);
  Parser_TsPacketLog(type, "ISO_639_language_code = 0x%x : %c%c%c\n",
                     (buff[3] << 16) | (buff[4] << 8) | (buff[5] & 0xFF),
                     buff[3], buff[4], buff[5]);
  Parser_TsPacketLog(type, "length_of_items = 0x%x\n", buff[6]);
  if (0 != buff[6]) {
    for (i = 0; i < buff[6]; i += offset) {
      Parser_TsPacketLog(type, "item_description_length = 0x%x\n", buff[i + 7]);
      if (0 != buff[i + 7]) {
        Parser_TsPacketLog(type, "item_description_char: ");
        for (j = 0; j < buff[i + 7]; j++) {
          Parser_TsPacketLog(type, "%c", buff[i + j + 8]);
        }
        Parser_TsPacketLog(type, "\n");
      }
      offset = j + 1;
      tmp = buff[i + j + 8];
      Parser_TsPacketLog(type, "item_length = 0x%x\n", tmp);
      if (0 != tmp) {
        Parser_TsPacketLog(type, "item_char: ");
        for (j = 0; j < tmp; j++) {
          Parser_TsPacketLog(type, "%c", buff[i + j + offset + 8]);
        }
        Parser_TsPacketLog(type, "\n");
      }
      offset += tmp;
      offset += 1;
    }
  }
  Parser_TsPacketLog(type, "text_length = 0x%x\n", buff[i + 7]);
  if (0 != buff[i + 7]) {
    Parser_TsPacketLog(type, "text_char: ");
    for (j = 0; j < buff[i + 7]; j++) {
      Parser_TsPacketLog(type, "%c", buff[i + j + 8]);
    }
    Parser_TsPacketLog(type, "\n");
  }
  Parser_TsPacketLog(type, "******END******\n");
  return buff[1];
}


x86 assembly (clang, -O0):
<x4E_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)
movl   $0x0,-0x1c(%rbp)
movb   $0x0,-0x1d(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1160 <x4E_Tag_DescriptorParser+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    14af <x4E_Tag_DescriptorParser+0x38f>
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    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%edx
and    $0xf0,%edx
sar    $0x4,%edx
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%edx
and    $0xf,%edx
lea    0xe5b(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%edx
shl    $0x10,%edx
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x8,%eax
or     %eax,%edx
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0xff,%eax
or     %eax,%edx
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%ecx
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%r8d
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%r9d
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%edx
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     13e2 <x4E_Tag_DescriptorParser+0x2c2>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
cmp    %ecx,%eax
jae    13dd <x4E_Tag_DescriptorParser+0x2bd>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x7,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
lea    0xe01(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x7,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     130e <x4E_Tag_DescriptorParser+0x1ee>
mov    -0x8(%rbp),%edi
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x7,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jae    12fd <x4E_Tag_DescriptorParser+0x1dd>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x8,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
lea    0xdc8(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12b0 <x4E_Tag_DescriptorParser+0x190>
mov    -0x8(%rbp),%edi
lea    0xdfb(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x8,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1d(%rbp)
mov    -0x8(%rbp),%edi
movzbl -0x1d(%rbp),%edx
lea    0xd79(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
movzbl -0x1d(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     13bc <x4E_Tag_DescriptorParser+0x29c>
mov    -0x8(%rbp),%edi
lea    0xd6e(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
movzbl -0x1d(%rbp),%ecx
cmp    %ecx,%eax
jae    13ab <x4E_Tag_DescriptorParser+0x28b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    -0x1c(%rbp),%ecx
add    $0x8,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
lea    0xd1a(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1367 <x4E_Tag_DescriptorParser+0x247>
mov    -0x8(%rbp),%edi
lea    0xd4d(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
movzbl -0x1d(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    124a <x4E_Tag_DescriptorParser+0x12a>
jmp    13e2 <x4E_Tag_DescriptorParser+0x2c2>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x7,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
lea    0xcd7(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x7,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1493 <x4E_Tag_DescriptorParser+0x373>
mov    -0x8(%rbp),%edi
lea    0xcc0(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x7,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jae    1482 <x4E_Tag_DescriptorParser+0x362>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x8,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
lea    0xc43(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1435 <x4E_Tag_DescriptorParser+0x315>
mov    -0x8(%rbp),%edi
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   1030 <Parser_TsPacketLog@plt>
mov    -0x8(%rbp),%edi
lea    0xc56(%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):
<x4E_Tag_DescriptorParser>:
test   %rsi,%rsi
je     13da <x4E_Tag_DescriptorParser+0x2ba>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r12
mov    %edi,%r15d
movzbl (%rsi),%esi
call   1040 <Parser_DisplayTagInfo@plt>
movzbl 0x1(%r12),%edx
lea    0xeae(%rip),%rsi
xor    %ebx,%ebx
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl 0x2(%r12),%edx
shr    $0x4,%edx
lea    0xeb1(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl 0x2(%r12),%edx
and    $0xf,%edx
lea    0xe92(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl 0x3(%r12),%ecx
mov    %ecx,%eax
shl    $0x10,%eax
movzbl 0x4(%r12),%r8d
mov    %r8d,%edx
shl    $0x8,%edx
or     %eax,%edx
movzbl 0x5(%r12),%r9d
or     %r9d,%edx
lea    0xe7e(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl 0x6(%r12),%edx
lea    0xe8e(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
cmpb   $0x0,0x6(%r12)
je     1334 <x4E_Tag_DescriptorParser+0x214>
lea    0xec1(%rip),%r13
xor    %r14d,%r14d
xor    %ebx,%ebx
jmp    1219 <x4E_Tag_DescriptorParser+0xf9>
cs nopw 0x0(%rax,%rax,1)
mov    (%rsp),%rax
add    %eax,%ebp
add    %ebp,%ebx
add    $0x1,%ebx
movzbl 0x6(%r12),%eax
cmp    %eax,%ebx
jae    1334 <x4E_Tag_DescriptorParser+0x214>
lea    0x7(%rbx),%ebp
movzbl (%r12,%rbp,1),%edx
mov    %r15d,%edi
lea    0xe4d(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
cmpb   $0x0,(%r12,%rbp,1)
mov    %rbx,(%rsp)
je     1299 <x4E_Tag_DescriptorParser+0x179>
xor    %r14d,%r14d
mov    %r15d,%edi
lea    0xe4e(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
cmpb   $0x0,(%r12,%rbp,1)
je     1288 <x4E_Tag_DescriptorParser+0x168>
add    $0x8,%ebx
xor    %r14d,%r14d
xchg   %ax,%ax
lea    (%rbx,%r14,1),%eax
movzbl (%r12,%rax,1),%edx
mov    %r15d,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
add    $0x1,%r14
movzbl (%r12,%rbp,1),%eax
cmp    %rax,%r14
jb     1260 <x4E_Tag_DescriptorParser+0x140>
mov    (%rsp),%rbx
mov    %r15d,%edi
lea    0xe70(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    0x1(%r14),%ebp
lea    (%rbx,%r14,1),%eax
add    $0x8,%eax
movzbl (%r12,%rax,1),%ebx
mov    %r15d,%edi
lea    0xe00(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
test   %ebx,%ebx
je     1200 <x4E_Tag_DescriptorParser+0xe0>
mov    %rbp,0x10(%rsp)
mov    %r15d,%edi
lea    0xdf4(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
mov    %rbx,0x8(%rsp)
mov    %ebx,%ebp
mov    (%rsp),%rbx
add    %r14d,%ebx
add    $0x9,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
movzbl (%r12,%rax,1),%edx
mov    %r15d,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
add    $0x1,%ebx
add    $0xffffffffffffffff,%rbp
jne    12f0 <x4E_Tag_DescriptorParser+0x1d0>
mov    %r15d,%edi
lea    0xdeb(%rip),%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
mov    0x8(%rsp),%rbx
mov    %ebx,%r14d
mov    (%rsp),%rax
mov    0x10(%rsp),%rbp
jmp    1204 <x4E_Tag_DescriptorParser+0xe4>
lea    0x7(%rbx),%r13d
movzbl (%r12,%r13,1),%edx
lea    0xd8f(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
cmpb   $0x0,(%r12,%r13,1)
je     13b4 <x4E_Tag_DescriptorParser+0x294>
lea    0xd8b(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
cmpb   $0x0,(%r12,%r13,1)
je     13a3 <x4E_Tag_DescriptorParser+0x283>
mov    %rbx,%rbp
add    $0x8,%ebp
lea    0xd36(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%rbx,%rbp,1),%eax
movzbl (%r12,%rax,1),%edx
mov    %r15d,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
add    $0x1,%rbx
movzbl (%r12,%r13,1),%eax
cmp    %rax,%rbx
jb     1380 <x4E_Tag_DescriptorParser+0x260>
lea    0xd58(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
lea    0xd38(%rip),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <Parser_TsPacketLog@plt>
movzbl 0x1(%r12),%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 = [26 x i8] c"descriptor_number = 0x%x\0A\00"
@.str.2 = [31 x i8] c"last_descriptor_number = 0x%x\0A\00"
@.str.3 = [39 x i8] c"ISO_639_language_code = 0x%x : %c%c%c\0A\00"
@.str.4 = [24 x i8] c"length_of_items = 0x%x\0A\00"
@.str.5 = [32 x i8] c"item_description_length = 0x%x\0A\00"
@.str.6 = [24 x i8] c"item_description_char: \00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [20 x i8] c"item_length = 0x%x\0A\00"
@.str.10 = [12 x i8] c"item_char: \00"
@.str.11 = [20 x i8] c"text_length = 0x%x\0A\00"
@.str.12 = [12 x i8] c"text_char: \00"
@.str.13 = [17 x i8] c"******END******\0A\00"
define i32 @x4E_Tag_DescriptorParser(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %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 %253
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)
%25 = load i32, i32* %4
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = and i32 %29, 240
%31 = ashr i32 %30, 4
%32 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %25, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %4
%34 = load i8*, i8** %5
%35 = getelementptr inbounds i8, i8* %34, i64 2
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = and i32 %37, 15
%39 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %33, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %4
%41 = load i8*, i8** %5
%42 = getelementptr inbounds i8, i8* %41, i64 3
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = shl i32 %44, 16
%46 = load i8*, i8** %5
%47 = getelementptr inbounds i8, i8* %46, i64 4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = shl i32 %49, 8
%51 = or i32 %45, %50
%52 = load i8*, i8** %5
%53 = getelementptr inbounds i8, i8* %52, i64 5
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = and i32 %55, 255
%57 = or i32 %51, %56
%58 = load i8*, i8** %5
%59 = getelementptr inbounds i8, i8* %58, i64 3
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = load i8*, i8** %5
%63 = getelementptr inbounds i8, i8* %62, i64 4
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = load i8*, i8** %5
%67 = getelementptr inbounds i8, i8* %66, i64 5
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %40, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %57, i32 %61, i32 %65, i32 %69)
%71 = load i32, i32* %4
%72 = load i8*, i8** %5
%73 = getelementptr inbounds i8, i8* %72, i64 6
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %71, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %75)
%77 = load i8*, i8** %5
%78 = getelementptr inbounds i8, i8* %77, i64 6
%79 = load i8, i8* %78
%80 = zext i8 %79 to i32
%81 = icmp ne i32 0, %80
br i1 %81, label %82, label %197
82: ; preds = %13
store i32 0, i32* %6
br label %83
83: ; preds = %192, %82
%84 = load i32, i32* %6
%85 = load i8*, i8** %5
%86 = getelementptr inbounds i8, i8* %85, i64 6
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = icmp ult i32 %84, %88
br i1 %89, label %90, label %196
90: ; preds = %83
%91 = load i32, i32* %4
%92 = load i8*, i8** %5
%93 = load i32, i32* %6
%94 = add i32 %93, 7
%95 = zext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %92, i64 %95
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %91, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %98)
%100 = load i8*, i8** %5
%101 = load i32, i32* %6
%102 = add i32 %101, 7
%103 = zext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %100, i64 %103
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = icmp ne i32 0, %106
br i1 %107, label %108, label %139
108: ; preds = %90
%109 = load i32, i32* %4
%110 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %109, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %7
br label %111
111: ; preds = %133, %108
%112 = load i32, i32* %7
%113 = load i8*, i8** %5
%114 = load i32, i32* %6
%115 = add i32 %114, 7
%116 = zext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %113, i64 %116
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = icmp ult i32 %112, %119
br i1 %120, label %121, label %136
121: ; preds = %111
%122 = load i32, i32* %4
%123 = load i8*, i8** %5
%124 = load i32, i32* %6
%125 = load i32, i32* %7
%126 = add i32 %124, %125
%127 = add i32 %126, 8
%128 = zext i32 %127 to i64
%129 = getelementptr inbounds i8, i8* %123, i64 %128
%130 = load i8, i8* %129
%131 = zext i8 %130 to i32
%132 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %122, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %131)
br label %133
133: ; preds = %121
%134 = load i32, i32* %7
%135 = add i32 %134, 1
store i32 %135, i32* %7
br label %111
136: ; preds = %111
%137 = load i32, i32* %4
%138 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %137, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %139
139: ; preds = %136, %90
%140 = load i32, i32* %7
%141 = add i32 %140, 1
store i32 %141, i32* %8
%142 = load i8*, i8** %5
%143 = load i32, i32* %6
%144 = load i32, i32* %7
%145 = add i32 %143, %144
%146 = add i32 %145, 8
%147 = zext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %142, i64 %147
%149 = load i8, i8* %148
store i8 %149, i8* %9
%150 = load i32, i32* %4
%151 = load i8, i8* %9
%152 = zext i8 %151 to i32
%153 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %150, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %152)
%154 = load i8, i8* %9
%155 = zext i8 %154 to i32
%156 = icmp ne i32 0, %155
br i1 %156, label %157, label %185
157: ; preds = %139
%158 = load i32, i32* %4
%159 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %158, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %7
br label %160
160: ; preds = %179, %157
%161 = load i32, i32* %7
%162 = load i8, i8* %9
%163 = zext i8 %162 to i32
%164 = icmp ult i32 %161, %163
br i1 %164, label %165, label %182
165: ; preds = %160
%166 = load i32, i32* %4
%167 = load i8*, i8** %5
%168 = load i32, i32* %6
%169 = load i32, i32* %7
%170 = add i32 %168, %169
%171 = load i32, i32* %8
%172 = add i32 %170, %171
%173 = add i32 %172, 8
%174 = zext i32 %173 to i64
%175 = getelementptr inbounds i8, i8* %167, i64 %174
%176 = load i8, i8* %175
%177 = zext i8 %176 to i32
%178 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %166, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %177)
br label %179
179: ; preds = %165
%180 = load i32, i32* %7
%181 = add i32 %180, 1
store i32 %181, i32* %7
br label %160
182: ; preds = %160
%183 = load i32, i32* %4
%184 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %183, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %185
185: ; preds = %182, %139
%186 = load i8, i8* %9
%187 = zext i8 %186 to i32
%188 = load i32, i32* %8
%189 = add i32 %188, %187
store i32 %189, i32* %8
%190 = load i32, i32* %8
%191 = add i32 %190, 1
store i32 %191, i32* %8
br label %192
192: ; preds = %185
%193 = load i32, i32* %8
%194 = load i32, i32* %6
%195 = add i32 %194, %193
store i32 %195, i32* %6
br label %83
196: ; preds = %83
br label %197
197: ; preds = %196, %13
%198 = load i32, i32* %4
%199 = load i8*, i8** %5
%200 = load i32, i32* %6
%201 = add i32 %200, 7
%202 = zext i32 %201 to i64
%203 = getelementptr inbounds i8, i8* %199, i64 %202
%204 = load i8, i8* %203
%205 = zext i8 %204 to i32
%206 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %198, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %205)
%207 = load i8*, i8** %5
%208 = load i32, i32* %6
%209 = add i32 %208, 7
%210 = zext i32 %209 to i64
%211 = getelementptr inbounds i8, i8* %207, i64 %210
%212 = load i8, i8* %211
%213 = zext i8 %212 to i32
%214 = icmp ne i32 0, %213
br i1 %214, label %215, label %246
215: ; preds = %197
%216 = load i32, i32* %4
%217 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %216, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %7
br label %218
218: ; preds = %240, %215
%219 = load i32, i32* %7
%220 = load i8*, i8** %5
%221 = load i32, i32* %6
%222 = add i32 %221, 7
%223 = zext i32 %222 to i64
%224 = getelementptr inbounds i8, i8* %220, i64 %223
%225 = load i8, i8* %224
%226 = zext i8 %225 to i32
%227 = icmp ult i32 %219, %226
br i1 %227, label %228, label %243
228: ; preds = %218
%229 = load i32, i32* %4
%230 = load i8*, i8** %5
%231 = load i32, i32* %6
%232 = load i32, i32* %7
%233 = add i32 %231, %232
%234 = add i32 %233, 8
%235 = zext i32 %234 to i64
%236 = getelementptr inbounds i8, i8* %230, i64 %235
%237 = load i8, i8* %236
%238 = zext i8 %237 to i32
%239 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %229, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %238)
br label %240
240: ; preds = %228
%241 = load i32, i32* %7
%242 = add i32 %241, 1
store i32 %242, i32* %7
br label %218
243: ; preds = %218
%244 = load i32, i32* %4
%245 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %244, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %246
246: ; preds = %243, %197
%247 = load i32, i32* %4
%248 = call i32 (i32, i8*, ...) @Parser_TsPacketLog(i32 %247, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%249 = load i8*, i8** %5
%250 = getelementptr inbounds i8, i8* %249, i64 1
%251 = load i8, i8* %250
%252 = zext i8 %251 to i32
store i32 %252, i32* %3
br label %253
253: ; preds = %246, %12
%254 = load i32, i32* %3
ret i32 %254
}

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