; LLVM IR from gulrak/filesystem :: test/impl_test.ll (ZN3ghc10filesystem9canonicalERKNS0_4pathERSt10error_code)

; 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.ghc::filesystem::path::iterator" = type { %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.ghc::filesystem::path" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.ghc::filesystem::path" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::error_code" = type { i32, ptr }
%"class.ghc::filesystem::file_status" = type <{ i32, i16, [2 x i8] }>

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef) #0

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

; 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 noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ghc10filesystem11file_status4typeEv(ptr noundef nonnull align 4 dereferenceable(6)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathaSEOS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path11is_absoluteEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path18has_root_directoryEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3ghc10filesystem4path5beginEv(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path::iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path8iteratorneERKS2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3ghc10filesystem4path3endEv(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path::iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK3ghc10filesystem4path8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(72)) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3ghc10filesystem4path11parent_pathEv(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3ghc10filesystemeqERKNS0_4pathES3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ghc10filesystem8absoluteERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ghc10filesystem9canonicalERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %2) #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::error_code", align 8
  %8 = alloca %"class.ghc::filesystem::path", align 8
  %9 = alloca %"class.ghc::filesystem::path", align 8
  %10 = alloca %"class.ghc::filesystem::file_status", align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::error_code", align 8
  %13 = alloca i8, align 1
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.ghc::filesystem::path::iterator", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.ghc::filesystem::path::iterator", align 8
  %20 = alloca %"class.ghc::filesystem::path", align 8
  %21 = alloca %"class.ghc::filesystem::path", align 8
  %22 = alloca i1, align 1
  %23 = alloca i1, align 1
  %24 = alloca %"class.ghc::filesystem::path", align 8
  %25 = alloca %"class.ghc::filesystem::path", align 8
  %26 = alloca %"class.std::__cxx11::basic_string", align 8
  %27 = alloca %"class.ghc::filesystem::path", align 8
  %28 = alloca %"class.ghc::filesystem::file_status", align 4
  %29 = alloca %"class.ghc::filesystem::path", align 8
  %30 = alloca %"class.ghc::filesystem::file_status", align 4
  %31 = alloca %"class.ghc::filesystem::path", align 8
  %32 = alloca %"class.ghc::filesystem::path", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %33) #6
  br i1 %34, label %35, label %42

35:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  %36 = call { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef 2)
  %37 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 0
  %38 = extractvalue { i32, ptr } %36, 0
  store i32 %38, ptr %37, align 8
  %39 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 1
  %40 = extractvalue { i32, ptr } %36, 1
  store ptr %40, ptr %39, align 8
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  br label %244

42:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path11is_absoluteEv(ptr noundef nonnull align 8 dereferenceable(32) %43)
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3ghc10filesystem4pathC1ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %46)
  br label %50

47:                                               ; preds = %42
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3ghc10filesystem8absoluteERKNS0_4pathERSt10error_code(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %48, ptr noundef nonnull align 8 dereferenceable(16) %49)
  br label %50

50:                                               ; preds = %47, %45
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3ghc10filesystem6statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::file_status") align 4 %10, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(16) %51) #6
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %52) #6
  br i1 %53, label %54, label %55

54:                                               ; preds = %50
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  store i32 1, ptr %11, align 4
  br label %243

55:                                               ; preds = %50
  %56 = call noundef i32 @_ZNK3ghc10filesystem11file_status4typeEv(ptr noundef nonnull align 4 dereferenceable(6) %10) #6
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %65

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %59 = call { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef 2)
  %60 = getelementptr inbounds { i32, ptr }, ptr %12, i32 0, i32 0
  %61 = extractvalue { i32, ptr } %59, 0
  store i32 %61, ptr %60, align 8
  %62 = getelementptr inbounds { i32, ptr }, ptr %12, i32 0, i32 1
  %63 = extractvalue { i32, ptr } %59, 1
  store ptr %63, ptr %62, align 8
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %64, ptr align 8 %12, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  store i32 1, ptr %11, align 4
  br label %243

65:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  br label %66

66:                                               ; preds = %232, %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %67 = call noundef i64 @_ZNK3ghc10filesystem4path16root_name_lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  %68 = add i64 0, %67
  %69 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path18has_root_directoryEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %70 = zext i1 %69 to i64
  %71 = select i1 %69, i32 1, i32 0
  %72 = sext i32 %71 to i64
  %73 = add i64 %68, %72
  store i64 %73, ptr %14, align 8, !tbaa !12
  store i8 0, ptr %13, align 1, !tbaa !14
  call void @_ZN3ghc10filesystem4path5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store ptr %8, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr %16) #6
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZNK3ghc10filesystem4path5beginEv(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path::iterator") align 8 %16, ptr noundef nonnull align 8 dereferenceable(32) %74)
          to label %75 unwind label %81

75:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 72, ptr %19) #6
  %76 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZNK3ghc10filesystem4path3endEv(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path::iterator") align 8 %19, ptr noundef nonnull align 8 dereferenceable(32) %76)
          to label %77 unwind label %85

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %212, %77
  %79 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path8iteratorneERKS2_(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr noundef nonnull align 8 dereferenceable(72) %19)
  br i1 %79, label %89, label %80

80:                                               ; preds = %78
  store i32 4, ptr %11, align 4
  br label %221

81:                                               ; preds = %66
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %17, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %18, align 4
  br label %225

85:                                               ; preds = %75
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %17, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %18, align 4
  br label %224

89:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #6
  %90 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK3ghc10filesystem4path8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(72) %16)
  invoke void @_ZN3ghc10filesystem4pathC1ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %90)
          to label %91 unwind label %105

91:                                               ; preds = %89
  %92 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  store i1 false, ptr %22, align 1
  store i1 false, ptr %23, align 1
  br i1 %92, label %96, label %93

93:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  store i1 true, ptr %22, align 1
  invoke void @_ZN3ghc10filesystem4pathC2IA2_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 1 dereferenceable(2) @.str.4, i32 noundef 2)
          to label %94 unwind label %109

94:                                               ; preds = %93
  store i1 true, ptr %23, align 1
  %95 = call noundef zeroext i1 @_ZN3ghc10filesystemeqERKNS0_4pathES3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  br label %96

96:                                               ; preds = %94, %91
  %97 = phi i1 [ true, %91 ], [ %95, %94 ]
  %98 = load i1, ptr %23, align 1
  br i1 %98, label %99, label %100

99:                                               ; preds = %96
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  br label %100

100:                                              ; preds = %99, %96
  %101 = load i1, ptr %22, align 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  br label %103

103:                                              ; preds = %102, %100
  br i1 %97, label %104, label %116

104:                                              ; preds = %103
  store i32 5, ptr %11, align 4
  br label %207

105:                                              ; preds = %89
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %17, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %18, align 4
  br label %216

109:                                              ; preds = %93
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %17, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %18, align 4
  %113 = load i1, ptr %22, align 1
  br i1 %113, label %114, label %115

114:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  br label %115

115:                                              ; preds = %114, %109
  br label %215

116:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #6
  invoke void @_ZN3ghc10filesystem4pathC2IA3_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull align 1 dereferenceable(3) @.str.5, i32 noundef 2)
          to label %117 unwind label %122

117:                                              ; preds = %116
  %118 = call noundef zeroext i1 @_ZN3ghc10filesystemeqERKNS0_4pathES3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %24) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #6
  br i1 %118, label %119, label %130

119:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #6
  invoke void @_ZNK3ghc10filesystem4path11parent_pathEv(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path") align 8 %25, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %120 unwind label %126

120:                                              ; preds = %119
  %121 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathaSEOS1_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #6
  store i32 5, ptr %11, align 4
  br label %207

122:                                              ; preds = %116
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %17, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #6
  br label %215

126:                                              ; preds = %119
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %17, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #6
  br label %215

130:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 32, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #6
  invoke void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path") align 8 %27, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %131 unwind label %139

131:                                              ; preds = %130
  invoke void @_ZNK3ghc10filesystem4path6stringB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %26, ptr noundef nonnull align 8 dereferenceable(32) %27)
          to label %132 unwind label %143

132:                                              ; preds = %131
  %133 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %26) #6
  %134 = load i64, ptr %14, align 8, !tbaa !12
  %135 = icmp ule i64 %133, %134
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #6
  br i1 %135, label %136, label %152

136:                                              ; preds = %132
  %137 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathdVERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %138 unwind label %148

138:                                              ; preds = %136
  store i32 5, ptr %11, align 4
  br label %207

139:                                              ; preds = %130
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %17, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %18, align 4
  br label %147

143:                                              ; preds = %131
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %17, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %18, align 4
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #6
  br label %147

147:                                              ; preds = %143, %139
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #6
  br label %215

148:                                              ; preds = %136
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %17, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %18, align 4
  br label %215

152:                                              ; preds = %132
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %29) #6
  invoke void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path") align 8 %29, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %155 unwind label %160

155:                                              ; preds = %154
  %156 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3ghc10filesystem14symlink_statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::file_status") align 4 %28, ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef nonnull align 8 dereferenceable(16) %156) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #6
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %157) #6
  br i1 %158, label %159, label %164

159:                                              ; preds = %155
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  store i32 1, ptr %11, align 4
  br label %204

160:                                              ; preds = %154
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %17, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #6
  br label %214

164:                                              ; preds = %155
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %30, ptr noundef nonnull align 4 dereferenceable(6) %28) #6
  %165 = call noundef zeroext i1 @_ZN3ghc10filesystem10is_symlinkENS0_11file_statusE(ptr noundef %30) #6
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %30) #6
  br i1 %165, label %166, label %196

166:                                              ; preds = %164
  store i8 1, ptr %13, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 32, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %32) #6
  invoke void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path") align 8 %32, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %167 unwind label %173

167:                                              ; preds = %166
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3ghc10filesystem12read_symlinkERKNS0_4pathERSt10error_code(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::path") align 8 %31, ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull align 8 dereferenceable(16) %168)
          to label %169 unwind label %177

169:                                              ; preds = %167
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %32) #6
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %170) #6
  br i1 %171, label %172, label %182

172:                                              ; preds = %169
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  store i32 1, ptr %11, align 4
  br label %194

173:                                              ; preds = %166
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %17, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %18, align 4
  br label %181

177:                                              ; preds = %167
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %17, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %18, align 4
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #6
  br label %181

181:                                              ; preds = %177, %173
  call void @llvm.lifetime.end.p0(i64 32, ptr %32) #6
  br label %195

182:                                              ; preds = %169
  %183 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path11is_absoluteEv(ptr noundef nonnull align 8 dereferenceable(32) %31)
  br i1 %183, label %184, label %191

184:                                              ; preds = %182
  %185 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %186 unwind label %187

186:                                              ; preds = %184
  store i32 5, ptr %11, align 4
  br label %194

187:                                              ; preds = %191, %184
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %17, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %18, align 4
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  br label %195

191:                                              ; preds = %182
  %192 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathdVERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %193 unwind label %187

193:                                              ; preds = %191
  store i32 5, ptr %11, align 4
  br label %194

194:                                              ; preds = %193, %186, %172
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #6
  br label %204

195:                                              ; preds = %187, %181
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #6
  br label %213

196:                                              ; preds = %164
  %197 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathdVERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %198 unwind label %199

198:                                              ; preds = %196
  br label %203

199:                                              ; preds = %196
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %17, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %18, align 4
  br label %213

203:                                              ; preds = %198
  store i32 0, ptr %11, align 4
  br label %204

204:                                              ; preds = %203, %194, %159
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  %205 = load i32, ptr %11, align 4
  switch i32 %205, label %207 [
    i32 0, label %206
  ]

206:                                              ; preds = %204
  store i32 0, ptr %11, align 4
  br label %207

207:                                              ; preds = %206, %204, %138, %120, %104
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  %208 = load i32, ptr %11, align 4
  switch i32 %208, label %221 [
    i32 0, label %209
    i32 5, label %210
  ]

209:                                              ; preds = %207
  br label %210

210:                                              ; preds = %209, %207
  %211 = invoke noundef nonnull align 8 dereferenceable(72) ptr @_ZN3ghc10filesystem4path8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(72) %16)
          to label %212 unwind label %217

212:                                              ; preds = %210
  br label %78

213:                                              ; preds = %199, %195
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %28) #6
  br label %214

214:                                              ; preds = %213, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %215

215:                                              ; preds = %214, %148, %147, %126, %122, %115
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  br label %216

216:                                              ; preds = %215, %105
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  br label %223

217:                                              ; preds = %210
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %17, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %18, align 4
  br label %223

221:                                              ; preds = %207, %80
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %19) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %19) #6
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %16) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %222 = load i32, ptr %11, align 4
  switch i32 %222, label %229 [
    i32 4, label %226
  ]

223:                                              ; preds = %217, %216
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %19) #6
  br label %224

224:                                              ; preds = %223, %85
  call void @llvm.lifetime.end.p0(i64 72, ptr %19) #6
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %16) #6
  br label %225

225:                                              ; preds = %224, %81
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %241

226:                                              ; preds = %221
  %227 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %228 unwind label %237

228:                                              ; preds = %226
  store i32 0, ptr %11, align 4
  br label %229

229:                                              ; preds = %228, %221
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %230 = load i32, ptr %11, align 4
  switch i32 %230, label %242 [
    i32 0, label %231
  ]

231:                                              ; preds = %229
  br label %232

232:                                              ; preds = %231
  %233 = load i8, ptr %13, align 1, !tbaa !14, !range !16, !noundef !17
  %234 = trunc i8 %233 to i1
  br i1 %234, label %66, label %235, !llvm.loop !18

235:                                              ; preds = %232
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNSt10error_code5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %236) #6
  call void @_ZN3ghc10filesystem4pathC1EOS1_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  store i32 1, ptr %11, align 4
  br label %242

237:                                              ; preds = %226
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %17, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %18, align 4
  br label %241

241:                                              ; preds = %237, %225
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %245

242:                                              ; preds = %235, %229
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %243

243:                                              ; preds = %242, %58, %54
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %244

244:                                              ; preds = %243, %35
  ret void

245:                                              ; preds = %241
  %246 = load ptr, ptr %17, align 8
  %247 = load i32, ptr %18, align 4
  %248 = insertvalue { ptr, i32 } poison, ptr %246, 0
  %249 = insertvalue { ptr, i32 } %248, i32 %247, 1
  resume { ptr, i32 } %249
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ghc10filesystem6statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::file_status") align 4, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ghc10filesystem14symlink_statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::file_status") align 4, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3ghc10filesystem10is_symlinkENS0_11file_statusE(ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ghc10filesystem12read_symlinkERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) #3

declare void @_ZN3ghc10filesystem4pathC1Ev(ptr)

declare void @_ZN3ghc10filesystem4pathC1ERKS1_(ptr, ptr)

declare void @_ZN3ghc10filesystem4pathC1EOS1_(ptr, ptr)

declare void @_ZN3ghc10filesystem4pathD1Ev(ptr)

declare void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr, ptr)

declare void @_ZN3ghc10filesystem11file_statusD1Ev(ptr)

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{i64 0, i64 4, !10, i64 8, i64 8, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !19}
!19 = !{!"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"

%"class.ghc::filesystem::path::iterator" = type { %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.__gnu_cxx::__normal_iterator", %"class.ghc::filesystem::path" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.ghc::filesystem::path" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.ghc::filesystem::file_status" = type <{ i32, i16, [2 x i8] }>

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef) local_unnamed_addr #0

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

; 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 noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ghc10filesystem11file_status4typeEv(ptr noundef nonnull align 4 dereferenceable(6)) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path11is_absoluteEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path18has_root_directoryEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3ghc10filesystem4path5beginEv(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path::iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZN3ghc10filesystem4path8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ghc10filesystem4path8iteratorneERKS2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3ghc10filesystem4path3endEv(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path::iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3ghc10filesystem4path11parent_pathEv(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3ghc10filesystemeqERKNS0_4pathES3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ghc10filesystem8absoluteERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ghc10filesystem9canonicalERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.ghc::filesystem::path", align 8
  %5 = alloca %"class.ghc::filesystem::path", align 8
  %6 = alloca %"class.ghc::filesystem::file_status", align 4
  %7 = alloca %"class.ghc::filesystem::path::iterator", align 8
  %8 = alloca %"class.ghc::filesystem::path::iterator", align 8
  %9 = alloca %"class.ghc::filesystem::path", align 8
  %10 = alloca %"class.ghc::filesystem::path", align 8
  %11 = alloca %"class.ghc::filesystem::path", align 8
  %12 = alloca %"class.ghc::filesystem::path", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.ghc::filesystem::path", align 8
  %15 = alloca %"class.ghc::filesystem::file_status", align 4
  %16 = alloca %"class.ghc::filesystem::path", align 8
  %17 = alloca %"class.ghc::filesystem::file_status", align 4
  %18 = alloca %"class.ghc::filesystem::path", align 8
  %19 = alloca %"class.ghc::filesystem::path", align 8
  %20 = tail call noundef zeroext i1 @_ZNK3ghc10filesystem4path5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  br i1 %20, label %21, label %25

21:                                               ; preds = %3
  %22 = tail call { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef 2)
  %23 = extractvalue { i32, ptr } %22, 0
  %24 = extractvalue { i32, ptr } %22, 1
  store i32 %23, ptr %2, align 8, !tbaa !5
  %.sroa.417.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %24, ptr %.sroa.417.0..sroa_idx, align 8, !tbaa !9
  tail call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %130

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  %26 = tail call noundef zeroext i1 @_ZNK3ghc10filesystem4path11is_absoluteEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  call void @_ZN3ghc10filesystem4pathC1ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %1)
  br label %29

28:                                               ; preds = %25
  call void @_ZN3ghc10filesystem8absoluteERKNS0_4pathERSt10error_code(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %2)
  br label %29

29:                                               ; preds = %28, %27
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN3ghc10filesystem6statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::file_status") align 4 %6, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  %30 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  br i1 %30, label %31, label %32

31:                                               ; preds = %29
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %.loopexit87

32:                                               ; preds = %29
  %33 = call noundef i32 @_ZNK3ghc10filesystem11file_status4typeEv(ptr noundef nonnull align 4 dereferenceable(6) %6) #5
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %35, label %.preheader86

35:                                               ; preds = %32
  %36 = call { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef 2)
  %37 = extractvalue { i32, ptr } %36, 0
  %38 = extractvalue { i32, ptr } %36, 1
  store i32 %37, ptr %2, align 8, !tbaa !5
  %.sroa.410.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %38, ptr %.sroa.410.0..sroa_idx, align 8, !tbaa !9
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %.loopexit87

.preheader86:                                     ; preds = %32, %125
  %39 = call noundef i64 @_ZNK3ghc10filesystem4path16root_name_lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  %40 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path18has_root_directoryEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %41 = zext i1 %40 to i64
  %42 = add i64 %39, %41
  call void @_ZN3ghc10filesystem4path5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #5
  invoke void @_ZNK3ghc10filesystem4path5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path::iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %43 unwind label %45

43:                                               ; preds = %.preheader86
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #5
  invoke void @_ZNK3ghc10filesystem4path3endEv(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path::iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %.preheader unwind label %47

.preheader:                                       ; preds = %43, %112
  %.050 = phi i1 [ %.25273, %112 ], [ false, %43 ]
  %44 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path8iteratorneERKS2_(ptr noundef nonnull align 8 dereferenceable(72) %7, ptr noundef nonnull align 8 dereferenceable(72) %8)
  br i1 %44, label %49, label %.loopexit

45:                                               ; preds = %.preheader86
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %122

47:                                               ; preds = %43
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %121

49:                                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  %50 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK3ghc10filesystem4path8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(72) %7)
  invoke void @_ZN3ghc10filesystem4pathC1ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %50)
          to label %51 unwind label %55

51:                                               ; preds = %49
  %52 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br i1 %52, label %.thread70, label %53

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  invoke void @_ZN3ghc10filesystem4pathC2IA2_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 1 dereferenceable(2) @.str.4, i32 noundef 2)
          to label %.critedge unwind label %57

.critedge:                                        ; preds = %53
  %54 = call noundef zeroext i1 @_ZN3ghc10filesystemeqERKNS0_4pathES3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br i1 %54, label %.thread70, label %59

55:                                               ; preds = %49
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %117

57:                                               ; preds = %53
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br label %116

59:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  invoke void @_ZN3ghc10filesystem4pathC2IA3_cS1_EERKT_NS1_6formatE(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 1 dereferenceable(3) @.str.5, i32 noundef 2)
          to label %60 unwind label %65

60:                                               ; preds = %59
  %61 = call noundef zeroext i1 @_ZN3ghc10filesystemeqERKNS0_4pathES3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  br i1 %61, label %62, label %69

62:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  invoke void @_ZNK3ghc10filesystem4path11parent_pathEv(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %63 unwind label %67

63:                                               ; preds = %62
  %64 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathaSEOS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  br label %.thread70

65:                                               ; preds = %59
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  br label %116

67:                                               ; preds = %62
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  br label %116

69:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #5
  invoke void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path") align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %70 unwind label %75

70:                                               ; preds = %69
  invoke void @_ZNK3ghc10filesystem4path6stringB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %71 unwind label %77

71:                                               ; preds = %70
  %72 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  %.not = icmp ugt i64 %72, %42
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  br i1 %.not, label %82, label %73

73:                                               ; preds = %71
  %74 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathdVERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %.thread70 unwind label %80

75:                                               ; preds = %69
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %79

77:                                               ; preds = %70
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  br label %79

79:                                               ; preds = %77, %75
  %.pn = phi { ptr, i32 } [ %78, %77 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  br label %116

80:                                               ; preds = %73
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %116

82:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %16) #5
  invoke void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path") align 8 %16, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %83 unwind label %85

83:                                               ; preds = %82
  call void @_ZN3ghc10filesystem14symlink_statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::file_status") align 4 %15, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #5
  %84 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  br i1 %84, label %.thread74, label %87

.thread74:                                        ; preds = %83
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %.loopexit

85:                                               ; preds = %82
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #5
  br label %115

87:                                               ; preds = %83
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %17, ptr noundef nonnull align 4 dereferenceable(6) %15) #5
  %88 = call noundef zeroext i1 @_ZN3ghc10filesystem10is_symlinkENS0_11file_statusE(ptr noundef nonnull %17) #5
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %17) #5
  br i1 %88, label %89, label %107

89:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %19) #5
  invoke void @_ZN3ghc10filesystemdvERKNS0_4pathES3_(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path") align 8 %19, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %90 unwind label %93

90:                                               ; preds = %89
  invoke void @_ZN3ghc10filesystem12read_symlinkERKNS0_4pathERSt10error_code(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::path") align 8 %18, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %91 unwind label %95

91:                                               ; preds = %90
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #5
  %92 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  br i1 %92, label %111, label %98

93:                                               ; preds = %89
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %97

95:                                               ; preds = %90
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  br label %97

97:                                               ; preds = %95, %93
  %.pn55 = phi { ptr, i32 } [ %96, %95 ], [ %94, %93 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %19) #5
  br label %106

98:                                               ; preds = %91
  %99 = call noundef zeroext i1 @_ZNK3ghc10filesystem4path11is_absoluteEv(ptr noundef nonnull align 8 dereferenceable(32) %18)
  br i1 %99, label %100, label %104

100:                                              ; preds = %98
  %101 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %.thread81 unwind label %102

102:                                              ; preds = %104, %100
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  br label %106

104:                                              ; preds = %98
  %105 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathdVERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %.thread81 unwind label %102

106:                                              ; preds = %102, %97
  %.pn57 = phi { ptr, i32 } [ %103, %102 ], [ %.pn55, %97 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #5
  br label %114

107:                                              ; preds = %87
  %108 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathdVERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %.thread77 unwind label %109

.thread77:                                        ; preds = %107
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %112

109:                                              ; preds = %107
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %114

.thread70:                                        ; preds = %63, %.critedge, %73, %51
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %112

.thread81:                                        ; preds = %100, %104
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #5
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %112

111:                                              ; preds = %91
  call void @_ZN3ghc10filesystem4pathC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #5
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %.loopexit

112:                                              ; preds = %.thread81, %.thread77, %.thread70
  %.25273 = phi i1 [ %.050, %.thread70 ], [ %.050, %.thread77 ], [ true, %.thread81 ]
  %113 = invoke noundef nonnull align 8 dereferenceable(72) ptr @_ZN3ghc10filesystem4path8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(72) %7)
          to label %.preheader unwind label %118

114:                                              ; preds = %109, %106
  %.pn57.pn = phi { ptr, i32 } [ %.pn57, %106 ], [ %110, %109 ]
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %15) #5
  br label %115

115:                                              ; preds = %114, %85
  %.pn57.pn.pn = phi { ptr, i32 } [ %.pn57.pn, %114 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %116

116:                                              ; preds = %57, %115, %80, %79, %67, %65
  %.pn61 = phi { ptr, i32 } [ %68, %67 ], [ %81, %80 ], [ %.pn57.pn.pn, %115 ], [ %.pn, %79 ], [ %66, %65 ], [ %58, %57 ]
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br label %117

117:                                              ; preds = %116, %55
  %.pn61.pn = phi { ptr, i32 } [ %.pn61, %116 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %120

118:                                              ; preds = %112
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %120

.loopexit:                                        ; preds = %.preheader, %111, %.thread74
  %.353 = phi i1 [ true, %111 ], [ %.050, %.thread74 ], [ %.050, %.preheader ]
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %8) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #5
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %7) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #5
  br i1 %44, label %.loopexit87, label %123

120:                                              ; preds = %118, %117
  %.pn64 = phi { ptr, i32 } [ %119, %118 ], [ %.pn61.pn, %117 ]
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %8) #5
  br label %121

121:                                              ; preds = %120, %47
  %.pn64.pn = phi { ptr, i32 } [ %.pn64, %120 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #5
  call void @_ZN3ghc10filesystem4path8iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %7) #5
  br label %122

122:                                              ; preds = %121, %45
  %.pn64.pn.pn = phi { ptr, i32 } [ %.pn64.pn, %121 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #5
  br label %129

123:                                              ; preds = %.loopexit
  %124 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN3ghc10filesystem4pathaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %125 unwind label %127

125:                                              ; preds = %123
  br i1 %.353, label %.preheader86, label %126, !llvm.loop !11

126:                                              ; preds = %125
  call void @_ZNSt10error_code5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @_ZN3ghc10filesystem4pathC1EOS1_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %.loopexit87

127:                                              ; preds = %123
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %129

129:                                              ; preds = %127, %122
  %.pn68 = phi { ptr, i32 } [ %128, %127 ], [ %.pn64.pn.pn, %122 ]
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn68

.loopexit87:                                      ; preds = %.loopexit, %126, %35, %31
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN3ghc10filesystem4pathD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %130

130:                                              ; preds = %.loopexit87, %21
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ghc10filesystem6statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::file_status") align 4, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ghc10filesystem14symlink_statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::file_status") align 4, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3ghc10filesystem10is_symlinkENS0_11file_statusE(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ghc10filesystem12read_symlinkERKNS0_4pathERSt10error_code(ptr dead_on_unwind noalias writable sret(%"class.ghc::filesystem::path") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

declare void @_ZN3ghc10filesystem4pathC1Ev(ptr) local_unnamed_addr

declare void @_ZN3ghc10filesystem4pathC1ERKS1_(ptr, ptr) local_unnamed_addr

declare void @_ZN3ghc10filesystem4pathC1EOS1_(ptr, ptr) local_unnamed_addr

declare void @_ZN3ghc10filesystem4pathD1Ev(ptr) local_unnamed_addr

declare void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr, ptr) local_unnamed_addr

declare void @_ZN3ghc10filesystem11file_statusD1Ev(ptr) local_unnamed_addr

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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