; LLVM IR from GPUOpen-LibrariesAndSDKs/TAN :: amf/public/common (AMFSTL)

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

@_ZL21AMF_FORBIDDEN_SYMBOLSB5cxx11 = external hidden global %"class.std::__cxx11::basic_string", align 8
@_ZL27AMF_FORBIDDEN_SYMBOLS_QUERYB5cxx11 = external hidden global %"class.std::__cxx11::basic_string", align 8
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3amf28amf_from_unicode_to_url_utf8ERKNSt7__cxx1112basic_stringIwSt11char_traitsIwENS_13amf_allocatorIwEEEEb(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i1 noundef zeroext %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string.0", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i1, align 1
  %12 = alloca i64, align 8
  %13 = alloca [20 x i8], align 16
  %14 = alloca i64, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = zext i1 %2 to i8
  store i8 %15, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3amf37amf_convert_path_to_url_accepted_pathERKNSt7__cxx1112basic_stringIwSt11char_traitsIwENS_13amf_allocatorIwEEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string.0") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %16)
  invoke void @_ZN3amf24amf_from_unicode_to_utf8ERKNSt7__cxx1112basic_stringIwSt11char_traitsIwENS_13amf_allocatorIwEEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %17 unwind label %25

17:                                               ; preds = %3
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  store i1 false, ptr %11, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %18 unwind label %29

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  store i64 %19, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 20, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %20

20:                                               ; preds = %90, %18
  %21 = load i64, ptr %14, align 8, !tbaa !11
  %22 = load i64, ptr %12, align 8, !tbaa !11
  %23 = icmp ult i64 %21, %22
  br i1 %23, label %33, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %93

25:                                               ; preds = %3
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %9, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  br label %98

29:                                               ; preds = %17
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %9, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %10, align 4
  br label %97

33:                                               ; preds = %20
  %34 = load i64, ptr %14, align 8, !tbaa !11
  %35 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %34)
          to label %36 unwind label %75

36:                                               ; preds = %33
  %37 = load i8, ptr %35, align 1, !tbaa !13
  %38 = sext i8 %37 to i32
  %39 = icmp sle i32 %38, 32
  br i1 %39, label %67, label %40

40:                                               ; preds = %36
  %41 = load i64, ptr %14, align 8, !tbaa !11
  %42 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %41)
          to label %43 unwind label %75

43:                                               ; preds = %40
  %44 = load i8, ptr %42, align 1, !tbaa !13
  %45 = sext i8 %44 to i32
  %46 = icmp sge i32 %45, 127
  br i1 %46, label %67, label %47

47:                                               ; preds = %43
  %48 = load i8, ptr %6, align 1, !tbaa !9, !range !14, !noundef !15
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %57

50:                                               ; preds = %47
  %51 = load i64, ptr %14, align 8, !tbaa !11
  %52 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %51)
          to label %53 unwind label %75

53:                                               ; preds = %50
  %54 = load i8, ptr %52, align 1, !tbaa !13
  %55 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL21AMF_FORBIDDEN_SYMBOLSB5cxx11, i8 noundef signext %54, i64 noundef 0) #4
  %56 = icmp ne i64 %55, -1
  br i1 %56, label %67, label %57

57:                                               ; preds = %53, %47
  %58 = load i8, ptr %6, align 1, !tbaa !9, !range !14, !noundef !15
  %59 = trunc i8 %58 to i1
  br i1 %59, label %79, label %60

60:                                               ; preds = %57
  %61 = load i64, ptr %14, align 8, !tbaa !11
  %62 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %61)
          to label %63 unwind label %75

63:                                               ; preds = %60
  %64 = load i8, ptr %62, align 1, !tbaa !13
  %65 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL27AMF_FORBIDDEN_SYMBOLS_QUERYB5cxx11, i8 noundef signext %64, i64 noundef 0) #4
  %66 = icmp ne i64 %65, -1
  br i1 %66, label %67, label %79

67:                                               ; preds = %63, %53, %43, %36
  %68 = getelementptr inbounds [20 x i8], ptr %13, i64 0, i64 0
  %69 = load i64, ptr %14, align 8, !tbaa !11
  %70 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %69)
          to label %71 unwind label %75

71:                                               ; preds = %67
  %72 = load i8, ptr %70, align 1, !tbaa !13
  %73 = zext i8 %72 to i32
  %74 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %68, i64 noundef 20, ptr noundef @.str.6, i32 noundef %73) #4
  br label %86

75:                                               ; preds = %86, %79, %67, %60, %50, %40, %33
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %9, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %97

79:                                               ; preds = %63, %57
  %80 = load i64, ptr %14, align 8, !tbaa !11
  %81 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %80)
          to label %82 unwind label %75

82:                                               ; preds = %79
  %83 = load i8, ptr %81, align 1, !tbaa !13
  %84 = getelementptr inbounds [20 x i8], ptr %13, i64 0, i64 0
  store i8 %83, ptr %84, align 16, !tbaa !13
  %85 = getelementptr inbounds [20 x i8], ptr %13, i64 0, i64 1
  store i8 0, ptr %85, align 1, !tbaa !13
  br label %86

86:                                               ; preds = %82, %71
  %87 = getelementptr inbounds [20 x i8], ptr %13, i64 0, i64 0
  %88 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %87)
          to label %89 unwind label %75

89:                                               ; preds = %86
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %14, align 8, !tbaa !11
  %92 = add i64 %91, 1
  store i64 %92, ptr %14, align 8, !tbaa !11
  br label %20, !llvm.loop !16

93:                                               ; preds = %24
  store i1 true, ptr %11, align 1
  call void @llvm.lifetime.end.p0(i64 20, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %94 = load i1, ptr %11, align 1
  br i1 %94, label %96, label %95

95:                                               ; preds = %93
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %96

96:                                               ; preds = %95, %93
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  ret void

97:                                               ; preds = %75, %29
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  br label %98

98:                                               ; preds = %97, %25
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %9, align 8
  %101 = load i32, ptr %10, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext, i64 noundef) #1 align 2

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #3

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 = { 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 #4 = { 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 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, amf::amf_allocator<char>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, amf::amf_allocator<char>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::__cxx11::basic_string.0" = type { %"struct.std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, amf::amf_allocator<wchar_t>>::_Alloc_hider", i64, %union.anon.5 }
%"struct.std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, amf::amf_allocator<wchar_t>>::_Alloc_hider" = type { ptr }
%union.anon.5 = type { i64, [8 x i8] }

@_ZL21AMF_FORBIDDEN_SYMBOLSB5cxx11 = external hidden global %"class.std::__cxx11::basic_string", align 8
@_ZL27AMF_FORBIDDEN_SYMBOLS_QUERYB5cxx11 = external hidden global %"class.std::__cxx11::basic_string", align 8
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3amf28amf_from_unicode_to_url_utf8ERKNSt7__cxx1112basic_stringIwSt11char_traitsIwENS_13amf_allocatorIwEEEEb(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i1 noundef zeroext %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string.0", align 8
  %6 = alloca [20 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @_ZN3amf37amf_convert_path_to_url_accepted_pathERKNSt7__cxx1112basic_stringIwSt11char_traitsIwENS_13amf_allocatorIwEEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string.0") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %1)
  invoke void @_ZN3amf24amf_from_unicode_to_utf8ERKNSt7__cxx1112basic_stringIwSt11char_traitsIwENS_13amf_allocatorIwEEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %7 unwind label %35

7:                                                ; preds = %3
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %8 unwind label %37

8:                                                ; preds = %7
  %9 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %6) #4
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %10 = getelementptr inbounds i8, ptr %6, i64 1
  br i1 %2, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %32
  %.020.us = phi i64 [ %33, %32 ], [ 0, %.lr.ph ]
  %11 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020.us)
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %13 = icmp slt i8 %12, 33
  br i1 %13, label %25, label %14

14:                                               ; preds = %.lr.ph.split.us
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020.us)
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = icmp eq i8 %16, 127
  br i1 %17, label %25, label %18

18:                                               ; preds = %14
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020.us)
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL21AMF_FORBIDDEN_SYMBOLSB5cxx11, i8 noundef signext %20, i64 noundef 0) #4
  %.not.us = icmp eq i64 %21, -1
  br i1 %.not.us, label %22, label %25

22:                                               ; preds = %18
  %23 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020.us)
  %24 = load i8, ptr %23, align 1, !tbaa !5
  store i8 %24, ptr %6, align 16, !tbaa !5
  store i8 0, ptr %10, align 1, !tbaa !5
  br label %30

25:                                               ; preds = %18, %14, %.lr.ph.split.us
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020.us)
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %28 = zext i8 %27 to i32
  %29 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 20, ptr noundef nonnull @.str.6, i32 noundef %28) #4
  br label %30

30:                                               ; preds = %25, %22
  %31 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %6)
          to label %32 unwind label %.split.us

32:                                               ; preds = %30
  %33 = add nuw i64 %.020.us, 1
  %exitcond23.not = icmp eq i64 %33, %9
  br i1 %exitcond23.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !8

.split.us:                                        ; preds = %30
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %55

._crit_edge:                                      ; preds = %61, %32, %8
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %6) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  ret void

35:                                               ; preds = %3
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  br label %64

37:                                               ; preds = %7
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %63

.lr.ph.split:                                     ; preds = %.lr.ph, %61
  %.020 = phi i64 [ %62, %61 ], [ 0, %.lr.ph ]
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020)
  %40 = load i8, ptr %39, align 1, !tbaa !5
  %41 = icmp slt i8 %40, 33
  br i1 %41, label %49, label %42

42:                                               ; preds = %.lr.ph.split
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020)
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = icmp eq i8 %44, 127
  br i1 %45, label %49, label %.critedge

.critedge:                                        ; preds = %42
  %46 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020)
  %47 = load i8, ptr %46, align 1, !tbaa !5
  %48 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL27AMF_FORBIDDEN_SYMBOLS_QUERYB5cxx11, i8 noundef signext %47, i64 noundef 0) #4
  %.not17 = icmp eq i64 %48, -1
  br i1 %.not17, label %56, label %49

49:                                               ; preds = %.critedge, %42, %.lr.ph.split
  %50 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020)
  %51 = load i8, ptr %50, align 1, !tbaa !5
  %52 = zext i8 %51 to i32
  %53 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 20, ptr noundef nonnull @.str.6, i32 noundef %52) #4
  br label %59

.split:                                           ; preds = %59
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %55

55:                                               ; preds = %.split.us, %.split
  %.us-phi = phi { ptr, i32 } [ %54, %.split ], [ %34, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %6) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %63

56:                                               ; preds = %.critedge
  %57 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.020)
  %58 = load i8, ptr %57, align 1, !tbaa !5
  store i8 %58, ptr %6, align 16, !tbaa !5
  store i8 0, ptr %10, align 1, !tbaa !5
  br label %59

59:                                               ; preds = %56, %49
  %60 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %6)
          to label %61 unwind label %.split

61:                                               ; preds = %59
  %62 = add nuw i64 %.020, 1
  %exitcond.not = icmp eq i64 %62, %9
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !8

63:                                               ; preds = %55, %37
  %.pn = phi { ptr, i32 } [ %.us-phi, %55 ], [ %38, %37 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br label %64

64:                                               ; preds = %63, %35
  %.pn.pn = phi { ptr, i32 } [ %.pn, %63 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3amf13amf_allocatorIcEEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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 = { 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 #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass