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

; 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::file_status" = type <{ i32, i16, [2 x i8] }>
%"class.std::error_code" = type { i32, ptr }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

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

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3ghc10filesystem4path5c_strEv(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) #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIcSaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #5

; 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 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 noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext, i16 noundef zeroext) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN3ghc10filesystemorINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext, i16 noundef zeroext) #0

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN3ghc10filesystem9copy_fileERKNS0_4pathES3_NS0_12copy_optionsERSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i16 noundef zeroext %2, ptr noundef nonnull align 8 dereferenceable(16) %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::error_code", align 8
  %11 = alloca %"class.std::error_code", align 8
  %12 = alloca %"class.ghc::filesystem::file_status", align 4
  %13 = alloca %"class.ghc::filesystem::file_status", align 4
  %14 = alloca i8, align 1
  %15 = alloca %"class.ghc::filesystem::file_status", align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.ghc::filesystem::file_status", align 4
  %18 = alloca %"class.ghc::filesystem::file_status", align 4
  %19 = alloca %"class.std::error_code", align 8
  %20 = alloca %"class.std::chrono::time_point", align 8
  %21 = alloca %"class.std::error_code", align 8
  %22 = alloca %"class.std::chrono::time_point", align 8
  %23 = alloca %"class.std::error_code", align 8
  %24 = alloca %"class.std::vector", align 8
  %25 = alloca i8, align 1
  %26 = alloca %"class.std::allocator", align 1
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.std::error_code", align 8
  %30 = alloca i32, align 4
  %31 = alloca %"class.std::error_code", align 8
  %32 = alloca %"class.std::error_code", align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca %"class.std::error_code", align 8
  %36 = alloca i64, align 8
  %37 = alloca %"class.std::error_code", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i16 %2, ptr %8, align 2, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  call void @_ZNSt10error_codeC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  call void @_ZNSt10error_codeC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %38 = 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 %12, ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 8 dereferenceable(16) %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN3ghc10filesystem6statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind writable sret(%"class.ghc::filesystem::file_status") align 4 %13, ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #8
  store i8 0, ptr %14, align 1, !tbaa !11
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNSt10error_code5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %40) #8
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %15, ptr noundef nonnull align 4 dereferenceable(6) %12) #8
  %41 = call noundef zeroext i1 @_ZN3ghc10filesystem15is_regular_fileENS0_11file_statusE(ptr noundef %15) #8
  %42 = xor i1 %41, true
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %15) #8
  br i1 %42, label %43, label %45

43:                                               ; preds = %4
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %44, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !13
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %287

45:                                               ; preds = %4
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %17, ptr noundef nonnull align 4 dereferenceable(6) %13) #8
  %46 = call noundef zeroext i1 @_ZN3ghc10filesystem6existsENS0_11file_statusE(ptr noundef %17) #8
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %17) #8
  br i1 %46, label %47, label %125

47:                                               ; preds = %45
  %48 = load i16, ptr %8, align 2, !tbaa !9
  %49 = invoke noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %48, i16 noundef zeroext 1)
          to label %50 unwind label %289

50:                                               ; preds = %47
  %51 = icmp eq i16 %49, 1
  br i1 %51, label %52, label %53

52:                                               ; preds = %50
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %287

53:                                               ; preds = %50
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %18, ptr noundef nonnull align 4 dereferenceable(6) %13) #8
  %54 = call noundef zeroext i1 @_ZN3ghc10filesystem15is_regular_fileENS0_11file_statusE(ptr noundef %18) #8
  br i1 %54, label %55, label %67

55:                                               ; preds = %53
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = call noundef zeroext i1 @_ZN3ghc10filesystem10equivalentERKNS0_4pathES3_RSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %56, ptr noundef nonnull align 8 dereferenceable(32) %57, ptr noundef nonnull align 8 dereferenceable(16) %58) #8
  br i1 %59, label %67, label %60

60:                                               ; preds = %55
  %61 = load i16, ptr %8, align 2, !tbaa !9
  %62 = invoke noundef zeroext i16 @_ZN3ghc10filesystemorINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext 2, i16 noundef zeroext 4)
          to label %63 unwind label %289

63:                                               ; preds = %60
  %64 = invoke noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %61, i16 noundef zeroext %62)
          to label %65 unwind label %289

65:                                               ; preds = %63
  %66 = icmp eq i16 %64, 0
  br label %67

67:                                               ; preds = %65, %55, %53
  %68 = phi i1 [ true, %55 ], [ true, %53 ], [ %66, %65 ]
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %18) #8
  br i1 %68, label %69, label %80

69:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  %70 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  br i1 %70, label %71, label %72

71:                                               ; preds = %69
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !13
  br label %78

72:                                               ; preds = %69
  %73 = call { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef 1)
  %74 = getelementptr inbounds { i32, ptr }, ptr %19, i32 0, i32 0
  %75 = extractvalue { i32, ptr } %73, 0
  store i32 %75, ptr %74, align 8
  %76 = getelementptr inbounds { i32, ptr }, ptr %19, i32 0, i32 1
  %77 = extractvalue { i32, ptr } %73, 1
  store ptr %77, ptr %76, align 8
  br label %78

78:                                               ; preds = %72, %71
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %79, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %287

80:                                               ; preds = %67
  %81 = load i16, ptr %8, align 2, !tbaa !9
  %82 = invoke noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %81, i16 noundef zeroext 4)
          to label %83 unwind label %289

83:                                               ; preds = %80
  %84 = icmp eq i16 %82, 4
  br i1 %84, label %85, label %124

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = call i64 @_ZN3ghc10filesystem15last_write_timeERKNS0_4pathERSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %86, ptr noundef nonnull align 8 dereferenceable(16) %87) #8
  %89 = getelementptr inbounds %"class.std::chrono::time_point", ptr %20, i32 0, i32 0
  %90 = getelementptr inbounds %"class.std::chrono::duration", ptr %89, i32 0, i32 0
  store i64 %88, ptr %90, align 8
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %91) #8
  br i1 %92, label %93, label %100

93:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  %94 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %95 = getelementptr inbounds { i32, ptr }, ptr %21, i32 0, i32 0
  %96 = extractvalue { i32, ptr } %94, 0
  store i32 %96, ptr %95, align 8
  %97 = getelementptr inbounds { i32, ptr }, ptr %21, i32 0, i32 1
  %98 = extractvalue { i32, ptr } %94, 1
  store ptr %98, ptr %97, align 8
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %99, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %121

100:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = call i64 @_ZN3ghc10filesystem15last_write_timeERKNS0_4pathERSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %101, ptr noundef nonnull align 8 dereferenceable(16) %102) #8
  %104 = getelementptr inbounds %"class.std::chrono::time_point", ptr %22, i32 0, i32 0
  %105 = getelementptr inbounds %"class.std::chrono::duration", ptr %104, i32 0, i32 0
  store i64 %103, ptr %105, align 8
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %106) #8
  br i1 %107, label %108, label %115

108:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  %109 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %110 = getelementptr inbounds { i32, ptr }, ptr %23, i32 0, i32 0
  %111 = extractvalue { i32, ptr } %109, 0
  store i32 %111, ptr %110, align 8
  %112 = getelementptr inbounds { i32, ptr }, ptr %23, i32 0, i32 1
  %113 = extractvalue { i32, ptr } %109, 1
  store ptr %113, ptr %112, align 8
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %114, ptr align 8 %23, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %120

115:                                              ; preds = %100
  %116 = invoke noundef zeroext i1 @_ZNSt6chronoleINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EEbRKNS_10time_pointIT_T0_EERKNS7_IS8_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %117 unwind label %289

117:                                              ; preds = %115
  br i1 %116, label %118, label %119

118:                                              ; preds = %117
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %120

119:                                              ; preds = %117
  store i32 0, ptr %16, align 4
  br label %120

120:                                              ; preds = %119, %118, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %121

121:                                              ; preds = %120, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  %122 = load i32, ptr %16, align 4
  switch i32 %122, label %287 [
    i32 0, label %123
  ]

123:                                              ; preds = %121
  br label %124

124:                                              ; preds = %123, %83
  store i8 1, ptr %14, align 1, !tbaa !11
  br label %125

125:                                              ; preds = %124, %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #8
  store i8 0, ptr %25, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #8
  invoke void @_ZNSt6vectorIcSaIcEEC2EmRKcRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef 16384, ptr noundef nonnull align 1 dereferenceable(1) %25, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %126 unwind label %289

126:                                              ; preds = %125
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 -1, ptr %27, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 -1, ptr %28, align 4, !tbaa !14
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = call noundef ptr @_ZNK3ghc10filesystem4path5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %127) #8
  %129 = invoke i32 (ptr, i32, ...) @open(ptr noundef %128, i32 noundef 0)
          to label %130 unwind label %289

130:                                              ; preds = %126
  store i32 %129, ptr %27, align 4, !tbaa !14
  %131 = icmp slt i32 %129, 0
  br i1 %131, label %132, label %139

132:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #8
  %133 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %134 = getelementptr inbounds { i32, ptr }, ptr %29, i32 0, i32 0
  %135 = extractvalue { i32, ptr } %133, 0
  store i32 %135, ptr %134, align 8
  %136 = getelementptr inbounds { i32, ptr }, ptr %29, i32 0, i32 1
  %137 = extractvalue { i32, ptr } %133, 1
  store ptr %137, ptr %136, align 8
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %138, ptr align 8 %29, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #8
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %286

139:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 577, ptr %30, align 4, !tbaa !14
  %140 = load i8, ptr %14, align 1, !tbaa !11, !range !17, !noundef !18
  %141 = trunc i8 %140 to i1
  br i1 %141, label %145, label %142

142:                                              ; preds = %139
  %143 = load i32, ptr %30, align 4, !tbaa !14
  %144 = or i32 %143, 128
  store i32 %144, ptr %30, align 4, !tbaa !14
  br label %145

145:                                              ; preds = %142, %139
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = call noundef ptr @_ZNK3ghc10filesystem4path5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %146) #8
  %148 = load i32, ptr %30, align 4, !tbaa !14
  %149 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %12) #8
  %150 = invoke noundef zeroext i16 @_ZN3ghc10filesystemanINS0_5permsEEENSt9enable_ifIXoooooosr3std7is_sameIT_S2_EE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_NS0_12copy_optionsEEE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %149, i16 noundef zeroext 511)
          to label %151 unwind label %289

151:                                              ; preds = %145
  %152 = zext i16 %150 to i32
  %153 = invoke i32 (ptr, i32, ...) @open(ptr noundef %147, i32 noundef %148, i32 noundef %152)
          to label %154 unwind label %289

154:                                              ; preds = %151
  store i32 %153, ptr %28, align 4, !tbaa !14
  %155 = icmp slt i32 %153, 0
  br i1 %155, label %156, label %166

156:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #8
  %157 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %158 = getelementptr inbounds { i32, ptr }, ptr %31, i32 0, i32 0
  %159 = extractvalue { i32, ptr } %157, 0
  store i32 %159, ptr %158, align 8
  %160 = getelementptr inbounds { i32, ptr }, ptr %31, i32 0, i32 1
  %161 = extractvalue { i32, ptr } %157, 1
  store ptr %161, ptr %160, align 8
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %162, ptr align 8 %31, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #8
  %163 = load i32, ptr %27, align 4, !tbaa !14
  %164 = invoke i32 @close(i32 noundef %163)
          to label %165 unwind label %289

165:                                              ; preds = %156
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %285

166:                                              ; preds = %154
  %167 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %13) #8
  %168 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %12) #8
  %169 = icmp ne i16 %167, %168
  br i1 %169, label %170, label %192

170:                                              ; preds = %166
  %171 = load i32, ptr %28, align 4, !tbaa !14
  %172 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %12) #8
  %173 = invoke noundef zeroext i16 @_ZN3ghc10filesystemanINS0_5permsEEENSt9enable_ifIXoooooosr3std7is_sameIT_S2_EE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_NS0_12copy_optionsEEE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %172, i16 noundef zeroext 511)
          to label %174 unwind label %289

174:                                              ; preds = %170
  %175 = zext i16 %173 to i32
  %176 = call i32 @fchmod(i32 noundef %171, i32 noundef %175) #8
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %191

178:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #8
  %179 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %180 = getelementptr inbounds { i32, ptr }, ptr %32, i32 0, i32 0
  %181 = extractvalue { i32, ptr } %179, 0
  store i32 %181, ptr %180, align 8
  %182 = getelementptr inbounds { i32, ptr }, ptr %32, i32 0, i32 1
  %183 = extractvalue { i32, ptr } %179, 1
  store ptr %183, ptr %182, align 8
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %184, ptr align 8 %32, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #8
  %185 = load i32, ptr %27, align 4, !tbaa !14
  %186 = invoke i32 @close(i32 noundef %185)
          to label %187 unwind label %289

187:                                              ; preds = %178
  %188 = load i32, ptr %28, align 4, !tbaa !14
  %189 = invoke i32 @close(i32 noundef %188)
          to label %190 unwind label %289

190:                                              ; preds = %187
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %285

191:                                              ; preds = %174
  br label %192

192:                                              ; preds = %191, %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  br label %193

193:                                              ; preds = %276, %192
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %209, %194
  %196 = load i32, ptr %27, align 4, !tbaa !14
  %197 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  %198 = call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  %199 = invoke i64 @read(i32 noundef %196, ptr noundef %197, i64 noundef %198)
          to label %200 unwind label %289

200:                                              ; preds = %195
  store i64 %199, ptr %33, align 8, !tbaa !19
  br label %201

201:                                              ; preds = %200
  %202 = call ptr @__errno_location() #9
  %203 = load i32, ptr %202, align 4, !tbaa !14
  %204 = icmp eq i32 %203, 4
  br i1 %204, label %205, label %209

205:                                              ; preds = %201
  %206 = load i64, ptr %33, align 8, !tbaa !19
  %207 = icmp ne i64 %206, 0
  %208 = xor i1 %207, true
  br label %209

209:                                              ; preds = %205, %201
  %210 = phi i1 [ false, %201 ], [ %208, %205 ]
  br i1 %210, label %195, label %211, !llvm.loop !21

211:                                              ; preds = %209
  %212 = load i64, ptr %33, align 8, !tbaa !19
  %213 = icmp ne i64 %212, 0
  br i1 %213, label %215, label %214

214:                                              ; preds = %211
  br label %277

215:                                              ; preds = %211
  %216 = load i64, ptr %33, align 8, !tbaa !19
  %217 = icmp slt i64 %216, 0
  br i1 %217, label %218, label %231

218:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #8
  %219 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %220 = getelementptr inbounds { i32, ptr }, ptr %35, i32 0, i32 0
  %221 = extractvalue { i32, ptr } %219, 0
  store i32 %221, ptr %220, align 8
  %222 = getelementptr inbounds { i32, ptr }, ptr %35, i32 0, i32 1
  %223 = extractvalue { i32, ptr } %219, 1
  store ptr %223, ptr %222, align 8
  %224 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %224, ptr align 8 %35, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #8
  %225 = load i32, ptr %27, align 4, !tbaa !14
  %226 = invoke i32 @close(i32 noundef %225)
          to label %227 unwind label %289

227:                                              ; preds = %218
  %228 = load i32, ptr %28, align 4, !tbaa !14
  %229 = invoke i32 @close(i32 noundef %228)
          to label %230 unwind label %289

230:                                              ; preds = %227
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %284

231:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  store i64 0, ptr %36, align 8, !tbaa !19
  br label %232

232:                                              ; preds = %270, %231
  %233 = load i32, ptr %28, align 4, !tbaa !14
  %234 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  %235 = load i64, ptr %36, align 8, !tbaa !19
  %236 = getelementptr inbounds i8, ptr %234, i64 %235
  %237 = load i64, ptr %33, align 8, !tbaa !19
  %238 = invoke i64 @write(i32 noundef %233, ptr noundef %236, i64 noundef %237)
          to label %239 unwind label %289

239:                                              ; preds = %232
  store i64 %238, ptr %34, align 8, !tbaa !19
  %240 = icmp sgt i64 %238, 0
  br i1 %240, label %241, label %248

241:                                              ; preds = %239
  %242 = load i64, ptr %34, align 8, !tbaa !19
  %243 = load i64, ptr %33, align 8, !tbaa !19
  %244 = sub nsw i64 %243, %242
  store i64 %244, ptr %33, align 8, !tbaa !19
  %245 = load i64, ptr %34, align 8, !tbaa !19
  %246 = load i64, ptr %36, align 8, !tbaa !19
  %247 = add nsw i64 %246, %245
  store i64 %247, ptr %36, align 8, !tbaa !19
  br label %269

248:                                              ; preds = %239
  %249 = load i64, ptr %34, align 8, !tbaa !19
  %250 = icmp slt i64 %249, 0
  br i1 %250, label %251, label %268

251:                                              ; preds = %248
  %252 = call ptr @__errno_location() #9
  %253 = load i32, ptr %252, align 4, !tbaa !14
  %254 = icmp ne i32 %253, 4
  br i1 %254, label %255, label %268

255:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 16, ptr %37) #8
  %256 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %257 = getelementptr inbounds { i32, ptr }, ptr %37, i32 0, i32 0
  %258 = extractvalue { i32, ptr } %256, 0
  store i32 %258, ptr %257, align 8
  %259 = getelementptr inbounds { i32, ptr }, ptr %37, i32 0, i32 1
  %260 = extractvalue { i32, ptr } %256, 1
  store ptr %260, ptr %259, align 8
  %261 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %261, ptr align 8 %37, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #8
  %262 = load i32, ptr %27, align 4, !tbaa !14
  %263 = invoke i32 @close(i32 noundef %262)
          to label %264 unwind label %289

264:                                              ; preds = %255
  %265 = load i32, ptr %28, align 4, !tbaa !14
  %266 = invoke i32 @close(i32 noundef %265)
          to label %267 unwind label %289

267:                                              ; preds = %264
  store i1 false, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %274

268:                                              ; preds = %251, %248
  br label %269

269:                                              ; preds = %268, %241
  br label %270

270:                                              ; preds = %269
  %271 = load i64, ptr %33, align 8, !tbaa !19
  %272 = icmp ne i64 %271, 0
  br i1 %272, label %232, label %273, !llvm.loop !23

273:                                              ; preds = %270
  store i32 0, ptr %16, align 4
  br label %274

274:                                              ; preds = %273, %267
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  %275 = load i32, ptr %16, align 4
  switch i32 %275, label %284 [
    i32 0, label %276
  ]

276:                                              ; preds = %274
  br label %193, !llvm.loop !24

277:                                              ; preds = %214
  %278 = load i32, ptr %27, align 4, !tbaa !14
  %279 = invoke i32 @close(i32 noundef %278)
          to label %280 unwind label %289

280:                                              ; preds = %277
  %281 = load i32, ptr %28, align 4, !tbaa !14
  %282 = invoke i32 @close(i32 noundef %281)
          to label %283 unwind label %289

283:                                              ; preds = %280
  store i1 true, ptr %5, align 1
  store i32 1, ptr %16, align 4
  br label %284

284:                                              ; preds = %283, %274, %230
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %285

285:                                              ; preds = %284, %190, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %286

286:                                              ; preds = %285, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @_ZNSt6vectorIcSaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  br label %287

287:                                              ; preds = %286, %121, %78, %52, %43
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #8
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  %288 = load i1, ptr %5, align 1
  ret i1 %288

289:                                              ; preds = %280, %277, %264, %255, %232, %227, %218, %195, %187, %178, %170, %156, %151, %145, %126, %125, %115, %80, %63, %60, %47
  %290 = landingpad { ptr, i32 }
          catch ptr null
  %291 = extractvalue { ptr, i32 } %290, 0
  call void @__clang_call_terminate(ptr %291) #10
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNSt6chronoleINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EEbRKNS_10time_pointIT_T0_EERKNS7_IS8_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN3ghc10filesystemanINS0_5permsEEENSt9enable_ifIXoooooosr3std7is_sameIT_S2_EE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_NS0_12copy_optionsEEE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext, i16 noundef zeroext) #0

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

declare i32 @close(i32 noundef) #6

; Function Attrs: nounwind
declare i32 @fchmod(i32 noundef, i32 noundef) #7

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

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTSN3ghc10filesystem12copy_optionsE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i64 0, i64 4, !14, i64 8, i64 8, !5}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}


; 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::file_status" = type <{ i32, i16, [2 x i8] }>
%"class.std::error_code" = type { i32, ptr }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

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

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

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

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

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

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

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

; Function Attrs: mustprogress 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) #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIcSaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #5

; 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 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 noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN3ghc10filesystemorINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN3ghc10filesystem9copy_fileERKNS0_4pathES3_NS0_12copy_optionsERSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i16 noundef zeroext %2, ptr noundef nonnull align 8 dereferenceable(16) %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::error_code", align 8
  %6 = alloca %"class.std::error_code", align 8
  %7 = alloca %"class.ghc::filesystem::file_status", align 4
  %8 = alloca %"class.ghc::filesystem::file_status", align 4
  %9 = alloca %"class.ghc::filesystem::file_status", align 4
  %10 = alloca %"class.ghc::filesystem::file_status", align 4
  %11 = alloca %"class.ghc::filesystem::file_status", align 4
  %12 = alloca %"class.std::chrono::time_point", align 8
  %13 = alloca %"class.std::chrono::time_point", align 8
  %14 = alloca %"class.std::vector", align 8
  %15 = alloca i8, align 1
  %16 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  call void @_ZNSt10error_codeC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #9
  call void @_ZNSt10error_codeC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  call void @_ZN3ghc10filesystem6statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::file_status") align 4 %7, ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  call void @_ZN3ghc10filesystem6statusERKNS0_4pathERSt10error_code(ptr dead_on_unwind nonnull writable sret(%"class.ghc::filesystem::file_status") align 4 %8, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %6) #9
  call void @_ZNSt10error_code5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #9
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %9, ptr noundef nonnull align 4 dereferenceable(6) %7) #9
  %17 = call noundef zeroext i1 @_ZN3ghc10filesystem15is_regular_fileENS0_11file_statusE(ptr noundef nonnull %9) #9
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %9) #9
  br i1 %17, label %19, label %18

18:                                               ; preds = %4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !5
  br label %128

19:                                               ; preds = %4
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %10, ptr noundef nonnull align 4 dereferenceable(6) %8) #9
  %20 = call noundef zeroext i1 @_ZN3ghc10filesystem6existsENS0_11file_statusE(ptr noundef nonnull %10) #9
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %10) #9
  br i1 %20, label %21, label %63

21:                                               ; preds = %19
  %22 = call noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %2, i16 noundef zeroext 1)
  %23 = icmp eq i16 %22, 1
  br i1 %23, label %128, label %24

24:                                               ; preds = %21
  call void @_ZN3ghc10filesystem11file_statusC1ERKS1_(ptr noundef nonnull align 4 dereferenceable(6) %11, ptr noundef nonnull align 4 dereferenceable(6) %8) #9
  %25 = call noundef zeroext i1 @_ZN3ghc10filesystem15is_regular_fileENS0_11file_statusE(ptr noundef nonnull %11) #9
  br i1 %25, label %26, label %.critedge

26:                                               ; preds = %24
  %27 = call noundef zeroext i1 @_ZN3ghc10filesystem10equivalentERKNS0_4pathES3_RSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %3) #9
  br i1 %27, label %.critedge, label %28

28:                                               ; preds = %26
  %29 = call noundef zeroext i16 @_ZN3ghc10filesystemorINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext 2, i16 noundef zeroext 4)
  %30 = call noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %2, i16 noundef zeroext %29)
  %31 = icmp eq i16 %30, 0
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %11) #9
  br i1 %31, label %32, label %43

.critedge:                                        ; preds = %24, %26
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %11) #9
  br label %32

32:                                               ; preds = %.critedge, %28
  %33 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #9
  br i1 %33, label %34, label %36

34:                                               ; preds = %32
  %35 = load <2 x i32>, ptr %6, align 8
  %.sroa.549.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.549.0.copyload = load ptr, ptr %.sroa.549.0..sroa_idx, align 8, !tbaa !10
  br label %41

36:                                               ; preds = %32
  %37 = call { i32, ptr } @_ZN3ghc10filesystem6detail15make_error_codeENS1_14portable_errorE(i32 noundef 1)
  %38 = extractvalue { i32, ptr } %37, 0
  %39 = extractvalue { i32, ptr } %37, 1
  %40 = insertelement <2 x i32> <i32 poison, i32 undef>, i32 %38, i64 0
  br label %41

41:                                               ; preds = %36, %34
  %.sroa.549.0 = phi ptr [ %.sroa.549.0.copyload, %34 ], [ %39, %36 ]
  %42 = phi <2 x i32> [ %35, %34 ], [ %40, %36 ]
  store <2 x i32> %42, ptr %3, align 8
  %.sroa.549.0..sroa_idx50 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %.sroa.549.0, ptr %.sroa.549.0..sroa_idx50, align 8, !tbaa !10
  br label %128

43:                                               ; preds = %28
  %44 = call noundef zeroext i16 @_ZN3ghc10filesystemanINS0_12copy_optionsEEENSt9enable_ifIXoooooosr3std7is_sameIT_NS0_5permsEEE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_S2_EE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %2, i16 noundef zeroext 4)
  %45 = icmp eq i16 %44, 4
  br i1 %45, label %46, label %63

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  %47 = call i64 @_ZN3ghc10filesystem15last_write_timeERKNS0_4pathERSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %3) #9
  store i64 %47, ptr %12, align 8
  %48 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #9
  br i1 %48, label %.thread, label %52

.thread:                                          ; preds = %46
  %49 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %50 = extractvalue { i32, ptr } %49, 0
  %51 = extractvalue { i32, ptr } %49, 1
  store i32 %50, ptr %3, align 8, !tbaa !6
  %.sroa.444.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %51, ptr %.sroa.444.0..sroa_idx, align 8, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %128

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %53 = call i64 @_ZN3ghc10filesystem15last_write_timeERKNS0_4pathERSt10error_code(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %3) #9
  store i64 %53, ptr %13, align 8
  %54 = call noundef zeroext i1 @_ZNKSt10error_codecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #9
  br i1 %54, label %55, label %59

55:                                               ; preds = %52
  %56 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %57 = extractvalue { i32, ptr } %56, 0
  %58 = extractvalue { i32, ptr } %56, 1
  store i32 %57, ptr %3, align 8, !tbaa !6
  %.sroa.441.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %58, ptr %.sroa.441.0..sroa_idx, align 8, !tbaa !10
  br label %.thread101

59:                                               ; preds = %52
  %60 = invoke noundef zeroext i1 @_ZNSt6chronoleINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EEbRKNS_10time_pointIT_T0_EERKNS7_IS8_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %61 unwind label %.loopexit.split-lp.loopexit.split-lp

61:                                               ; preds = %59
  br i1 %60, label %.thread101, label %62

.thread101:                                       ; preds = %55, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %128

62:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %63

63:                                               ; preds = %62, %43, %19
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #9
  store i8 0, ptr %15, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #9
  invoke void @_ZNSt6vectorIcSaIcEEC2EmRKcRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef 16384, ptr noundef nonnull align 1 dereferenceable(1) %15, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %64 unwind label %.loopexit.split-lp.loopexit.split-lp

64:                                               ; preds = %63
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #9
  %65 = call noundef ptr @_ZNK3ghc10filesystem4path5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #9
  %66 = invoke i32 (ptr, i32, ...) @open(ptr noundef %65, i32 noundef 0)
          to label %67 unwind label %.loopexit.split-lp.loopexit.split-lp

67:                                               ; preds = %64
  %68 = icmp slt i32 %66, 0
  br i1 %68, label %69, label %73

69:                                               ; preds = %67
  %70 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %71 = extractvalue { i32, ptr } %70, 0
  %72 = extractvalue { i32, ptr } %70, 1
  store i32 %71, ptr %3, align 8, !tbaa !6
  %.sroa.426.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %72, ptr %.sroa.426.0..sroa_idx, align 8, !tbaa !10
  br label %.critedge98

73:                                               ; preds = %67
  %spec.select = select i1 %20, i32 577, i32 705
  %74 = call noundef ptr @_ZNK3ghc10filesystem4path5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %75 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %7) #9
  %76 = call noundef zeroext i16 @_ZN3ghc10filesystemanINS0_5permsEEENSt9enable_ifIXoooooosr3std7is_sameIT_S2_EE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_NS0_12copy_optionsEEE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %75, i16 noundef zeroext 511)
  %77 = zext i16 %76 to i32
  %78 = invoke i32 (ptr, i32, ...) @open(ptr noundef %74, i32 noundef %spec.select, i32 noundef %77)
          to label %79 unwind label %.loopexit.split-lp.loopexit.split-lp

79:                                               ; preds = %73
  %80 = icmp slt i32 %78, 0
  br i1 %80, label %81, label %85

81:                                               ; preds = %79
  %82 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %83 = extractvalue { i32, ptr } %82, 0
  %84 = extractvalue { i32, ptr } %82, 1
  store i32 %83, ptr %3, align 8, !tbaa !6
  %.sroa.421.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %84, ptr %.sroa.421.0..sroa_idx, align 8, !tbaa !10
  br label %.invoke

85:                                               ; preds = %79
  %86 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %8) #9
  %87 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %7) #9
  %.not = icmp eq i16 %86, %87
  br i1 %.not, label %.preheader115, label %88

88:                                               ; preds = %85
  %89 = call noundef zeroext i16 @_ZNK3ghc10filesystem11file_status11permissionsEv(ptr noundef nonnull align 4 dereferenceable(6) %7) #9
  %90 = call noundef zeroext i16 @_ZN3ghc10filesystemanINS0_5permsEEENSt9enable_ifIXoooooosr3std7is_sameIT_S2_EE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_NS0_12copy_optionsEEE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext %89, i16 noundef zeroext 511)
  %91 = zext i16 %90 to i32
  %92 = call i32 @fchmod(i32 noundef %78, i32 noundef %91) #9
  %.not93 = icmp eq i32 %92, 0
  br i1 %.not93, label %.preheader115, label %.invoke110

.preheader115:                                    ; preds = %85, %88
  br label %93

93:                                               ; preds = %.backedge, %.preheader115
  %94 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  %95 = call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  %96 = invoke i64 @read(i32 noundef %66, ptr noundef %94, i64 noundef %95)
          to label %97 unwind label %.loopexit.split-lp.loopexit

97:                                               ; preds = %93
  %98 = tail call ptr @__errno_location() #10
  %99 = load i32, ptr %98, align 4, !tbaa !6
  %100 = icmp eq i32 %99, 4
  %.not94 = icmp eq i64 %96, 0
  %101 = and i1 %.not94, %100
  br i1 %101, label %.backedge, label %102

.backedge:                                        ; preds = %123, %97
  br label %93, !llvm.loop !13

102:                                              ; preds = %97
  br i1 %.not94, label %124, label %103

103:                                              ; preds = %102
  %104 = icmp slt i64 %96, 0
  br i1 %104, label %.invoke110, label %.preheader

.preheader:                                       ; preds = %103, %123
  %.087 = phi i64 [ %.188, %123 ], [ %96, %103 ]
  %.085 = phi i64 [ %.186, %123 ], [ 0, %103 ]
  %105 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  %106 = getelementptr inbounds i8, ptr %105, i64 %.085
  %107 = invoke i64 @write(i32 noundef %78, ptr noundef %106, i64 noundef %.087)
          to label %108 unwind label %.loopexit

108:                                              ; preds = %.preheader
  %109 = icmp sgt i64 %107, 0
  br i1 %109, label %110, label %113

110:                                              ; preds = %108
  %111 = sub nsw i64 %.087, %107
  %112 = add nuw nsw i64 %107, %.085
  br label %123

113:                                              ; preds = %108
  %114 = icmp slt i64 %107, 0
  br i1 %114, label %115, label %123

115:                                              ; preds = %113
  %116 = load i32, ptr %98, align 4, !tbaa !6
  %.not95 = icmp eq i32 %116, 4
  br i1 %.not95, label %123, label %.invoke110

.invoke110:                                       ; preds = %103, %115, %88
  %117 = call { i32, ptr } @_ZN3ghc10filesystem6detail17make_system_errorEi(i32 noundef 0)
  %118 = extractvalue { i32, ptr } %117, 0
  %119 = extractvalue { i32, ptr } %117, 1
  store i32 %118, ptr %3, align 8, !tbaa !6
  %.sroa.418.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %119, ptr %.sroa.418.0..sroa_idx, align 8, !tbaa !10
  %120 = invoke i32 @close(i32 noundef %66)
          to label %.invoke unwind label %.loopexit.split-lp.loopexit.split-lp

.invoke:                                          ; preds = %.invoke110, %81
  %121 = phi i32 [ %66, %81 ], [ %78, %.invoke110 ]
  %122 = invoke i32 @close(i32 noundef %121)
          to label %.critedge98 unwind label %.loopexit.split-lp.loopexit.split-lp

123:                                              ; preds = %110, %115, %113
  %.188 = phi i64 [ %111, %110 ], [ %.087, %115 ], [ %.087, %113 ]
  %.186 = phi i64 [ %112, %110 ], [ %.085, %115 ], [ %.085, %113 ]
  %.not96 = icmp eq i64 %.188, 0
  br i1 %.not96, label %.backedge, label %.preheader, !llvm.loop !15

124:                                              ; preds = %102
  %125 = invoke i32 @close(i32 noundef %66)
          to label %126 unwind label %.loopexit.split-lp.loopexit.split-lp

126:                                              ; preds = %124
  %127 = invoke i32 @close(i32 noundef %78)
          to label %.critedge98 unwind label %.loopexit.split-lp.loopexit.split-lp

.critedge98:                                      ; preds = %.invoke, %126, %69
  %.8 = phi i1 [ false, %69 ], [ true, %126 ], [ false, %.invoke ]
  call void @_ZNSt6vectorIcSaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  br label %128

128:                                              ; preds = %.thread101, %.thread, %21, %.critedge98, %41, %18
  %.9 = phi i1 [ false, %18 ], [ false, %41 ], [ %.8, %.critedge98 ], [ false, %21 ], [ false, %.thread ], [ false, %.thread101 ]
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @_ZN3ghc10filesystem11file_statusD1Ev(ptr noundef nonnull align 4 dereferenceable(6) %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  ret i1 %.9

.loopexit:                                        ; preds = %.preheader
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %93
  %lpad.loopexit104 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %.invoke110, %.invoke, %126, %124, %73, %64, %63, %59
  %lpad.loopexit.split-lp105 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit104, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp105, %.loopexit.split-lp.loopexit.split-lp ]
  %129 = extractvalue { ptr, i32 } %lpad.phi, 0
  call void @__clang_call_terminate(ptr %129) #11
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNSt6chronoleINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EEbRKNS_10time_pointIT_T0_EERKNS7_IS8_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN3ghc10filesystemanINS0_5permsEEENSt9enable_ifIXoooooosr3std7is_sameIT_S2_EE5valuesr3std7is_sameIS4_NS0_12perm_optionsEEE5valuesr3std7is_sameIS4_NS0_12copy_optionsEEE5valuesr3std7is_sameIS4_NS0_17directory_optionsEEE5valueES4_E4typeES4_S4_(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #0

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

declare i32 @close(i32 noundef) local_unnamed_addr #7

; Function Attrs: nounwind
declare i32 @fchmod(i32 noundef, i32 noundef) local_unnamed_addr #8

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

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 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 #0 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 0, i64 4, !6, i64 8, i64 8, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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