; LLVM IR from gem5/gem5 :: ext/mcpat/xmlParser.ll (ZN7XMLNode9parseFileEPKcS1_P10XMLResults)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.XMLNode = type { ptr }
%struct.XMLResults = type { i32, i32, i32 }

@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL18guessWideCharChars = external hidden global i8, align 1
@_ZN7XMLNode12emptyXMLNodeE = external dso_local global %struct.XMLNode, align 8

; Function Attrs: nounwind
declare void @free(ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_Z16myIsTextWideCharPKvi(ptr noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z21myWideCharToMultiBytePKw(ptr noundef) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef ptr @_ZL6xfopenPKcS0_(ptr noundef, ptr noundef) #5

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #6

declare i32 @fclose(ptr noundef) #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7XMLNode9parseFileEPKcS1_P10XMLResults(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i1, align 1
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %23

18:                                               ; preds = %4
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.XMLResults, ptr %19, i32 0, i32 1
  store i32 0, ptr %20, align 4, !tbaa !9
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.XMLResults, ptr %21, i32 0, i32 2
  store i32 0, ptr %22, align 4, !tbaa !13
  br label %23

23:                                               ; preds = %18, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef ptr @_ZL6xfopenPKcS0_(ptr noundef %24, ptr noundef @.str.23)
  store ptr %25, ptr %9, align 8, !tbaa !5
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %35

28:                                               ; preds = %23
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.XMLResults, ptr %32, i32 0, i32 0
  store i32 10, ptr %33, align 4, !tbaa !14
  br label %34

34:                                               ; preds = %31, %28
  call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  store i32 1, ptr %10, align 4
  br label %171

35:                                               ; preds = %23
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = call i32 @fseek(ptr noundef %36, i64 noundef 0, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = call i64 @ftell(ptr noundef %38)
  %40 = trunc i64 %39 to i32
  store i32 %40, ptr %11, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !15
  %41 = load i32, ptr %11, align 4, !tbaa !15
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %52, label %43

43:                                               ; preds = %35
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %49

46:                                               ; preds = %43
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.XMLResults, ptr %47, i32 0, i32 0
  store i32 3, ptr %48, align 4, !tbaa !14
  br label %49

49:                                               ; preds = %46, %43
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = call i32 @fclose(ptr noundef %50)
  call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  store i32 1, ptr %10, align 4
  br label %170

52:                                               ; preds = %35
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = call i32 @fseek(ptr noundef %53, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %55 = load i32, ptr %11, align 4, !tbaa !15
  %56 = add nsw i32 %55, 4
  %57 = sext i32 %56 to i64
  %58 = call noalias ptr @malloc(i64 noundef %57) #8
  store ptr %58, ptr %13, align 8, !tbaa !5
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = load i32, ptr %11, align 4, !tbaa !15
  %61 = sext i32 %60 to i64
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = call i64 @fread(ptr noundef %59, i64 noundef 1, i64 noundef %61, ptr noundef %62)
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr %11, align 4, !tbaa !15
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = call i32 @fclose(ptr noundef %65)
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = load i32, ptr %11, align 4, !tbaa !15
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %67, i64 %69
  store i8 0, ptr %70, align 1, !tbaa !16
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load i32, ptr %11, align 4, !tbaa !15
  %73 = add nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %71, i64 %74
  store i8 0, ptr %75, align 1, !tbaa !16
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = load i32, ptr %11, align 4, !tbaa !15
  %78 = add nsw i32 %77, 2
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %76, i64 %79
  store i8 0, ptr %80, align 1, !tbaa !16
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load i32, ptr %11, align 4, !tbaa !15
  %83 = add nsw i32 %82, 3
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr %81, i64 %84
  store i8 0, ptr %85, align 1, !tbaa !16
  %86 = load i8, ptr @_ZL18guessWideCharChars, align 1, !tbaa !16
  %87 = icmp ne i8 %86, 0
  br i1 %87, label %88, label %148

88:                                               ; preds = %52
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = load i32, ptr %11, align 4, !tbaa !15
  %91 = call noundef signext i8 @_Z16myIsTextWideCharPKvi(ptr noundef %89, i32 noundef %90)
  %92 = icmp ne i8 %91, 0
  br i1 %92, label %93, label %127

93:                                               ; preds = %88
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i64 0
  %96 = load i8, ptr %95, align 1, !tbaa !16
  %97 = zext i8 %96 to i32
  %98 = icmp eq i32 %97, 239
  br i1 %98, label %99, label %106

99:                                               ; preds = %93
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 1
  %102 = load i8, ptr %101, align 1, !tbaa !16
  %103 = zext i8 %102 to i32
  %104 = icmp eq i32 %103, 255
  br i1 %104, label %105, label %106

105:                                              ; preds = %99
  store i32 2, ptr %12, align 4, !tbaa !15
  br label %106

106:                                              ; preds = %105, %99, %93
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 0
  %109 = load i8, ptr %108, align 1, !tbaa !16
  %110 = zext i8 %109 to i32
  %111 = icmp eq i32 %110, 255
  br i1 %111, label %112, label %119

112:                                              ; preds = %106
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 1
  %115 = load i8, ptr %114, align 1, !tbaa !16
  %116 = zext i8 %115 to i32
  %117 = icmp eq i32 %116, 254
  br i1 %117, label %118, label %119

118:                                              ; preds = %112
  store i32 2, ptr %12, align 4, !tbaa !15
  br label %119

119:                                              ; preds = %118, %112, %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = load i32, ptr %12, align 4, !tbaa !15
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i8, ptr %120, i64 %122
  %124 = call noundef ptr @_Z21myWideCharToMultiBytePKw(ptr noundef %123)
  store ptr %124, ptr %14, align 8, !tbaa !5
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %125) #7
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %126, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %12, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %147

127:                                              ; preds = %88
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = getelementptr inbounds i8, ptr %128, i64 0
  %130 = load i8, ptr %129, align 1, !tbaa !16
  %131 = zext i8 %130 to i32
  %132 = icmp eq i32 %131, 239
  br i1 %132, label %133, label %146

133:                                              ; preds = %127
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = getelementptr inbounds i8, ptr %134, i64 1
  %136 = load i8, ptr %135, align 1, !tbaa !16
  %137 = zext i8 %136 to i32
  %138 = icmp eq i32 %137, 187
  br i1 %138, label %139, label %146

139:                                              ; preds = %133
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i64 2
  %142 = load i8, ptr %141, align 1, !tbaa !16
  %143 = zext i8 %142 to i32
  %144 = icmp eq i32 %143, 191
  br i1 %144, label %145, label %146

145:                                              ; preds = %139
  store i32 3, ptr %12, align 4, !tbaa !15
  br label %146

146:                                              ; preds = %145, %139, %133, %127
  br label %147

147:                                              ; preds = %146, %119
  br label %148

148:                                              ; preds = %147, %52
  %149 = load ptr, ptr %13, align 8, !tbaa !5
  %150 = icmp ne ptr %149, null
  br i1 %150, label %158, label %151

151:                                              ; preds = %148
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = icmp ne ptr %152, null
  br i1 %153, label %154, label %157

154:                                              ; preds = %151
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.XMLResults, ptr %155, i32 0, i32 0
  store i32 14, ptr %156, align 4, !tbaa !14
  br label %157

157:                                              ; preds = %154, %151
  call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  store i32 1, ptr %10, align 4
  br label %169

158:                                              ; preds = %148
  store i1 false, ptr %15, align 1
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = load i32, ptr %12, align 4, !tbaa !15
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i8, ptr %159, i64 %161
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7XMLNode11parseStringEPKcS1_P10XMLResults(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %0, ptr noundef %162, ptr noundef %163, ptr noundef %164)
  %165 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %165) #7
  store i1 true, ptr %15, align 1
  store i32 1, ptr %10, align 4
  %166 = load i1, ptr %15, align 1
  br i1 %166, label %168, label %167

167:                                              ; preds = %158
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #7
  br label %168

168:                                              ; preds = %167, %158
  br label %169

169:                                              ; preds = %168, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %170

170:                                              ; preds = %169, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %171

171:                                              ; preds = %170, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7XMLNode11parseStringEPKcS1_P10XMLResults(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef, ptr noundef, ptr noundef) #1 align 2

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #6

declare i64 @ftell(ptr noundef) #6

declare void @_ZN7XMLNodeD1Ev(ptr)

declare void @_ZN7XMLNodeC1ERKS_(ptr, ptr)

attributes #0 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 4}
!10 = !{!"_ZTS10XMLResults", !11, i64 0, !12, i64 4, !12, i64 8}
!11 = !{!"_ZTS8XMLError", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{!10, !11, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.XMLNode = type { ptr }

@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL18guessWideCharChars = external hidden local_unnamed_addr global i8, align 1
@_ZN7XMLNode12emptyXMLNodeE = external dso_local global %struct.XMLNode, align 8

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_Z16myIsTextWideCharPKvi(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z21myWideCharToMultiBytePKw(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef ptr @_ZL6xfopenPKcS0_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7XMLNode9parseFileEPKcS1_P10XMLResults(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 align 2 {
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %5, label %.thread

5:                                                ; preds = %4
  %6 = tail call noundef ptr @_ZL6xfopenPKcS0_(ptr noundef %1, ptr noundef nonnull @.str.23)
  %7 = icmp eq ptr %6, null
  br i1 %7, label %13, label %14

.thread:                                          ; preds = %4
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 0, ptr %8, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 0, ptr %9, align 4, !tbaa !11
  %10 = tail call noundef ptr @_ZL6xfopenPKcS0_(ptr noundef %1, ptr noundef nonnull @.str.23)
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %.thread
  store i32 10, ptr %3, align 4, !tbaa !12
  br label %13

13:                                               ; preds = %5, %12
  tail call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  br label %66

14:                                               ; preds = %.thread, %5
  %15 = phi ptr [ %10, %.thread ], [ %6, %5 ]
  %16 = tail call i32 @fseek(ptr noundef nonnull %15, i64 noundef 0, i32 noundef 2)
  %17 = tail call i64 @ftell(ptr noundef nonnull %15)
  %18 = and i64 %17, 4294967295
  %.not54 = icmp eq i64 %18, 0
  br i1 %.not54, label %19, label %23

19:                                               ; preds = %14
  br i1 %.not, label %21, label %20

20:                                               ; preds = %19
  store i32 3, ptr %3, align 4, !tbaa !12
  br label %21

21:                                               ; preds = %20, %19
  %22 = tail call i32 @fclose(ptr noundef nonnull %15)
  tail call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  br label %66

23:                                               ; preds = %14
  %24 = tail call i32 @fseek(ptr noundef nonnull %15, i64 noundef 0, i32 noundef 0)
  %25 = shl i64 %17, 32
  %sext = add i64 %25, 17179869184
  %26 = ashr exact i64 %sext, 32
  %27 = tail call noalias ptr @malloc(i64 noundef %26) #6
  %28 = ashr exact i64 %25, 32
  %29 = tail call i64 @fread(ptr noundef %27, i64 noundef 1, i64 noundef %28, ptr noundef nonnull %15)
  %30 = tail call i32 @fclose(ptr noundef nonnull %15)
  %sext56 = shl i64 %29, 32
  %31 = ashr exact i64 %sext56, 32
  %32 = getelementptr inbounds i8, ptr %27, i64 %31
  store i8 0, ptr %32, align 1, !tbaa !13
  %sext57 = add i64 %sext56, 4294967296
  %33 = ashr exact i64 %sext57, 32
  %34 = getelementptr inbounds i8, ptr %27, i64 %33
  store i8 0, ptr %34, align 1, !tbaa !13
  %sext58 = add i64 %sext56, 8589934592
  %35 = ashr exact i64 %sext58, 32
  %36 = getelementptr inbounds i8, ptr %27, i64 %35
  store i8 0, ptr %36, align 1, !tbaa !13
  %sext59 = add i64 %sext56, 12884901888
  %37 = ashr exact i64 %sext59, 32
  %38 = getelementptr inbounds i8, ptr %27, i64 %37
  store i8 0, ptr %38, align 1, !tbaa !13
  %39 = load i8, ptr @_ZL18guessWideCharChars, align 1, !tbaa !13
  %.not60 = icmp eq i8 %39, 0
  br i1 %.not60, label %.thread68, label %40

40:                                               ; preds = %23
  %41 = trunc i64 %29 to i32
  %42 = tail call noundef signext i8 @_Z16myIsTextWideCharPKvi(ptr noundef nonnull %27, i32 noundef %41)
  %.not61 = icmp eq i8 %42, 0
  %43 = load i8, ptr %27, align 1, !tbaa !13
  br i1 %.not61, label %46, label %44

44:                                               ; preds = %40
  switch i8 %43, label %59 [
    i8 -17, label %.sink.split
    i8 -1, label %45
  ]

45:                                               ; preds = %44
  br label %.sink.split

46:                                               ; preds = %40
  %47 = icmp eq i8 %43, -17
  br i1 %47, label %48, label %.thread68

48:                                               ; preds = %46
  %49 = getelementptr inbounds i8, ptr %27, i64 1
  %50 = load i8, ptr %49, align 1, !tbaa !13
  %51 = icmp eq i8 %50, -69
  br i1 %51, label %52, label %.thread68

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %27, i64 2
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = icmp eq i8 %54, -65
  %spec.select64 = select i1 %55, i64 3, i64 0
  br label %.thread68

.sink.split:                                      ; preds = %44, %45
  %.sink75 = phi i8 [ -2, %45 ], [ -1, %44 ]
  %56 = getelementptr inbounds i8, ptr %27, i64 1
  %57 = load i8, ptr %56, align 1, !tbaa !13
  %58 = icmp eq i8 %57, %.sink75
  %spec.select63 = select i1 %58, i64 2, i64 0
  br label %59

59:                                               ; preds = %.sink.split, %44
  %.1 = phi i64 [ 0, %44 ], [ %spec.select63, %.sink.split ]
  %60 = getelementptr inbounds i8, ptr %27, i64 %.1
  %61 = tail call noundef ptr @_Z21myWideCharToMultiBytePKw(ptr noundef nonnull %60)
  tail call void @free(ptr noundef nonnull %27) #7
  %.not62 = icmp eq ptr %61, null
  br i1 %.not62, label %62, label %.thread68

62:                                               ; preds = %59
  br i1 %.not, label %64, label %63

63:                                               ; preds = %62
  store i32 14, ptr %3, align 4, !tbaa !12
  br label %64

64:                                               ; preds = %63, %62
  tail call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  br label %66

.thread68:                                        ; preds = %52, %23, %46, %48, %59
  %.073 = phi ptr [ %61, %59 ], [ %27, %48 ], [ %27, %46 ], [ %27, %23 ], [ %27, %52 ]
  %.272 = phi i64 [ 0, %59 ], [ 0, %48 ], [ 0, %46 ], [ 0, %23 ], [ %spec.select64, %52 ]
  %65 = getelementptr inbounds i8, ptr %.073, i64 %.272
  tail call void @_ZN7XMLNode11parseStringEPKcS1_P10XMLResults(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %0, ptr noundef nonnull %65, ptr noundef %2, ptr noundef %3)
  tail call void @free(ptr noundef nonnull %.073) #7
  br label %66

66:                                               ; preds = %21, %.thread68, %64, %13
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7XMLNode11parseStringEPKcS1_P10XMLResults(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #5

declare void @_ZN7XMLNodeC1ERKS_(ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 4}
!6 = !{!"_ZTS10XMLResults", !7, i64 0, !10, i64 4, !10, i64 8}
!7 = !{!"_ZTS8XMLError", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !7, i64 0}
!13 = !{!8, !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass