#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 /*<<< orphan*/ Src;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ Dst;
typedef int /*<<< orphan*/ Buf;

/* Variables and functions */
int /*<<< orphan*/ CopyFile(char *, char *, char *);
int FILENAME_MAX;
scalar_t__ ReadLine(int /*<<< orphan*/ *, char *, int);
int UnUnicodeHex(char *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *strstr(char *, char *);
void ProcessXML(FILE *Fin, char *TypeSource, char *Type) {
  char Buf[10240];
  char Dst[FILENAME_MAX];
  char Src[FILENAME_MAX];
  int i, j, c;
  char *fuid;
  char *source;
  char *field;
  char *FileType;
  while (ReadLine(Fin, Buf, sizeof(Buf)) > 0) {
    if (!strncmp(Buf, "<item ", 6))
      FileType = Type;
    else if (!strncmp(Buf, "<source ", 8))
      FileType = TypeSource;
    else
      continue;
    fuid = strstr(Buf, " fuid=\"");
    if (!fuid)
      continue;
    fuid += 7;
    source = strstr(Buf, " source=\"");
    if (!source)
      continue;
    source += 9;
    field = strstr(Buf, " artifact=\"1\"");
    if (field)
      continue;
    field = strstr(Buf, " mime=\"directory\"");
    if (field)
      continue;
    memset(Dst, '\0', sizeof(Dst));
    memset(Src, '\0', sizeof(Src));
    j = 0;
    for (i = 0; source[i] != '\"'; i++) {
      if (source[i] != '&')
        Src[j++] = source[i];
      else {
        c = UnUnicodeHex(source + i);
        if (c >= 0) {
          Src[j++] = c;
          i += 5;
        } else
          Src[j++] = source[i];
      }
    }
    j = 0;
    for (i = 0; fuid[i] != '\"'; i++) {
      if (fuid[i] != '&')
        Dst[j++] = fuid[i];
      else {
        c = UnUnicodeHex(fuid + i);
        if (c >= 0) {
          Dst[j++] = c;
          i += 5;
        } else
          Dst[j++] = fuid[i];
      }
    }
    CopyFile(Src, FileType, Dst);
    if (FileType != Type)
      CopyFile(Src, Type, Dst);
  }
}


x86 assembly (clang, -O0):
<ProcessXML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2890,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%ecx
mov    %rcx,-0x2888(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x2828(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x2880(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x2830(%rbp)
mov    (%rax),%eax
mov    %rax,-0x2878(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x2870(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x2838(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x2820(%rbp),%rsi
mov    $0x2800,%edx
call   1050 <ReadLine@plt>
cmp    $0x0,%rax
jle    1612 <ProcessXML+0x4b2>
lea    -0x2820(%rbp),%rdi
lea    0xdf5(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    122e <ProcessXML+0xce>
mov    -0x18(%rbp),%rax
mov    %rax,-0x2868(%rbp)
jmp    1269 <ProcessXML+0x109>
lea    -0x2820(%rbp),%rdi
lea    0xdcb(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    125f <ProcessXML+0xff>
mov    -0x10(%rbp),%rax
mov    %rax,-0x2868(%rbp)
jmp    1264 <ProcessXML+0x104>
jmp    11de <ProcessXML+0x7e>
jmp    1269 <ProcessXML+0x109>
lea    -0x2820(%rbp),%rdi
lea    0xd99(%rip),%rsi
call   1080 <strstr@plt>
mov    %rax,-0x2850(%rbp)
cmpq   $0x0,-0x2850(%rbp)
jne    1296 <ProcessXML+0x136>
jmp    11de <ProcessXML+0x7e>
mov    -0x2850(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x2850(%rbp)
lea    -0x2820(%rbp),%rdi
lea    0xd62(%rip),%rsi
call   1080 <strstr@plt>
mov    %rax,-0x2858(%rbp)
cmpq   $0x0,-0x2858(%rbp)
jne    12d5 <ProcessXML+0x175>
jmp    11de <ProcessXML+0x7e>
mov    -0x2858(%rbp),%rax
add    $0x9,%rax
mov    %rax,-0x2858(%rbp)
lea    -0x2820(%rbp),%rdi
lea    0xd2d(%rip),%rsi
call   1080 <strstr@plt>
mov    %rax,-0x2860(%rbp)
cmpq   $0x0,-0x2860(%rbp)
je     1314 <ProcessXML+0x1b4>
jmp    11de <ProcessXML+0x7e>
lea    -0x2820(%rbp),%rdi
lea    0xd0e(%rip),%rsi
call   1080 <strstr@plt>
mov    %rax,-0x2860(%rbp)
cmpq   $0x0,-0x2860(%rbp)
je     1341 <ProcessXML+0x1e1>
jmp    11de <ProcessXML+0x7e>
mov    -0x2880(%rbp),%rdi
mov    -0x2888(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x2870(%rbp),%rdi
mov    -0x2878(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x0,-0x2840(%rbp)
movl   $0x0,-0x283c(%rbp)
mov    -0x2858(%rbp),%rax
movslq -0x283c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
je     149d <ProcessXML+0x33d>
mov    -0x2858(%rbp),%rax
movslq -0x283c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x26,%eax
je     13ed <ProcessXML+0x28d>
mov    -0x2870(%rbp),%rax
mov    -0x2858(%rbp),%rcx
movslq -0x283c(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x2840(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2840(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1484 <ProcessXML+0x324>
mov    -0x2858(%rbp),%rdi
movslq -0x283c(%rbp),%rax
add    %rax,%rdi
call   1060 <UnUnicodeHex@plt>
mov    %eax,-0x2844(%rbp)
cmpl   $0x0,-0x2844(%rbp)
jl     1450 <ProcessXML+0x2f0>
mov    -0x2870(%rbp),%rax
mov    -0x2844(%rbp),%ecx
mov    %cl,%dl
mov    -0x2840(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2840(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x283c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x283c(%rbp)
jmp    147f <ProcessXML+0x31f>
mov    -0x2870(%rbp),%rax
mov    -0x2858(%rbp),%rcx
movslq -0x283c(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x2840(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2840(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1484 <ProcessXML+0x324>
jmp    1489 <ProcessXML+0x329>
mov    -0x283c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x283c(%rbp)
jmp    1383 <ProcessXML+0x223>
movl   $0x0,-0x2840(%rbp)
movl   $0x0,-0x283c(%rbp)
mov    -0x2850(%rbp),%rax
movslq -0x283c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
je     15cb <ProcessXML+0x46b>
mov    -0x2850(%rbp),%rax
movslq -0x283c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x26,%eax
je     151b <ProcessXML+0x3bb>
mov    -0x2880(%rbp),%rax
mov    -0x2850(%rbp),%rcx
movslq -0x283c(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x2840(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2840(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    15b2 <ProcessXML+0x452>
mov    -0x2850(%rbp),%rdi
movslq -0x283c(%rbp),%rax
add    %rax,%rdi
call   1060 <UnUnicodeHex@plt>
mov    %eax,-0x2844(%rbp)
cmpl   $0x0,-0x2844(%rbp)
jl     157e <ProcessXML+0x41e>
mov    -0x2880(%rbp),%rax
mov    -0x2844(%rbp),%ecx
mov    %cl,%dl
mov    -0x2840(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2840(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x283c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x283c(%rbp)
jmp    15ad <ProcessXML+0x44d>
mov    -0x2880(%rbp),%rax
mov    -0x2850(%rbp),%rcx
movslq -0x283c(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x2840(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2840(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    15b2 <ProcessXML+0x452>
jmp    15b7 <ProcessXML+0x457>
mov    -0x283c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x283c(%rbp)
jmp    14b1 <ProcessXML+0x351>
mov    -0x2880(%rbp),%rdx
mov    -0x2870(%rbp),%rdi
mov    -0x2868(%rbp),%rsi
call   1070 <CopyFile@plt>
mov    -0x2868(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     160d <ProcessXML+0x4ad>
mov    -0x2880(%rbp),%rdx
mov    -0x2870(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <CopyFile@plt>
jmp    11de <ProcessXML+0x7e>
mov    -0x2828(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcessXML>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2848,%rsp
mov    %rdx,%r12
mov    %rsi,-0x70(%rbp)
mov    %rdi,%rbx
mov    %rsp,-0x68(%rbp)
mov    0x2e5f(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rcx,-0x60(%rbp)
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rdx,%rsp
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rax,-0x58(%rbp)
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
lea    -0x2870(%rbp),%rsi
mov    $0x2800,%edx
call   1050 <ReadLine@plt>
test   %rax,%rax
jle    13ab <ProcessXML+0x24b>
lea    -0x2870(%rbp),%r15
mov    %r12,-0x50(%rbp)
mov    %rbx,-0x48(%rbp)
jmp    1209 <ProcessXML+0xa9>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2800,%edx
call   1050 <ReadLine@plt>
test   %rax,%rax
jle    13ab <ProcessXML+0x24b>
mov    %r15,%rdi
lea    0xded(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %r12,-0x40(%rbp)
test   %eax,%eax
je     1245 <ProcessXML+0xe5>
mov    %r15,%rdi
lea    0xdd8(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
mov    -0x70(%rbp),%rcx
mov    %rcx,-0x40(%rbp)
test   %eax,%eax
jne    11f0 <ProcessXML+0x90>
mov    %r15,%rdi
lea    0xdc1(%rip),%rsi
call   1080 <strstr@plt>
test   %rax,%rax
je     11f0 <ProcessXML+0x90>
mov    %rax,%r14
mov    %r15,%rdi
lea    0xdb2(%rip),%rsi
call   1080 <strstr@plt>
test   %rax,%rax
je     11f0 <ProcessXML+0x90>
mov    %rax,%r13
mov    %r15,%rdi
lea    0xda5(%rip),%rsi
call   1080 <strstr@plt>
test   %rax,%rax
jne    11f0 <ProcessXML+0x90>
mov    %r15,%rdi
lea    0xd9b(%rip),%rsi
call   1080 <strstr@plt>
test   %rax,%rax
jne    11f0 <ProcessXML+0x90>
add    $0x7,%r14
add    $0x9,%r13
xor    %r12d,%r12d
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    -0x60(%rbp),%rdx
call   1040 <memset@plt>
mov    -0x38(%rbp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    -0x58(%rbp),%rdx
call   1040 <memset@plt>
jmp    12ef <ProcessXML+0x18f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x22,%al
je     1319 <ProcessXML+0x1b9>
mov    %al,(%r15)
add    $0x1,%r12d
add    $0x1,%r15
movslq %r12d,%rbx
movzbl 0x0(%r13,%rbx,1),%eax
cmp    $0x26,%al
jne    12e0 <ProcessXML+0x180>
add    %r13,%rbx
mov    %rbx,%rdi
call   1060 <UnUnicodeHex@plt>
test   %eax,%eax
js     1314 <ProcessXML+0x1b4>
mov    %al,(%r15)
add    $0x5,%r12d
jmp    12e7 <ProcessXML+0x187>
movzbl (%rbx),%eax
jmp    12e4 <ProcessXML+0x184>
xor    %r12d,%r12d
mov    -0x30(%rbp),%r13
jmp    1340 <ProcessXML+0x1e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x22,%al
je     136a <ProcessXML+0x20a>
mov    %al,0x0(%r13)
add    $0x1,%r12d
add    $0x1,%r13
movslq %r12d,%rbx
movzbl (%r14,%rbx,1),%eax
cmp    $0x26,%al
jne    1330 <ProcessXML+0x1d0>
add    %r14,%rbx
mov    %rbx,%rdi
call   1060 <UnUnicodeHex@plt>
test   %eax,%eax
js     1365 <ProcessXML+0x205>
mov    %al,0x0(%r13)
add    $0x5,%r12d
jmp    1338 <ProcessXML+0x1d8>
movzbl (%rbx),%eax
jmp    1334 <ProcessXML+0x1d4>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rbx
mov    %rbx,%rsi
mov    -0x30(%rbp),%rdx
call   1070 <CopyFile@plt>
mov    -0x50(%rbp),%r12
cmp    %r12,%rbx
mov    -0x48(%rbp),%rbx
lea    -0x2870(%rbp),%r15
je     11f0 <ProcessXML+0x90>
mov    -0x38(%rbp),%rdi
mov    %r12,%rsi
mov    -0x30(%rbp),%rdx
call   1070 <CopyFile@plt>
jmp    11f0 <ProcessXML+0x90>
mov    -0x68(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@FILENAME_MAX = global i32 0
@.str = [7 x i8] c"<item \00"
@.str.1 = [9 x i8] c"<source \00"
@.str.2 = [8 x i8] c" fuid=\22\00"
@.str.3 = [10 x i8] c" source=\22\00"
@.str.4 = [14 x i8] c" artifact=\221\22\00"
@.str.5 = [18 x i8] c" mime=\22directory\22\00"
define void @ProcessXML(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [10240 x i8]
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%18 = load i32, i32* @FILENAME_MAX
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %8
%21 = alloca i8, i64 %19
store i64 %19, i64* %9
%22 = load i32, i32* @FILENAME_MAX
%23 = zext i32 %22 to i64
%24 = alloca i8, i64 %23
store i64 %23, i64* %10
br label %25
25: ; preds = %203, %71, %65, %57, %49, %42, %3
%26 = load i32*, i32** %4
%27 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%28 = call i64 @ReadLine(i32* %26, i8* %27, i32 10240)
%29 = icmp sgt i64 %28, 0
br i1 %29, label %30, label %204
30: ; preds = %25
%31 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%32 = call i32 @strncmp(i8* %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%33 = icmp ne i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = load i8*, i8** %6
store i8* %35, i8** %17
br label %44
36: ; preds = %30
%37 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%38 = call i32 @strncmp(i8* %37, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%39 = icmp ne i32 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %36
%41 = load i8*, i8** %5
store i8* %41, i8** %17
br label %43
42: ; preds = %36
br label %25
43: ; preds = %40
br label %44
44: ; preds = %43, %34
%45 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%46 = call i8* @strstr(i8* %45, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i8* %46, i8** %14
%47 = load i8*, i8** %14
%48 = icmp ne i8* %47, null
br i1 %48, label %50, label %49
49: ; preds = %44
br label %25
50: ; preds = %44
%51 = load i8*, i8** %14
%52 = getelementptr inbounds i8, i8* %51, i64 7
store i8* %52, i8** %14
%53 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%54 = call i8* @strstr(i8* %53, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
store i8* %54, i8** %15
%55 = load i8*, i8** %15
%56 = icmp ne i8* %55, null
br i1 %56, label %58, label %57
57: ; preds = %50
br label %25
58: ; preds = %50
%59 = load i8*, i8** %15
%60 = getelementptr inbounds i8, i8* %59, i64 9
store i8* %60, i8** %15
%61 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%62 = call i8* @strstr(i8* %61, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i8* %62, i8** %16
%63 = load i8*, i8** %16
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %66
65: ; preds = %58
br label %25
66: ; preds = %58
%67 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%68 = call i8* @strstr(i8* %67, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
store i8* %68, i8** %16
%69 = load i8*, i8** %16
%70 = icmp ne i8* %69, null
br i1 %70, label %71, label %72
71: ; preds = %66
br label %25
72: ; preds = %66
%73 = trunc i64 %19 to i32
%74 = call i32 @memset(i8* %21, i8 signext 0, i32 %73)
%75 = trunc i64 %23 to i32
%76 = call i32 @memset(i8* %24, i8 signext 0, i32 %75)
store i32 0, i32* %12
store i32 0, i32* %11
br label %77
77: ; preds = %132, %72
%78 = load i8*, i8** %15
%79 = load i32, i32* %11
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %78, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp ne i32 %83, 34
br i1 %84, label %85, label %135
85: ; preds = %77
%86 = load i8*, i8** %15
%87 = load i32, i32* %11
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %86, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp ne i32 %91, 38
br i1 %92, label %93, label %103
93: ; preds = %85
%94 = load i8*, i8** %15
%95 = load i32, i32* %11
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %94, i64 %96
%98 = load i8, i8* %97
%99 = load i32, i32* %12
%100 = add nsw i32 %99, 1
store i32 %100, i32* %12
%101 = sext i32 %99 to i64
%102 = getelementptr inbounds i8, i8* %24, i64 %101
store i8 %98, i8* %102
br label %131
103: ; preds = %85
%104 = load i8*, i8** %15
%105 = load i32, i32* %11
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %104, i64 %106
%108 = call i32 @UnUnicodeHex(i8* %107)
store i32 %108, i32* %13
%109 = load i32, i32* %13
%110 = icmp sge i32 %109, 0
br i1 %110, label %111, label %120
111: ; preds = %103
%112 = load i32, i32* %13
%113 = trunc i32 %112 to i8
%114 = load i32, i32* %12
%115 = add nsw i32 %114, 1
store i32 %115, i32* %12
%116 = sext i32 %114 to i64
%117 = getelementptr inbounds i8, i8* %24, i64 %116
store i8 %113, i8* %117
%118 = load i32, i32* %11
%119 = add nsw i32 %118, 5
store i32 %119, i32* %11
br label %130
120: ; preds = %103
%121 = load i8*, i8** %15
%122 = load i32, i32* %11
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %121, i64 %123
%125 = load i8, i8* %124
%126 = load i32, i32* %12
%127 = add nsw i32 %126, 1
store i32 %127, i32* %12
%128 = sext i32 %126 to i64
%129 = getelementptr inbounds i8, i8* %24, i64 %128
store i8 %125, i8* %129
br label %130
130: ; preds = %120, %111
br label %131
131: ; preds = %130, %93
br label %132
132: ; preds = %131
%133 = load i32, i32* %11
%134 = add nsw i32 %133, 1
store i32 %134, i32* %11
br label %77
135: ; preds = %77
store i32 0, i32* %12
store i32 0, i32* %11
br label %136
136: ; preds = %191, %135
%137 = load i8*, i8** %14
%138 = load i32, i32* %11
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8, i8* %137, i64 %139
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp ne i32 %142, 34
br i1 %143, label %144, label %194
144: ; preds = %136
%145 = load i8*, i8** %14
%146 = load i32, i32* %11
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %145, i64 %147
%149 = load i8, i8* %148
%150 = sext i8 %149 to i32
%151 = icmp ne i32 %150, 38
br i1 %151, label %152, label %162
152: ; preds = %144
%153 = load i8*, i8** %14
%154 = load i32, i32* %11
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %153, i64 %155
%157 = load i8, i8* %156
%158 = load i32, i32* %12
%159 = add nsw i32 %158, 1
store i32 %159, i32* %12
%160 = sext i32 %158 to i64
%161 = getelementptr inbounds i8, i8* %21, i64 %160
store i8 %157, i8* %161
br label %190
162: ; preds = %144
%163 = load i8*, i8** %14
%164 = load i32, i32* %11
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i8, i8* %163, i64 %165
%167 = call i32 @UnUnicodeHex(i8* %166)
store i32 %167, i32* %13
%168 = load i32, i32* %13
%169 = icmp sge i32 %168, 0
br i1 %169, label %170, label %179
170: ; preds = %162
%171 = load i32, i32* %13
%172 = trunc i32 %171 to i8
%173 = load i32, i32* %12
%174 = add nsw i32 %173, 1
store i32 %174, i32* %12
%175 = sext i32 %173 to i64
%176 = getelementptr inbounds i8, i8* %21, i64 %175
store i8 %172, i8* %176
%177 = load i32, i32* %11
%178 = add nsw i32 %177, 5
store i32 %178, i32* %11
br label %189
179: ; preds = %162
%180 = load i8*, i8** %14
%181 = load i32, i32* %11
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds i8, i8* %180, i64 %182
%184 = load i8, i8* %183
%185 = load i32, i32* %12
%186 = add nsw i32 %185, 1
store i32 %186, i32* %12
%187 = sext i32 %185 to i64
%188 = getelementptr inbounds i8, i8* %21, i64 %187
store i8 %184, i8* %188
br label %189
189: ; preds = %179, %170
br label %190
190: ; preds = %189, %152
br label %191
191: ; preds = %190
%192 = load i32, i32* %11
%193 = add nsw i32 %192, 1
store i32 %193, i32* %11
br label %136
194: ; preds = %136
%195 = load i8*, i8** %17
%196 = call i32 @CopyFile(i8* %24, i8* %195, i8* %21)
%197 = load i8*, i8** %17
%198 = load i8*, i8** %6
%199 = icmp ne i8* %197, %198
br i1 %199, label %200, label %203
200: ; preds = %194
%201 = load i8*, i8** %6
%202 = call i32 @CopyFile(i8* %24, i8* %201, i8* %21)
br label %203
203: ; preds = %200, %194
br label %25
204: ; preds = %25
%205 = load i8*, i8** %8
ret void
}

LLVM IR (-O2):
@FILENAME_MAX = global i32 0
@.str = [7 x i8] c"<item \00"
@.str.1 = [9 x i8] c"<source \00"
@.str.2 = [8 x i8] c" fuid=\22\00"
@.str.3 = [10 x i8] c" source=\22\00"
@.str.4 = [14 x i8] c" artifact=\221\22\00"
@.str.5 = [18 x i8] c" mime=\22directory\22\00"
define void @ProcessXML(i32* %0, i8* %1, i8* %2) {
%4 = alloca [10240 x i8]
%5 = getelementptr inbounds [10240 x i8], [10240 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* @FILENAME_MAX
%7 = zext i32 %6 to i64
%8 = tail call i8* @llvm.stacksave()
%9 = alloca i8, i64 %7
%10 = load i32, i32* @FILENAME_MAX
%11 = zext i32 %10 to i64
%12 = alloca i8, i64 %11
%13 = call i64 @ReadLine(i32* %0, i8* %5, i32 10240)
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %91
15: ; preds = %3, %88
%16 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%17 = icmp eq i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %88
21: ; preds = %18, %15
%22 = phi i8* [ %2, %15 ], [ %1, %18 ]
%23 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i8* %23, null
br i1 %24, label %88, label %25
25: ; preds = %21
%26 = getelementptr inbounds i8, i8* %23, i64 7
%27 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i8* %27, null
br i1 %28, label %88, label %29
29: ; preds = %25
%30 = getelementptr inbounds i8, i8* %27, i64 9
%31 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %88
33: ; preds = %29
%34 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %88
36: ; preds = %33
%37 = call i32 @memset(i8* %9, i8 signext 0, i32 %6)
%38 = call i32 @memset(i8* %12, i8 signext 0, i32 %10)
br label %39
39: ; preds = %57, %36
%40 = phi i64 [ %59, %57 ], [ 0, %36 ]
%41 = phi i32 [ %60, %57 ], [ 0, %36 ]
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %30, i64 %42
%44 = load i8, i8* %43
switch i8 %44, label %45 [
i8 34, label %61
i8 38, label %47
]
45: ; preds = %39
%46 = getelementptr inbounds i8, i8* %12, i64 %40
store i8 %44, i8* %46
br label %57
47: ; preds = %39
%48 = call i32 @UnUnicodeHex(i8* %43)
%49 = icmp sgt i32 %48, -1
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = trunc i32 %48 to i8
%52 = getelementptr inbounds i8, i8* %12, i64 %40
store i8 %51, i8* %52
%53 = add nsw i32 %41, 5
br label %57
54: ; preds = %47
%55 = load i8, i8* %43
%56 = getelementptr inbounds i8, i8* %12, i64 %40
store i8 %55, i8* %56
br label %57
57: ; preds = %45, %54, %50
%58 = phi i32 [ %41, %45 ], [ %53, %50 ], [ %41, %54 ]
%59 = add nuw i64 %40, 1
%60 = add nsw i32 %58, 1
br label %39
61: ; preds = %39, %79
%62 = phi i64 [ %81, %79 ], [ 0, %39 ]
%63 = phi i32 [ %82, %79 ], [ 0, %39 ]
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %26, i64 %64
%66 = load i8, i8* %65
switch i8 %66, label %67 [
i8 34, label %83
i8 38, label %69
]
67: ; preds = %61
%68 = getelementptr inbounds i8, i8* %9, i64 %62
store i8 %66, i8* %68
br label %79
69: ; preds = %61
%70 = call i32 @UnUnicodeHex(i8* %65)
%71 = icmp sgt i32 %70, -1
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = trunc i32 %70 to i8
%74 = getelementptr inbounds i8, i8* %9, i64 %62
store i8 %73, i8* %74
%75 = add nsw i32 %63, 5
br label %79
76: ; preds = %69
%77 = load i8, i8* %65
%78 = getelementptr inbounds i8, i8* %9, i64 %62
store i8 %77, i8* %78
br label %79
79: ; preds = %67, %76, %72
%80 = phi i32 [ %63, %67 ], [ %75, %72 ], [ %63, %76 ]
%81 = add nuw i64 %62, 1
%82 = add nsw i32 %80, 1
br label %61
83: ; preds = %61
%84 = call i32 @CopyFile(i8* %12, i8* %22, i8* %9)
%85 = icmp eq i8* %22, %2
br i1 %85, label %88, label %86
86: ; preds = %83
%87 = call i32 @CopyFile(i8* %12, i8* %2, i8* %9)
br label %88
88: ; preds = %83, %86, %18, %21, %25, %29, %33
%89 = call i64 @ReadLine(i32* %0, i8* %5, i32 10240)
%90 = icmp sgt i64 %89, 0
br i1 %90, label %15, label %91
91: ; preds = %88, %3
ret void
}