; LLVM IR from turi-code/SFrame :: oss_src/serialization (dir_archive)

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.3 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.3 = type { i64, [8 x i8] }
%class.anon.30 = type { ptr }
%class.anon.31 = type { ptr }
%"class.std::vector.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.anon.37 = type { i8 }
%class.anon.38 = type { i8 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef %0, i1 noundef zeroext %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %class.anon.30, align 8
  %10 = alloca i32, align 4
  %11 = alloca %class.anon.31, align 8
  %12 = alloca %"class.std::vector.32", align 8
  %13 = alloca i8, align 1
  %14 = alloca %class.anon.37, align 1
  %15 = alloca %class.anon.38, align 1
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %17 = zext i1 %1 to i8
  store i8 %17, ptr %4, align 1, !tbaa !9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %0)
  invoke void @_ZN8graphlab6fileio12get_protocolENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef %6)
          to label %18 unwind label %26

18:                                               ; preds = %2
  %19 = invoke noundef zeroext i1 @_ZN8graphlab6fileio20is_writable_protocolENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %5)
          to label %20 unwind label %30

20:                                               ; preds = %18
  %21 = xor i1 %19, true
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br i1 %21, label %22, label %35

22:                                               ; preds = %20
  br label %23

23:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %24 = getelementptr inbounds %class.anon.30, ptr %9, i32 0, i32 0
  store ptr %0, ptr %24, align 8, !tbaa !5
  call void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %25

25:                                               ; preds = %23
  br label %35

26:                                               ; preds = %2
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %7, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %8, align 4
  br label %34

30:                                               ; preds = %18
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %7, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %34

34:                                               ; preds = %30, %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %103

35:                                               ; preds = %25, %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %36 = call noundef i32 @_ZN8graphlab6fileio15get_file_statusERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0)
  store i32 %36, ptr %10, align 4, !tbaa !11
  %37 = load i32, ptr %10, align 4, !tbaa !11
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %39, label %44

39:                                               ; preds = %35
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %41 = getelementptr inbounds %class.anon.31, ptr %11, i32 0, i32 0
  store ptr %0, ptr %41, align 8, !tbaa !5
  call void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %42

42:                                               ; preds = %40
  br label %43

43:                                               ; preds = %42
  br label %102

44:                                               ; preds = %35
  %45 = load i32, ptr %10, align 4, !tbaa !11
  %46 = icmp eq i32 %45, 2
  br i1 %46, label %47, label %101

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  call void @_ZN8graphlab6fileio21get_directory_listingERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::vector.32") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  %48 = invoke noundef zeroext i1 @_ZN8graphlab11dir_archive30directory_has_existing_archiveERKSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6fileio11file_statusEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %49 unwind label %61

49:                                               ; preds = %47
  %50 = zext i1 %48 to i8
  store i8 %50, ptr %13, align 1, !tbaa !9
  %51 = load i8, ptr %13, align 1, !tbaa !9, !range !13, !noundef !14
  %52 = trunc i8 %51 to i1
  br i1 %52, label %53, label %69

53:                                               ; preds = %49
  %54 = load i8, ptr %4, align 1, !tbaa !9, !range !13, !noundef !14
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %69

56:                                               ; preds = %53
  br label %57

57:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  invoke void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %58 unwind label %65

58:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  br label %99

61:                                               ; preds = %90, %47
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %7, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %8, align 4
  br label %100

65:                                               ; preds = %57
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %7, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  br label %100

69:                                               ; preds = %53, %49
  %70 = load i8, ptr %13, align 1, !tbaa !9, !range !13, !noundef !14
  %71 = trunc i8 %70 to i1
  br i1 %71, label %84, label %72

72:                                               ; preds = %69
  %73 = call noundef i64 @_ZNKSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN8graphlab6fileio11file_statusEESaISA_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %74 = icmp ugt i64 %73, 0
  br i1 %74, label %75, label %84

75:                                               ; preds = %72
  br label %76

76:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  invoke void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %77 unwind label %80

77:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  br label %98

80:                                               ; preds = %76
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %7, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  br label %100

84:                                               ; preds = %72, %69
  %85 = load i8, ptr %13, align 1, !tbaa !9, !range !13, !noundef !14
  %86 = trunc i8 %85 to i1
  br i1 %86, label %87, label %97

87:                                               ; preds = %84
  %88 = load i8, ptr %4, align 1, !tbaa !9, !range !13, !noundef !14
  %89 = trunc i8 %88 to i1
  br i1 %89, label %97, label %90

90:                                               ; preds = %87
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %91 unwind label %61

91:                                               ; preds = %90
  invoke void @_ZN8graphlab11dir_archive14delete_archiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %16)
          to label %92 unwind label %93

92:                                               ; preds = %91
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  br label %97

93:                                               ; preds = %91
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %7, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  br label %100

97:                                               ; preds = %92, %87, %84
  br label %98

98:                                               ; preds = %97, %79
  br label %99

99:                                               ; preds = %98, %60
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN8graphlab6fileio11file_statusEESaISA_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %101

100:                                              ; preds = %93, %80, %65, %61
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN8graphlab6fileio11file_statusEESaISA_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %103

101:                                              ; preds = %99, %44
  br label %102

102:                                              ; preds = %101, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  ret void

103:                                              ; preds = %100, %34
  %104 = load ptr, ptr %7, align 8
  %105 = load i32, ptr %8, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

declare noundef zeroext i1 @_ZN8graphlab6fileio20is_writable_protocolENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare noundef i32 @_ZN8graphlab6fileio15get_file_statusERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare void @_ZN8graphlab6fileio21get_directory_listingERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::vector.32") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8graphlab11dir_archive30directory_has_existing_archiveERKSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6fileio11file_statusEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab11dir_archive14delete_archiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #2 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN8graphlab6fileio11file_statusE", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.3 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.3 = type { i64, [8 x i8] }
%class.anon.30 = type { ptr }
%class.anon.31 = type { ptr }
%"class.std::vector.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>, std::allocator<std::pair<std::__cxx11::basic_string<char>, graphlab::fileio::file_status>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.anon.37 = type { i8 }
%class.anon.38 = type { i8 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull %0, i1 noundef zeroext %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %class.anon.30, align 8
  %6 = alloca %class.anon.31, align 8
  %7 = alloca %"class.std::vector.32", align 8
  %8 = alloca %class.anon.37, align 1
  %9 = alloca %class.anon.38, align 1
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %0)
  invoke void @_ZN8graphlab6fileio12get_protocolENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull %4)
          to label %11 unwind label %15

11:                                               ; preds = %2
  %12 = invoke noundef zeroext i1 @_ZN8graphlab6fileio20is_writable_protocolENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %3)
          to label %13 unwind label %17

13:                                               ; preds = %11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  br i1 %12, label %20, label %14

14:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr %0, ptr %5, align 8, !tbaa !5
  call void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %20

15:                                               ; preds = %2
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %19

17:                                               ; preds = %11
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br label %19

19:                                               ; preds = %17, %15
  %.pn = phi { ptr, i32 } [ %18, %17 ], [ %16, %15 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  br label %47

20:                                               ; preds = %14, %13
  %21 = call noundef i32 @_ZN8graphlab6fileio15get_file_statusERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0)
  switch i32 %21, label %46 [
    i32 1, label %22
    i32 2, label %23
  ]

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store ptr %0, ptr %6, align 8, !tbaa !5
  call void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %46

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN8graphlab6fileio21get_directory_listingERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.32") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %0)
  %24 = invoke noundef zeroext i1 @_ZN8graphlab11dir_archive30directory_has_existing_archiveERKSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6fileio11file_statusEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %25 unwind label %28

25:                                               ; preds = %23
  %brmerge.demorgan = and i1 %24, %1
  br i1 %brmerge.demorgan, label %26, label %32

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #5
  invoke void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %27 unwind label %30

27:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  br label %44

28:                                               ; preds = %39, %23
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %45

30:                                               ; preds = %26
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #5
  br label %45

32:                                               ; preds = %25
  br i1 %24, label %.critedge, label %33

33:                                               ; preds = %32
  %34 = call noundef i64 @_ZNKSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN8graphlab6fileio11file_statusEESaISA_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %.not = icmp eq i64 %34, 0
  br i1 %.not, label %44, label %35

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #5
  invoke void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %36 unwind label %37

36:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  br label %44

37:                                               ; preds = %35
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  br label %45

.critedge:                                        ; preds = %32
  br i1 %1, label %44, label %39

39:                                               ; preds = %.critedge
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %40 unwind label %28

40:                                               ; preds = %39
  invoke void @_ZN8graphlab11dir_archive14delete_archiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %10)
          to label %41 unwind label %42

41:                                               ; preds = %40
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  br label %44

42:                                               ; preds = %40
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  br label %45

44:                                               ; preds = %33, %36, %41, %.critedge, %27
  call void @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN8graphlab6fileio11file_statusEESaISA_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %46

45:                                               ; preds = %42, %37, %30, %28
  %.pn13 = phi { ptr, i32 } [ %31, %30 ], [ %43, %42 ], [ %29, %28 ], [ %38, %37 ]
  call void @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN8graphlab6fileio11file_statusEESaISA_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %47

46:                                               ; preds = %20, %44, %22
  ret void

47:                                               ; preds = %45, %19
  %.pn13.pn = phi { ptr, i32 } [ %.pn13, %45 ], [ %.pn, %19 ]
  resume { ptr, i32 } %.pn13.pn
}

declare noundef zeroext i1 @_ZN8graphlab6fileio20is_writable_protocolENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

declare noundef i32 @_ZN8graphlab6fileio15get_file_statusERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

declare void @_ZN8graphlab6fileio21get_directory_listingERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::vector.32") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8graphlab11dir_archive30directory_has_existing_archiveERKSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6fileio11file_statusEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab24check_directory_writableENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab11dir_archive14delete_archiveENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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