; LLVM IR from chensoft/libsocket :: lib/libchen/src/data (json)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.8 }
%union.anon.8 = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::istreambuf_iterator" = type <{ ptr, i32, [4 x i8] }>
%"class.chen::iterator::erasure" = type { ptr }
%"class.std::error_code" = type { i32, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZTIN4chen4json5errorE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTISt9exception = external constant ptr
@.str.1 = external hidden unnamed_addr constant [20 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #1

declare ptr @__cxa_begin_catch(ptr)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt9basic_iosIcSt11char_traitsIcEE10exceptionsESt12_Ios_Iostate(ptr noundef nonnull align 8 dereferenceable(264), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZStorSt12_Ios_IostateS_(i32 noundef, i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2ERSi(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2ISt19istreambuf_iteratorIcSt11char_traitsIcEEEET_(ptr noundef nonnull align 8 dereferenceable(8), ptr, i32) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3 align 2

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen3str6formatIJPKcS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_DpT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef, ptr noundef) #4 align 2

declare { i32, ptr } @_ZN4chen3sys5errorEv() #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt10error_code7messageB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen4json5errorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #8

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @__cxa_free_exception(ptr)

declare void @__cxa_end_catch()

declare void @__cxa_rethrow()

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2IN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEET_(ptr noundef nonnull align 8 dereferenceable(8), ptr) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4chen4json8validateERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca %"class.std::basic_ifstream", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::istreambuf_iterator", align 8
  %9 = alloca %"class.chen::iterator::erasure", align 8
  %10 = alloca %"class.std::istreambuf_iterator", align 8
  %11 = alloca %"class.chen::iterator::erasure", align 8
  %12 = alloca %"class.std::istreambuf_iterator", align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::error_code", align 8
  %17 = alloca i1, align 1
  %18 = alloca ptr, align 8
  %19 = alloca %"class.chen::iterator::erasure", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.chen::iterator::erasure", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %23 = zext i1 %1 to i8
  store i8 %23, ptr %4, align 1, !tbaa !9
  %24 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %123

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 520, ptr %5) #9
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(256) %5)
          to label %27 unwind label %49

27:                                               ; preds = %26
  %28 = load ptr, ptr %5, align 8, !tbaa !13
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %5, i64 %30
  %32 = invoke noundef i32 @_ZStorSt12_Ios_IostateS_(i32 noundef 1, i32 noundef 4)
          to label %33 unwind label %53

33:                                               ; preds = %27
  invoke void @_ZNSt9basic_iosIcSt11char_traitsIcEE10exceptionsESt12_Ios_Iostate(ptr noundef nonnull align 8 dereferenceable(264) %31, i32 noundef %32)
          to label %34 unwind label %53

34:                                               ; preds = %33
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %35) #9
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %5, ptr noundef %36, i32 noundef 4)
          to label %37 unwind label %53

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #9
  call void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2ERSi(ptr noundef nonnull align 8 dereferenceable(12) %8, ptr noundef nonnull align 8 dereferenceable(16) %5) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %8, i64 16, i1 false)
  %38 = getelementptr inbounds { ptr, i32 }, ptr %10, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8
  %40 = getelementptr inbounds { ptr, i32 }, ptr %10, i32 0, i32 1
  %41 = load i32, ptr %40, align 8
  invoke void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2ISt19istreambuf_iteratorIcSt11char_traitsIcEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr %39, i32 %41)
          to label %42 unwind label %57

42:                                               ; preds = %37
  call void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %12) #9
  %43 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8
  %45 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 1
  %46 = load i32, ptr %45, align 8
  invoke void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2ISt19istreambuf_iteratorIcSt11char_traitsIcEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr %44, i32 %46)
          to label %47 unwind label %61

47:                                               ; preds = %42
  invoke void @_ZN4chen4json8validateENS_8iterator7erasureISt18input_iterator_tagKhS4_PS4_lEES6_(ptr noundef %9, ptr noundef %11)
          to label %48 unwind label %65

48:                                               ; preds = %47
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %5) #9
  call void @llvm.lifetime.end.p0(i64 520, ptr %5) #9
  br label %122

49:                                               ; preds = %26
  %50 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %6, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %7, align 4
  br label %72

53:                                               ; preds = %34, %33, %27
  %54 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %6, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %7, align 4
  br label %71

57:                                               ; preds = %37
  %58 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %6, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %7, align 4
  br label %70

61:                                               ; preds = %42
  %62 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  br label %69

65:                                               ; preds = %47
  %66 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %6, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %7, align 4
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  br label %69

69:                                               ; preds = %65, %61
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  br label %70

70:                                               ; preds = %69, %57
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  br label %71

71:                                               ; preds = %70, %53
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %5) #9
  br label %72

72:                                               ; preds = %71, %49
  call void @llvm.lifetime.end.p0(i64 520, ptr %5) #9
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %7, align 4
  %75 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN4chen4json5errorE) #9
  %76 = icmp eq i32 %74, %75
  br i1 %76, label %77, label %80

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %78 = load ptr, ptr %6, align 8
  %79 = call ptr @__cxa_begin_catch(ptr %78) #9
  store ptr %79, ptr %18, align 8
  invoke void @__cxa_rethrow() #10
          to label %154 unwind label %117

80:                                               ; preds = %73
  %81 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #9
  %82 = icmp eq i32 %74, %81
  br i1 %82, label %83, label %146

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %84 = load ptr, ptr %6, align 8
  %85 = call ptr @__cxa_begin_catch(ptr %84) #9
  store ptr %85, ptr %13, align 8
  store i1 true, ptr %17, align 1
  %86 = call ptr @__cxa_allocate_exception(i64 24) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #9
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %87) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #9
  %89 = invoke { i32, ptr } @_ZN4chen3sys5errorEv()
          to label %90 unwind label %99

90:                                               ; preds = %83
  %91 = getelementptr inbounds { i32, ptr }, ptr %16, i32 0, i32 0
  %92 = extractvalue { i32, ptr } %89, 0
  store i32 %92, ptr %91, align 8
  %93 = getelementptr inbounds { i32, ptr }, ptr %16, i32 0, i32 1
  %94 = extractvalue { i32, ptr } %89, 1
  store ptr %94, ptr %93, align 8
  invoke void @_ZNKSt10error_code7messageB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %95 unwind label %99

95:                                               ; preds = %90
  %96 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #9
  invoke void @_ZN4chen3str6formatIJPKcS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_DpT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef @.str.1, ptr noundef %88, ptr noundef %96)
          to label %97 unwind label %103

97:                                               ; preds = %95
  invoke void @_ZN4chen4json5errorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %98 unwind label %107

98:                                               ; preds = %97
  store i1 false, ptr %17, align 1
  invoke void @__cxa_throw(ptr %86, ptr @_ZTIN4chen4json5errorE, ptr @_ZNSt13runtime_errorD2Ev) #10
          to label %154 unwind label %107

99:                                               ; preds = %90, %83
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %6, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %7, align 4
  br label %112

103:                                              ; preds = %95
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %6, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %7, align 4
  br label %111

107:                                              ; preds = %98, %97
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %6, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #9
  br label %111

111:                                              ; preds = %107, %103
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #9
  br label %112

112:                                              ; preds = %111, %99
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #9
  %113 = load i1, ptr %17, align 1
  br i1 %113, label %114, label %115

114:                                              ; preds = %112
  call void @__cxa_free_exception(ptr %86) #9
  br label %115

115:                                              ; preds = %114, %112
  invoke void @__cxa_end_catch()
          to label %116 unwind label %151

116:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %146

117:                                              ; preds = %77
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %6, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %7, align 4
  invoke void @__cxa_end_catch()
          to label %121 unwind label %151

121:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  br label %146

122:                                              ; preds = %48
  br label %145

123:                                              ; preds = %2
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = call ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %124) #9
  %126 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %125, ptr %126, align 8
  %127 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2IN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr %128)
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = call ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %129) #9
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  %132 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8
  invoke void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2IN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr %133)
          to label %134 unwind label %136

134:                                              ; preds = %123
  invoke void @_ZN4chen4json8validateENS_8iterator7erasureISt18input_iterator_tagKhS4_PS4_lEES6_(ptr noundef %19, ptr noundef %21)
          to label %135 unwind label %140

135:                                              ; preds = %134
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #9
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #9
  br label %145

136:                                              ; preds = %123
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %6, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %7, align 4
  br label %144

140:                                              ; preds = %134
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %6, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %7, align 4
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #9
  br label %144

144:                                              ; preds = %140, %136
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #9
  br label %146

145:                                              ; preds = %135, %122
  ret void

146:                                              ; preds = %144, %121, %116, %80
  %147 = load ptr, ptr %6, align 8
  %148 = load i32, ptr %7, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150

151:                                              ; preds = %117, %115
  %152 = landingpad { ptr, i32 }
          catch ptr null
  %153 = extractvalue { ptr, i32 } %152, 0
  call void @__clang_call_terminate(ptr %153) #11
  unreachable

154:                                              ; preds = %98, %77
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen4json8validateENS_8iterator7erasureISt18input_iterator_tagKhS4_PS4_lEES6_(ptr noundef, ptr noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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 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 = { 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 = { inlinehint 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 #6 = { nounwind memory(none) }
attributes #7 = { "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 #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn }
attributes #11 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.8 }
%union.anon.8 = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::istreambuf_iterator" = type <{ ptr, i32, [4 x i8] }>
%"class.chen::iterator::erasure" = type { ptr }
%"class.std::error_code" = type { i32, ptr }

@_ZTIN4chen4json5errorE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTISt9exception = external constant ptr
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #1

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt9basic_iosIcSt11char_traitsIcEE10exceptionsESt12_Ios_Iostate(ptr noundef nonnull align 8 dereferenceable(264), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZStorSt12_Ios_IostateS_(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2ERSi(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2ISt19istreambuf_iteratorIcSt11char_traitsIcEEEET_(ptr noundef nonnull align 8 dereferenceable(8), ptr, i32) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #2 align 2

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #5

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen3str6formatIJPKcS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_DpT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3 align 2

declare { i32, ptr } @_ZN4chen3sys5errorEv() local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt10error_code7messageB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen4json5errorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #7

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

declare void @__cxa_rethrow() local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2IN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEET_(ptr noundef nonnull align 8 dereferenceable(8), ptr) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4chen4json8validateERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(32) %0, i1 noundef zeroext %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::basic_ifstream", align 8
  %4 = alloca %"class.std::istreambuf_iterator", align 8
  %5 = alloca %"class.chen::iterator::erasure", align 8
  %6 = alloca %"class.chen::iterator::erasure", align 8
  %7 = alloca %"class.std::istreambuf_iterator", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::error_code", align 8
  %11 = alloca %"class.chen::iterator::erasure", align 8
  %12 = alloca %"class.chen::iterator::erasure", align 8
  br i1 %1, label %13, label %71

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %3) #8
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(256) %3)
          to label %14 unwind label %29

14:                                               ; preds = %13
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr %3, i64 %17
  %19 = call noundef i32 @_ZStorSt12_Ios_IostateS_(i32 noundef 1, i32 noundef 4)
  invoke void @_ZNSt9basic_iosIcSt11char_traitsIcEE10exceptionsESt12_Ios_Iostate(ptr noundef nonnull align 8 dereferenceable(264) %18, i32 noundef %19)
          to label %20 unwind label %31

20:                                               ; preds = %14
  %21 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %3, ptr noundef %21, i32 noundef 4)
          to label %22 unwind label %31

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  call void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2ERSi(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  %.sroa.02.0.copyload = load ptr, ptr %4, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.2.0.copyload = load i32, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2ISt19istreambuf_iteratorIcSt11char_traitsIcEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr %.sroa.02.0.copyload, i32 %.sroa.2.0.copyload)
          to label %23 unwind label %33

23:                                               ; preds = %22
  call void @_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %7) #8
  %24 = load ptr, ptr %7, align 8
  %25 = getelementptr inbounds i8, ptr %7, i64 8
  %26 = load i32, ptr %25, align 8
  invoke void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2ISt19istreambuf_iteratorIcSt11char_traitsIcEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr %24, i32 %26)
          to label %27 unwind label %35

27:                                               ; preds = %23
  invoke void @_ZN4chen4json8validateENS_8iterator7erasureISt18input_iterator_tagKhS4_PS4_lEES6_(ptr noundef nonnull %5, ptr noundef nonnull %6)
          to label %28 unwind label %37

28:                                               ; preds = %27
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %3) #8
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %3) #8
  br label %81

29:                                               ; preds = %13
  %30 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  br label %42

31:                                               ; preds = %20, %14
  %32 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  br label %41

33:                                               ; preds = %22
  %34 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  br label %40

35:                                               ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  br label %39

37:                                               ; preds = %27
  %38 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN4chen4json5errorE
          catch ptr @_ZTISt9exception
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br label %39

39:                                               ; preds = %37, %35
  %.pn24 = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br label %40

40:                                               ; preds = %39, %33
  %.pn24.pn = phi { ptr, i32 } [ %.pn24, %39 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  br label %41

41:                                               ; preds = %40, %31
  %.pn24.pn.pn = phi { ptr, i32 } [ %.pn24.pn, %40 ], [ %32, %31 ]
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %3) #8
  br label %42

42:                                               ; preds = %41, %29
  %.pn24.pn.pn.pn = phi { ptr, i32 } [ %.pn24.pn.pn, %41 ], [ %30, %29 ]
  %.3 = extractvalue { ptr, i32 } %.pn24.pn.pn.pn, 0
  %.315 = extractvalue { ptr, i32 } %.pn24.pn.pn.pn, 1
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %3) #8
  %43 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN4chen4json5errorE) #8
  %44 = icmp eq i32 %.315, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  %46 = call ptr @__cxa_begin_catch(ptr %.3) #8
  invoke void @__cxa_rethrow() #9
          to label %86 unwind label %69

47:                                               ; preds = %42
  %48 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #8
  %49 = icmp eq i32 %.315, %48
  br i1 %49, label %50, label %82

50:                                               ; preds = %47
  %51 = call ptr @__cxa_begin_catch(ptr %.3) #8
  %52 = call ptr @__cxa_allocate_exception(i64 24) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  %53 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  %54 = invoke { i32, ptr } @_ZN4chen3sys5errorEv()
          to label %55 unwind label %.thread

55:                                               ; preds = %50
  %56 = extractvalue { i32, ptr } %54, 0
  store i32 %56, ptr %10, align 8
  %57 = getelementptr inbounds i8, ptr %10, i64 8
  %58 = extractvalue { i32, ptr } %54, 1
  store ptr %58, ptr %57, align 8
  invoke void @_ZNKSt10error_code7messageB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %59 unwind label %.thread

59:                                               ; preds = %55
  %60 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  invoke void @_ZN4chen3str6formatIJPKcS3_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_DpT_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull @.str.1, ptr noundef %53, ptr noundef %60)
          to label %61 unwind label %.thread36

61:                                               ; preds = %59
  invoke void @_ZN4chen4json5errorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(24) %52, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %62 unwind label %65

62:                                               ; preds = %61
  invoke void @__cxa_throw(ptr nonnull %52, ptr nonnull @_ZTIN4chen4json5errorE, ptr nonnull @_ZNSt13runtime_errorD2Ev) #9
          to label %86 unwind label %65

.thread:                                          ; preds = %50, %55
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br label %67

.thread36:                                        ; preds = %59
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br label %67

65:                                               ; preds = %61, %62
  %.020 = phi i1 [ false, %62 ], [ true, %61 ]
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  br i1 %.020, label %67, label %68

67:                                               ; preds = %.thread36, %.thread, %65
  %.pn29.pn35 = phi { ptr, i32 } [ %63, %.thread ], [ %66, %65 ], [ %64, %.thread36 ]
  call void @__cxa_free_exception(ptr %52) #8
  br label %68

68:                                               ; preds = %67, %65
  %.pn29.pn34 = phi { ptr, i32 } [ %.pn29.pn35, %67 ], [ %66, %65 ]
  invoke void @__cxa_end_catch()
          to label %82 unwind label %83

69:                                               ; preds = %45
  %70 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %82 unwind label %83

71:                                               ; preds = %2
  %72 = tail call ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2IN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr %72)
  %73 = call ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #8
  invoke void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lEC2IN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEET_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr %73)
          to label %74 unwind label %76

74:                                               ; preds = %71
  invoke void @_ZN4chen4json8validateENS_8iterator7erasureISt18input_iterator_tagKhS4_PS4_lEES6_(ptr noundef nonnull %11, ptr noundef nonnull %12)
          to label %75 unwind label %78

75:                                               ; preds = %74
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br label %81

76:                                               ; preds = %71
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %80

78:                                               ; preds = %74
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  br label %80

80:                                               ; preds = %78, %76
  %.pn = phi { ptr, i32 } [ %79, %78 ], [ %77, %76 ]
  call void @_ZN4chen8iterator7erasureISt18input_iterator_tagKhS3_PS3_lED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br label %82

81:                                               ; preds = %75, %28
  ret void

82:                                               ; preds = %69, %68, %80, %47
  %.merged = phi { ptr, i32 } [ %.pn24.pn.pn.pn, %47 ], [ %.pn, %80 ], [ %.pn29.pn34, %68 ], [ %70, %69 ]
  resume { ptr, i32 } %.merged

83:                                               ; preds = %69, %68
  %84 = landingpad { ptr, i32 }
          catch ptr null
  %85 = extractvalue { ptr, i32 } %84, 0
  call void @__clang_call_terminate(ptr %85) #10
  unreachable

86:                                               ; preds = %62, %45
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chen4json8validateENS_8iterator7erasureISt18input_iterator_tagKhS4_PS4_lEES6_(ptr noundef, ptr noundef) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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 = { inlinehint 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 #5 = { nofree nosync nounwind memory(none) }
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 "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 #8 = { nounwind }
attributes #9 = { noreturn }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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