; LLVM IR from gulrak/filesystem :: test/filesystem_test.ll (ZNK5Catch9XmlEncode8encodeToERSo)

; 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.Catch::XmlEncode" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }

@.str.233 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.235 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.236 = 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK5Catch9XmlEncode8encodeToERSo(ptr noundef nonnull align 8 dereferenceable(36) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i64, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %215, %2
  %16 = load i64, ptr %5, align 8, !tbaa !9
  %17 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 0
  %18 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  %19 = icmp ult i64 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %218

21:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  %22 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 0
  %23 = load i64, ptr %5, align 8, !tbaa !9
  %24 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %22, i64 noundef %23) #4
  %25 = load i8, ptr %24, align 1, !tbaa !11
  store i8 %25, ptr %7, align 1, !tbaa !11
  %26 = load i8, ptr %7, align 1, !tbaa !11
  %27 = zext i8 %26 to i32
  switch i32 %27, label %73 [
    i32 60, label %28
    i32 38, label %31
    i32 62, label %34
    i32 34, label %61
  ]

28:                                               ; preds = %21
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef @.str.233)
  br label %214

31:                                               ; preds = %21
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef @.str.234)
  br label %214

34:                                               ; preds = %21
  %35 = load i64, ptr %5, align 8, !tbaa !9
  %36 = icmp ugt i64 %35, 2
  br i1 %36, label %37, label %56

37:                                               ; preds = %34
  %38 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 0
  %39 = load i64, ptr %5, align 8, !tbaa !9
  %40 = sub i64 %39, 1
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %38, i64 noundef %40) #4
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = sext i8 %42 to i32
  %44 = icmp eq i32 %43, 93
  br i1 %44, label %45, label %56

45:                                               ; preds = %37
  %46 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 0
  %47 = load i64, ptr %5, align 8, !tbaa !9
  %48 = sub i64 %47, 2
  %49 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %46, i64 noundef %48) #4
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 %51, 93
  br i1 %52, label %53, label %56

53:                                               ; preds = %45
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef @.str.235)
  br label %60

56:                                               ; preds = %45, %37, %34
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load i8, ptr %7, align 1, !tbaa !11
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8) %57, i8 noundef zeroext %58)
  br label %60

60:                                               ; preds = %56, %53
  br label %214

61:                                               ; preds = %21
  %62 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 1
  %63 = load i32, ptr %62, align 8, !tbaa !12
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %68

65:                                               ; preds = %61
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef @.str.236)
  br label %72

68:                                               ; preds = %61
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = load i8, ptr %7, align 1, !tbaa !11
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8) %69, i8 noundef zeroext %70)
  br label %72

72:                                               ; preds = %68, %65
  br label %214

73:                                               ; preds = %21
  %74 = load i8, ptr %7, align 1, !tbaa !11
  %75 = zext i8 %74 to i32
  %76 = icmp slt i32 %75, 9
  br i1 %76, label %89, label %77

77:                                               ; preds = %73
  %78 = load i8, ptr %7, align 1, !tbaa !11
  %79 = zext i8 %78 to i32
  %80 = icmp sgt i32 %79, 13
  br i1 %80, label %81, label %85

81:                                               ; preds = %77
  %82 = load i8, ptr %7, align 1, !tbaa !11
  %83 = zext i8 %82 to i32
  %84 = icmp slt i32 %83, 32
  br i1 %84, label %89, label %85

85:                                               ; preds = %81, %77
  %86 = load i8, ptr %7, align 1, !tbaa !11
  %87 = zext i8 %86 to i32
  %88 = icmp eq i32 %87, 127
  br i1 %88, label %89, label %92

89:                                               ; preds = %85, %81, %73
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i8, ptr %7, align 1, !tbaa !11
  call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %90, i8 noundef zeroext %91)
  br label %214

92:                                               ; preds = %85
  %93 = load i8, ptr %7, align 1, !tbaa !11
  %94 = zext i8 %93 to i32
  %95 = icmp slt i32 %94, 127
  br i1 %95, label %96, label %100

96:                                               ; preds = %92
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load i8, ptr %7, align 1, !tbaa !11
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8) %97, i8 noundef zeroext %98)
  br label %214

100:                                              ; preds = %92
  %101 = load i8, ptr %7, align 1, !tbaa !11
  %102 = zext i8 %101 to i32
  %103 = icmp slt i32 %102, 192
  br i1 %103, label %108, label %104

104:                                              ; preds = %100
  %105 = load i8, ptr %7, align 1, !tbaa !11
  %106 = zext i8 %105 to i32
  %107 = icmp sge i32 %106, 248
  br i1 %107, label %108, label %111

108:                                              ; preds = %104, %100
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = load i8, ptr %7, align 1, !tbaa !11
  call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %109, i8 noundef zeroext %110)
  br label %214

111:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %112 = load i8, ptr %7, align 1, !tbaa !11
  %113 = call noundef i64 @_ZN5Catch12_GLOBAL__N_113trailingBytesEh(i8 noundef zeroext %112)
  store i64 %113, ptr %8, align 8, !tbaa !9
  %114 = load i64, ptr %5, align 8, !tbaa !9
  %115 = load i64, ptr %8, align 8, !tbaa !9
  %116 = add i64 %114, %115
  %117 = sub i64 %116, 1
  %118 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 0
  %119 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %118) #4
  %120 = icmp uge i64 %117, %119
  br i1 %120, label %121, label %124

121:                                              ; preds = %111
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = load i8, ptr %7, align 1, !tbaa !11
  call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %122, i8 noundef zeroext %123)
  store i32 5, ptr %6, align 4
  br label %213

124:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  store i8 1, ptr %9, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %125 = load i8, ptr %7, align 1, !tbaa !11
  %126 = call noundef i32 @_ZN5Catch12_GLOBAL__N_111headerValueEh(i8 noundef zeroext %125)
  store i32 %126, ptr %10, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 1, ptr %11, align 8, !tbaa !9
  br label %127

127:                                              ; preds = %156, %124
  %128 = load i64, ptr %11, align 8, !tbaa !9
  %129 = load i64, ptr %8, align 8, !tbaa !9
  %130 = icmp ult i64 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  store i32 6, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %159

132:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #4
  %133 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 0
  %134 = load i64, ptr %5, align 8, !tbaa !9
  %135 = load i64, ptr %11, align 8, !tbaa !9
  %136 = add i64 %134, %135
  %137 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %133, i64 noundef %136) #4
  %138 = load i8, ptr %137, align 1, !tbaa !11
  store i8 %138, ptr %12, align 1, !tbaa !11
  %139 = load i8, ptr %12, align 1, !tbaa !11
  %140 = zext i8 %139 to i32
  %141 = and i32 %140, 192
  %142 = icmp eq i32 %141, 128
  %143 = zext i1 %142 to i32
  %144 = load i8, ptr %9, align 1, !tbaa !17, !range !21, !noundef !22
  %145 = trunc i8 %144 to i1
  %146 = zext i1 %145 to i32
  %147 = and i32 %146, %143
  %148 = icmp ne i32 %147, 0
  %149 = zext i1 %148 to i8
  store i8 %149, ptr %9, align 1, !tbaa !17
  %150 = load i32, ptr %10, align 4, !tbaa !19
  %151 = shl i32 %150, 6
  %152 = load i8, ptr %12, align 1, !tbaa !11
  %153 = zext i8 %152 to i32
  %154 = and i32 %153, 63
  %155 = or i32 %151, %154
  store i32 %155, ptr %10, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #4
  br label %156

156:                                              ; preds = %132
  %157 = load i64, ptr %11, align 8, !tbaa !9
  %158 = add i64 %157, 1
  store i64 %158, ptr %11, align 8, !tbaa !9
  br label %127, !llvm.loop !23

159:                                              ; preds = %131
  %160 = load i8, ptr %9, align 1, !tbaa !17, !range !21, !noundef !22
  %161 = trunc i8 %160 to i1
  br i1 %161, label %162, label %186

162:                                              ; preds = %159
  %163 = load i32, ptr %10, align 4, !tbaa !19
  %164 = icmp ult i32 %163, 128
  br i1 %164, label %186, label %165

165:                                              ; preds = %162
  %166 = load i32, ptr %10, align 4, !tbaa !19
  %167 = icmp ule i32 128, %166
  br i1 %167, label %168, label %174

168:                                              ; preds = %165
  %169 = load i32, ptr %10, align 4, !tbaa !19
  %170 = icmp ult i32 %169, 2048
  br i1 %170, label %171, label %174

171:                                              ; preds = %168
  %172 = load i64, ptr %8, align 8, !tbaa !9
  %173 = icmp ugt i64 %172, 2
  br i1 %173, label %186, label %174

174:                                              ; preds = %171, %168, %165
  %175 = load i32, ptr %10, align 4, !tbaa !19
  %176 = icmp ult i32 2048, %175
  br i1 %176, label %177, label %183

177:                                              ; preds = %174
  %178 = load i32, ptr %10, align 4, !tbaa !19
  %179 = icmp ult i32 %178, 65536
  br i1 %179, label %180, label %183

180:                                              ; preds = %177
  %181 = load i64, ptr %8, align 8, !tbaa !9
  %182 = icmp ugt i64 %181, 3
  br i1 %182, label %186, label %183

183:                                              ; preds = %180, %177, %174
  %184 = load i32, ptr %10, align 4, !tbaa !19
  %185 = icmp uge i32 %184, 1114112
  br i1 %185, label %186, label %189

186:                                              ; preds = %183, %180, %171, %162, %159
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = load i8, ptr %7, align 1, !tbaa !11
  call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %187, i8 noundef zeroext %188)
  store i32 5, ptr %6, align 4
  br label %212

189:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %190

190:                                              ; preds = %204, %189
  %191 = load i64, ptr %13, align 8, !tbaa !9
  %192 = load i64, ptr %8, align 8, !tbaa !9
  %193 = icmp ult i64 %191, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %190
  store i32 9, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %207

195:                                              ; preds = %190
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %"class.Catch::XmlEncode", ptr %14, i32 0, i32 0
  %198 = load i64, ptr %5, align 8, !tbaa !9
  %199 = load i64, ptr %13, align 8, !tbaa !9
  %200 = add i64 %198, %199
  %201 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %197, i64 noundef %200) #4
  %202 = load i8, ptr %201, align 1, !tbaa !11
  %203 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %196, i8 noundef signext %202)
  br label %204

204:                                              ; preds = %195
  %205 = load i64, ptr %13, align 8, !tbaa !9
  %206 = add i64 %205, 1
  store i64 %206, ptr %13, align 8, !tbaa !9
  br label %190, !llvm.loop !25

207:                                              ; preds = %194
  %208 = load i64, ptr %8, align 8, !tbaa !9
  %209 = sub i64 %208, 1
  %210 = load i64, ptr %5, align 8, !tbaa !9
  %211 = add i64 %210, %209
  store i64 %211, ptr %5, align 8, !tbaa !9
  store i32 5, ptr %6, align 4
  br label %212

212:                                              ; preds = %207, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  br label %213

213:                                              ; preds = %212, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %214

214:                                              ; preds = %213, %108, %96, %89, %72, %60, %31, %28
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  br label %215

215:                                              ; preds = %214
  %216 = load i64, ptr %5, align 8, !tbaa !9
  %217 = add i64 %216, 1
  store i64 %217, ptr %5, align 8, !tbaa !9
  br label %15, !llvm.loop !26

218:                                              ; preds = %20
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN5Catch12_GLOBAL__N_113trailingBytesEh(i8 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN5Catch12_GLOBAL__N_111headerValueEh(i8 noundef zeroext) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 }

!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 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !16, i64 32}
!13 = !{!"_ZTSN5Catch9XmlEncodeE", !14, i64 0, !16, i64 32}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !10, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!16 = !{!"_ZTSN5Catch9XmlEncode7ForWhatE", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}


; 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.233 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.235 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.236 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK5Catch9XmlEncode8encodeToERSo(ptr noundef nonnull align 8 dereferenceable(36) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) local_unnamed_addr #2 align 2 {
  %3 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %._crit_edge100, label %.lr.ph99

.lr.ph99:                                         ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  br label %5

._crit_edge100:                                   ; preds = %._crit_edge96, %2
  ret void

5:                                                ; preds = %.lr.ph99, %._crit_edge96
  %.08297 = phi i64 [ 0, %.lr.ph99 ], [ %82, %._crit_edge96 ]
  %6 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %.08297) #3
  %7 = load i8, ptr %6, align 1, !tbaa !5
  switch i8 %7, label %35 [
    i8 60, label %8
    i8 38, label %10
    i8 62, label %12
    i8 34, label %28
  ]

8:                                                ; preds = %5
  %9 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull @.str.233)
  br label %._crit_edge96

10:                                               ; preds = %5
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull @.str.234)
  br label %._crit_edge96

12:                                               ; preds = %5
  %13 = icmp ugt i64 %.08297, 2
  br i1 %13, label %14, label %26

14:                                               ; preds = %12
  %15 = add i64 %.08297, -1
  %16 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %15) #3
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = icmp eq i8 %17, 93
  br i1 %18, label %19, label %26

19:                                               ; preds = %14
  %20 = add i64 %.08297, -2
  %21 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %20) #3
  %22 = load i8, ptr %21, align 1, !tbaa !5
  %23 = icmp eq i8 %22, 93
  br i1 %23, label %24, label %26

24:                                               ; preds = %19
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull @.str.235)
  br label %._crit_edge96

26:                                               ; preds = %19, %14, %12
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef zeroext 62)
  br label %._crit_edge96

28:                                               ; preds = %5
  %29 = load i32, ptr %4, align 8, !tbaa !8
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %33

31:                                               ; preds = %28
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull @.str.236)
  br label %._crit_edge96

33:                                               ; preds = %28
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef zeroext 34)
  br label %._crit_edge96

35:                                               ; preds = %5
  %36 = icmp ult i8 %7, 9
  br i1 %36, label %40, label %37

37:                                               ; preds = %35
  %38 = add i8 %7, -14
  %or.cond = icmp ult i8 %38, 18
  %39 = icmp eq i8 %7, 127
  %or.cond5 = or i1 %39, %or.cond
  br i1 %or.cond5, label %40, label %41

40:                                               ; preds = %37, %35
  tail call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef zeroext %7)
  br label %._crit_edge96

41:                                               ; preds = %37
  %42 = icmp ult i8 %7, 127
  br i1 %42, label %43, label %45

43:                                               ; preds = %41
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef zeroext %7)
  br label %._crit_edge96

45:                                               ; preds = %41
  %46 = add i8 %7, 8
  %or.cond8 = icmp ult i8 %46, -56
  br i1 %or.cond8, label %47, label %48

47:                                               ; preds = %45
  tail call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef zeroext %7)
  br label %._crit_edge96

48:                                               ; preds = %45
  %49 = tail call noundef i64 @_ZN5Catch12_GLOBAL__N_113trailingBytesEh(i8 noundef zeroext %7)
  %50 = add i64 %.08297, -1
  %51 = add i64 %50, %49
  %52 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %.not88 = icmp ult i64 %51, %52
  br i1 %.not88, label %54, label %53

53:                                               ; preds = %48
  tail call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef zeroext %7)
  br label %._crit_edge96

54:                                               ; preds = %48
  %55 = tail call noundef i32 @_ZN5Catch12_GLOBAL__N_111headerValueEh(i8 noundef zeroext %7)
  %56 = icmp ugt i64 %49, 1
  br i1 %56, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %54
  %.085.lcssa = phi i1 [ true, %54 ], [ %64, %.lr.ph ]
  %.084.lcssa = phi i32 [ %55, %54 ], [ %67, %.lr.ph ]
  %57 = icmp ugt i32 %.084.lcssa, 127
  %or.cond10.not = select i1 %.085.lcssa, i1 %57, i1 false
  br i1 %or.cond10.not, label %69, label %76

.lr.ph:                                           ; preds = %54, %.lr.ph
  %.08392 = phi i64 [ %68, %.lr.ph ], [ 1, %54 ]
  %.08491 = phi i32 [ %67, %.lr.ph ], [ %55, %54 ]
  %.08590 = phi i1 [ %64, %.lr.ph ], [ true, %54 ]
  %58 = add i64 %.08392, %.08297
  %59 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %58) #3
  %60 = load i8, ptr %59, align 1, !tbaa !5
  %61 = zext i8 %60 to i32
  %62 = and i32 %61, 192
  %63 = icmp eq i32 %62, 128
  %64 = and i1 %.08590, %63
  %65 = shl i32 %.08491, 6
  %66 = and i32 %61, 63
  %67 = or disjoint i32 %66, %65
  %68 = add nuw i64 %.08392, 1
  %exitcond.not = icmp eq i64 %68, %49
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

69:                                               ; preds = %._crit_edge
  %70 = icmp ult i32 %.084.lcssa, 2048
  %71 = icmp ugt i64 %49, 2
  %or.cond14 = and i1 %71, %70
  br i1 %or.cond14, label %76, label %72

72:                                               ; preds = %69
  %73 = add i32 %.084.lcssa, -2049
  %or.cond16 = icmp ult i32 %73, 63487
  %74 = icmp ugt i64 %49, 3
  %or.cond18 = and i1 %74, %or.cond16
  %75 = icmp ugt i32 %.084.lcssa, 1114111
  %or.cond20 = select i1 %or.cond18, i1 true, i1 %75
  br i1 %or.cond20, label %76, label %.preheader

.preheader:                                       ; preds = %72
  %.not101 = icmp eq i64 %49, 0
  br i1 %.not101, label %._crit_edge96, label %.lr.ph95

76:                                               ; preds = %72, %69, %._crit_edge
  tail call void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef zeroext %7)
  br label %._crit_edge96

.lr.ph95:                                         ; preds = %.preheader, %.lr.ph95
  %.094 = phi i64 [ %81, %.lr.ph95 ], [ 0, %.preheader ]
  %77 = add i64 %.094, %.08297
  %78 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %77) #3
  %79 = load i8, ptr %78, align 1, !tbaa !5
  %80 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %1, i8 noundef signext %79)
  %81 = add nuw i64 %.094, 1
  %exitcond103.not = icmp eq i64 %81, %49
  br i1 %exitcond103.not, label %._crit_edge96, label %.lr.ph95, !llvm.loop !17

._crit_edge96:                                    ; preds = %.lr.ph95, %.preheader, %53, %76, %31, %33, %24, %26, %47, %43, %40, %10, %8
  %.3 = phi i64 [ %.08297, %40 ], [ %.08297, %43 ], [ %.08297, %47 ], [ %.08297, %31 ], [ %.08297, %33 ], [ %.08297, %24 ], [ %.08297, %26 ], [ %.08297, %10 ], [ %.08297, %8 ], [ %.08297, %53 ], [ %.08297, %76 ], [ %51, %.preheader ], [ %51, %.lr.ph95 ]
  %82 = add i64 %.3, 1
  %83 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %84 = icmp ult i64 %82, %83
  br i1 %84, label %5, label %._crit_edge100, !llvm.loop !18
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5Catch12_GLOBAL__N_113hexEscapeCharERSoh(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN5Catch12_GLOBAL__N_113trailingBytesEh(i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN5Catch12_GLOBAL__N_111headerValueEh(i8 noundef zeroext) local_unnamed_addr #2

attributes #0 = { 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 #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 = { 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 #3 = { 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 = !{!9, !14, i64 32}
!9 = !{!"_ZTSN5Catch9XmlEncodeE", !10, i64 0, !14, i64 32}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !11, i64 0, !13, i64 8, !6, i64 16}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!12 = !{!"any pointer", !6, i64 0}
!13 = !{!"long", !6, i64 0}
!14 = !{!"_ZTSN5Catch9XmlEncode7ForWhatE", !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


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