; LLVM IR from hbirchtree/coffeecutie :: src/peripheral/platform/platforms/linux (process)

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

%"struct.stl_types::nested_domain_error_code" = type { %"struct.stl_types::error_code", %"struct.platform::file::file_error_category", %"struct.stl_types::domain_error_code" }
%"struct.stl_types::error_code" = type { %"class.std::error_code", %"class.std::__cxx11::basic_string" }
%"class.std::error_code" = type { i32, ptr }
%"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] }
%"struct.platform::file::file_error_category" = type { %"class.std::_V2::error_category" }
%"class.std::_V2::error_category" = type { ptr }
%"struct.stl_types::domain_error_code" = type { %"struct.stl_types::error_code", %"struct.platform::file::posix_error_category" }
%"struct.platform::file::posix_error_category" = type { %"class.std::_V2::error_category" }
%"struct.platform::env::Linux::mem_usage" = type { i64, i64, i64, i64, i64 }

@.str = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN8platform3env5Linux15ProcessProperty3MemEi(i32 noundef %0) #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"struct.stl_types::nested_domain_error_code", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.platform::env::Linux::mem_usage", align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 112, ptr %3) #8
  call void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %3)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #8
  invoke void @_ZN8platform4file5Linux7FileFun8sys_readB5cxx11EPKcRN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS5_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef @.str, ptr noundef nonnull align 8 dereferenceable(112) %3)
          to label %14 unwind label %24

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #8
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %90, %14
  br label %16

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %17 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %17, ptr %10, align 8, !tbaa !9
  %18 = load i64, ptr %8, align 8, !tbaa !9
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) %4, i8 noundef signext 32, i64 noundef %18) #8
  store i64 %19, ptr %8, align 8, !tbaa !9
  %20 = load i64, ptr %8, align 8, !tbaa !9
  %21 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  %22 = icmp ugt i64 %20, %21
  br i1 %22, label %23, label %28

23:                                               ; preds = %16
  store i32 3, ptr %11, align 4
  br label %88

24:                                               ; preds = %1
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %5, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %6, align 4
  br label %94

28:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #8
  %29 = load i64, ptr %10, align 8, !tbaa !9
  %30 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %29)
          to label %31 unwind label %46

31:                                               ; preds = %28
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = load i64, ptr %10, align 8, !tbaa !9
  %34 = sub i64 %32, %33
  %35 = invoke noundef i32 @_ZL6C_CASTIjmET_T0_(i64 noundef %34)
          to label %36 unwind label %46

36:                                               ; preds = %31
  %37 = zext i32 %35 to i64
  invoke void @_ZN9stl_types3str11encapsulateIcEENSt7__cxx1112basic_stringIT_St11char_traitsIS4_ESaIS4_EEEPKS4_m(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef %30, i64 noundef %37)
          to label %38 unwind label %46

38:                                               ; preds = %36
  %39 = invoke noundef i64 @_ZN9stl_types11cast_stringImEET_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %40 unwind label %50

40:                                               ; preds = %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #8
  store i64 %39, ptr %12, align 8, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %55

43:                                               ; preds = %40
  %44 = load i64, ptr %12, align 8, !tbaa !9
  %45 = getelementptr inbounds %"struct.platform::env::Linux::mem_usage", ptr %7, i32 0, i32 0
  store i64 %44, ptr %45, align 8, !tbaa !11
  br label %83

46:                                               ; preds = %36, %31, %28
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  br label %54

50:                                               ; preds = %38
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %5, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #8
  br label %54

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  br label %94

55:                                               ; preds = %40
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = load i64, ptr %12, align 8, !tbaa !9
  %60 = getelementptr inbounds %"struct.platform::env::Linux::mem_usage", ptr %7, i32 0, i32 1
  store i64 %59, ptr %60, align 8, !tbaa !13
  br label %82

61:                                               ; preds = %55
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = icmp eq i32 %62, 2
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = load i64, ptr %12, align 8, !tbaa !9
  %66 = getelementptr inbounds %"struct.platform::env::Linux::mem_usage", ptr %7, i32 0, i32 2
  store i64 %65, ptr %66, align 8, !tbaa !14
  br label %81

67:                                               ; preds = %61
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 3
  br i1 %69, label %70, label %73

70:                                               ; preds = %67
  %71 = load i64, ptr %12, align 8, !tbaa !9
  %72 = getelementptr inbounds %"struct.platform::env::Linux::mem_usage", ptr %7, i32 0, i32 3
  store i64 %71, ptr %72, align 8, !tbaa !15
  br label %80

73:                                               ; preds = %67
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 5
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  %77 = load i64, ptr %12, align 8, !tbaa !9
  %78 = getelementptr inbounds %"struct.platform::env::Linux::mem_usage", ptr %7, i32 0, i32 4
  store i64 %77, ptr %78, align 8, !tbaa !16
  br label %79

79:                                               ; preds = %76, %73
  br label %80

80:                                               ; preds = %79, %70
  br label %81

81:                                               ; preds = %80, %64
  br label %82

82:                                               ; preds = %81, %58
  br label %83

83:                                               ; preds = %82, %43
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = add i64 %84, 1
  store i64 %85, ptr %8, align 8, !tbaa !9
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  store i32 0, ptr %11, align 4
  br label %88

88:                                               ; preds = %83, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %89 = load i32, ptr %11, align 4
  switch i32 %89, label %100 [
    i32 0, label %90
    i32 3, label %91
  ]

90:                                               ; preds = %88
  br label %15, !llvm.loop !17

91:                                               ; preds = %88
  %92 = getelementptr inbounds %"struct.platform::env::Linux::mem_usage", ptr %7, i32 0, i32 1
  %93 = load i64, ptr %92, align 8, !tbaa !13
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #8
  call void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(112) %3) #8
  call void @llvm.lifetime.end.p0(i64 112, ptr %3) #8
  ret i64 %93

94:                                               ; preds = %54, %24
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #8
  call void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(112) %3) #8
  call void @llvm.lifetime.end.p0(i64 112, ptr %3) #8
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %5, align 8
  %97 = load i32, ptr %6, align 4
  %98 = insertvalue { ptr, i32 } poison, ptr %96, 0
  %99 = insertvalue { ptr, i32 } %98, i32 %97, 1
  resume { ptr, i32 } %99

100:                                              ; preds = %88
  unreachable
}

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

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

declare void @_ZN8platform4file5Linux7FileFun8sys_readB5cxx11EPKcRN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS5_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(112)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext, i64 noundef) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN9stl_types11cast_stringImEET_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #0

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL6C_CASTIjmET_T0_(i64 noundef) #7

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #7 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 = { alwaysinline 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN8platform3env5Linux9mem_usageE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !10, i64 24}
!16 = !{!12, !10, i64 32}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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

%"struct.stl_types::nested_domain_error_code" = type { %"struct.stl_types::error_code", %"struct.platform::file::file_error_category", %"struct.stl_types::domain_error_code" }
%"struct.stl_types::error_code" = type { %"class.std::error_code", %"class.std::__cxx11::basic_string" }
%"class.std::error_code" = type { i32, ptr }
%"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] }
%"struct.platform::file::file_error_category" = type { %"class.std::_V2::error_category" }
%"class.std::_V2::error_category" = type { ptr }
%"struct.stl_types::domain_error_code" = type { %"struct.stl_types::error_code", %"struct.platform::file::posix_error_category" }
%"struct.platform::file::posix_error_category" = type { %"class.std::_V2::error_category" }

@.str = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN8platform3env5Linux15ProcessProperty3MemEi(i32 noundef %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.stl_types::nested_domain_error_code", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %2) #7
  call void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %2)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  invoke void @_ZN8platform4file5Linux7FileFun8sys_readB5cxx11EPKcRN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS5_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull @.str, ptr noundef nonnull align 8 dereferenceable(112) %2)
          to label %.preheader unwind label %29

.preheader:                                       ; preds = %1
  %5 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) %3, i8 noundef signext 32, i64 noundef 0) #7
  %6 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %7 = icmp ugt i64 %5, %6
  br i1 %7, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  %8 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
  %9 = call noundef i32 @_ZL6C_CASTIjmET_T0_(i64 noundef %5)
  %10 = zext i32 %9 to i64
  invoke void @_ZN9stl_types3str11encapsulateIcEENSt7__cxx1112basic_stringIT_St11char_traitsIS4_ESaIS4_EEEPKS4_m(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull %8, i64 noundef %10)
          to label %11 unwind label %.loopexit.split-lp

11:                                               ; preds = %.lr.ph.preheader
  %12 = invoke noundef i64 @_ZN9stl_types11cast_stringImEET_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %13 unwind label %.loopexit.split-lp48

13:                                               ; preds = %11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  %14 = add i64 %5, 1
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) %3, i8 noundef signext 32, i64 noundef %14) #7
  %16 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %17 = icmp ugt i64 %15, %16
  br i1 %17, label %._crit_edge, label %.lr.ph.peel.next

.lr.ph.peel.next:                                 ; preds = %13
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  %18 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %14)
  %19 = sub i64 %15, %14
  %20 = call noundef i32 @_ZL6C_CASTIjmET_T0_(i64 noundef %19)
  %21 = zext i32 %20 to i64
  invoke void @_ZN9stl_types3str11encapsulateIcEENSt7__cxx1112basic_stringIT_St11char_traitsIS4_ESaIS4_EEEPKS4_m(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull %18, i64 noundef %21)
          to label %22 unwind label %.loopexit.split-lp

22:                                               ; preds = %.lr.ph.peel.next
  %23 = invoke noundef i64 @_ZN9stl_types11cast_stringImEET_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %24 unwind label %.loopexit.split-lp48

24:                                               ; preds = %22
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  %25 = add i64 %15, 1
  %26 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) %3, i8 noundef signext 32, i64 noundef %25) #7
  %27 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %28 = icmp ugt i64 %26, %27
  br i1 %28, label %._crit_edge, label %.lr.ph

29:                                               ; preds = %1
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %45

.lr.ph:                                           ; preds = %24, %40
  %31 = phi i64 [ %42, %40 ], [ %26, %24 ]
  %.02540 = phi i64 [ %41, %40 ], [ %25, %24 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.02540)
  %33 = sub i64 %31, %.02540
  %34 = call noundef i32 @_ZL6C_CASTIjmET_T0_(i64 noundef %33)
  %35 = zext i32 %34 to i64
  invoke void @_ZN9stl_types3str11encapsulateIcEENSt7__cxx1112basic_stringIT_St11char_traitsIS4_ESaIS4_EEEPKS4_m(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull %32, i64 noundef %35)
          to label %36 unwind label %.loopexit

36:                                               ; preds = %.lr.ph
  %37 = invoke noundef i64 @_ZN9stl_types11cast_stringImEET_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %40 unwind label %.loopexit47

.loopexit:                                        ; preds = %.lr.ph
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %39

.loopexit.split-lp:                               ; preds = %.lr.ph.preheader, %.lr.ph.peel.next
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %39

.loopexit47:                                      ; preds = %36
  %lpad.loopexit49 = landingpad { ptr, i32 }
          cleanup
  br label %38

.loopexit.split-lp48:                             ; preds = %11, %22
  %lpad.loopexit.split-lp50 = landingpad { ptr, i32 }
          cleanup
  br label %38

38:                                               ; preds = %.loopexit.split-lp48, %.loopexit47
  %lpad.phi51 = phi { ptr, i32 } [ %lpad.loopexit49, %.loopexit47 ], [ %lpad.loopexit.split-lp50, %.loopexit.split-lp48 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  br label %39

39:                                               ; preds = %.loopexit, %.loopexit.split-lp, %38
  %.pn = phi { ptr, i32 } [ %lpad.phi51, %38 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  br label %45

40:                                               ; preds = %36
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  %41 = add i64 %31, 1
  %42 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) %3, i8 noundef signext 32, i64 noundef %41) #7
  %43 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %44 = icmp ugt i64 %42, %43
  br i1 %44, label %._crit_edge, label %.lr.ph, !llvm.loop !5

._crit_edge:                                      ; preds = %40, %13, %24, %.preheader
  %.sroa.5.0.lcssa = phi i64 [ 0, %.preheader ], [ 0, %13 ], [ %23, %24 ], [ %23, %40 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(112) %2) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %2) #7
  ret i64 %.sroa.5.0.lcssa

45:                                               ; preds = %39, %29
  %.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(112) %2) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn.pn
}

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

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

declare void @_ZN8platform4file5Linux7FileFun8sys_readB5cxx11EPKcRN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS5_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext, i64 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN9stl_types11cast_stringImEET_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL6C_CASTIjmET_T0_(i64 noundef) local_unnamed_addr #6

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9stl_types24nested_domain_error_codeIN8platform4file9FileErrorENS2_19file_error_categoryENS_17domain_error_codeIiNS2_20posix_error_categoryEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #6 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 = { alwaysinline 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 = { "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 = { 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 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.peeled.count", i32 2}


; Effective O3 passes: BDCEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass