#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*/ iTlvValueLen(unsigned char *);
scalar_t__ memcmp(unsigned char *, char *, int);
int /*<<< orphan*/ memcpy(unsigned char *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ psTlvValue(unsigned char *);
int /*<<< orphan*/ strlen(unsigned char *);
void vAddExtraInfo(unsigned char *pszMsg, unsigned char *psTlvObj) {
  if (memcmp(psTlvObj, "\x50", 1) == 0 ||
      memcmp(psTlvObj, "\x5F\x20", 2) == 0 ||
      memcmp(psTlvObj, "\x5F\x2D", 2) == 0 ||
      memcmp(psTlvObj, "\x9F\x16", 2) == 0 ||
      memcmp(psTlvObj, "\x9F\x1C", 2) == 0 ||
      memcmp(psTlvObj, "\x9F\x4E", 2) == 0 ||
      memcmp(psTlvObj, "\x9F\x61", 2) == 0) {
    *pszMsg++ = '[';
    memcpy(pszMsg, psTlvValue(psTlvObj), iTlvValueLen(psTlvObj));
    pszMsg += strlen(pszMsg);
    *pszMsg++ = ']';
  }
}


x86 assembly (clang, -O0):
<vAddExtraInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe95(%rip),%rsi
mov    $0x1,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1239 <vAddExtraInfo+0xe9>
mov    -0x10(%rbp),%rdi
lea    0xe78(%rip),%rsi
mov    $0x2,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1239 <vAddExtraInfo+0xe9>
mov    -0x10(%rbp),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x2,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1239 <vAddExtraInfo+0xe9>
mov    -0x10(%rbp),%rdi
lea    0xe40(%rip),%rsi
mov    $0x2,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1239 <vAddExtraInfo+0xe9>
mov    -0x10(%rbp),%rdi
lea    0xe24(%rip),%rsi
mov    $0x2,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1239 <vAddExtraInfo+0xe9>
mov    -0x10(%rbp),%rdi
lea    0xe08(%rip),%rsi
mov    $0x2,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1239 <vAddExtraInfo+0xe9>
mov    -0x10(%rbp),%rdi
lea    0xdec(%rip),%rsi
mov    $0x2,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
jne    12a1 <vAddExtraInfo+0x151>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x5b,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <psTlvValue@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <iTlvValueLen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1070 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x5d,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vAddExtraInfo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xe9c(%rip),%rsi
mov    %r15,%rdi
mov    $0x1,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     1210 <vAddExtraInfo+0xc0>
lea    0xe81(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     1210 <vAddExtraInfo+0xc0>
lea    0xe6b(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     1210 <vAddExtraInfo+0xc0>
lea    0xe55(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     1210 <vAddExtraInfo+0xc0>
lea    0xe3f(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     1210 <vAddExtraInfo+0xc0>
lea    0xe29(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     1210 <vAddExtraInfo+0xc0>
lea    0xe13(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
jne    1246 <vAddExtraInfo+0xf6>
lea    0x1(%r14),%rbx
movb   $0x5b,(%r14)
mov    %r15,%rdi
call   1050 <psTlvValue@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1040 <iTlvValueLen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1070 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x5d,0x1(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"P\00"
@.str.1 = [3 x i8] c"_ \00"
@.str.2 = [3 x i8] c"_-\00"
@.str.3 = [3 x i8] c"\9F\16\00"
@.str.4 = [3 x i8] c"\9F\1C\00"
@.str.5 = [3 x i8] c"\9FN\00"
@.str.6 = [3 x i8] c"\9Fa\00"
define void @vAddExtraInfo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @memcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %32, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i64 @memcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %32, label %12
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = call i64 @memcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%15 = icmp eq i64 %14, 0
br i1 %15, label %32, label %16
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = call i64 @memcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%19 = icmp eq i64 %18, 0
br i1 %19, label %32, label %20
20: ; preds = %16
%21 = load i8*, i8** %4
%22 = call i64 @memcmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%23 = icmp eq i64 %22, 0
br i1 %23, label %32, label %24
24: ; preds = %20
%25 = load i8*, i8** %4
%26 = call i64 @memcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%27 = icmp eq i64 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i8*, i8** %4
%30 = call i64 @memcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %48
32: ; preds = %28, %24, %20, %16, %12, %8, %2
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %3
store i8 91, i8* %33
%35 = load i8*, i8** %3
%36 = load i8*, i8** %4
%37 = call i32 @psTlvValue(i8* %36)
%38 = load i8*, i8** %4
%39 = call i32 @iTlvValueLen(i8* %38)
%40 = call i32 @memcpy(i8* %35, i32 %37, i32 %39)
%41 = load i8*, i8** %3
%42 = call i32 @strlen(i8* %41)
%43 = load i8*, i8** %3
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds i8, i8* %43, i64 %44
store i8* %45, i8** %3
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %3
store i8 93, i8* %46
br label %48
48: ; preds = %32, %28
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"P\00"
@.str.1 = [3 x i8] c"_ \00"
@.str.2 = [3 x i8] c"_-\00"
@.str.3 = [3 x i8] c"\9F\16\00"
@.str.4 = [3 x i8] c"\9F\1C\00"
@.str.5 = [3 x i8] c"\9FN\00"
@.str.6 = [3 x i8] c"\9Fa\00"
define void @vAddExtraInfo(i8* %0, i8* %1) {
%3 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %23, label %5
5: ; preds = %2
%6 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %23, label %8
8: ; preds = %5
%9 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %23, label %11
11: ; preds = %8
%12 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%16 = icmp eq i64 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%19 = icmp eq i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %20, %17, %14, %11, %8, %5, %2
%24 = getelementptr inbounds i8, i8* %0, i64 1
store i8 91, i8* %0
%25 = tail call i32 @psTlvValue(i8* %1)
%26 = tail call i32 @iTlvValueLen(i8* %1)
%27 = tail call i32 @memcpy(i8* %24, i32 %25, i32 %26)
%28 = tail call i32 @strlen(i8* %24)
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %24, i64 %29
store i8 93, i8* %30
br label %31
31: ; preds = %23, %20
ret void
}