; LLVM IR from tevador/RandomX :: src/tests (jit-performance)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"class.std::locale" = type { ptr }
%"struct.randomx::ProgramConfiguration" = type { [2 x i64], i32, i32, i32, i32 }
%"class.randomx::Program" = type { [16 x i64], [256 x %"class.randomx::Instruction"] }
%"class.randomx::Instruction" = type { i8, i8, i8, i8, i32 }
%"class.randomx::JitCompilerX86" = type <{ %"class.std::vector", [8 x i32], ptr, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Stopwatch = type <{ %"class.std::chrono::time_point", i64, i8, [7 x i8] }>
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }

@__const.main.seed = external hidden unnamed_addr constant [26 x i8], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [26 x i8], align 16
  %8 = alloca [64 x i8], align 16
  %9 = alloca %"struct.randomx::ProgramConfiguration", align 8
  %10 = alloca %"class.randomx::Program", align 8
  %11 = alloca %"class.randomx::JitCompilerX86", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %class.Stopwatch, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_Z7readIntiPPcRii(i32 noundef %17, ptr noundef %18, ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef 1000000)
  call void @llvm.lifetime.start.p0(i64 26, ptr %7) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 @__const.main.seed, i64 26, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #9
  %19 = call i32 @randomx_blake2b(ptr noundef %8, i64 noundef 64, ptr noundef %7, i64 noundef 26, ptr noundef null, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 2176, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr %11) #9
  call void @_ZN7randomx14JitCompilerX86C1Ev(ptr noundef nonnull align 8 dereferenceable(68) %11)
  %20 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %21 unwind label %35

21:                                               ; preds = %2
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef %22)
          to label %24 unwind label %35

24:                                               ; preds = %21
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef @.str.1)
          to label %26 unwind label %35

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %28 unwind label %35

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #9
  invoke void @_ZN9StopwatchC2Eb(ptr noundef nonnull align 8 dereferenceable(17) %14, i1 noundef zeroext true)
          to label %29 unwind label %39

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %75, %29
  %31 = load i32, ptr %15, align 4, !tbaa !5
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %43, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %87

35:                                               ; preds = %26, %24, %21, %2
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %12, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %13, align 4
  br label %105

39:                                               ; preds = %101, %99, %97, %95, %93, %91, %89, %87, %28
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %12, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %13, align 4
  br label %104

43:                                               ; preds = %30
  %44 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  invoke void @_Z11fillAes1Rx4ILb0EEvPvmS0_(ptr noundef %44, i64 noundef 2176, ptr noundef %10)
          to label %45 unwind label %78

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %46 = invoke noundef i64 @_ZN7randomx7Program10getEntropyEi(ptr noundef nonnull align 8 dereferenceable(2176) %10, i32 noundef 12)
          to label %47 unwind label %82

47:                                               ; preds = %45
  store i64 %46, ptr %16, align 8, !tbaa !11
  %48 = load i64, ptr %16, align 8, !tbaa !11
  %49 = and i64 %48, 1
  %50 = add i64 0, %49
  %51 = trunc i64 %50 to i32
  %52 = getelementptr inbounds %"struct.randomx::ProgramConfiguration", ptr %9, i32 0, i32 1
  store i32 %51, ptr %52, align 8, !tbaa !13
  %53 = load i64, ptr %16, align 8, !tbaa !11
  %54 = lshr i64 %53, 1
  store i64 %54, ptr %16, align 8, !tbaa !11
  %55 = load i64, ptr %16, align 8, !tbaa !11
  %56 = and i64 %55, 1
  %57 = add i64 2, %56
  %58 = trunc i64 %57 to i32
  %59 = getelementptr inbounds %"struct.randomx::ProgramConfiguration", ptr %9, i32 0, i32 2
  store i32 %58, ptr %59, align 4, !tbaa !15
  %60 = load i64, ptr %16, align 8, !tbaa !11
  %61 = lshr i64 %60, 1
  store i64 %61, ptr %16, align 8, !tbaa !11
  %62 = load i64, ptr %16, align 8, !tbaa !11
  %63 = and i64 %62, 1
  %64 = add i64 4, %63
  %65 = trunc i64 %64 to i32
  %66 = getelementptr inbounds %"struct.randomx::ProgramConfiguration", ptr %9, i32 0, i32 3
  store i32 %65, ptr %66, align 8, !tbaa !16
  %67 = load i64, ptr %16, align 8, !tbaa !11
  %68 = lshr i64 %67, 1
  store i64 %68, ptr %16, align 8, !tbaa !11
  %69 = load i64, ptr %16, align 8, !tbaa !11
  %70 = and i64 %69, 1
  %71 = add i64 6, %70
  %72 = trunc i64 %71 to i32
  %73 = getelementptr inbounds %"struct.randomx::ProgramConfiguration", ptr %9, i32 0, i32 4
  store i32 %72, ptr %73, align 4, !tbaa !17
  invoke void @_ZN7randomx14JitCompilerX8615generateProgramERNS_7ProgramERNS_20ProgramConfigurationE(ptr noundef nonnull align 8 dereferenceable(68) %11, ptr noundef nonnull align 8 dereferenceable(2176) %10, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %74 unwind label %82

74:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %15, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %15, align 4, !tbaa !5
  br label %30, !llvm.loop !18

78:                                               ; preds = %43
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %12, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %13, align 4
  br label %86

82:                                               ; preds = %47, %45
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %12, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %86

86:                                               ; preds = %82, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %104

87:                                               ; preds = %34
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %89 unwind label %39

89:                                               ; preds = %87
  %90 = invoke noundef double @_ZNK9Stopwatch10getElapsedEv(ptr noundef nonnull align 8 dereferenceable(17) %14)
          to label %91 unwind label %39

91:                                               ; preds = %89
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %88, double noundef %90)
          to label %93 unwind label %39

93:                                               ; preds = %91
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef @.str.3)
          to label %95 unwind label %39

95:                                               ; preds = %93
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %97 unwind label %39

97:                                               ; preds = %95
  %98 = invoke noundef ptr @_ZN7randomx14JitCompilerX8614getProgramFuncEv(ptr noundef nonnull align 8 dereferenceable(68) %11)
          to label %99 unwind label %39

99:                                               ; preds = %97
  %100 = invoke noundef i64 @_ZN7randomx14JitCompilerX8611getCodeSizeEv(ptr noundef nonnull align 8 dereferenceable(68) %11)
          to label %101 unwind label %39

101:                                              ; preds = %99
  invoke void @_Z4dumpPKcmS0_(ptr noundef %98, i64 noundef %100, ptr noundef @.str.4)
          to label %102 unwind label %39

102:                                              ; preds = %101
  store i32 0, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  call void @_ZN7randomx14JitCompilerX86D1Ev(ptr noundef nonnull align 8 dereferenceable(68) %11) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 2176, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 26, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  %103 = load i32, ptr %3, align 4
  ret i32 %103

104:                                              ; preds = %86, %39
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  br label %105

105:                                              ; preds = %104, %35
  call void @_ZN7randomx14JitCompilerX86D1Ev(ptr noundef nonnull align 8 dereferenceable(68) %11) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 2176, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 26, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %12, align 8
  %108 = load i32, ptr %13, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i32 @randomx_blake2b(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #4

declare void @_ZN7randomx14JitCompilerX86C1Ev(ptr noundef nonnull align 8 dereferenceable(68)) unnamed_addr #4

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

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9StopwatchC2Eb(ptr noundef nonnull align 8 dereferenceable(17), i1 noundef zeroext) unnamed_addr #6 align 2

declare void @_Z11fillAes1Rx4ILb0EEvPvmS0_(ptr noundef, i64 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7randomx7Program10getEntropyEi(ptr noundef nonnull align 8 dereferenceable(2176), i32 noundef) #6 align 2

declare void @_ZN7randomx14JitCompilerX8615generateProgramERNS_7ProgramERNS_20ProgramConfigurationE(ptr noundef nonnull align 8 dereferenceable(68), ptr noundef nonnull align 8 dereferenceable(2176), ptr noundef nonnull align 8 dereferenceable(32)) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK9Stopwatch10getElapsedEv(ptr noundef nonnull align 8 dereferenceable(17)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z4dumpPKcmS0_(ptr noundef, i64 noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7randomx14JitCompilerX8614getProgramFuncEv(ptr noundef nonnull align 8 dereferenceable(68)) #7 align 2

declare noundef i64 @_ZN7randomx14JitCompilerX8611getCodeSizeEv(ptr noundef nonnull align 8 dereferenceable(68)) #4

; Function Attrs: nounwind
declare void @_ZN7randomx14JitCompilerX86D1Ev(ptr noundef nonnull align 8 dereferenceable(68)) unnamed_addr #8

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 16}
!14 = !{!"_ZTSN7randomx20ProgramConfigurationE", !7, i64 0, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!15 = !{!14, !6, i64 20}
!16 = !{!14, !6, i64 24}
!17 = !{!14, !6, i64 28}
!18 = distinct !{!18, !19}
!19 = !{!"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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"class.std::locale" = type { ptr }
%"struct.randomx::ProgramConfiguration" = type { [2 x i64], i32, i32, i32, i32 }
%"class.randomx::Program" = type { [16 x i64], [256 x %"class.randomx::Instruction"] }
%"class.randomx::Instruction" = type { i8, i8, i8, i8, i32 }
%"class.randomx::JitCompilerX86" = type <{ %"class.std::vector", [8 x i32], ptr, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Stopwatch = type <{ %"class.std::chrono::time_point", i64, i8, [7 x i8] }>
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }

@__const.main.seed = external hidden unnamed_addr constant [26 x i8], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 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

; 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 norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca [26 x i8], align 16
  %5 = alloca [64 x i8], align 16
  %6 = alloca %"struct.randomx::ProgramConfiguration", align 8
  %7 = alloca %"class.randomx::Program", align 8
  %8 = alloca %"class.randomx::JitCompilerX86", align 8
  %9 = alloca %class.Stopwatch, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  call void @_Z7readIntiPPcRii(i32 noundef %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 1000000)
  call void @llvm.lifetime.start.p0(i64 26, ptr nonnull %4) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(26) %4, ptr noundef nonnull align 16 dereferenceable(26) @__const.main.seed, i64 26, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #9
  %10 = call i32 @randomx_blake2b(ptr noundef nonnull %5, i64 noundef 64, ptr noundef nonnull %4, i64 noundef 26, ptr noundef null, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 2176, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #9
  call void @_ZN7randomx14JitCompilerX86C1Ev(ptr noundef nonnull align 8 dereferenceable(68) %8)
  %11 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %12 unwind label %27

12:                                               ; preds = %2
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef %13)
          to label %15 unwind label %27

15:                                               ; preds = %12
  %16 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull @.str.1)
          to label %17 unwind label %27

17:                                               ; preds = %15
  %18 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %19 unwind label %27

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #9
  invoke void @_ZN9StopwatchC2Eb(ptr noundef nonnull align 8 dereferenceable(17) %9, i1 noundef zeroext true)
          to label %.preheader unwind label %29

.preheader:                                       ; preds = %19
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %22 = getelementptr inbounds i8, ptr %6, i64 16
  %23 = getelementptr inbounds i8, ptr %6, i64 20
  %24 = getelementptr inbounds i8, ptr %6, i64 24
  %25 = getelementptr inbounds i8, ptr %6, i64 28
  br label %31

._crit_edge:                                      ; preds = %46, %.preheader
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
          to label %54 unwind label %29

27:                                               ; preds = %17, %15, %12, %2
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %68

29:                                               ; preds = %65, %62, %60, %58, %56, %54, %._crit_edge, %19
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %67

31:                                               ; preds = %.lr.ph, %46
  %.020 = phi i32 [ 0, %.lr.ph ], [ %47, %46 ]
  invoke void @_Z11fillAes1Rx4ILb0EEvPvmS0_(ptr noundef nonnull %5, i64 noundef 2176, ptr noundef nonnull %7)
          to label %32 unwind label %50

32:                                               ; preds = %31
  %33 = invoke noundef i64 @_ZN7randomx7Program10getEntropyEi(ptr noundef nonnull align 8 dereferenceable(2176) %7, i32 noundef 12)
          to label %34 unwind label %52

34:                                               ; preds = %32
  %35 = trunc i64 %33 to i32
  %36 = and i32 %35, 1
  store i32 %36, ptr %22, align 8, !tbaa !9
  %37 = lshr i32 %35, 1
  %38 = and i32 %37, 1
  %39 = or disjoint i32 %38, 2
  store i32 %39, ptr %23, align 4, !tbaa !11
  %40 = lshr i32 %35, 2
  %41 = and i32 %40, 1
  %42 = or disjoint i32 %41, 4
  store i32 %42, ptr %24, align 8, !tbaa !12
  %43 = lshr i32 %35, 3
  %44 = and i32 %43, 1
  %45 = or disjoint i32 %44, 6
  store i32 %45, ptr %25, align 4, !tbaa !13
  invoke void @_ZN7randomx14JitCompilerX8615generateProgramERNS_7ProgramERNS_20ProgramConfigurationE(ptr noundef nonnull align 8 dereferenceable(68) %8, ptr noundef nonnull align 8 dereferenceable(2176) %7, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %46 unwind label %52

46:                                               ; preds = %34
  %47 = add nuw nsw i32 %.020, 1
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %31, label %._crit_edge, !llvm.loop !14

50:                                               ; preds = %31
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %67

52:                                               ; preds = %34, %32
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %67

54:                                               ; preds = %._crit_edge
  %55 = invoke noundef double @_ZNK9Stopwatch10getElapsedEv(ptr noundef nonnull align 8 dereferenceable(17) %9)
          to label %56 unwind label %29

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %26, double noundef %55)
          to label %58 unwind label %29

58:                                               ; preds = %56
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str.3)
          to label %60 unwind label %29

60:                                               ; preds = %58
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %62 unwind label %29

62:                                               ; preds = %60
  %63 = call noundef ptr @_ZN7randomx14JitCompilerX8614getProgramFuncEv(ptr noundef nonnull align 8 dereferenceable(68) %8)
  %64 = invoke noundef i64 @_ZN7randomx14JitCompilerX8611getCodeSizeEv(ptr noundef nonnull align 8 dereferenceable(68) %8)
          to label %65 unwind label %29

65:                                               ; preds = %62
  invoke void @_Z4dumpPKcmS0_(ptr noundef %63, i64 noundef %64, ptr noundef nonnull @.str.4)
          to label %66 unwind label %29

66:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #9
  call void @_ZN7randomx14JitCompilerX86D1Ev(ptr noundef nonnull align 8 dereferenceable(68) %8) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 2176, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 26, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  ret i32 0

67:                                               ; preds = %50, %52, %29
  %.pn.pn = phi { ptr, i32 } [ %30, %29 ], [ %53, %52 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #9
  br label %68

68:                                               ; preds = %67, %27
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %67 ], [ %28, %27 ]
  call void @_ZN7randomx14JitCompilerX86D1Ev(ptr noundef nonnull align 8 dereferenceable(68) %8) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 2176, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 26, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7readIntiPPcRii(i32 noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i32 @randomx_blake2b(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @_ZN7randomx14JitCompilerX86C1Ev(ptr noundef nonnull align 8 dereferenceable(68)) unnamed_addr #4

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

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9StopwatchC2Eb(ptr noundef nonnull align 8 dereferenceable(17), i1 noundef zeroext) unnamed_addr #6 align 2

declare void @_Z11fillAes1Rx4ILb0EEvPvmS0_(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7randomx7Program10getEntropyEi(ptr noundef nonnull align 8 dereferenceable(2176), i32 noundef) local_unnamed_addr #6 align 2

declare void @_ZN7randomx14JitCompilerX8615generateProgramERNS_7ProgramERNS_20ProgramConfigurationE(ptr noundef nonnull align 8 dereferenceable(68), ptr noundef nonnull align 8 dereferenceable(2176), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

; 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 #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK9Stopwatch10getElapsedEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z4dumpPKcmS0_(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7randomx14JitCompilerX8614getProgramFuncEv(ptr noundef nonnull align 8 dereferenceable(68)) local_unnamed_addr #7 align 2

declare noundef i64 @_ZN7randomx14JitCompilerX8611getCodeSizeEv(ptr noundef nonnull align 8 dereferenceable(68)) local_unnamed_addr #4

; Function Attrs: nounwind
declare void @_ZN7randomx14JitCompilerX86D1Ev(ptr noundef nonnull align 8 dereferenceable(68)) unnamed_addr #8

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTSN7randomx20ProgramConfigurationE", !7, i64 0, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!11 = !{!10, !6, i64 20}
!12 = !{!10, !6, i64 24}
!13 = !{!10, !6, i64 28}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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