; LLVM IR from intel/cryptography-primitives :: sources/ippcp/xmss (wots_internal)

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

%struct.cpWOTSParams = type { i32, i32, i32, i32, i32, ptr }

; Function Attrs: nounwind uwtable
declare dso_local void @cp_xmss_base_w(ptr noundef, i32 noundef, ptr noundef, ptr 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: inlinehint nounwind uwtable
declare hidden void @cp_to_byte(ptr noundef, i32 noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @cp_xmss_WOTS_pkFromSig(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %24 = load ptr, ptr %15, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.cpWOTSParams, ptr %24, i32 0, i32 3
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = load ptr, ptr %15, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.cpWOTSParams, ptr %27, i32 0, i32 2
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = sub nsw i32 %26, %29
  store i32 %30, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %31 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %31, ptr %18, align 8, !tbaa !5
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load ptr, ptr %15, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.cpWOTSParams, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !13
  %36 = load ptr, ptr %18, align 8, !tbaa !5
  %37 = load ptr, ptr %15, align 8, !tbaa !5
  call void @cp_xmss_base_w(ptr noundef %32, i32 noundef %35, ptr noundef %36, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store i32 0, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %59, %7
  %39 = load i32, ptr %20, align 4, !tbaa !9
  %40 = load ptr, ptr %15, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.cpWOTSParams, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !13
  %43 = icmp slt i32 %39, %42
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %38
  %46 = load i32, ptr %19, align 4, !tbaa !9
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.cpWOTSParams, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !14
  %50 = add i32 %46, %49
  %51 = sub i32 %50, 1
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  %53 = load i32, ptr %20, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !15
  %57 = zext i8 %56 to i32
  %58 = sub i32 %51, %57
  store i32 %58, ptr %19, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %45
  %60 = load i32, ptr %20, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %20, align 4, !tbaa !9
  br label %38, !llvm.loop !16

62:                                               ; preds = %44
  %63 = load i32, ptr %19, align 4, !tbaa !9
  %64 = load i32, ptr %17, align 4, !tbaa !9
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.cpWOTSParams, ptr %65, i32 0, i32 4
  %67 = load i32, ptr %66, align 8, !tbaa !18
  %68 = mul nsw i32 %64, %67
  %69 = and i32 %68, 7
  %70 = sub nsw i32 8, %69
  %71 = shl i32 %63, %70
  store i32 %71, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %72 = load i32, ptr %17, align 4, !tbaa !9
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.cpWOTSParams, ptr %73, i32 0, i32 4
  %75 = load i32, ptr %74, align 8, !tbaa !18
  %76 = mul nsw i32 %72, %75
  %77 = sitofp i32 %76 to double
  %78 = fdiv double %77, 8.000000e+00
  %79 = call i32 @cp_xmss_ceil(double noundef %78)
  store i32 %79, ptr %21, align 4, !tbaa !9
  %80 = load ptr, ptr %18, align 8, !tbaa !5
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.cpWOTSParams, ptr %81, i32 0, i32 3
  %83 = load i32, ptr %82, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr %80, i64 %84
  %86 = load i32, ptr %21, align 4, !tbaa !9
  %87 = load i32, ptr %19, align 4, !tbaa !9
  call void @cp_to_byte(ptr noundef %85, i32 noundef %86, i32 noundef %87)
  %88 = load ptr, ptr %18, align 8, !tbaa !5
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.cpWOTSParams, ptr %89, i32 0, i32 3
  %91 = load i32, ptr %90, align 4, !tbaa !11
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i8, ptr %88, i64 %92
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = load ptr, ptr %18, align 8, !tbaa !5
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.cpWOTSParams, ptr %96, i32 0, i32 2
  %98 = load i32, ptr %97, align 8, !tbaa !13
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i8, ptr %95, i64 %99
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  call void @cp_xmss_base_w(ptr noundef %93, i32 noundef %94, ptr noundef %100, ptr noundef %101)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %163, %62
  %103 = load i32, ptr %22, align 4, !tbaa !9
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.cpWOTSParams, ptr %104, i32 0, i32 3
  %106 = load i32, ptr %105, align 4, !tbaa !11
  %107 = icmp slt i32 %103, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %102
  store i32 5, ptr %23, align 4
  br label %166

109:                                              ; preds = %102
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = load i32, ptr %22, align 4, !tbaa !9
  %112 = trunc i32 %111 to i8
  call void @cp_xmss_set_chain_address(ptr noundef %110, i8 noundef zeroext %112)
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load i32, ptr %22, align 4, !tbaa !9
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.cpWOTSParams, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 8, !tbaa !19
  %118 = mul nsw i32 %114, %117
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i8, ptr %113, i64 %119
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  %122 = load i32, ptr %22, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %121, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !15
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.cpWOTSParams, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !14
  %129 = sub i32 %128, 1
  %130 = load ptr, ptr %18, align 8, !tbaa !5
  %131 = load i32, ptr %22, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i8, ptr %130, i64 %132
  %134 = load i8, ptr %133, align 1, !tbaa !15
  %135 = zext i8 %134 to i32
  %136 = sub i32 %129, %135
  %137 = trunc i32 %136 to i8
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = load i32, ptr %22, align 4, !tbaa !9
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.cpWOTSParams, ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 8, !tbaa !19
  %145 = mul nsw i32 %141, %144
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i8, ptr %140, i64 %146
  %148 = load ptr, ptr %14, align 8, !tbaa !5
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.cpWOTSParams, ptr %149, i32 0, i32 3
  %151 = load i32, ptr %150, align 4, !tbaa !11
  %152 = load i32, ptr %17, align 4, !tbaa !9
  %153 = add nsw i32 %151, %152
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds i8, ptr %148, i64 %154
  %156 = load ptr, ptr %15, align 8, !tbaa !5
  %157 = call i32 @cp_xmss_chain(ptr noundef %120, i8 noundef zeroext %125, i8 noundef zeroext %137, ptr noundef %138, ptr noundef %139, ptr noundef %147, ptr noundef %155, ptr noundef %156)
  store i32 %157, ptr %16, align 4, !tbaa !9
  %158 = load i32, ptr %16, align 4, !tbaa !9
  %159 = icmp ne i32 0, %158
  br i1 %159, label %160, label %162

160:                                              ; preds = %109
  %161 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %161, ptr %8, align 4
  store i32 1, ptr %23, align 4
  br label %166

162:                                              ; preds = %109
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %22, align 4, !tbaa !9
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %22, align 4, !tbaa !9
  br label %102, !llvm.loop !20

166:                                              ; preds = %160, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  %167 = load i32, ptr %23, align 4
  switch i32 %167, label %171 [
    i32 5, label %168
  ]

168:                                              ; preds = %166
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  call void @cp_xmss_set_chain_address(ptr noundef %169, i8 noundef zeroext 0)
  %170 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %170, ptr %8, align 4
  store i32 1, ptr %23, align 4
  br label %171

171:                                              ; preds = %168, %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %172 = load i32, ptr %8, align 4
  ret i32 %172
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cp_xmss_ceil(double noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cp_xmss_set_chain_address(ptr noundef, i8 noundef zeroext) #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 = { inlinehint 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 4}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!12, !10, i64 16}
!19 = !{!12, !10, i64 0}
!20 = distinct !{!20, !17}


; 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: nounwind uwtable
declare dso_local void @cp_xmss_base_w(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cp_to_byte(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @cp_xmss_WOTS_pkFromSig(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #0 {
  %8 = getelementptr inbounds i8, ptr %6, i64 12
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %6, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = sub nsw i32 %9, %11
  tail call void @cp_xmss_base_w(ptr noundef %0, i32 noundef %11, ptr noundef %5, ptr noundef %6)
  %13 = load i32, ptr %10, align 8, !tbaa !11
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %15 = getelementptr inbounds i8, ptr %6, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !12
  %wide.trip.count = zext nneg i32 %13 to i64
  %min.iters.check = icmp ult i32 %13, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %.05967.ph = phi i32 [ 0, %.lr.ph ], [ %28, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %16, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
  %vec.phi84 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
  %17 = add <4 x i32> %broadcast.splat, %vec.phi
  %18 = add <4 x i32> %broadcast.splat, %vec.phi84
  %19 = getelementptr inbounds i8, ptr %5, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 4
  %wide.load = load <4 x i8>, ptr %19, align 1, !tbaa !13
  %wide.load85 = load <4 x i8>, ptr %20, align 1, !tbaa !13
  %21 = zext <4 x i8> %wide.load to <4 x i32>
  %22 = zext <4 x i8> %wide.load85 to <4 x i32>
  %23 = xor <4 x i32> %21, <i32 -1, i32 -1, i32 -1, i32 -1>
  %24 = xor <4 x i32> %22, <i32 -1, i32 -1, i32 -1, i32 -1>
  %25 = add <4 x i32> %17, %23
  %26 = add <4 x i32> %18, %24
  %index.next = add nuw i64 %index, 8
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %26, %25
  %28 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %7
  %.059.lcssa = phi i32 [ 0, %7 ], [ %28, %middle.block ], [ %54, %scalar.ph ]
  %29 = getelementptr inbounds i8, ptr %6, i64 16
  %30 = load i32, ptr %29, align 8, !tbaa !18
  %31 = mul nsw i32 %30, %12
  %32 = and i32 %31, 7
  %33 = sub nuw nsw i32 8, %32
  %34 = shl i32 %.059.lcssa, %33
  %35 = sitofp i32 %31 to double
  %36 = fmul double %35, 1.250000e-01
  %37 = tail call i32 @cp_xmss_ceil(double noundef %36)
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i8, ptr %5, i64 %39
  tail call void @cp_to_byte(ptr noundef %40, i32 noundef %37, i32 noundef %34)
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %5, i64 %42
  %44 = load i32, ptr %10, align 8, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %5, i64 %45
  tail call void @cp_xmss_base_w(ptr noundef %43, i32 noundef %12, ptr noundef %46, ptr noundef nonnull %6)
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %.not6469 = icmp sgt i32 %47, 0
  br i1 %.not6469, label %.lr.ph72, label %._crit_edge73

.lr.ph72:                                         ; preds = %._crit_edge
  %48 = getelementptr inbounds i8, ptr %6, i64 4
  br label %58

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.05967 = phi i32 [ %54, %scalar.ph ], [ %.05967.ph, %scalar.ph.preheader ]
  %49 = add i32 %16, %.05967
  %50 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv
  %51 = load i8, ptr %50, align 1, !tbaa !13
  %52 = zext i8 %51 to i32
  %53 = xor i32 %52, -1
  %54 = add i32 %49, %53
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !19

55:                                               ; preds = %58
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %.not64 = icmp slt i64 %indvars.iv.next78, %57
  br i1 %.not64, label %58, label %._crit_edge73, !llvm.loop !20

58:                                               ; preds = %.lr.ph72, %55
  %indvars.iv77 = phi i64 [ 0, %.lr.ph72 ], [ %indvars.iv.next78, %55 ]
  %59 = trunc nuw nsw i64 %indvars.iv77 to i32
  %60 = trunc i64 %indvars.iv77 to i8
  tail call void @cp_xmss_set_chain_address(ptr noundef %3, i8 noundef zeroext %60)
  %61 = load i32, ptr %6, align 8, !tbaa !21
  %62 = mul nsw i32 %61, %59
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %1, i64 %63
  %65 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv77
  %66 = load i8, ptr %65, align 1, !tbaa !13
  %67 = load i32, ptr %48, align 4, !tbaa !12
  %68 = zext i8 %66 to i32
  %69 = xor i32 %68, -1
  %70 = add i32 %67, %69
  %71 = trunc i32 %70 to i8
  %72 = getelementptr inbounds i8, ptr %4, i64 %63
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = add nsw i32 %73, %12
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %5, i64 %75
  %77 = tail call i32 @cp_xmss_chain(ptr noundef %64, i8 noundef zeroext %66, i8 noundef zeroext %71, ptr noundef %2, ptr noundef %3, ptr noundef %72, ptr noundef %76, ptr noundef nonnull %6)
  %.not = icmp eq i32 %77, 0
  br i1 %.not, label %55, label %.thread

._crit_edge73:                                    ; preds = %55, %._crit_edge
  tail call void @cp_xmss_set_chain_address(ptr noundef %3, i8 noundef zeroext 0)
  br label %.thread

.thread:                                          ; preds = %58, %._crit_edge73
  %.1 = phi i32 [ 0, %._crit_edge73 ], [ %77, %58 ]
  ret i32 %.1
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cp_xmss_ceil(double noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cp_xmss_set_chain_address(ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 = { inlinehint 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass