; LLVM IR from GPUOpen-LibrariesAndSDKs/TAN :: amf/public/common/DataStreamFile.ll (ZN3amf21AMFDataStreamFileImpl11GetPositionEPl)

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

@.str = external hidden unnamed_addr constant [24 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [99 x i32], align 4
@.str.3 = external hidden unnamed_addr constant [22 x i32], align 4
@.str.6 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.7 = external hidden unnamed_addr constant [30 x i32], align 4

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15__FormatMessageB5cxx11EiPKwS1_z(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef, ptr noundef, ...) #3

declare void @AMFTraceW(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #4

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

; Function Attrs: nounwind
declare i64 @lseek64(i32 noundef, i64 noundef, i32 noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3amf21AMFDataStreamFileImpl11GetPositionEPl(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  %20 = zext i1 %19 to i32
  store i32 %20, ptr %6, align 4, !tbaa !9
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %21)
  br i1 %22, label %43, label %23

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  %24 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, i32 noundef %24)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  invoke void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %9, i32 noundef -1, ptr noundef @.str.6)
          to label %25 unwind label %29

25:                                               ; preds = %23
  invoke void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %26 unwind label %33

26:                                               ; preds = %25
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  %27 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef @.str.2, i32 noundef 168, i32 noundef 0, ptr noundef @.str.3, i32 noundef 0, ptr noundef %27)
          to label %28 unwind label %38

28:                                               ; preds = %26
  store i32 7, ptr %3, align 4
  store i32 1, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %44

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

33:                                               ; preds = %25
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %10, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  br label %37

37:                                               ; preds = %33, %29
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br label %42

38:                                               ; preds = %26
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %10, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %42

42:                                               ; preds = %38, %37
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %88

43:                                               ; preds = %2
  store i32 0, ptr %12, align 4
  br label %44

44:                                               ; preds = %43, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %45 = load i32, ptr %12, align 4
  switch i32 %45, label %93 [
    i32 0, label %46
    i32 1, label %86
  ]

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %47 = getelementptr inbounds %"class.amf::AMFDataStreamFileImpl", ptr %17, i32 0, i32 1
  %48 = load i32, ptr %47, align 8, !tbaa !11
  %49 = icmp ne i32 %48, -1
  %50 = zext i1 %49 to i32
  store i32 %50, ptr %13, align 4, !tbaa !9
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %51)
  br i1 %52, label %73, label %53

53:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #7
  %54 = load i32, ptr %13, align 4, !tbaa !9
  call void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %15, i32 noundef %54)
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #7
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN3amf15__FormatMessageB5cxx11EiPKwS1_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %16, i32 noundef 0, ptr noundef @.str, ptr noundef @.str.7)
          to label %55 unwind label %59

55:                                               ; preds = %53
  invoke void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %56 unwind label %63

56:                                               ; preds = %55
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  %57 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef @.str.2, i32 noundef 169, i32 noundef 0, ptr noundef @.str.3, i32 noundef 0, ptr noundef %57)
          to label %58 unwind label %68

58:                                               ; preds = %56
  store i32 16, ptr %3, align 4
  store i32 1, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  br label %74

59:                                               ; preds = %53
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %10, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %11, align 4
  br label %67

63:                                               ; preds = %55
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %10, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  br label %67

67:                                               ; preds = %63, %59
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  br label %72

68:                                               ; preds = %56
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %10, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  br label %72

72:                                               ; preds = %68, %67
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %88

73:                                               ; preds = %46
  store i32 0, ptr %12, align 4
  br label %74

74:                                               ; preds = %73, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %75 = load i32, ptr %12, align 4
  switch i32 %75, label %93 [
    i32 0, label %76
    i32 1, label %86
  ]

76:                                               ; preds = %74
  %77 = getelementptr inbounds %"class.amf::AMFDataStreamFileImpl", ptr %17, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !11
  %79 = call i64 @lseek64(i32 noundef %78, i64 noundef 0, i32 noundef 1) #7
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  store i64 %79, ptr %80, align 8, !tbaa !20
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load i64, ptr %81, align 8, !tbaa !20
  %83 = icmp eq i64 %82, -1
  br i1 %83, label %84, label %85

84:                                               ; preds = %76
  store i32 1, ptr %3, align 4
  br label %86

85:                                               ; preds = %76
  store i32 0, ptr %3, align 4
  br label %86

86:                                               ; preds = %85, %84, %74, %44
  %87 = load i32, ptr %3, align 4
  ret i32 %87

88:                                               ; preds = %72, %42
  %89 = load ptr, ptr %10, align 8
  %90 = load i32, ptr %11, align 4
  %91 = insertvalue { ptr, i32 } poison, ptr %89, 0
  %92 = insertvalue { ptr, i32 } %91, i32 %90, 1
  resume { ptr, i32 } %92

93:                                               ; preds = %74, %44
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef) #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 "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 = { 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 #7 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTSN3amf21AMFDataStreamFileImplE", !13, i64 0, !10, i64 24, !18, i64 32}
!13 = !{!"_ZTSN3amf16AMFInterfaceImplINS_13AMFDataStreamEiiiEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSN3amf13AMFDataStreamE", !15, i64 0}
!15 = !{!"_ZTSN3amf12AMFInterfaceE"}
!16 = !{!"_ZTSN3amf16AMFInterfaceBaseE", !17, i64 8}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEE", !19, i64 0, !17, i64 8, !7, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE12_Alloc_hiderE", !6, i64 0}
!20 = !{!17, !17, 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, amf::amf_allocator<wchar_t>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, amf::amf_allocator<wchar_t>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str = external hidden unnamed_addr constant [24 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [99 x i32], align 4
@.str.3 = external hidden unnamed_addr constant [22 x i32], align 4
@.str.6 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.7 = external hidden unnamed_addr constant [30 x i32], align 4

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15__FormatMessageB5cxx11EiPKwS1_z(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #3

declare void @AMFTraceW(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #4

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

; Function Attrs: nounwind
declare i64 @lseek64(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 17) i32 @_ZN3amf21AMFDataStreamFileImpl11GetPositionEPl(ptr nocapture noundef nonnull readonly align 8 dereferenceable(64) %0, ptr noundef writeonly %1) unnamed_addr #6 align 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.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = icmp ne ptr %1, null
  %10 = zext i1 %9 to i32
  %11 = tail call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %10)
  br i1 %11, label %25, label %12

12:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, i32 noundef %10)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  invoke void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, i32 noundef -1, ptr noundef nonnull @.str.6)
          to label %13 unwind label %16

13:                                               ; preds = %12
  invoke void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %14 unwind label %18

14:                                               ; preds = %13
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  %15 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef nonnull @.str.2, i32 noundef 168, i32 noundef 0, ptr noundef nonnull @.str.3, i32 noundef 0, ptr noundef %15)
          to label %24 unwind label %21

16:                                               ; preds = %12
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %20

18:                                               ; preds = %13
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %20

20:                                               ; preds = %18, %16
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %23

21:                                               ; preds = %14
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  br label %23

23:                                               ; preds = %21, %20
  %.pn23 = phi { ptr, i32 } [ %22, %21 ], [ %.pn, %20 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %49

24:                                               ; preds = %14
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %48

25:                                               ; preds = %2
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = load i32, ptr %26, align 8, !tbaa !5
  %28 = icmp ne i32 %27, -1
  %29 = zext i1 %28 to i32
  %30 = tail call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %29)
  br i1 %30, label %44, label %31

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, i32 noundef %29)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #7
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN3amf15__FormatMessageB5cxx11EiPKwS1_z(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, i32 noundef 0, ptr noundef nonnull @.str, ptr noundef nonnull @.str.7)
          to label %32 unwind label %35

32:                                               ; preds = %31
  invoke void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %33 unwind label %37

33:                                               ; preds = %32
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %34 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef nonnull @.str.2, i32 noundef 169, i32 noundef 0, ptr noundef nonnull @.str.3, i32 noundef 0, ptr noundef %34)
          to label %43 unwind label %40

35:                                               ; preds = %31
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

37:                                               ; preds = %32
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  br label %39

39:                                               ; preds = %37, %35
  %.pn25 = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  br label %42

40:                                               ; preds = %33
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  br label %42

42:                                               ; preds = %40, %39
  %.pn27 = phi { ptr, i32 } [ %41, %40 ], [ %.pn25, %39 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  br label %49

43:                                               ; preds = %33
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  br label %48

44:                                               ; preds = %25
  %45 = load i32, ptr %26, align 8, !tbaa !5
  %46 = tail call i64 @lseek64(i32 noundef %45, i64 noundef 0, i32 noundef 1) #7
  store i64 %46, ptr %1, align 8, !tbaa !18
  %47 = icmp eq i64 %46, -1
  %. = zext i1 %47 to i32
  br label %48

48:                                               ; preds = %43, %24, %44
  %.2 = phi i32 [ 7, %24 ], [ 16, %43 ], [ %., %44 ]
  ret i32 %.2

49:                                               ; preds = %42, %23
  %.pn27.pn = phi { ptr, i32 } [ %.pn27, %42 ], [ %.pn23, %23 ]
  resume { ptr, i32 } %.pn27.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 "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 = { 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 #7 = { 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, !14, i64 24}
!6 = !{!"_ZTSN3amf21AMFDataStreamFileImplE", !7, i64 0, !14, i64 24, !15, i64 32}
!7 = !{!"_ZTSN3amf16AMFInterfaceImplINS_13AMFDataStreamEiiiEE", !8, i64 0, !10, i64 8}
!8 = !{!"_ZTSN3amf13AMFDataStreamE", !9, i64 0}
!9 = !{!"_ZTSN3amf12AMFInterfaceE"}
!10 = !{!"_ZTSN3amf16AMFInterfaceBaseE", !11, i64 8}
!11 = !{!"long", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"int", !12, i64 0}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEE", !16, i64 0, !11, i64 8, !12, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE12_Alloc_hiderE", !17, i64 0}
!17 = !{!"any pointer", !12, i64 0}
!18 = !{!11, !11, i64 0}


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