; LLVM IR from HiroIshida/tinyfk :: urdf_parser/tinyxml/tinyxml.ll (ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding)

; 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"

%class.TiXmlBase = type { ptr, %struct.TiXmlCursor, ptr }
%struct.TiXmlCursor = type { i32, i32 }

@.str.2 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding = external hidden unnamed_addr constant [52 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9TiXmlNode5ClearEv(ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157), i32 noundef, ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %0, ptr noundef %1, i32 noundef %2) #4 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %15 = load ptr, ptr %5, align 8
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %19, label %18

18:                                               ; preds = %3
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %15, i32 noundef 2, ptr noundef null, ptr noundef null, i32 noundef 0)
  store i1 false, ptr %4, align 1
  br label %131

19:                                               ; preds = %3
  call void @_ZN9TiXmlNode5ClearEv(ptr noundef nonnull align 8 dereferenceable(104) %15)
  %20 = getelementptr inbounds %class.TiXmlBase, ptr %15, i32 0, i32 1
  call void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8) %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !11
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call i32 @fseek(ptr noundef %21, i64 noundef 0, i32 noundef 2)
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call i64 @ftell(ptr noundef %23)
  store i64 %24, ptr %8, align 8, !tbaa !11
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call i32 @fseek(ptr noundef %25, i64 noundef 0, i32 noundef 0)
  %27 = load i64, ptr %8, align 8, !tbaa !11
  %28 = icmp sle i64 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %19
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %15, i32 noundef 12, ptr noundef null, ptr noundef null, i32 noundef 0)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %130

30:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %31 = load i64, ptr %8, align 8, !tbaa !11
  %32 = add nsw i64 %31, 1
  %33 = call noalias noundef nonnull ptr @_Znam(i64 noundef %32) #8
  store ptr %33, ptr %10, align 8, !tbaa !5
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 0
  store i8 0, ptr %35, align 1, !tbaa !13
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load i64, ptr %8, align 8, !tbaa !11
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call i64 @fread(ptr noundef %36, i64 noundef %37, i64 noundef 1, ptr noundef %38)
  %40 = icmp ne i64 %39, 1
  br i1 %40, label %41, label %46

41:                                               ; preds = %30
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = icmp eq ptr %42, null
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  call void @_ZdaPv(ptr noundef %42) #9
  br label %45

45:                                               ; preds = %44, %41
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %15, i32 noundef 2, ptr noundef null, ptr noundef null, i32 noundef 0)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %129

46:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %47, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %48, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  store i8 13, ptr %13, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  store i8 10, ptr %14, align 1, !tbaa !13
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load i64, ptr %8, align 8, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %49, i64 %50
  store i8 0, ptr %51, align 1, !tbaa !13
  br label %52

52:                                               ; preds = %105, %46
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = icmp ne i8 %54, 0
  br i1 %55, label %56, label %106

56:                                               ; preds = %52
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load i64, ptr %8, align 8, !tbaa !11
  %60 = getelementptr inbounds i8, ptr %58, i64 %59
  %61 = icmp ult ptr %57, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %56
  br label %65

63:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.2, i32 noundef 1059, ptr noundef @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #10
  unreachable

64:                                               ; No predecessors!
  br label %65

65:                                               ; preds = %64, %62
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = load i64, ptr %8, align 8, !tbaa !11
  %69 = getelementptr inbounds i8, ptr %67, i64 %68
  %70 = icmp ule ptr %66, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %65
  br label %74

72:                                               ; preds = %65
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.2, i32 noundef 1060, ptr noundef @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #10
  unreachable

73:                                               ; No predecessors!
  br label %74

74:                                               ; preds = %73, %71
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = icmp ule ptr %75, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %74
  br label %81

79:                                               ; preds = %74
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str.2, i32 noundef 1061, ptr noundef @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #10
  unreachable

80:                                               ; No predecessors!
  br label %81

81:                                               ; preds = %80, %78
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = load i8, ptr %82, align 1, !tbaa !13
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 13
  br i1 %85, label %86, label %99

86:                                               ; preds = %81
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i32 1
  store ptr %88, ptr %12, align 8, !tbaa !5
  store i8 10, ptr %87, align 1, !tbaa !13
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i32 1
  store ptr %90, ptr %11, align 8, !tbaa !5
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = load i8, ptr %91, align 1, !tbaa !13
  %93 = sext i8 %92 to i32
  %94 = icmp eq i32 %93, 10
  br i1 %94, label %95, label %98

95:                                               ; preds = %86
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i32 1
  store ptr %97, ptr %11, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %95, %86
  br label %105

99:                                               ; preds = %81
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i32 1
  store ptr %101, ptr %11, align 8, !tbaa !5
  %102 = load i8, ptr %100, align 1, !tbaa !13
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i32 1
  store ptr %104, ptr %12, align 8, !tbaa !5
  store i8 %102, ptr %103, align 1, !tbaa !13
  br label %105

105:                                              ; preds = %99, %98
  br label %52, !llvm.loop !14

106:                                              ; preds = %52
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = load i64, ptr %8, align 8, !tbaa !11
  %110 = getelementptr inbounds i8, ptr %108, i64 %109
  %111 = icmp ule ptr %107, %110
  br i1 %111, label %112, label %113

112:                                              ; preds = %106
  br label %115

113:                                              ; preds = %106
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.2, i32 noundef 1074, ptr noundef @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #10
  unreachable

114:                                              ; No predecessors!
  br label %115

115:                                              ; preds = %114, %112
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 0, ptr %116, align 1, !tbaa !13
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = load i32, ptr %7, align 4, !tbaa !9
  %119 = load ptr, ptr %15, align 8, !tbaa !16
  %120 = getelementptr inbounds ptr, ptr %119, i64 3
  %121 = load ptr, ptr %120, align 8
  %122 = call noundef ptr %121(ptr noundef nonnull align 8 dereferenceable(157) %15, ptr noundef %117, ptr noundef null, i32 noundef %118)
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %126, label %125

125:                                              ; preds = %115
  call void @_ZdaPv(ptr noundef %123) #9
  br label %126

126:                                              ; preds = %125, %115
  %127 = call noundef zeroext i1 @_ZNK13TiXmlDocument5ErrorEv(ptr noundef nonnull align 8 dereferenceable(157) %15)
  %128 = xor i1 %127, true
  store i1 %128, ptr %4, align 1
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %129

129:                                              ; preds = %126, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %130

130:                                              ; preds = %129, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %131

131:                                              ; preds = %130, %18
  %132 = load i1, ptr %4, align 1
  ret i1 %132
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8)) #1 align 2

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

declare i64 @ftell(ptr noundef) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK13TiXmlDocument5ErrorEv(ptr noundef nonnull align 8 dereferenceable(157)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn 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 #3 = { "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 = { 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 = { nobuiltin 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 #6 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }
attributes #10 = { noreturn 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS13TiXmlEncoding", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, 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"

@.str.2 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding = external hidden unnamed_addr constant [52 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9TiXmlNode5ClearEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #0 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157), i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #3 align 2 {
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %3
  tail call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %0, i32 noundef 2, ptr noundef null, ptr noundef null, i32 noundef 0)
  br label %46

5:                                                ; preds = %3
  tail call void @_ZN9TiXmlNode5ClearEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %7 = tail call i32 @fseek(ptr noundef nonnull %1, i64 noundef 0, i32 noundef 2)
  %8 = tail call i64 @ftell(ptr noundef nonnull %1)
  %9 = tail call i32 @fseek(ptr noundef nonnull %1, i64 noundef 0, i32 noundef 0)
  %10 = icmp slt i64 %8, 1
  br i1 %10, label %11, label %12

11:                                               ; preds = %5
  tail call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %0, i32 noundef 12, ptr noundef null, ptr noundef null, i32 noundef 0)
  br label %46

12:                                               ; preds = %5
  %13 = add nuw nsw i64 %8, 1
  %14 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %13) #7
  store i8 0, ptr %14, align 1, !tbaa !5
  %15 = tail call i64 @fread(ptr noundef nonnull %14, i64 noundef %8, i64 noundef 1, ptr noundef nonnull %1)
  %.not47 = icmp eq i64 %15, 1
  br i1 %.not47, label %17, label %16

16:                                               ; preds = %12
  tail call void @_ZdaPv(ptr noundef nonnull %14) #8
  tail call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %0, i32 noundef 2, ptr noundef null, ptr noundef null, i32 noundef 0)
  br label %46

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %14, i64 %8
  store i8 0, ptr %18, align 1, !tbaa !5
  %19 = load i8, ptr %14, align 1, !tbaa !5
  %.not4855 = icmp eq i8 %19, 0
  br i1 %.not4855, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17, %36
  %20 = phi i8 [ %37, %36 ], [ %19, %17 ]
  %.03957 = phi ptr [ %.140, %36 ], [ %14, %17 ]
  %.04156 = phi ptr [ %.142, %36 ], [ %14, %17 ]
  %21 = icmp ult ptr %.04156, %18
  br i1 %21, label %23, label %22

22:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.2, i32 noundef 1059, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #9
  unreachable

23:                                               ; preds = %.lr.ph
  %.not50 = icmp ugt ptr %.03957, %18
  br i1 %.not50, label %24, label %25

24:                                               ; preds = %23
  tail call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.2, i32 noundef 1060, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #9
  unreachable

25:                                               ; preds = %23
  %.not51 = icmp ugt ptr %.03957, %.04156
  br i1 %.not51, label %26, label %27

26:                                               ; preds = %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.2, i32 noundef 1061, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #9
  unreachable

27:                                               ; preds = %25
  %28 = icmp eq i8 %20, 13
  br i1 %28, label %29, label %34

29:                                               ; preds = %27
  store i8 10, ptr %.03957, align 1, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %.04156, i64 1
  %31 = load i8, ptr %30, align 1, !tbaa !5
  %32 = icmp eq i8 %31, 10
  %33 = getelementptr inbounds i8, ptr %.04156, i64 2
  %spec.select = select i1 %32, ptr %33, ptr %30
  br label %36

34:                                               ; preds = %27
  %35 = getelementptr inbounds i8, ptr %.04156, i64 1
  store i8 %20, ptr %.03957, align 1, !tbaa !5
  br label %36

36:                                               ; preds = %29, %34
  %.142 = phi ptr [ %35, %34 ], [ %spec.select, %29 ]
  %.140 = getelementptr inbounds i8, ptr %.03957, i64 1
  %37 = load i8, ptr %.142, align 1, !tbaa !5
  %.not48 = icmp eq i8 %37, 0
  br i1 %.not48, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %36, %17
  %.039.lcssa = phi ptr [ %14, %17 ], [ %.140, %36 ]
  %.not49 = icmp ugt ptr %.039.lcssa, %18
  br i1 %.not49, label %38, label %39

38:                                               ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.2, i32 noundef 1074, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13TiXmlDocument8LoadFileEP8_IO_FILE13TiXmlEncoding) #9
  unreachable

39:                                               ; preds = %._crit_edge
  store i8 0, ptr %.039.lcssa, align 1, !tbaa !5
  %40 = load ptr, ptr %0, align 8, !tbaa !10
  %41 = getelementptr inbounds i8, ptr %40, i64 24
  %42 = load ptr, ptr %41, align 8
  %43 = tail call noundef ptr %42(ptr noundef nonnull align 8 dereferenceable(157) %0, ptr noundef nonnull %14, ptr noundef null, i32 noundef %2)
  tail call void @_ZdaPv(ptr noundef nonnull %14) #8
  %44 = tail call noundef zeroext i1 @_ZNK13TiXmlDocument5ErrorEv(ptr noundef nonnull align 8 dereferenceable(157) %0)
  %45 = xor i1 %44, true
  br label %46

46:                                               ; preds = %11, %39, %16, %4
  %.2 = phi i1 [ false, %4 ], [ false, %11 ], [ false, %16 ], [ %45, %39 ]
  ret i1 %.2
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #5

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK13TiXmlDocument5ErrorEv(ptr noundef nonnull align 8 dereferenceable(157)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { noreturn 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 #2 = { "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 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 = { 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 #5 = { nobuiltin 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 #6 = { nobuiltin 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 #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { noreturn 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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"vtable pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass