; LLVM IR from thepowersgang/mrustc :: tools/minicargo/os.ll (ZN10os_support15get_mrustc_pathEv)

; 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.helpers::path" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@__dso_handle = external hidden global i8
@_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path = external hidden global %"class.helpers::path", align 8
@_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path = external hidden global i64, align 8
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #0

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) #1

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

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

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

; Function Attrs: nounwind
declare ptr @getenv(ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN10os_support15get_mrustc_pathEv() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.helpers::path", align 8
  %6 = alloca i32, align 4
  %7 = alloca [4096 x i8], align 16
  %8 = alloca i64, align 8
  %9 = alloca %"class.helpers::path", align 8
  %10 = alloca %"class.helpers::path", align 8
  %11 = alloca %"class.helpers::path", align 8
  %12 = load atomic i8, ptr @_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path acquire, align 8
  %13 = icmp eq i8 %12, 0
  br i1 %13, label %14, label %20, !prof !5

14:                                               ; preds = %0
  %15 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path) #0
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %20

17:                                               ; preds = %14
  invoke void @_ZN7helpers4pathC2Ev(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path)
          to label %18 unwind label %29

18:                                               ; preds = %17
  %19 = call i32 @__cxa_atexit(ptr @_ZN7helpers4pathD2Ev, ptr @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path) #0
  br label %20

20:                                               ; preds = %18, %14, %0
  %21 = call noundef zeroext i1 @_ZNK7helpers4path8is_validEv(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path)
  br i1 %21, label %68, label %22

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #0
  %23 = call ptr @getenv(ptr noundef @.str.21) #0
  store ptr %23, ptr %4, align 8, !tbaa !6
  %24 = load ptr, ptr %4, align 8, !tbaa !6
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %33

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #0
  %27 = load ptr, ptr %4, align 8, !tbaa !6
  call void @_ZN7helpers4pathC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %27)
  %28 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7helpers4pathaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr noundef nonnull align 8 dereferenceable(32) %5) #0
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #0
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #0
  store ptr @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr %1, align 8
  store i32 1, ptr %6, align 4
  br label %34

29:                                               ; preds = %17
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %2, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %3, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path) #0
  br label %71

33:                                               ; preds = %22
  store i32 0, ptr %6, align 4
  br label %34

34:                                               ; preds = %33, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #0
  %35 = load i32, ptr %6, align 4
  switch i32 %35, label %76 [
    i32 0, label %36
    i32 1, label %69
  ]

36:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4096, ptr %7) #0
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #0
  %37 = getelementptr inbounds [4096 x i8], ptr %7, i64 0, i64 0
  %38 = call i64 @readlink(ptr noundef @.str.22, ptr noundef %37, i64 noundef 4095) #0
  store i64 %38, ptr %8, align 8, !tbaa !10
  %39 = load i64, ptr %8, align 8, !tbaa !10
  %40 = icmp sge i64 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %36
  %42 = load i64, ptr %8, align 8, !tbaa !10
  %43 = getelementptr inbounds [4096 x i8], ptr %7, i64 0, i64 %42
  store i8 0, ptr %43, align 1, !tbaa !12
  br label %47

44:                                               ; preds = %36
  %45 = getelementptr inbounds [4096 x i8], ptr %7, i64 0, i64 0
  %46 = call ptr @strcpy(ptr noundef %45, ptr noundef @.str.23) #0
  br label %47

47:                                               ; preds = %44, %41
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #0
  %48 = getelementptr inbounds [4096 x i8], ptr %7, i64 0, i64 0
  call void @_ZN7helpers4pathC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef %48)
  %49 = invoke noundef zeroext i1 @_ZN7helpers4path13pop_componentEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %50 unwind label %54

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #0
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #0
  invoke void @_ZNK7helpers4pathdvEPKc(ptr dead_on_unwind writable sret(%"class.helpers::path") align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.24)
          to label %51 unwind label %58

51:                                               ; preds = %50
  invoke void @_ZNK7helpers4path9normaliseEv(ptr dead_on_unwind writable sret(%"class.helpers::path") align 8 %10, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %52 unwind label %62

52:                                               ; preds = %51
  %53 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7helpers4pathaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr noundef nonnull align 8 dereferenceable(32) %10) #0
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #0
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #0
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #0
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #0
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #0
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #0
  call void @llvm.lifetime.end.p0(i64 4096, ptr %7) #0
  br label %68

54:                                               ; preds = %47
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %2, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %3, align 4
  br label %67

58:                                               ; preds = %50
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %2, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %3, align 4
  br label %66

62:                                               ; preds = %51
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %2, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %3, align 4
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #0
  br label %66

66:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #0
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #0
  br label %67

67:                                               ; preds = %66, %54
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #0
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #0
  call void @llvm.lifetime.end.p0(i64 4096, ptr %7) #0
  br label %71

68:                                               ; preds = %52, %20
  store ptr @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr %1, align 8
  br label %69

69:                                               ; preds = %68, %34
  %70 = load ptr, ptr %1, align 8
  ret ptr %70

71:                                               ; preds = %67, %29
  %72 = load ptr, ptr %2, align 8
  %73 = load i32, ptr %3, align 4
  %74 = insertvalue { ptr, i32 } poison, ptr %72, 0
  %75 = insertvalue { ptr, i32 } %74, i32 %73, 1
  resume { ptr, i32 } %75

76:                                               ; preds = %34
  unreachable
}

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #0

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #0

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #0

declare void @_ZN7helpers4pathC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #6

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

; Function Attrs: nounwind
declare i64 @readlink(ptr noundef, ptr noundef, i64 noundef) #4

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

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

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

declare void @_ZNK7helpers4path9normaliseEv(ptr dead_on_unwind writable sret(%"class.helpers::path") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #6

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

!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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!8, !8, i64 0}


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

%"class.helpers::path" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@__dso_handle = external hidden global i8
@_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path = external hidden global %"class.helpers::path", align 8
@_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path = external hidden global i64, align 8
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #0

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) #1

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

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

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

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN10os_support15get_mrustc_pathEv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.helpers::path", align 8
  %2 = alloca [4096 x i8], align 16
  %3 = alloca %"class.helpers::path", align 8
  %4 = alloca %"class.helpers::path", align 8
  %5 = alloca %"class.helpers::path", align 8
  %6 = load atomic i8, ptr @_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path acquire, align 8
  %7 = icmp eq i8 %6, 0
  br i1 %7, label %8, label %12, !prof !5

8:                                                ; preds = %0
  %9 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path) #9
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %12, label %10

10:                                               ; preds = %8
  tail call void @_ZN7helpers4pathC2Ev(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path)
  %11 = tail call i32 @__cxa_atexit(ptr nonnull @_ZN7helpers4pathD2Ev, ptr nonnull @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr nonnull @__dso_handle) #9
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZN10os_support15get_mrustc_pathEvE15s_compiler_path) #9
  br label %12

12:                                               ; preds = %10, %8, %0
  %13 = tail call noundef zeroext i1 @_ZNK7helpers4path8is_validEv(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path)
  br i1 %13, label %39, label %14

14:                                               ; preds = %12
  %15 = tail call ptr @getenv(ptr noundef nonnull @.str.21) #9
  %.not13.not = icmp eq ptr %15, null
  br i1 %.not13.not, label %18, label %16

16:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #9
  call void @_ZN7helpers4pathC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %15)
  %17 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7helpers4pathaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #9
  br label %39

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %2) #9
  %19 = call i64 @readlink(ptr noundef nonnull @.str.22, ptr noundef nonnull %2, i64 noundef 4095) #9
  %20 = icmp sgt i64 %19, -1
  br i1 %20, label %21, label %23

21:                                               ; preds = %18
  %22 = getelementptr inbounds [4096 x i8], ptr %2, i64 0, i64 %19
  store i8 0, ptr %22, align 1, !tbaa !6
  br label %25

23:                                               ; preds = %18
  %24 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.23) #9
  br label %25

25:                                               ; preds = %23, %21
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #9
  call void @_ZN7helpers4pathC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull %2)
  %26 = invoke noundef zeroext i1 @_ZN7helpers4path13pop_componentEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %27 unwind label %31

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #9
  invoke void @_ZNK7helpers4pathdvEPKc(ptr dead_on_unwind nonnull writable sret(%"class.helpers::path") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.24)
          to label %28 unwind label %33

28:                                               ; preds = %27
  invoke void @_ZNK7helpers4path9normaliseEv(ptr dead_on_unwind nonnull writable sret(%"class.helpers::path") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %29 unwind label %35

29:                                               ; preds = %28
  %30 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7helpers4pathaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path, ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %2) #9
  br label %39

31:                                               ; preds = %25
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %38

33:                                               ; preds = %27
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %37

35:                                               ; preds = %28
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  br label %37

37:                                               ; preds = %35, %33
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %38

38:                                               ; preds = %37, %31
  %.pn.pn = phi { ptr, i32 } [ %.pn, %37 ], [ %32, %31 ]
  call void @_ZN7helpers4pathD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %2) #9
  resume { ptr, i32 } %.pn.pn

39:                                               ; preds = %16, %12, %29
  ret ptr @_ZZN10os_support15get_mrustc_pathEvE15s_compiler_path
}

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #0

declare void @_ZN7helpers4pathC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #6

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

; Function Attrs: nofree nounwind
declare noundef i64 @readlink(ptr nocapture noundef readonly, ptr nocapture noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #8

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

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

declare void @_ZNK7helpers4path9normaliseEv(ptr dead_on_unwind writable sret(%"class.helpers::path") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6

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

!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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass