; LLVM IR from ThePhysicsGuys/Physics3D :: tests/mathTests.ll (Z16testFixCastToIntv)

; 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_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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] }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"struct.P3D::Fix" = type { i64 }
%class.AssertComparer = type { i32, ptr }
%class.AssertComparer.44 = type { i32, ptr }
%struct.AssertBuilder = type { i32 }
%class.TestInterface = type <{ i64, i8, [7 x i8] }>

@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZTI14AssertionError = external dso_local constant { ptr, ptr }, align 8
@_Z9logStreamB5cxx11 = external global %"class.std::__cxx11::basic_stringstream", align 8

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

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

; Function Attrs: uwtable
declare hidden noundef ptr @_ZTW15__testInterface() #1

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZN14AssertionErrorC1EiPKc(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef, ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16testFixCastToIntv() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"struct.P3D::Fix", align 8
  %4 = alloca %class.AssertComparer, align 8
  %5 = alloca %class.AssertComparer.44, align 8
  %6 = alloca %struct.AssertBuilder, align 4
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca %"struct.P3D::Fix", align 8
  %13 = alloca %class.AssertComparer, align 8
  %14 = alloca %class.AssertComparer.44, align 8
  %15 = alloca %struct.AssertBuilder, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #8
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %64, %0
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 10000
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #8
  br label %67

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %23 = call i32 @rand() #8
  %24 = sub nsw i32 %23, 1073741823
  %25 = sext i32 %24 to i64
  store i64 %25, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %26 = load i64, ptr %2, align 8, !tbaa !9
  call void @_ZN3P3D3FixILl32EEC2El(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %26) #8
  %27 = load i64, ptr %2, align 8, !tbaa !9
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @_Z9logStreamB5cxx11, i64 16), i64 noundef %27)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %28, i8 noundef signext 10)
  br label %30

30:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  call void @_ZN13AssertBuilderC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef 438)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %31 = call noundef i64 @_ZNK3P3D3FixILl32EEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  store i64 %31, ptr %7, align 8, !tbaa !9
  %32 = call { i32, ptr } @_ZNK13AssertBuilderltIlEE14AssertComparerIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %33 = getelementptr inbounds { i32, ptr }, ptr %5, i32 0, i32 0
  %34 = extractvalue { i32, ptr } %32, 0
  store i32 %34, ptr %33, align 8
  %35 = getelementptr inbounds { i32, ptr }, ptr %5, i32 0, i32 1
  %36 = extractvalue { i32, ptr } %32, 1
  store ptr %36, ptr %35, align 8
  %37 = call { i32, ptr } @_ZNK14AssertComparerIlEeqIlEES_IbERKT_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %38 = getelementptr inbounds { i32, ptr }, ptr %4, i32 0, i32 0
  %39 = extractvalue { i32, ptr } %37, 0
  store i32 %39, ptr %38, align 8
  %40 = getelementptr inbounds { i32, ptr }, ptr %4, i32 0, i32 1
  %41 = extractvalue { i32, ptr } %37, 1
  store ptr %41, ptr %40, align 8
  %42 = getelementptr inbounds %class.AssertComparer, ptr %4, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  %44 = load i8, ptr %43, align 1, !tbaa !14, !range !16, !noundef !17
  %45 = trunc i8 %44 to i1
  %46 = xor i1 %45, true
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #8
  br i1 %46, label %47, label %60

47:                                               ; preds = %30
  %48 = call ptr @_ZTW15__testInterface()
  %49 = getelementptr inbounds %class.TestInterface, ptr %48, i32 0, i32 1
  %50 = load i8, ptr %49, align 8, !tbaa !18, !range !16, !noundef !17
  %51 = trunc i8 %50 to i1
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  br label %53

53:                                               ; preds = %52, %47
  %54 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZN14AssertionErrorC1EiPKc(ptr noundef nonnull align 8 dereferenceable(12) %54, i32 noundef 438, ptr noundef @.str.4)
          to label %55 unwind label %56

55:                                               ; preds = %53
  call void @__cxa_throw(ptr %54, ptr @_ZTI14AssertionError, ptr null) #9
  unreachable

56:                                               ; preds = %53
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %8, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %9, align 4
  call void @__cxa_free_exception(ptr %54) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #8
  br label %121

60:                                               ; preds = %30
  %61 = call ptr @_ZTW15__testInterface()
  call void @_ZN13TestInterface10markAssertEv(ptr noundef nonnull align 8 dereferenceable(9) %61)
  br label %62

62:                                               ; preds = %60
  br label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %1, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %1, align 4, !tbaa !5
  br label %18, !llvm.loop !20

67:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %117, %67
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = icmp slt i32 %69, 10000
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %120

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %73 = call i32 @rand() #8
  %74 = sitofp i32 %73 to double
  %75 = fdiv double %74, 0x41DFFFFFFFC00000
  %76 = fmul double %75, 1.000000e+05
  store double %76, ptr %11, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %77 = load double, ptr %11, align 8, !tbaa !22
  call void @_ZN3P3D3FixILl32EEC2Ed(ptr noundef nonnull align 8 dereferenceable(8) %12, double noundef %77) #8
  %78 = load double, ptr %11, align 8, !tbaa !22
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @_Z9logStreamB5cxx11, i64 16), double noundef %78)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %79, i8 noundef signext 10)
  br label %81

81:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @_ZN13AssertBuilderC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef 445)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %82 = call noundef i64 @_ZNK3P3D3FixILl32EEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  store i64 %82, ptr %16, align 8, !tbaa !9
  %83 = call { i32, ptr } @_ZNK13AssertBuilderltIlEE14AssertComparerIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %84 = getelementptr inbounds { i32, ptr }, ptr %14, i32 0, i32 0
  %85 = extractvalue { i32, ptr } %83, 0
  store i32 %85, ptr %84, align 8
  %86 = getelementptr inbounds { i32, ptr }, ptr %14, i32 0, i32 1
  %87 = extractvalue { i32, ptr } %83, 1
  store ptr %87, ptr %86, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %88 = load double, ptr %11, align 8, !tbaa !22
  %89 = fptosi double %88 to i64
  store i64 %89, ptr %17, align 8, !tbaa !9
  %90 = call { i32, ptr } @_ZNK14AssertComparerIlEeqIlEES_IbERKT_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %91 = getelementptr inbounds { i32, ptr }, ptr %13, i32 0, i32 0
  %92 = extractvalue { i32, ptr } %90, 0
  store i32 %92, ptr %91, align 8
  %93 = getelementptr inbounds { i32, ptr }, ptr %13, i32 0, i32 1
  %94 = extractvalue { i32, ptr } %90, 1
  store ptr %94, ptr %93, align 8
  %95 = getelementptr inbounds %class.AssertComparer, ptr %13, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = load i8, ptr %96, align 1, !tbaa !14, !range !16, !noundef !17
  %98 = trunc i8 %97 to i1
  %99 = xor i1 %98, true
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  br i1 %99, label %100, label %113

100:                                              ; preds = %81
  %101 = call ptr @_ZTW15__testInterface()
  %102 = getelementptr inbounds %class.TestInterface, ptr %101, i32 0, i32 1
  %103 = load i8, ptr %102, align 8, !tbaa !18, !range !16, !noundef !17
  %104 = trunc i8 %103 to i1
  br i1 %104, label %105, label %106

105:                                              ; preds = %100
  br label %106

106:                                              ; preds = %105, %100
  %107 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZN14AssertionErrorC1EiPKc(ptr noundef nonnull align 8 dereferenceable(12) %107, i32 noundef 445, ptr noundef @.str.4)
          to label %108 unwind label %109

108:                                              ; preds = %106
  call void @__cxa_throw(ptr %107, ptr @_ZTI14AssertionError, ptr null) #9
  unreachable

109:                                              ; preds = %106
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %8, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %9, align 4
  call void @__cxa_free_exception(ptr %107) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %121

113:                                              ; preds = %81
  %114 = call ptr @_ZTW15__testInterface()
  call void @_ZN13TestInterface10markAssertEv(ptr noundef nonnull align 8 dereferenceable(9) %114)
  br label %115

115:                                              ; preds = %113
  br label %116

116:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !5
  br label %68, !llvm.loop !24

120:                                              ; preds = %71
  ret void

121:                                              ; preds = %109, %56
  %122 = load ptr, ptr %8, align 8
  %123 = load i32, ptr %9, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125
}

; Function Attrs: nounwind
declare i32 @rand() #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D3FixILl32EEC2El(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13AssertBuilderC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZNK13AssertBuilderltIlEE14AssertComparerIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZNK14AssertComparerIlEeqIlEES_IbERKT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D3FixILl32EEC2Ed(ptr noundef nonnull align 8 dereferenceable(8), double noundef) unnamed_addr #7 align 2

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"_ZTS14AssertComparerIbE", !6, i64 0, !13, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !15, i64 8}
!19 = !{!"_ZTS13TestInterface", !10, i64 0, !15, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !23, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = distinct !{!24, !21}


; 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_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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] }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"struct.P3D::Fix" = type { i64 }
%class.AssertComparer.44 = type { i32, ptr }
%struct.AssertBuilder = type { i32 }

@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZTI14AssertionError = external dso_local constant { ptr, ptr }, align 8
@_Z9logStreamB5cxx11 = external global %"class.std::__cxx11::basic_stringstream", align 8

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

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

; Function Attrs: uwtable
declare hidden noundef ptr @_ZTW15__testInterface() local_unnamed_addr #1

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZN14AssertionErrorC1EiPKc(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef, ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN13TestInterface10markAssertEv(ptr noundef nonnull align 8 dereferenceable(9)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16testFixCastToIntv() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"struct.P3D::Fix", align 8
  %3 = alloca %class.AssertComparer.44, align 8
  %4 = alloca %struct.AssertBuilder, align 4
  %5 = alloca i64, align 8
  %6 = alloca %"struct.P3D::Fix", align 8
  %7 = alloca %class.AssertComparer.44, align 8
  %8 = alloca %struct.AssertBuilder, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  br label %13

.preheader:                                       ; preds = %34
  %12 = getelementptr inbounds i8, ptr %7, i64 8
  br label %37

13:                                               ; preds = %0, %34
  %.016 = phi i32 [ 0, %0 ], [ %35, %34 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %14 = call i32 @rand() #8
  %15 = add nsw i32 %14, -1073741823
  %16 = sext i32 %15 to i64
  store i64 %16, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  call void @_ZN3P3D3FixILl32EEC2El(ptr noundef nonnull align 8 dereferenceable(8) %2, i64 noundef %16) #8
  %17 = load i64, ptr %1, align 8, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @_Z9logStreamB5cxx11, i64 16), i64 noundef %17)
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %18, i8 noundef signext 10)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  call void @_ZN13AssertBuilderC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 438)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %20 = call noundef i64 @_ZNK3P3D3FixILl32EEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  store i64 %20, ptr %5, align 8, !tbaa !5
  %21 = call { i32, ptr } @_ZNK13AssertBuilderltIlEE14AssertComparerIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %22 = extractvalue { i32, ptr } %21, 0
  store i32 %22, ptr %3, align 8
  %23 = extractvalue { i32, ptr } %21, 1
  store ptr %23, ptr %11, align 8
  %24 = call { i32, ptr } @_ZNK14AssertComparerIlEeqIlEES_IbERKT_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %25 = extractvalue { i32, ptr } %24, 1
  %26 = load i8, ptr %25, align 1, !tbaa !9, !range !11, !noundef !12
  %27 = trunc nuw i8 %26 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  %28 = call ptr @_ZTW15__testInterface()
  br i1 %27, label %34, label %29

29:                                               ; preds = %13
  %30 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZN14AssertionErrorC1EiPKc(ptr noundef nonnull align 8 dereferenceable(12) %30, i32 noundef 438, ptr noundef nonnull @.str.4)
          to label %31 unwind label %32

31:                                               ; preds = %29
  call void @__cxa_throw(ptr nonnull %30, ptr nonnull @_ZTI14AssertionError, ptr null) #9
  unreachable

32:                                               ; preds = %29
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  br label %61

34:                                               ; preds = %13
  call void @_ZN13TestInterface10markAssertEv(ptr noundef nonnull align 8 dereferenceable(9) %28)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %35 = add nuw nsw i32 %.016, 1
  %exitcond.not = icmp eq i32 %35, 10000
  br i1 %exitcond.not, label %.preheader, label %13, !llvm.loop !13

36:                                               ; preds = %59
  ret void

37:                                               ; preds = %.preheader, %59
  %.01417 = phi i32 [ 0, %.preheader ], [ %60, %59 ]
  %38 = call i32 @rand() #8
  %39 = sitofp i32 %38 to double
  %40 = fdiv double %39, 0x41DFFFFFFFC00000
  %41 = fmul double %40, 1.000000e+05
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @_ZN3P3D3FixILl32EEC2Ed(ptr noundef nonnull align 8 dereferenceable(8) %6, double noundef %41) #8
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @_Z9logStreamB5cxx11, i64 16), double noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %42, i8 noundef signext 10)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  call void @_ZN13AssertBuilderC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 445)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %44 = call noundef i64 @_ZNK3P3D3FixILl32EEcvlEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  store i64 %44, ptr %9, align 8, !tbaa !5
  %45 = call { i32, ptr } @_ZNK13AssertBuilderltIlEE14AssertComparerIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %46 = extractvalue { i32, ptr } %45, 0
  store i32 %46, ptr %7, align 8
  %47 = extractvalue { i32, ptr } %45, 1
  store ptr %47, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %48 = fptosi double %41 to i64
  store i64 %48, ptr %10, align 8, !tbaa !5
  %49 = call { i32, ptr } @_ZNK14AssertComparerIlEeqIlEES_IbERKT_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %50 = extractvalue { i32, ptr } %49, 1
  %51 = load i8, ptr %50, align 1, !tbaa !9, !range !11, !noundef !12
  %52 = trunc nuw i8 %51 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  %53 = call ptr @_ZTW15__testInterface()
  br i1 %52, label %59, label %54

54:                                               ; preds = %37
  %55 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZN14AssertionErrorC1EiPKc(ptr noundef nonnull align 8 dereferenceable(12) %55, i32 noundef 445, ptr noundef nonnull @.str.4)
          to label %56 unwind label %57

56:                                               ; preds = %54
  call void @__cxa_throw(ptr nonnull %55, ptr nonnull @_ZTI14AssertionError, ptr null) #9
  unreachable

57:                                               ; preds = %54
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %55) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %61

59:                                               ; preds = %37
  call void @_ZN13TestInterface10markAssertEv(ptr noundef nonnull align 8 dereferenceable(9) %53)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %60 = add nuw nsw i32 %.01417, 1
  %exitcond18.not = icmp eq i32 %60, 10000
  br i1 %exitcond18.not, label %36, label %37, !llvm.loop !15

61:                                               ; preds = %57, %32
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %58, %57 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D3FixILl32EEC2El(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13AssertBuilderC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZNK13AssertBuilderltIlEE14AssertComparerIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZNK14AssertComparerIlEeqIlEES_IbERKT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D3FixILl32EEC2Ed(ptr noundef nonnull align 8 dereferenceable(8), double noundef) unnamed_addr #7 align 2

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

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass