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

; 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.5 = external hidden unnamed_addr constant [23 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: mustprogress uwtable
define dso_local noundef i32 @_ZN3amf21AMFDataStreamFileImpl4SeekENS_15AMF_SEEK_ORIGINElPl(ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %1, i64 noundef %2, ptr noundef %3) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %20 = getelementptr inbounds %"class.amf::AMFDataStreamFileImpl", ptr %19, i32 0, i32 1
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = icmp ne i32 %21, -1
  %23 = zext i1 %22 to i32
  store i32 %23, ptr %10, align 4, !tbaa !22
  %24 = load i32, ptr %10, align 4, !tbaa !22
  %25 = call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %24)
  br i1 %25, label %46, label %26

26:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  %27 = load i32, ptr %10, align 4, !tbaa !22
  call void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %12, i32 noundef %27)
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN3amf15__FormatMessageB5cxx11EiPKwS1_z(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %13, i32 noundef 0, ptr noundef @.str, ptr noundef @.str.5)
          to label %28 unwind label %32

28:                                               ; preds = %26
  invoke void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %29 unwind label %36

29:                                               ; preds = %28
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  %30 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef @.str.2, i32 noundef 134, i32 noundef 0, ptr noundef @.str.3, i32 noundef 0, ptr noundef %30)
          to label %31 unwind label %41

31:                                               ; preds = %29
  store i32 16, ptr %5, align 4
  store i32 1, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  br label %47

32:                                               ; preds = %26
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %14, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %15, align 4
  br label %40

36:                                               ; preds = %28
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %14, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %15, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  br label %40

40:                                               ; preds = %36, %32
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %45

41:                                               ; preds = %29
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %14, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %15, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  br label %45

45:                                               ; preds = %41, %40
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %73

46:                                               ; preds = %4
  store i32 0, ptr %16, align 4
  br label %47

47:                                               ; preds = %46, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %48 = load i32, ptr %16, align 4
  switch i32 %48, label %78 [
    i32 0, label %49
    i32 1, label %71
  ]

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !22
  %50 = load i32, ptr %7, align 4, !tbaa !9
  switch i32 %50, label %54 [
    i32 0, label %51
    i32 1, label %52
    i32 2, label %53
  ]

51:                                               ; preds = %49
  store i32 0, ptr %17, align 4, !tbaa !22
  br label %54

52:                                               ; preds = %49
  store i32 1, ptr %17, align 4, !tbaa !22
  br label %54

53:                                               ; preds = %49
  store i32 2, ptr %17, align 4, !tbaa !22
  br label %54

54:                                               ; preds = %53, %52, %51, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !11
  %55 = getelementptr inbounds %"class.amf::AMFDataStreamFileImpl", ptr %19, i32 0, i32 1
  %56 = load i32, ptr %55, align 8, !tbaa !13
  %57 = load i64, ptr %8, align 8, !tbaa !11
  %58 = load i32, ptr %17, align 4, !tbaa !22
  %59 = call i64 @lseek64(i32 noundef %56, i64 noundef %57, i32 noundef %58) #7
  store i64 %59, ptr %18, align 8, !tbaa !11
  %60 = load i64, ptr %18, align 8, !tbaa !11
  %61 = icmp eq i64 %60, -1
  br i1 %61, label %62, label %63

62:                                               ; preds = %54
  store i32 1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %70

63:                                               ; preds = %54
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %69

66:                                               ; preds = %63
  %67 = load i64, ptr %18, align 8, !tbaa !11
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %67, ptr %68, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %66, %63
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %70

70:                                               ; preds = %69, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %71

71:                                               ; preds = %70, %47
  %72 = load i32, ptr %5, align 4
  ret i32 %72

73:                                               ; preds = %45
  %74 = load ptr, ptr %14, align 8
  %75 = load i32, ptr %15, align 4
  %76 = insertvalue { ptr, i32 } poison, ptr %74, 0
  %77 = insertvalue { ptr, i32 } %76, i32 %75, 1
  resume { ptr, i32 } %77

78:                                               ; preds = %47
  unreachable
}

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

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 = { 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 #6 = { 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 #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 = !{!"_ZTSN3amf15AMF_SEEK_ORIGINE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !19, i64 24}
!14 = !{!"_ZTSN3amf21AMFDataStreamFileImplE", !15, i64 0, !19, i64 24, !20, i64 32}
!15 = !{!"_ZTSN3amf16AMFInterfaceImplINS_13AMFDataStreamEiiiEE", !16, i64 0, !18, i64 8}
!16 = !{!"_ZTSN3amf13AMFDataStreamE", !17, i64 0}
!17 = !{!"_ZTSN3amf12AMFInterfaceE"}
!18 = !{!"_ZTSN3amf16AMFInterfaceBaseE", !12, i64 8}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEE", !21, i64 0, !12, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!19, !19, 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.5 = external hidden unnamed_addr constant [23 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: mustprogress uwtable
define dso_local noundef range(i32 0, 17) i32 @_ZN3amf21AMFDataStreamFileImpl4SeekENS_15AMF_SEEK_ORIGINElPl(ptr nocapture noundef nonnull readonly align 8 dereferenceable(64) %0, i32 noundef %1, i64 noundef %2, ptr noundef writeonly %3) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %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 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = icmp ne i32 %9, -1
  %11 = zext i1 %10 to i32
  %12 = tail call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %11)
  br i1 %12, label %26, label %13

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

14:                                               ; preds = %13
  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 %5, ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %15 unwind label %19

15:                                               ; preds = %14
  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
  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
  %16 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef nonnull @.str.2, i32 noundef 134, i32 noundef 0, ptr noundef nonnull @.str.3, i32 noundef 0, ptr noundef %16)
          to label %25 unwind label %22

17:                                               ; preds = %13
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %21

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

21:                                               ; preds = %19, %17
  %.pn = phi { ptr, i32 } [ %20, %19 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  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 %24

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

24:                                               ; preds = %22, %21
  %.pn22 = phi { ptr, i32 } [ %23, %22 ], [ %.pn, %21 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn22

25:                                               ; preds = %15
  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
  br label %32

26:                                               ; preds = %4
  %switch.selectcmp = icmp eq i32 %1, 1
  %switch.select = zext i1 %switch.selectcmp to i32
  %switch.selectcmp24 = icmp eq i32 %1, 2
  %switch.select25 = select i1 %switch.selectcmp24, i32 2, i32 %switch.select
  %27 = load i32, ptr %8, align 8, !tbaa !5
  %28 = tail call i64 @lseek64(i32 noundef %27, i64 noundef %2, i32 noundef %switch.select25) #7
  %29 = icmp eq i64 %28, -1
  br i1 %29, label %32, label %30

30:                                               ; preds = %26
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %32, label %31

31:                                               ; preds = %30
  store i64 %28, ptr %3, align 8, !tbaa !18
  br label %32

32:                                               ; preds = %25, %26, %31, %30
  %.2 = phi i32 [ 16, %25 ], [ 1, %26 ], [ 0, %31 ], [ 0, %30 ]
  ret i32 %.2
}

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

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 = { 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 #6 = { 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 #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