; LLVM IR from BehaviorTree/BehaviorTree.CPP :: 3rdparty/lexy/src/input/file.ll (ZN4lexy7_detail9read_fileEPKcPFvPvS2_mES3_)

; 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.(anonymous namespace)::raii_fd" = type { i32 }
%"class.lexy::buffer<>::builder" = type { %"class.lexy::buffer" }
%"class.lexy::buffer" = type { ptr, i64 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4lexy7_detail9read_fileEPKcPFvPvS2_mES3_(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.(anonymous namespace)::raii_fd", align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca [4096 x i8], align 16
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.lexy::buffer<>::builder", align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i32 (ptr, i32, ...) @open(ptr noundef %17, i32 noundef 0)
  call void @_ZN12_GLOBAL__N_17raii_fdC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef %18) #6
  %19 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  %20 = icmp slt i32 %19, 0
  br i1 %20, label %21, label %23

21:                                               ; preds = %3
  %22 = call noundef i32 @_ZN12_GLOBAL__N_114get_file_errorEv() #6
  store i32 %22, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %127

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %24 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  %25 = call i64 @lseek(i32 noundef %24, i64 noundef 0, i32 noundef 2) #6
  store i64 %25, ptr %10, align 8, !tbaa !9
  %26 = load i64, ptr %10, align 8, !tbaa !9
  %27 = icmp eq i64 %26, -1
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %126

29:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %30 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %30, ptr %11, align 8, !tbaa !9
  %31 = load i64, ptr %11, align 8, !tbaa !9
  %32 = icmp ule i64 %31, 4096
  br i1 %32, label %33, label %60

33:                                               ; preds = %29
  %34 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  %35 = call i64 @lseek(i32 noundef %34, i64 noundef 0, i32 noundef 0) #6
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %33
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %124

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4096, ptr %12) #6
  %39 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  %40 = getelementptr inbounds [4096 x i8], ptr %12, i64 0, i64 0
  %41 = load i64, ptr %11, align 8, !tbaa !9
  %42 = invoke i64 @read(i32 noundef %39, ptr noundef %40, i64 noundef %41)
          to label %43 unwind label %47

43:                                               ; preds = %38
  %44 = load i64, ptr %11, align 8, !tbaa !9
  %45 = icmp ne i64 %42, %44
  br i1 %45, label %46, label %51

46:                                               ; preds = %43
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %57

47:                                               ; preds = %51, %38
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %13, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4096, ptr %12) #6
  br label %125

51:                                               ; preds = %43
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds [4096 x i8], ptr %12, i64 0, i64 0
  %55 = load i64, ptr %11, align 8, !tbaa !9
  invoke void %52(ptr noundef %53, ptr noundef %54, i64 noundef %55)
          to label %56 unwind label %47

56:                                               ; preds = %51
  store i32 0, ptr %9, align 4
  br label %57

57:                                               ; preds = %56, %46
  call void @llvm.lifetime.end.p0(i64 4096, ptr %12) #6
  %58 = load i32, ptr %9, align 4
  switch i32 %58, label %124 [
    i32 0, label %59
  ]

59:                                               ; preds = %57
  br label %123

60:                                               ; preds = %29
  %61 = load i64, ptr %11, align 8, !tbaa !9
  %62 = icmp ule i64 %61, 32768
  br i1 %62, label %63, label %99

63:                                               ; preds = %60
  %64 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  %65 = call i64 @lseek(i32 noundef %64, i64 noundef 0, i32 noundef 0) #6
  %66 = icmp ne i64 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %124

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %69 = load i64, ptr %11, align 8, !tbaa !9
  %70 = invoke noundef ptr @_ZN4lexy7_detail19get_memory_resourceIvvEEPT_v()
          to label %71 unwind label %81

71:                                               ; preds = %68
  invoke void @_ZN4lexy6bufferINS_16default_encodingEvE7builderC2EmPv(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %69, ptr noundef %70)
          to label %72 unwind label %81

72:                                               ; preds = %71
  %73 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  %74 = call noundef ptr @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  %75 = call noundef i64 @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  %76 = invoke i64 @read(i32 noundef %73, ptr noundef %74, i64 noundef %75)
          to label %77 unwind label %85

77:                                               ; preds = %72
  %78 = load i64, ptr %11, align 8, !tbaa !9
  %79 = icmp ne i64 %76, %78
  br i1 %79, label %80, label %89

80:                                               ; preds = %77
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %95

81:                                               ; preds = %71, %68
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %13, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %14, align 4
  br label %98

85:                                               ; preds = %89, %72
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %13, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %14, align 4
  call void @_ZN4lexy6bufferINS_16default_encodingEvE7builderD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  br label %98

89:                                               ; preds = %77
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = call noundef ptr @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  %93 = call noundef i64 @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  invoke void %90(ptr noundef %91, ptr noundef %92, i64 noundef %93)
          to label %94 unwind label %85

94:                                               ; preds = %89
  store i32 0, ptr %9, align 4
  br label %95

95:                                               ; preds = %94, %80
  call void @_ZN4lexy6bufferINS_16default_encodingEvE7builderD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  %96 = load i32, ptr %9, align 4
  switch i32 %96, label %124 [
    i32 0, label %97
  ]

97:                                               ; preds = %95
  br label %122

98:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %125

99:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %100 = load i64, ptr %11, align 8, !tbaa !9
  %101 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  %102 = call ptr @mmap(ptr noundef null, i64 noundef %100, i32 noundef 1, i32 noundef 2, i32 noundef %101, i64 noundef 0) #6
  store ptr %102, ptr %16, align 8, !tbaa !5
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = icmp eq ptr %103, inttoptr (i64 -1 to ptr)
  br i1 %104, label %105, label %106

105:                                              ; preds = %99
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %115

106:                                              ; preds = %99
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load ptr, ptr %16, align 8, !tbaa !5
  %110 = load i64, ptr %11, align 8, !tbaa !9
  invoke void %107(ptr noundef %108, ptr noundef %109, i64 noundef %110)
          to label %111 unwind label %118

111:                                              ; preds = %106
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  %113 = load i64, ptr %11, align 8, !tbaa !9
  %114 = call i32 @munmap(ptr noundef %112, i64 noundef %113) #6
  store i32 0, ptr %9, align 4
  br label %115

115:                                              ; preds = %111, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %116 = load i32, ptr %9, align 4
  switch i32 %116, label %124 [
    i32 0, label %117
  ]

117:                                              ; preds = %115
  br label %122

118:                                              ; preds = %106
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %13, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %125

122:                                              ; preds = %117, %97
  br label %123

123:                                              ; preds = %122, %59
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %124

124:                                              ; preds = %123, %115, %95, %67, %57, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %126

125:                                              ; preds = %118, %98, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZN12_GLOBAL__N_17raii_fdD2Ev(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %129

126:                                              ; preds = %124, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %127

127:                                              ; preds = %126, %21
  call void @_ZN12_GLOBAL__N_17raii_fdD2Ev(ptr noundef nonnull align 4 dereferenceable(4) %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %128 = load i32, ptr %4, align 4
  ret i32 %128

129:                                              ; preds = %125
  %130 = load ptr, ptr %13, align 8
  %131 = load i32, ptr %14, align 4
  %132 = insertvalue { ptr, i32 } poison, ptr %130, 0
  %133 = insertvalue { ptr, i32 } %132, i32 %131, 1
  resume { ptr, i32 } %133
}

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

declare i32 @open(ptr noundef, i32 noundef, ...) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_17raii_fdC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_114get_file_errorEv() #3

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) #4

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #2

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) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4lexy6bufferINS_16default_encodingEvE7builderC2EmPv(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, ptr noundef) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) #4

; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_17raii_fdD2Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 }

!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}


; 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.(anonymous namespace)::raii_fd" = type { i32 }
%"class.lexy::buffer<>::builder" = type { %"class.lexy::buffer" }
%"class.lexy::buffer" = type { ptr, i64 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4lexy7_detail9read_fileEPKcPFvPvS2_mES3_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.(anonymous namespace)::raii_fd", align 4
  %5 = alloca [4096 x i8], align 16
  %6 = alloca %"class.lexy::buffer<>::builder", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %7 = tail call i32 (ptr, i32, ...) @open(ptr noundef %0, i32 noundef 0)
  call void @_ZN12_GLOBAL__N_17raii_fdC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef %7) #6
  %8 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  %9 = icmp slt i32 %8, 0
  br i1 %9, label %10, label %12

10:                                               ; preds = %3
  %11 = call noundef i32 @_ZN12_GLOBAL__N_114get_file_errorEv() #6
  br label %.critedge47

12:                                               ; preds = %3
  %13 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  %14 = call i64 @lseek(i32 noundef %13, i64 noundef 0, i32 noundef 2) #6
  %15 = icmp eq i64 %14, -1
  br i1 %15, label %.critedge47, label %16

16:                                               ; preds = %12
  %17 = icmp ult i64 %14, 4097
  br i1 %17, label %18, label %29

18:                                               ; preds = %16
  %19 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  %20 = call i64 @lseek(i32 noundef %19, i64 noundef 0, i32 noundef 0) #6
  %.not40 = icmp eq i64 %20, 0
  br i1 %.not40, label %21, label %.critedge47

21:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %5) #6
  %22 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  %23 = invoke i64 @read(i32 noundef %22, ptr noundef nonnull %5, i64 noundef %14)
          to label %24 unwind label %25

24:                                               ; preds = %21
  %.not41 = icmp eq i64 %23, %14
  br i1 %.not41, label %27, label %.critedge

25:                                               ; preds = %27, %21
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %5) #6
  br label %58

27:                                               ; preds = %24
  invoke void %1(ptr noundef %2, ptr noundef nonnull %5, i64 noundef %14)
          to label %28 unwind label %25

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %5) #6
  br label %.critedge47

29:                                               ; preds = %16
  %30 = icmp ult i64 %14, 32769
  %31 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  br i1 %30, label %32, label %51

32:                                               ; preds = %29
  %33 = call i64 @lseek(i32 noundef %31, i64 noundef 0, i32 noundef 0) #6
  %.not37 = icmp eq i64 %33, 0
  br i1 %.not37, label %34, label %.critedge47

34:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %35 = call noundef ptr @_ZN4lexy7_detail19get_memory_resourceIvvEEPT_v()
  invoke void @_ZN4lexy6bufferINS_16default_encodingEvE7builderC2EmPv(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 noundef %14, ptr noundef %35)
          to label %36 unwind label %42

36:                                               ; preds = %34
  %37 = call noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  %38 = call noundef ptr @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  %39 = call noundef i64 @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  %40 = invoke i64 @read(i32 noundef %37, ptr noundef %38, i64 noundef %39)
          to label %41 unwind label %44

41:                                               ; preds = %36
  %.not38 = icmp eq i64 %40, %14
  br i1 %.not38, label %46, label %.critedge45

42:                                               ; preds = %34
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %50

44:                                               ; preds = %46, %36
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4lexy6bufferINS_16default_encodingEvE7builderD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  br label %50

46:                                               ; preds = %41
  %47 = call noundef ptr @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  %48 = call noundef i64 @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  invoke void %1(ptr noundef %2, ptr noundef %47, i64 noundef %48)
          to label %49 unwind label %44

49:                                               ; preds = %46
  call void @_ZN4lexy6bufferINS_16default_encodingEvE7builderD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %.critedge47

50:                                               ; preds = %44, %42
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %58

51:                                               ; preds = %29
  %52 = call ptr @mmap(ptr noundef null, i64 noundef %14, i32 noundef 1, i32 noundef 2, i32 noundef %31, i64 noundef 0) #6
  %.not = icmp eq ptr %52, inttoptr (i64 -1 to ptr)
  br i1 %.not, label %.critedge47, label %53

53:                                               ; preds = %51
  invoke void %1(ptr noundef %2, ptr noundef %52, i64 noundef %14)
          to label %54 unwind label %56

54:                                               ; preds = %53
  %55 = call i32 @munmap(ptr noundef %52, i64 noundef %14) #6
  br label %.critedge47

56:                                               ; preds = %53
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %58

.critedge:                                        ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %5) #6
  br label %.critedge47

.critedge45:                                      ; preds = %41
  call void @_ZN4lexy6bufferINS_16default_encodingEvE7builderD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %.critedge47

58:                                               ; preds = %56, %50, %25
  %.pn42 = phi { ptr, i32 } [ %26, %25 ], [ %.pn, %50 ], [ %57, %56 ]
  call void @_ZN12_GLOBAL__N_17raii_fdD2Ev(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn42

.critedge47:                                      ; preds = %28, %49, %54, %12, %51, %.critedge45, %32, %.critedge, %18, %10
  %.5 = phi i32 [ %11, %10 ], [ 1, %12 ], [ 1, %18 ], [ 1, %.critedge ], [ 1, %32 ], [ 1, %.critedge45 ], [ 1, %51 ], [ 0, %54 ], [ 0, %49 ], [ 0, %28 ]
  call void @_ZN12_GLOBAL__N_17raii_fdD2Ev(ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  ret i32 %.5
}

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

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_17raii_fdC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZNK12_GLOBAL__N_17raii_fdcviEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_114get_file_errorEv() local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #2

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) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4lexy6bufferINS_16default_encodingEvE7builderC2EmPv(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4dataEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK4lexy6bufferINS_16default_encodingEvE7builder4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_17raii_fdD2Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

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

!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)"}


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