; LLVM IR from hbirchtree/coffeecutie :: src/peripheral/platform/platforms/posix (file)

; 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] }
%"struct.platform::url::Url" = type { %"class.std::__cxx11::basic_string", i32, i32, i32, %"class.std::__cxx11::basic_string" }
%"struct.platform::file::DirFunDef<stl_types::domain_error_code<int, platform::file::posix_error_category>>::DirItem_t" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"class.std::allocator" = type { i8 }
%struct.dirent = type { i64, i64, i16, i8, [256 x i8] }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8platform4file5posix16PosixFileMod_def4StatERKNS_3url3UrlERN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS7_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(112)) #0 align 2

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

declare void @_ZNK8platform3url3UrldeB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #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: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

; 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8platform4file5posix16collect_error_toIN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS3_17domain_error_codeIiNS0_20posix_error_categoryEEEEEEEbRT_(ptr noundef nonnull align 8 dereferenceable(112)) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8platform4file5posix6DirFun2LsERKNS_3url3UrlERSt6vectorINS0_9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tESaISE_EERNS9_24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryESC_EE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(112) %2) #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.platform::url::Url", align 8
  %16 = alloca %"struct.platform::file::DirFunDef<stl_types::domain_error_code<int, platform::file::posix_error_category>>::DirItem_t", align 8
  %17 = alloca %"class.std::allocator", align 1
  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 32, ptr %8) #7
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK8platform3url3UrldeB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 8 dereferenceable(80) %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %19 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  %20 = invoke ptr @opendir(ptr noundef %19)
          to label %21 unwind label %28

21:                                               ; preds = %3
  store ptr %20, ptr %9, align 8, !tbaa !5
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %32, label %24

24:                                               ; preds = %21
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = invoke noundef zeroext i1 @_ZN8platform4file5posix16collect_error_toIN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS3_17domain_error_codeIiNS0_20posix_error_categoryEEEEEEEbRT_(ptr noundef nonnull align 8 dereferenceable(112) %25)
          to label %27 unwind label %28

27:                                               ; preds = %24
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %120

28:                                               ; preds = %24, %3
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %10, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %11, align 4
  br label %122

32:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store ptr null, ptr %13, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %100, %98, %32
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = invoke ptr @readdir(ptr noundef %34)
          to label %36 unwind label %43

36:                                               ; preds = %33
  store ptr %35, ptr %13, align 8, !tbaa !5
  %37 = icmp ne ptr %35, null
  br i1 %37, label %38, label %111

38:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.dirent, ptr %39, i32 0, i32 3
  %41 = load i8, ptr %40, align 2, !tbaa !11
  %42 = zext i8 %41 to i32
  switch i32 %42, label %54 [
    i32 6, label %47
    i32 2, label %48
    i32 4, label %49
    i32 10, label %50
    i32 1, label %51
    i32 8, label %52
    i32 12, label %53
  ]

43:                                               ; preds = %114, %111, %33
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %10, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %11, align 4
  br label %119

47:                                               ; preds = %38
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %71

48:                                               ; preds = %38
  store i32 2, ptr %14, align 4, !tbaa !9
  br label %71

49:                                               ; preds = %38
  store i32 5, ptr %14, align 4, !tbaa !9
  br label %71

50:                                               ; preds = %38
  store i32 6, ptr %14, align 4, !tbaa !9
  br label %71

51:                                               ; preds = %38
  store i32 7, ptr %14, align 4, !tbaa !9
  br label %71

52:                                               ; preds = %38
  store i32 4, ptr %14, align 4, !tbaa !9
  br label %71

53:                                               ; preds = %38
  store i32 8, ptr %14, align 4, !tbaa !9
  br label %71

54:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 80, ptr %15) #7
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.dirent, ptr %55, i32 0, i32 4
  %57 = getelementptr inbounds [256 x i8], ptr %56, i64 0, i64 0
  invoke void @_ZN8platform3url12constructors5MkUrlEPKc(ptr dead_on_unwind writable sret(%"struct.platform::url::Url") align 8 %15, ptr noundef %57)
          to label %58 unwind label %62

58:                                               ; preds = %54
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = invoke noundef i32 @_ZN8platform4file5posix16PosixFileMod_def4StatERKNS_3url3UrlERN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS7_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr noundef nonnull align 8 dereferenceable(80) %15, ptr noundef nonnull align 8 dereferenceable(112) %59)
          to label %61 unwind label %66

61:                                               ; preds = %58
  store i32 %60, ptr %14, align 4, !tbaa !9
  call void @_ZN8platform3url3UrlD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #7
  br label %71

62:                                               ; preds = %54
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  br label %70

66:                                               ; preds = %58
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %10, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %11, align 4
  call void @_ZN8platform3url3UrlD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #7
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #7
  br label %110

71:                                               ; preds = %61, %53, %52, %51, %50, %49, %48, %47
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.dirent, ptr %72, i32 0, i32 4
  %74 = getelementptr inbounds [256 x i8], ptr %73, i64 0, i64 0
  %75 = invoke noundef zeroext i1 @_ZN4libc3str3cmpINS0_15comparison_modeILb0ELb1ELb0ELb0EEEcTnPNSt9enable_ifIXsrT_8no_indexEvE4typeELPv0EJEEEbPKT0_SC_DpT2_(ptr noundef %74, ptr noundef @.str.1)
          to label %76 unwind label %84

76:                                               ; preds = %71
  br i1 %75, label %83, label %77

77:                                               ; preds = %76
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.dirent, ptr %78, i32 0, i32 4
  %80 = getelementptr inbounds [256 x i8], ptr %79, i64 0, i64 0
  %81 = invoke noundef zeroext i1 @_ZN4libc3str3cmpINS0_15comparison_modeILb0ELb1ELb0ELb0EEEcTnPNSt9enable_ifIXsrT_8no_indexEvE4typeELPv0EJEEEbPKT0_SC_DpT2_(ptr noundef %80, ptr noundef @.str.2)
          to label %82 unwind label %84

82:                                               ; preds = %77
  br i1 %81, label %83, label %88

83:                                               ; preds = %82, %76
  store i32 2, ptr %12, align 4
  br label %98, !llvm.loop !15

84:                                               ; preds = %77, %71
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  br label %110

88:                                               ; preds = %82
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #7
  %90 = getelementptr inbounds %"struct.platform::file::DirFunDef<stl_types::domain_error_code<int, platform::file::posix_error_category>>::DirItem_t", ptr %16, i32 0, i32 0
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.dirent, ptr %91, i32 0, i32 4
  %93 = getelementptr inbounds [256 x i8], ptr %92, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %90, ptr noundef %93, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %94 unwind label %101

94:                                               ; preds = %88
  %95 = getelementptr inbounds %"struct.platform::file::DirFunDef<stl_types::domain_error_code<int, platform::file::posix_error_category>>::DirItem_t", ptr %16, i32 0, i32 1
  %96 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %96, ptr %95, align 8, !tbaa !17
  invoke void @_ZNSt6vectorIN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS1_20posix_error_categoryEEEE9DirItem_tESaIS8_EE9push_backEOS8_(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 8 dereferenceable(36) %16)
          to label %97 unwind label %105

97:                                               ; preds = %94
  call void @_ZN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %16) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #7
  store i32 0, ptr %12, align 4
  br label %98

98:                                               ; preds = %97, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %99 = load i32, ptr %12, align 4
  switch i32 %99, label %128 [
    i32 0, label %100
    i32 2, label %33
  ]

100:                                              ; preds = %98
  br label %33, !llvm.loop !15

101:                                              ; preds = %88
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %10, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %11, align 4
  br label %109

105:                                              ; preds = %94
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %10, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %11, align 4
  call void @_ZN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %16) #7
  br label %109

109:                                              ; preds = %105, %101
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #7
  br label %110

110:                                              ; preds = %109, %84, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %119

111:                                              ; preds = %36
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = invoke i32 @closedir(ptr noundef %112)
          to label %114 unwind label %43

114:                                              ; preds = %111
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = invoke noundef zeroext i1 @_ZN8platform4file5posix16collect_error_toIN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS3_17domain_error_codeIiNS0_20posix_error_categoryEEEEEEEbRT_(ptr noundef nonnull align 8 dereferenceable(112) %115)
          to label %117 unwind label %43

117:                                              ; preds = %114
  %118 = call ptr @__errno_location() #8
  store i32 0, ptr %118, align 4, !tbaa !21
  store i1 true, ptr %4, align 1
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %120

119:                                              ; preds = %110, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %122

120:                                              ; preds = %117, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  %121 = load i1, ptr %4, align 1
  ret i1 %121

122:                                              ; preds = %119, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %10, align 8
  %125 = load i32, ptr %11, align 4
  %126 = insertvalue { ptr, i32 } poison, ptr %124, 0
  %127 = insertvalue { ptr, i32 } %126, i32 %125, 1
  resume { ptr, i32 } %127

128:                                              ; preds = %98
  unreachable
}

declare ptr @opendir(ptr noundef) #2

declare ptr @readdir(ptr noundef) #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN8platform3url12constructors5MkUrlEPKc(ptr dead_on_unwind noalias writable sret(%"struct.platform::url::Url") align 8, ptr noundef) #5

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4libc3str3cmpINS0_15comparison_modeILb0ELb1ELb0ELb0EEEcTnPNSt9enable_ifIXsrT_8no_indexEvE4typeELPv0EJEEEbPKT0_SC_DpT2_(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS1_20posix_error_categoryEEEE9DirItem_tESaIS8_EE9push_backEOS8_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(36)) #0 align 2

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

declare i32 @closedir(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 willreturn memory(none) "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 = { 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 #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 }
attributes #8 = { nounwind willreturn memory(none) }

!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 = !{!"_ZTSN8platform4file8NodeTypeE", !7, i64 0}
!11 = !{!12, !7, i64 18}
!12 = !{!"_ZTS6dirent", !13, i64 0, !13, i64 8, !14, i64 16, !7, i64 18, !7, i64 19}
!13 = !{!"long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !10, i64 32}
!18 = !{!"_ZTSN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tE", !19, i64 0, !10, i64 32}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !13, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !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.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::url::Url" = type { %"class.std::__cxx11::basic_string", i32, i32, i32, %"class.std::__cxx11::basic_string" }
%"struct.platform::file::DirFunDef<stl_types::domain_error_code<int, platform::file::posix_error_category>>::DirItem_t" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"class.std::allocator" = type { i8 }

@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@switch.table._ZN8platform4file5posix6DirFun2LsERKNS_3url3UrlERSt6vectorINS0_9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tESaISE_EERNS9_24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryESC_EE = private unnamed_addr constant [12 x i32] [i32 7, i32 2, i32 1, i32 5, i32 1, i32 1, i32 1, i32 4, i32 1, i32 6, i32 1, i32 8], align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8platform4file5posix16PosixFileMod_def4StatERKNS_3url3UrlERN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS7_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #4

; 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8platform4file5posix16collect_error_toIN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS3_17domain_error_codeIiNS0_20posix_error_categoryEEEEEEEbRT_(ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8platform4file5posix6DirFun2LsERKNS_3url3UrlERSt6vectorINS0_9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tESaISE_EERNS9_24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryESC_EE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(112) %2) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"struct.platform::url::Url", align 8
  %6 = alloca %"struct.platform::file::DirFunDef<stl_types::domain_error_code<int, platform::file::posix_error_category>>::DirItem_t", align 8
  %7 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @_ZNK8platform3url3UrldeB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(80) %0)
  %8 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  %9 = call ptr @opendir(ptr noundef %8)
  %.not = icmp ne ptr %9, null
  br i1 %.not, label %.preheader, label %11

.preheader:                                       ; preds = %3
  %10 = getelementptr inbounds i8, ptr %6, i64 32
  br label %15

11:                                               ; preds = %3
  %12 = invoke noundef zeroext i1 @_ZN8platform4file5posix16collect_error_toIN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS3_17domain_error_codeIiNS0_20posix_error_categoryEEEEEEEbRT_(ptr noundef nonnull align 8 dereferenceable(112) %2)
          to label %55 unwind label %13

13:                                               ; preds = %11
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %56

15:                                               ; preds = %.backedge, %.preheader
  %16 = invoke ptr @readdir(ptr noundef nonnull %9)
          to label %17 unwind label %.loopexit

17:                                               ; preds = %15
  %.not25 = icmp eq ptr %16, null
  br i1 %.not25, label %50, label %18

18:                                               ; preds = %17
  %19 = getelementptr inbounds i8, ptr %16, i64 18
  %20 = load i8, ptr %19, align 2, !tbaa !5
  %switch.tableidx = add i8 %20, -1
  %21 = icmp ult i8 %switch.tableidx, 12
  br i1 %21, label %switch.hole_check, label %22

.loopexit:                                        ; preds = %15
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %56

.loopexit.split-lp:                               ; preds = %50
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %56

22:                                               ; preds = %switch.hole_check, %18
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #8
  %23 = getelementptr inbounds i8, ptr %16, i64 19
  invoke void @_ZN8platform3url12constructors5MkUrlEPKc(ptr dead_on_unwind nonnull writable sret(%"struct.platform::url::Url") align 8 %5, ptr noundef nonnull %23)
          to label %24 unwind label %27

24:                                               ; preds = %22
  %25 = invoke noundef i32 @_ZN8platform4file5posix16PosixFileMod_def4StatERKNS_3url3UrlERN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS7_17domain_error_codeIiNS0_20posix_error_categoryEEEEE(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(112) %2)
          to label %26 unwind label %29

26:                                               ; preds = %24
  call void @_ZN8platform3url3UrlD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #8
  br label %33

27:                                               ; preds = %22
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %31

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8platform3url3UrlD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #8
  br label %31

31:                                               ; preds = %29, %27
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #8
  br label %56

switch.hole_check:                                ; preds = %18
  %switch.maskindex = zext nneg i8 %switch.tableidx to i16
  %switch.shifted = lshr i16 2731, %switch.maskindex
  %switch.lobit = trunc i16 %switch.shifted to i1
  br i1 %switch.lobit, label %switch.lookup, label %22

switch.lookup:                                    ; preds = %switch.hole_check
  %32 = zext nneg i8 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [12 x i32], ptr @switch.table._ZN8platform4file5posix6DirFun2LsERKNS_3url3UrlERSt6vectorINS0_9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tESaISE_EERNS9_24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryESC_EE, i64 0, i64 %32
  %switch.load = load i32, ptr %switch.gep, align 4
  br label %33

33:                                               ; preds = %switch.lookup, %26
  %.0 = phi i32 [ %25, %26 ], [ %switch.load, %switch.lookup ]
  %34 = getelementptr inbounds i8, ptr %16, i64 19
  %35 = invoke noundef zeroext i1 @_ZN4libc3str3cmpINS0_15comparison_modeILb0ELb1ELb0ELb0EEEcTnPNSt9enable_ifIXsrT_8no_indexEvE4typeELPv0EJEEEbPKT0_SC_DpT2_(ptr noundef nonnull %34, ptr noundef nonnull @.str.1)
          to label %36 unwind label %40

36:                                               ; preds = %33
  br i1 %35, label %.backedge, label %37

.backedge:                                        ; preds = %36, %39, %44
  br label %15, !llvm.loop !11

37:                                               ; preds = %36
  %38 = invoke noundef zeroext i1 @_ZN4libc3str3cmpINS0_15comparison_modeILb0ELb1ELb0ELb0EEEcTnPNSt9enable_ifIXsrT_8no_indexEvE4typeELPv0EJEEEbPKT0_SC_DpT2_(ptr noundef nonnull %34, ptr noundef nonnull @.str.2)
          to label %39 unwind label %40

39:                                               ; preds = %37
  br i1 %38, label %.backedge, label %42

40:                                               ; preds = %37, %33
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %56

42:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull %34, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %43 unwind label %45

43:                                               ; preds = %42
  store i32 %.0, ptr %10, align 8, !tbaa !13
  invoke void @_ZNSt6vectorIN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS1_20posix_error_categoryEEEE9DirItem_tESaIS8_EE9push_backEOS8_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(36) %6)
          to label %44 unwind label %47

44:                                               ; preds = %43
  call void @_ZN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #8
  br label %.backedge

45:                                               ; preds = %42
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %43
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #8
  br label %49

49:                                               ; preds = %47, %45
  %.pn27 = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #8
  br label %56

50:                                               ; preds = %17
  %51 = call i32 @closedir(ptr noundef nonnull %9)
  %52 = invoke noundef zeroext i1 @_ZN8platform4file5posix16collect_error_toIN9stl_types24nested_domain_error_codeINS0_9FileErrorENS0_19file_error_categoryENS3_17domain_error_codeIiNS0_20posix_error_categoryEEEEEEEbRT_(ptr noundef nonnull align 8 dereferenceable(112) %2)
          to label %53 unwind label %.loopexit.split-lp

53:                                               ; preds = %50
  %54 = tail call ptr @__errno_location() #9
  store i32 0, ptr %54, align 4, !tbaa !19
  br label %55

55:                                               ; preds = %11, %53
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  ret i1 %.not

56:                                               ; preds = %.loopexit, %.loopexit.split-lp, %49, %40, %31, %13
  %.pn27.pn.pn.pn = phi { ptr, i32 } [ %14, %13 ], [ %.pn27, %49 ], [ %41, %40 ], [ %.pn, %31 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn27.pn.pn.pn
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @opendir(ptr nocapture noundef readonly) local_unnamed_addr #6

declare ptr @readdir(ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN8platform3url12constructors5MkUrlEPKc(ptr dead_on_unwind noalias writable sret(%"struct.platform::url::Url") align 8, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4libc3str3cmpINS0_15comparison_modeILb0ELb1ELb0ELb0EEEcTnPNSt9enable_ifIXsrT_8no_indexEvE4typeELPv0EJEEEbPKT0_SC_DpT2_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS1_20posix_error_categoryEEEE9DirItem_tESaIS8_EE9push_backEOS8_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #0 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @closedir(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { 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 #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 }
attributes #9 = { nounwind willreturn memory(none) }

!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, !8, i64 18}
!6 = !{!"_ZTS6dirent", !7, i64 0, !7, i64 8, !10, i64 16, !8, i64 18, !8, i64 19}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !18, i64 32}
!14 = !{!"_ZTSN8platform4file9DirFunDefIN9stl_types17domain_error_codeIiNS0_20posix_error_categoryEEEE9DirItem_tE", !15, i64 0, !18, i64 32}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !7, i64 8, !8, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !17, i64 0}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"_ZTSN8platform4file8NodeTypeE", !8, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass