; LLVM IR from HarshCasper/NeoAlgo :: C/cryptography (Columnar_Cipher)

; 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"

@order.order_key = external hidden global [100 x i32], align 16
@order.temp = external hidden global [100 x i32], align 16
@order.index = external hidden global [100 x i32], align 16

; Function Attrs: nounwind uwtable
declare dso_local ptr @sort(ptr noundef, i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @order(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = call i64 @strlen(ptr noundef %10) #4
  %12 = trunc i64 %11 to i32
  store i32 %12, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %34, %1
  %14 = load i32, ptr %4, align 4, !tbaa !9
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %37

18:                                               ; preds = %13
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i8, ptr %19, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !11
  %24 = sext i8 %23 to i32
  %25 = sub nsw i32 %24, 0
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %27
  store i32 %25, ptr %28, align 4, !tbaa !9
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = sub nsw i32 %32, 65
  store i32 %33, ptr %31, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %18
  %35 = load i32, ptr %4, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %4, align 4, !tbaa !9
  br label %13, !llvm.loop !12

37:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %51, %37
  %39 = load i32, ptr %5, align 4, !tbaa !9
  %40 = load i32, ptr %3, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %54

43:                                               ; preds = %38
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100 x i32], ptr @order.temp, i64 0, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %43
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %5, align 4, !tbaa !9
  br label %38, !llvm.loop !14

54:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %55 = load i32, ptr %3, align 4, !tbaa !9
  %56 = call ptr @sort(ptr noundef @order.order_key, i32 noundef %55)
  store ptr %56, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %90, %54
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = load i32, ptr %3, align 4, !tbaa !9
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %93

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %86, %62
  %64 = load i32, ptr %9, align 4, !tbaa !9
  %65 = load i32, ptr %3, align 4, !tbaa !9
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %89

68:                                               ; preds = %63
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100 x i32], ptr @order.temp, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr %73, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = icmp eq i32 %72, %77
  br i1 %78, label %79, label %85

79:                                               ; preds = %68
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  %82 = load i32, ptr %7, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100 x i32], ptr @order.index, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %79, %68
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %9, align 4, !tbaa !9
  br label %63, !llvm.loop !15

89:                                               ; preds = %67
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %7, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %7, align 4, !tbaa !9
  br label %57, !llvm.loop !16

93:                                               ; preds = %61
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret ptr @order.index
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

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

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


; 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"

@order.order_key = external hidden global [100 x i32], align 16
@order.temp = external hidden local_unnamed_addr global [100 x i32], align 16
@order.index = external hidden global [100 x i32], align 16

; Function Attrs: nounwind uwtable
declare dso_local ptr @sort(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef nonnull ptr @order(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #3
  %3 = trunc i64 %2 to i32
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = and i64 %2, 2147483647
  %min.iters.check = icmp ult i64 %wide.trip.count, 8
  br i1 %min.iters.check, label %.lr.ph.preheader88, label %vector.memcheck

.lr.ph.preheader88:                               ; preds = %middle.block, %vector.memcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %5 = sub i64 %2, %indvars.iv.ph
  %xtraiter = and i64 %5, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader88, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader88 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader88 ]
  %6 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.prol
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %8 = sext i8 %7 to i32
  %9 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %indvars.iv.prol
  %10 = add nsw i32 %8, -65
  store i32 %10, ptr %9, align 4, !tbaa !8
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !10

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader88
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader88 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %11 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %12 = icmp ugt i64 %11, -4
  br i1 %12, label %.preheader28, label %.lr.ph

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %13 = shl nuw nsw i64 %wide.trip.count, 2
  %scevgep = getelementptr i8, ptr @order.order_key, i64 %13
  %scevgep52 = getelementptr i8, ptr %0, i64 %wide.trip.count
  %bound0 = icmp ugt ptr %scevgep52, @order.order_key
  %bound1 = icmp ugt ptr %scevgep, %0
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.preheader88, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.mod.vf = and i64 %2, 7
  %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %14 = getelementptr inbounds i8, ptr %0, i64 %index
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  %wide.load = load <4 x i8>, ptr %14, align 1, !tbaa !5, !alias.scope !12
  %wide.load53 = load <4 x i8>, ptr %15, align 1, !tbaa !5, !alias.scope !12
  %16 = sext <4 x i8> %wide.load to <4 x i32>
  %17 = sext <4 x i8> %wide.load53 to <4 x i32>
  %18 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %index
  %19 = add nsw <4 x i32> %16, <i32 -65, i32 -65, i32 -65, i32 -65>
  %20 = add nsw <4 x i32> %17, <i32 -65, i32 -65, i32 -65, i32 -65>
  %21 = getelementptr inbounds i8, ptr %18, i64 16
  store <4 x i32> %19, ptr %18, align 16, !tbaa !8, !alias.scope !15, !noalias !12
  store <4 x i32> %20, ptr %21, align 16, !tbaa !8, !alias.scope !15, !noalias !12
  %index.next = add nuw i64 %index, 8
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %.preheader28, label %.lr.ph.preheader88

.preheader28:                                     ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block
  br i1 %4, label %.preheader.us.preheader, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %23 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %25 = sext i8 %24 to i32
  %26 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %indvars.iv
  %27 = add nsw i32 %25, -65
  store i32 %27, ptr %26, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = sext i8 %29 to i32
  %31 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %indvars.iv.next
  %32 = add nsw i32 %30, -65
  store i32 %32, ptr %31, align 4, !tbaa !8
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %33 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next.1
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %35 = sext i8 %34 to i32
  %36 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %indvars.iv.next.1
  %37 = add nsw i32 %35, -65
  store i32 %37, ptr %36, align 4, !tbaa !8
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %38 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next.2
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = sext i8 %39 to i32
  %41 = getelementptr inbounds [100 x i32], ptr @order.order_key, i64 0, i64 %indvars.iv.next.2
  %42 = add nsw i32 %40, -65
  store i32 %42, ptr %41, align 4, !tbaa !8
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %.preheader28, label %.lr.ph, !llvm.loop !21

._crit_edge.thread:                               ; preds = %.preheader28, %1
  %43 = tail call ptr @sort(ptr noundef nonnull @order.order_key, i32 noundef %3)
  br label %._crit_edge36

.preheader.us.preheader:                          ; preds = %.preheader28
  %44 = shl i64 %2, 2
  %45 = and i64 %44, 8589934588
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @order.temp, ptr nonnull align 16 @order.order_key, i64 %45, i1 false), !tbaa !8
  %46 = tail call ptr @sort(ptr noundef nonnull @order.order_key, i32 noundef %3)
  %wide.trip.count49 = and i64 %2, 2147483647
  %47 = shl nuw nsw i64 %wide.trip.count, 2
  %scevgep55 = getelementptr i8, ptr @order.index, i64 %47
  %scevgep56 = getelementptr i8, ptr %46, i64 %47
  %min.iters.check62 = icmp ult i64 %wide.trip.count, 8
  %bound057 = icmp ugt ptr %scevgep56, @order.index
  %bound158 = icmp ult ptr %46, %scevgep55
  %found.conflict59 = and i1 %bound057, %bound158
  %n.mod.vf64 = and i64 %2, 7
  %n.vec65 = sub nsw i64 %wide.trip.count, %n.mod.vf64
  %cmp.n87 = icmp eq i64 %n.mod.vf64, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge34.us
  %indvars.iv46 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next47, %._crit_edge34.us ]
  %48 = getelementptr inbounds [100 x i32], ptr @order.temp, i64 0, i64 %indvars.iv46
  %49 = load i32, ptr %48, align 4, !tbaa !8
  %50 = getelementptr inbounds [100 x i32], ptr @order.index, i64 0, i64 %indvars.iv46
  %brmerge = select i1 %min.iters.check62, i1 true, i1 %found.conflict59
  br i1 %brmerge, label %scalar.ph61.preheader, label %vector.ph63

vector.ph63:                                      ; preds = %.preheader.us
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %49, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body67

vector.body67:                                    ; preds = %pred.store.continue85, %vector.ph63
  %index68 = phi i64 [ 0, %vector.ph63 ], [ %index.next86, %pred.store.continue85 ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph63 ], [ %vec.ind.next, %pred.store.continue85 ]
  %51 = getelementptr inbounds i32, ptr %46, i64 %index68
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %wide.load70 = load <4 x i32>, ptr %51, align 4, !tbaa !8, !alias.scope !22
  %wide.load71 = load <4 x i32>, ptr %52, align 4, !tbaa !8, !alias.scope !22
  %53 = icmp eq <4 x i32> %broadcast.splat, %wide.load70
  %54 = icmp eq <4 x i32> %broadcast.splat, %wide.load71
  %55 = add nuw nsw <4 x i64> %vec.ind, <i64 1, i64 1, i64 1, i64 1>
  %56 = add <4 x i64> %vec.ind, <i64 5, i64 5, i64 5, i64 5>
  %57 = extractelement <4 x i1> %53, i64 0
  br i1 %57, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body67
  %58 = bitcast <4 x i64> %55 to <8 x i32>
  %59 = extractelement <8 x i32> %58, i64 0
  store i32 %59, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body67
  %60 = extractelement <4 x i1> %53, i64 1
  br i1 %60, label %pred.store.if72, label %pred.store.continue73

pred.store.if72:                                  ; preds = %pred.store.continue
  %61 = bitcast <4 x i64> %55 to <8 x i32>
  %62 = extractelement <8 x i32> %61, i64 2
  store i32 %62, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue73

pred.store.continue73:                            ; preds = %pred.store.if72, %pred.store.continue
  %63 = extractelement <4 x i1> %53, i64 2
  br i1 %63, label %pred.store.if74, label %pred.store.continue75

pred.store.if74:                                  ; preds = %pred.store.continue73
  %64 = bitcast <4 x i64> %55 to <8 x i32>
  %65 = extractelement <8 x i32> %64, i64 4
  store i32 %65, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue75

pred.store.continue75:                            ; preds = %pred.store.if74, %pred.store.continue73
  %66 = extractelement <4 x i1> %53, i64 3
  br i1 %66, label %pred.store.if76, label %pred.store.continue77

pred.store.if76:                                  ; preds = %pred.store.continue75
  %67 = bitcast <4 x i64> %55 to <8 x i32>
  %68 = extractelement <8 x i32> %67, i64 6
  store i32 %68, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue77

pred.store.continue77:                            ; preds = %pred.store.if76, %pred.store.continue75
  %69 = extractelement <4 x i1> %54, i64 0
  br i1 %69, label %pred.store.if78, label %pred.store.continue79

pred.store.if78:                                  ; preds = %pred.store.continue77
  %70 = bitcast <4 x i64> %56 to <8 x i32>
  %71 = extractelement <8 x i32> %70, i64 0
  store i32 %71, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue79

pred.store.continue79:                            ; preds = %pred.store.if78, %pred.store.continue77
  %72 = extractelement <4 x i1> %54, i64 1
  br i1 %72, label %pred.store.if80, label %pred.store.continue81

pred.store.if80:                                  ; preds = %pred.store.continue79
  %73 = bitcast <4 x i64> %56 to <8 x i32>
  %74 = extractelement <8 x i32> %73, i64 2
  store i32 %74, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue81

pred.store.continue81:                            ; preds = %pred.store.if80, %pred.store.continue79
  %75 = extractelement <4 x i1> %54, i64 2
  br i1 %75, label %pred.store.if82, label %pred.store.continue83

pred.store.if82:                                  ; preds = %pred.store.continue81
  %76 = bitcast <4 x i64> %56 to <8 x i32>
  %77 = extractelement <8 x i32> %76, i64 4
  store i32 %77, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue83

pred.store.continue83:                            ; preds = %pred.store.if82, %pred.store.continue81
  %78 = extractelement <4 x i1> %54, i64 3
  br i1 %78, label %pred.store.if84, label %pred.store.continue85

pred.store.if84:                                  ; preds = %pred.store.continue83
  %79 = bitcast <4 x i64> %56 to <8 x i32>
  %80 = extractelement <8 x i32> %79, i64 6
  store i32 %80, ptr %50, align 4, !tbaa !8, !alias.scope !25, !noalias !22
  br label %pred.store.continue85

pred.store.continue85:                            ; preds = %pred.store.if84, %pred.store.continue83
  %index.next86 = add nuw i64 %index68, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %81 = icmp eq i64 %index.next86, %n.vec65
  br i1 %81, label %middle.block60, label %vector.body67, !llvm.loop !27

middle.block60:                                   ; preds = %pred.store.continue85
  br i1 %cmp.n87, label %._crit_edge34.us, label %scalar.ph61.preheader

scalar.ph61.preheader:                            ; preds = %.preheader.us, %middle.block60
  %indvars.iv41.ph = phi i64 [ 0, %.preheader.us ], [ %n.vec65, %middle.block60 ]
  %82 = sub i64 %2, %indvars.iv41.ph
  %.neg = add nsw i64 %indvars.iv41.ph, 1
  %xtraiter89 = and i64 %82, 1
  %lcmp.mod90.not = icmp eq i64 %xtraiter89, 0
  br i1 %lcmp.mod90.not, label %scalar.ph61.prol.loopexit, label %scalar.ph61.prol

scalar.ph61.prol:                                 ; preds = %scalar.ph61.preheader
  %83 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv41.ph
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = icmp eq i32 %49, %84
  %86 = add nuw nsw i64 %indvars.iv41.ph, 1
  br i1 %85, label %87, label %scalar.ph61.prol.loopexit

87:                                               ; preds = %scalar.ph61.prol
  %88 = trunc nuw nsw i64 %86 to i32
  store i32 %88, ptr %50, align 4, !tbaa !8
  br label %scalar.ph61.prol.loopexit

scalar.ph61.prol.loopexit:                        ; preds = %scalar.ph61.prol, %87, %scalar.ph61.preheader
  %indvars.iv41.unr = phi i64 [ %indvars.iv41.ph, %scalar.ph61.preheader ], [ %86, %87 ], [ %86, %scalar.ph61.prol ]
  %89 = icmp eq i64 %wide.trip.count, %.neg
  br i1 %89, label %._crit_edge34.us, label %scalar.ph61

scalar.ph61:                                      ; preds = %scalar.ph61.prol.loopexit, %._crit_edge51.1
  %indvars.iv41 = phi i64 [ %99, %._crit_edge51.1 ], [ %indvars.iv41.unr, %scalar.ph61.prol.loopexit ]
  %90 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv41
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %92 = icmp eq i32 %49, %91
  %93 = add nuw nsw i64 %indvars.iv41, 1
  br i1 %92, label %94, label %._crit_edge51

94:                                               ; preds = %scalar.ph61
  %95 = trunc nuw nsw i64 %93 to i32
  store i32 %95, ptr %50, align 4, !tbaa !8
  br label %._crit_edge51

._crit_edge51:                                    ; preds = %scalar.ph61, %94
  %96 = getelementptr inbounds i32, ptr %46, i64 %93
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %98 = icmp eq i32 %49, %97
  %99 = add nuw nsw i64 %indvars.iv41, 2
  br i1 %98, label %100, label %._crit_edge51.1

100:                                              ; preds = %._crit_edge51
  %101 = trunc nuw nsw i64 %99 to i32
  store i32 %101, ptr %50, align 4, !tbaa !8
  br label %._crit_edge51.1

._crit_edge51.1:                                  ; preds = %100, %._crit_edge51
  %exitcond45.not.1 = icmp eq i64 %99, %wide.trip.count49
  br i1 %exitcond45.not.1, label %._crit_edge34.us, label %scalar.ph61, !llvm.loop !28

._crit_edge34.us:                                 ; preds = %scalar.ph61.prol.loopexit, %._crit_edge51.1, %middle.block60
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count49
  br i1 %exitcond50.not, label %._crit_edge36, label %.preheader.us, !llvm.loop !29

._crit_edge36:                                    ; preds = %._crit_edge34.us, %._crit_edge.thread
  ret ptr @order.index
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

; 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) #2

attributes #0 = { 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 nofree nounwind willreturn memory(argmem: read) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind willreturn memory(read) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = !{!13}
!13 = distinct !{!13, !14}
!14 = distinct !{!14, !"LVerDomain"}
!15 = !{!16}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !18, !19}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !18, !19, !20}
!28 = distinct !{!28, !18, !19}
!29 = distinct !{!29, !18}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass