; LLVM IR from tevador/RandomX :: src (superscalar)

; 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.randomx::Instruction" = type { i8, i8, i8, i8, i32 }

; 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN7randomx18SuperscalarProgramclEi(ptr noundef nonnull align 8 dereferenceable(4200), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7randomx18executeSuperscalarERA8_mRNS_18SuperscalarProgramEPSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(4200) %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %209, %3
  %10 = load i32, ptr %7, align 4, !tbaa !9
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = call noundef i32 @_ZN7randomx18SuperscalarProgram7getSizeEv(ptr noundef nonnull align 8 dereferenceable(4200) %11)
  %13 = icmp ult i32 %10, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %212

15:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7randomx18SuperscalarProgramclEi(ptr noundef nonnull align 8 dereferenceable(4200) %16, i32 noundef %17)
  store ptr %18, ptr %8, align 8, !tbaa !5
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.randomx::Instruction", ptr %19, i32 0, i32 0
  %21 = load i8, ptr %20, align 4, !tbaa !11
  %22 = zext i8 %21 to i32
  switch i32 %22, label %207 [
    i32 0, label %23
    i32 1, label %39
    i32 2, label %55
    i32 3, label %75
    i32 4, label %91
    i32 5, label %108
    i32 7, label %108
    i32 9, label %108
    i32 6, label %120
    i32 8, label %120
    i32 10, label %120
    i32 11, label %132
    i32 12, label %154
    i32 13, label %176
  ]

23:                                               ; preds = %15
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.randomx::Instruction", ptr %25, i32 0, i32 2
  %27 = load i8, ptr %26, align 2, !tbaa !13
  %28 = zext i8 %27 to i64
  %29 = getelementptr inbounds [8 x i64], ptr %24, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !14
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.randomx::Instruction", ptr %32, i32 0, i32 1
  %34 = load i8, ptr %33, align 1, !tbaa !16
  %35 = zext i8 %34 to i64
  %36 = getelementptr inbounds [8 x i64], ptr %31, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !14
  %38 = sub i64 %37, %30
  store i64 %38, ptr %36, align 8, !tbaa !14
  br label %208

39:                                               ; preds = %15
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.randomx::Instruction", ptr %41, i32 0, i32 2
  %43 = load i8, ptr %42, align 2, !tbaa !13
  %44 = zext i8 %43 to i64
  %45 = getelementptr inbounds [8 x i64], ptr %40, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !14
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.randomx::Instruction", ptr %48, i32 0, i32 1
  %50 = load i8, ptr %49, align 1, !tbaa !16
  %51 = zext i8 %50 to i64
  %52 = getelementptr inbounds [8 x i64], ptr %47, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !14
  %54 = xor i64 %53, %46
  store i64 %54, ptr %52, align 8, !tbaa !14
  br label %208

55:                                               ; preds = %15
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.randomx::Instruction", ptr %57, i32 0, i32 2
  %59 = load i8, ptr %58, align 2, !tbaa !13
  %60 = zext i8 %59 to i64
  %61 = getelementptr inbounds [8 x i64], ptr %56, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !14
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = call noundef i32 @_ZNK7randomx11Instruction11getModShiftEv(ptr noundef nonnull align 4 dereferenceable(8) %63)
  %65 = zext i32 %64 to i64
  %66 = shl i64 %62, %65
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.randomx::Instruction", ptr %68, i32 0, i32 1
  %70 = load i8, ptr %69, align 1, !tbaa !16
  %71 = zext i8 %70 to i64
  %72 = getelementptr inbounds [8 x i64], ptr %67, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !14
  %74 = add i64 %73, %66
  store i64 %74, ptr %72, align 8, !tbaa !14
  br label %208

75:                                               ; preds = %15
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %"class.randomx::Instruction", ptr %77, i32 0, i32 2
  %79 = load i8, ptr %78, align 2, !tbaa !13
  %80 = zext i8 %79 to i64
  %81 = getelementptr inbounds [8 x i64], ptr %76, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !14
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.randomx::Instruction", ptr %84, i32 0, i32 1
  %86 = load i8, ptr %85, align 1, !tbaa !16
  %87 = zext i8 %86 to i64
  %88 = getelementptr inbounds [8 x i64], ptr %83, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !14
  %90 = mul i64 %89, %82
  store i64 %90, ptr %88, align 8, !tbaa !14
  br label %208

91:                                               ; preds = %15
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.randomx::Instruction", ptr %93, i32 0, i32 1
  %95 = load i8, ptr %94, align 1, !tbaa !16
  %96 = zext i8 %95 to i64
  %97 = getelementptr inbounds [8 x i64], ptr %92, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !14
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %99)
  %101 = call noundef i64 @_Z4rotrmj(i64 noundef %98, i32 noundef %100)
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.randomx::Instruction", ptr %103, i32 0, i32 1
  %105 = load i8, ptr %104, align 1, !tbaa !16
  %106 = zext i8 %105 to i64
  %107 = getelementptr inbounds [8 x i64], ptr %102, i64 0, i64 %106
  store i64 %101, ptr %107, align 8, !tbaa !14
  br label %208

108:                                              ; preds = %15, %15, %15
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %109)
  %111 = call noundef i64 @_Z17signExtend2sComplj(i32 noundef %110)
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %"class.randomx::Instruction", ptr %113, i32 0, i32 1
  %115 = load i8, ptr %114, align 1, !tbaa !16
  %116 = zext i8 %115 to i64
  %117 = getelementptr inbounds [8 x i64], ptr %112, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !14
  %119 = add i64 %118, %111
  store i64 %119, ptr %117, align 8, !tbaa !14
  br label %208

120:                                              ; preds = %15, %15, %15
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %121)
  %123 = call noundef i64 @_Z17signExtend2sComplj(i32 noundef %122)
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %"class.randomx::Instruction", ptr %125, i32 0, i32 1
  %127 = load i8, ptr %126, align 1, !tbaa !16
  %128 = zext i8 %127 to i64
  %129 = getelementptr inbounds [8 x i64], ptr %124, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !14
  %131 = xor i64 %130, %123
  store i64 %131, ptr %129, align 8, !tbaa !14
  br label %208

132:                                              ; preds = %15
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %"class.randomx::Instruction", ptr %134, i32 0, i32 1
  %136 = load i8, ptr %135, align 1, !tbaa !16
  %137 = zext i8 %136 to i64
  %138 = getelementptr inbounds [8 x i64], ptr %133, i64 0, i64 %137
  %139 = load i64, ptr %138, align 8, !tbaa !14
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %"class.randomx::Instruction", ptr %141, i32 0, i32 2
  %143 = load i8, ptr %142, align 2, !tbaa !13
  %144 = zext i8 %143 to i64
  %145 = getelementptr inbounds [8 x i64], ptr %140, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !14
  %147 = call noundef i64 @_Z4mulhmm(i64 noundef %139, i64 noundef %146)
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = getelementptr inbounds %"class.randomx::Instruction", ptr %149, i32 0, i32 1
  %151 = load i8, ptr %150, align 1, !tbaa !16
  %152 = zext i8 %151 to i64
  %153 = getelementptr inbounds [8 x i64], ptr %148, i64 0, i64 %152
  store i64 %147, ptr %153, align 8, !tbaa !14
  br label %208

154:                                              ; preds = %15
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = getelementptr inbounds %"class.randomx::Instruction", ptr %156, i32 0, i32 1
  %158 = load i8, ptr %157, align 1, !tbaa !16
  %159 = zext i8 %158 to i64
  %160 = getelementptr inbounds [8 x i64], ptr %155, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !14
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  %164 = getelementptr inbounds %"class.randomx::Instruction", ptr %163, i32 0, i32 2
  %165 = load i8, ptr %164, align 2, !tbaa !13
  %166 = zext i8 %165 to i64
  %167 = getelementptr inbounds [8 x i64], ptr %162, i64 0, i64 %166
  %168 = load i64, ptr %167, align 8, !tbaa !14
  %169 = call noundef i64 @_Z5smulhll(i64 noundef %161, i64 noundef %168)
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds %"class.randomx::Instruction", ptr %171, i32 0, i32 1
  %173 = load i8, ptr %172, align 1, !tbaa !16
  %174 = zext i8 %173 to i64
  %175 = getelementptr inbounds [8 x i64], ptr %170, i64 0, i64 %174
  store i64 %169, ptr %175, align 8, !tbaa !14
  br label %208

176:                                              ; preds = %15
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = icmp ne ptr %177, null
  br i1 %178, label %179, label %194

179:                                              ; preds = %176
  %180 = load ptr, ptr %6, align 8, !tbaa !5
  %181 = load ptr, ptr %8, align 8, !tbaa !5
  %182 = call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %181)
  %183 = zext i32 %182 to i64
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %180, i64 noundef %183) #4
  %185 = load i64, ptr %184, align 8, !tbaa !14
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds %"class.randomx::Instruction", ptr %187, i32 0, i32 1
  %189 = load i8, ptr %188, align 1, !tbaa !16
  %190 = zext i8 %189 to i64
  %191 = getelementptr inbounds [8 x i64], ptr %186, i64 0, i64 %190
  %192 = load i64, ptr %191, align 8, !tbaa !14
  %193 = mul i64 %192, %185
  store i64 %193, ptr %191, align 8, !tbaa !14
  br label %206

194:                                              ; preds = %176
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %195)
  %197 = call i64 @randomx_reciprocal(i32 noundef %196)
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds %"class.randomx::Instruction", ptr %199, i32 0, i32 1
  %201 = load i8, ptr %200, align 1, !tbaa !16
  %202 = zext i8 %201 to i64
  %203 = getelementptr inbounds [8 x i64], ptr %198, i64 0, i64 %202
  %204 = load i64, ptr %203, align 8, !tbaa !14
  %205 = mul i64 %204, %197
  store i64 %205, ptr %203, align 8, !tbaa !14
  br label %206

206:                                              ; preds = %194, %179
  br label %208

207:                                              ; preds = %15
  unreachable

208:                                              ; preds = %206, %154, %132, %120, %108, %91, %75, %55, %39, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %7, align 4, !tbaa !9
  %211 = add i32 %210, 1
  store i32 %211, ptr %7, align 4, !tbaa !9
  br label %9, !llvm.loop !17

212:                                              ; preds = %14
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7randomx18SuperscalarProgram7getSizeEv(ptr noundef nonnull align 8 dereferenceable(4200)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7randomx11Instruction11getModShiftEv(ptr noundef nonnull align 4 dereferenceable(8)) #1 align 2

declare noundef i64 @_Z4rotrmj(i64 noundef, i32 noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z17signExtend2sComplj(i32 noundef) #1

declare noundef i64 @_Z4mulhmm(i64 noundef, i64 noundef) #3

declare noundef i64 @_Z5smulhll(i64 noundef, i64 noundef) #3

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

declare i64 @randomx_reciprocal(i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"_ZTSN7randomx11InstructionE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4}
!13 = !{!12, !7, i64 2}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !7, i64 1}
!17 = distinct !{!17, !18}
!18 = !{!"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"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN7randomx18SuperscalarProgramclEi(ptr noundef nonnull align 8 dereferenceable(4200), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7randomx18executeSuperscalarERA8_mRNS_18SuperscalarProgramEPSt6vectorImSaImEE(ptr nocapture noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(4200) %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = tail call noundef i32 @_ZN7randomx18SuperscalarProgram7getSizeEv(ptr noundef nonnull align 8 dereferenceable(4200) %1)
  %.not55 = icmp eq i32 %4, 0
  br i1 %.not55, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %.not = icmp eq ptr %2, null
  br label %5

._crit_edge:                                      ; preds = %139, %3
  ret void

5:                                                ; preds = %.lr.ph, %139
  %.054 = phi i32 [ 0, %.lr.ph ], [ %140, %139 ]
  %6 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7randomx18SuperscalarProgramclEi(ptr noundef nonnull align 8 dereferenceable(4200) %1, i32 noundef %.054)
  %7 = load i8, ptr %6, align 4, !tbaa !5
  switch i8 %7, label %138 [
    i8 0, label %8
    i8 1, label %20
    i8 2, label %32
    i8 3, label %47
    i8 4, label %59
    i8 5, label %70
    i8 7, label %70
    i8 9, label %70
    i8 6, label %79
    i8 8, label %79
    i8 10, label %79
    i8 11, label %88
    i8 12, label %103
    i8 13, label %118
  ]

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %6, i64 2
  %10 = load i8, ptr %9, align 2, !tbaa !10
  %11 = zext i8 %10 to i64
  %12 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %11
  %13 = load i64, ptr %12, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %6, i64 1
  %15 = load i8, ptr %14, align 1, !tbaa !13
  %16 = zext i8 %15 to i64
  %17 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %16
  %18 = load i64, ptr %17, align 8, !tbaa !11
  %19 = sub i64 %18, %13
  store i64 %19, ptr %17, align 8, !tbaa !11
  br label %139

20:                                               ; preds = %5
  %21 = getelementptr inbounds i8, ptr %6, i64 2
  %22 = load i8, ptr %21, align 2, !tbaa !10
  %23 = zext i8 %22 to i64
  %24 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds i8, ptr %6, i64 1
  %27 = load i8, ptr %26, align 1, !tbaa !13
  %28 = zext i8 %27 to i64
  %29 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = xor i64 %30, %25
  store i64 %31, ptr %29, align 8, !tbaa !11
  br label %139

32:                                               ; preds = %5
  %33 = getelementptr inbounds i8, ptr %6, i64 2
  %34 = load i8, ptr %33, align 2, !tbaa !10
  %35 = zext i8 %34 to i64
  %36 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = tail call noundef i32 @_ZNK7randomx11Instruction11getModShiftEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %39 = zext nneg i32 %38 to i64
  %40 = shl i64 %37, %39
  %41 = getelementptr inbounds i8, ptr %6, i64 1
  %42 = load i8, ptr %41, align 1, !tbaa !13
  %43 = zext i8 %42 to i64
  %44 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = add i64 %45, %40
  store i64 %46, ptr %44, align 8, !tbaa !11
  br label %139

47:                                               ; preds = %5
  %48 = getelementptr inbounds i8, ptr %6, i64 2
  %49 = load i8, ptr %48, align 2, !tbaa !10
  %50 = zext i8 %49 to i64
  %51 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds i8, ptr %6, i64 1
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = zext i8 %54 to i64
  %56 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = mul i64 %57, %52
  store i64 %58, ptr %56, align 8, !tbaa !11
  br label %139

59:                                               ; preds = %5
  %60 = getelementptr inbounds i8, ptr %6, i64 1
  %61 = load i8, ptr %60, align 1, !tbaa !13
  %62 = zext i8 %61 to i64
  %63 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !11
  %65 = tail call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %66 = tail call noundef i64 @_Z4rotrmj(i64 noundef %64, i32 noundef %65)
  %67 = load i8, ptr %60, align 1, !tbaa !13
  %68 = zext i8 %67 to i64
  %69 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %68
  store i64 %66, ptr %69, align 8, !tbaa !11
  br label %139

70:                                               ; preds = %5, %5, %5
  %71 = tail call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %72 = tail call noundef i64 @_Z17signExtend2sComplj(i32 noundef %71)
  %73 = getelementptr inbounds i8, ptr %6, i64 1
  %74 = load i8, ptr %73, align 1, !tbaa !13
  %75 = zext i8 %74 to i64
  %76 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = add i64 %77, %72
  store i64 %78, ptr %76, align 8, !tbaa !11
  br label %139

79:                                               ; preds = %5, %5, %5
  %80 = tail call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %81 = tail call noundef i64 @_Z17signExtend2sComplj(i32 noundef %80)
  %82 = getelementptr inbounds i8, ptr %6, i64 1
  %83 = load i8, ptr %82, align 1, !tbaa !13
  %84 = zext i8 %83 to i64
  %85 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !11
  %87 = xor i64 %86, %81
  store i64 %87, ptr %85, align 8, !tbaa !11
  br label %139

88:                                               ; preds = %5
  %89 = getelementptr inbounds i8, ptr %6, i64 1
  %90 = load i8, ptr %89, align 1, !tbaa !13
  %91 = zext i8 %90 to i64
  %92 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = getelementptr inbounds i8, ptr %6, i64 2
  %95 = load i8, ptr %94, align 2, !tbaa !10
  %96 = zext i8 %95 to i64
  %97 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !11
  %99 = tail call noundef i64 @_Z4mulhmm(i64 noundef %93, i64 noundef %98)
  %100 = load i8, ptr %89, align 1, !tbaa !13
  %101 = zext i8 %100 to i64
  %102 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %101
  store i64 %99, ptr %102, align 8, !tbaa !11
  br label %139

103:                                              ; preds = %5
  %104 = getelementptr inbounds i8, ptr %6, i64 1
  %105 = load i8, ptr %104, align 1, !tbaa !13
  %106 = zext i8 %105 to i64
  %107 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !11
  %109 = getelementptr inbounds i8, ptr %6, i64 2
  %110 = load i8, ptr %109, align 2, !tbaa !10
  %111 = zext i8 %110 to i64
  %112 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !11
  %114 = tail call noundef i64 @_Z5smulhll(i64 noundef %108, i64 noundef %113)
  %115 = load i8, ptr %104, align 1, !tbaa !13
  %116 = zext i8 %115 to i64
  %117 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %116
  store i64 %114, ptr %117, align 8, !tbaa !11
  br label %139

118:                                              ; preds = %5
  %119 = tail call noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8) %6)
  br i1 %.not, label %130, label %120

120:                                              ; preds = %118
  %121 = zext i32 %119 to i64
  %122 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %121) #3
  %123 = load i64, ptr %122, align 8, !tbaa !11
  %124 = getelementptr inbounds i8, ptr %6, i64 1
  %125 = load i8, ptr %124, align 1, !tbaa !13
  %126 = zext i8 %125 to i64
  %127 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !11
  %129 = mul i64 %128, %123
  store i64 %129, ptr %127, align 8, !tbaa !11
  br label %139

130:                                              ; preds = %118
  %131 = tail call i64 @randomx_reciprocal(i32 noundef %119)
  %132 = getelementptr inbounds i8, ptr %6, i64 1
  %133 = load i8, ptr %132, align 1, !tbaa !13
  %134 = zext i8 %133 to i64
  %135 = getelementptr inbounds [8 x i64], ptr %0, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !11
  %137 = mul i64 %136, %131
  store i64 %137, ptr %135, align 8, !tbaa !11
  br label %139

138:                                              ; preds = %5
  unreachable

139:                                              ; preds = %120, %130, %103, %88, %79, %70, %59, %47, %32, %20, %8
  %140 = add nuw i32 %.054, 1
  %141 = tail call noundef i32 @_ZN7randomx18SuperscalarProgram7getSizeEv(ptr noundef nonnull align 8 dereferenceable(4200) %1)
  %142 = icmp ult i32 %140, %141
  br i1 %142, label %5, label %._crit_edge, !llvm.loop !14
}

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

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

declare noundef i64 @_Z4rotrmj(i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7randomx11Instruction8getImm32Ev(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z17signExtend2sComplj(i32 noundef) local_unnamed_addr #0

declare noundef i64 @_Z4mulhmm(i64 noundef, i64 noundef) local_unnamed_addr #2

declare noundef i64 @_Z5smulhll(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

declare i64 @randomx_reciprocal(i32 noundef) local_unnamed_addr #2

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 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass