; LLVM IR from openssl/openssl :: crypto/slh_dsa (slh_wots)

; 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.wpacket_st = type { ptr, ptr, i64, i64, i64, ptr, i8 }
%struct.slh_dsa_hash_ctx_st = type { ptr, ptr, ptr, ptr, i32 }
%struct.slh_dsa_key_st = type { [128 x i8], ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.slh_dsa_params_st = type { ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
%struct.slh_adrs_func_st = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.slh_hash_func_st = type { ptr, ptr, ptr, ptr, ptr, ptr }

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

declare i32 @WPACKET_init_static_len(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @slh_wots_chain(ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @WPACKET_get_total_written(ptr noundef, ptr noundef) #1

declare i32 @WPACKET_finish(ptr noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @slh_bytes_to_nibbles(ptr noundef, i64 noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @compute_checksum_nibbles(ptr noundef, i64 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_slh_wots_pk_from_sig(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i64 noundef %6) #2 {
  %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 i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca [67 x i8], align 16
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca [2144 x i8], align 16
  %25 = alloca %struct.wpacket_st, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i64, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca [32 x i8], align 16
  %32 = 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 i64 %6, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.slh_dsa_hash_ctx_st, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  store ptr %35, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 67, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %36 = load ptr, ptr %17, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.slh_dsa_key_st, ptr %36, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = getelementptr inbounds %struct.slh_dsa_params_st, ptr %38, i32 0, i32 3
  %40 = load i32, ptr %39, align 8, !tbaa !17
  %41 = zext i32 %40 to i64
  store i64 %41, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %42 = load i64, ptr %20, align 8, !tbaa !9
  %43 = mul i64 2, %42
  store i64 %43, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %44 = load i64, ptr %21, align 8, !tbaa !9
  %45 = add i64 %44, 3
  store i64 %45, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 2144, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  store ptr %25, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  store i64 0, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %46 = load ptr, ptr %17, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.slh_dsa_key_st, ptr %46, i32 0, i32 7
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  store ptr %48, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %49 = load ptr, ptr %17, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.slh_dsa_key_st, ptr %49, i32 0, i32 6
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  store ptr %51, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %52 = load ptr, ptr %29, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.slh_adrs_func_st, ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  store ptr %54, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %31) #4
  %55 = load ptr, ptr %26, align 8, !tbaa !5
  %56 = getelementptr inbounds [2144 x i8], ptr %24, i64 0, i64 0
  %57 = call i32 @WPACKET_init_static_len(ptr noundef %55, ptr noundef %56, i64 noundef 2144, i64 noundef 0)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %7
  store i32 0, ptr %8, align 4
  store i32 1, ptr %32, align 4
  br label %142

60:                                               ; preds = %7
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = load i64, ptr %20, align 8, !tbaa !9
  %63 = getelementptr inbounds [67 x i8], ptr %18, i64 0, i64 0
  call void @slh_bytes_to_nibbles(ptr noundef %61, i64 noundef %62, ptr noundef %63)
  %64 = getelementptr inbounds [67 x i8], ptr %18, i64 0, i64 0
  %65 = load i64, ptr %21, align 8, !tbaa !9
  %66 = getelementptr inbounds [67 x i8], ptr %18, i64 0, i64 0
  %67 = load i64, ptr %21, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  call void @compute_checksum_nibbles(ptr noundef %64, i64 noundef %65, ptr noundef %68)
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %101, %60
  %70 = load i64, ptr %19, align 8, !tbaa !9
  %71 = load i64, ptr %22, align 8, !tbaa !9
  %72 = icmp ult i64 %70, %71
  br i1 %72, label %73, label %104

73:                                               ; preds = %69
  %74 = load ptr, ptr %30, align 8, !tbaa !5
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = load i64, ptr %19, align 8, !tbaa !9
  %77 = trunc i64 %76 to i32
  call void %74(ptr noundef %75, i32 noundef %77)
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = load i64, ptr %20, align 8, !tbaa !9
  %80 = call i32 @PACKET_get_bytes(ptr noundef %78, ptr noundef %23, i64 noundef %79)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %99

82:                                               ; preds = %73
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load ptr, ptr %23, align 8, !tbaa !5
  %85 = load i64, ptr %19, align 8, !tbaa !9
  %86 = getelementptr inbounds [67 x i8], ptr %18, i64 0, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !23
  %88 = load i64, ptr %19, align 8, !tbaa !9
  %89 = getelementptr inbounds [67 x i8], ptr %18, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !23
  %91 = zext i8 %90 to i32
  %92 = sub nsw i32 15, %91
  %93 = trunc i32 %92 to i8
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = load ptr, ptr %26, align 8, !tbaa !5
  %97 = call i32 @slh_wots_chain(ptr noundef %83, ptr noundef %84, i8 noundef zeroext %87, i8 noundef zeroext %93, ptr noundef %94, ptr noundef %95, ptr noundef %96)
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %82, %73
  br label %135

100:                                              ; preds = %82
  br label %101

101:                                              ; preds = %100
  %102 = load i64, ptr %19, align 8, !tbaa !9
  %103 = add i64 %102, 1
  store i64 %103, ptr %19, align 8, !tbaa !9
  br label %69, !llvm.loop !24

104:                                              ; preds = %69
  %105 = load ptr, ptr %29, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.slh_adrs_func_st, ptr %105, i32 0, i32 10
  %107 = load ptr, ptr %106, align 8, !tbaa !26
  %108 = getelementptr inbounds [32 x i8], ptr %31, i64 0, i64 0
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  call void %107(ptr noundef %108, ptr noundef %109)
  %110 = load ptr, ptr %29, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.slh_adrs_func_st, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !27
  %113 = getelementptr inbounds [32 x i8], ptr %31, i64 0, i64 0
  call void %112(ptr noundef %113, i32 noundef 1)
  %114 = load ptr, ptr %29, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.slh_adrs_func_st, ptr %114, i32 0, i32 4
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  %117 = getelementptr inbounds [32 x i8], ptr %31, i64 0, i64 0
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  call void %116(ptr noundef %117, ptr noundef %118)
  %119 = load ptr, ptr %26, align 8, !tbaa !5
  %120 = call i32 @WPACKET_get_total_written(ptr noundef %119, ptr noundef %27)
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %123, label %122

122:                                              ; preds = %104
  br label %135

123:                                              ; preds = %104
  %124 = load ptr, ptr %28, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.slh_hash_func_st, ptr %124, i32 0, i32 5
  %126 = load ptr, ptr %125, align 8, !tbaa !29
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = getelementptr inbounds [32 x i8], ptr %31, i64 0, i64 0
  %130 = getelementptr inbounds [2144 x i8], ptr %24, i64 0, i64 0
  %131 = load i64, ptr %27, align 8, !tbaa !9
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  %133 = load i64, ptr %15, align 8, !tbaa !9
  %134 = call i32 %126(ptr noundef %127, ptr noundef %128, ptr noundef %129, ptr noundef %130, i64 noundef %131, ptr noundef %132, i64 noundef %133)
  store i32 %134, ptr %16, align 4, !tbaa !11
  br label %135

135:                                              ; preds = %123, %122, %99
  %136 = load ptr, ptr %26, align 8, !tbaa !5
  %137 = call i32 @WPACKET_finish(ptr noundef %136)
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %140

140:                                              ; preds = %139, %135
  %141 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %141, ptr %8, align 4
  store i32 1, ptr %32, align 4
  br label %142

142:                                              ; preds = %140, %59
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 2144, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 67, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %143 = load i32, ptr %8, align 4
  ret i32 %143
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @PACKET_get_bytes(ptr noundef, ptr noundef, i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = { 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 #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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"slh_dsa_hash_ctx_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32}
!15 = !{!16, !6, i64 160}
!16 = !{!"slh_dsa_key_st", !7, i64 0, !6, i64 128, !6, i64 136, !6, i64 144, !12, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!17 = !{!18, !12, i64 16}
!18 = !{!"slh_dsa_params_st", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !10, i64 56}
!19 = !{!16, !6, i64 176}
!20 = !{!16, !6, i64 168}
!21 = !{!22, !6, i64 40}
!22 = !{!"slh_adrs_func_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!22, !6, i64 80}
!27 = !{!22, !6, i64 16}
!28 = !{!22, !6, i64 32}
!29 = !{!30, !6, i64 40}
!30 = !{!"slh_hash_func_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}


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

%struct.wpacket_st = type { ptr, ptr, i64, i64, i64, ptr, i8 }

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

declare i32 @WPACKET_init_static_len(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @slh_wots_chain(ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @WPACKET_get_total_written(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @WPACKET_finish(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @slh_bytes_to_nibbles(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @compute_checksum_nibbles(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_slh_wots_pk_from_sig(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i64 noundef %6) local_unnamed_addr #2 {
  %8 = alloca [67 x i8], align 16
  %9 = alloca ptr, align 8
  %10 = alloca [2144 x i8], align 16
  %11 = alloca %struct.wpacket_st, align 8
  %12 = alloca i64, align 8
  %13 = alloca [32 x i8], align 16
  %14 = load ptr, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 67, ptr nonnull %8) #4
  %15 = getelementptr inbounds i8, ptr %14, i64 160
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = load i32, ptr %17, align 8, !tbaa !13
  %19 = zext i32 %18 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 2144, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  store i64 0, ptr %12, align 8, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %14, i64 176
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %14, i64 168
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %23, i64 40
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #4
  %26 = call i32 @WPACKET_init_static_len(ptr noundef nonnull %11, ptr noundef nonnull %10, i64 noundef 2144, i64 noundef 0) #4
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %56, label %27

27:                                               ; preds = %7
  %28 = shl nuw nsw i64 %19, 1
  call void @slh_bytes_to_nibbles(ptr noundef %2, i64 noundef %19, ptr noundef nonnull %8)
  %29 = getelementptr inbounds i8, ptr %8, i64 %28
  call void @compute_checksum_nibbles(ptr noundef nonnull %8, i64 noundef %28, ptr noundef nonnull %29)
  %30 = add nuw nsw i64 %28, 2
  br label %33

31:                                               ; preds = %36
  %32 = add nuw nsw i64 %.04045, 1
  %exitcond.not = icmp eq i64 %.04045, %30
  br i1 %exitcond.not, label %42, label %33, !llvm.loop !21

33:                                               ; preds = %27, %31
  %.04045 = phi i64 [ 0, %27 ], [ %32, %31 ]
  %34 = trunc i64 %.04045 to i32
  call void %25(ptr noundef %4, i32 noundef %34) #4
  %35 = call i32 @PACKET_get_bytes(ptr noundef %1, ptr noundef nonnull %9, i64 noundef %19)
  %.not42 = icmp eq i32 %35, 0
  br i1 %.not42, label %.loopexit, label %36

36:                                               ; preds = %33
  %37 = load ptr, ptr %9, align 8, !tbaa !23
  %38 = getelementptr inbounds [67 x i8], ptr %8, i64 0, i64 %.04045
  %39 = load i8, ptr %38, align 1, !tbaa !24
  %40 = sub i8 15, %39
  %41 = call i32 @slh_wots_chain(ptr noundef nonnull %0, ptr noundef %37, i8 noundef zeroext %39, i8 noundef zeroext %40, ptr noundef %3, ptr noundef %4, ptr noundef nonnull %11)
  %.not43 = icmp eq i32 %41, 0
  br i1 %.not43, label %.loopexit, label %31

42:                                               ; preds = %31
  %43 = getelementptr inbounds i8, ptr %23, i64 80
  %44 = load ptr, ptr %43, align 8, !tbaa !25
  call void %44(ptr noundef nonnull %13, ptr noundef %4) #4
  %45 = getelementptr inbounds i8, ptr %23, i64 16
  %46 = load ptr, ptr %45, align 8, !tbaa !26
  call void %46(ptr noundef nonnull %13, i32 noundef 1) #4
  %47 = getelementptr inbounds i8, ptr %23, i64 32
  %48 = load ptr, ptr %47, align 8, !tbaa !27
  call void %48(ptr noundef nonnull %13, ptr noundef %4) #4
  %49 = call i32 @WPACKET_get_total_written(ptr noundef nonnull %11, ptr noundef nonnull %12) #4
  %.not41 = icmp eq i32 %49, 0
  br i1 %.not41, label %.loopexit, label %50

50:                                               ; preds = %42
  %51 = getelementptr inbounds i8, ptr %21, i64 40
  %52 = load ptr, ptr %51, align 8, !tbaa !28
  %53 = load i64, ptr %12, align 8, !tbaa !16
  %54 = call i32 %52(ptr noundef nonnull %0, ptr noundef %3, ptr noundef nonnull %13, ptr noundef nonnull %10, i64 noundef %53, ptr noundef %5, i64 noundef %6) #4
  br label %.loopexit

.loopexit:                                        ; preds = %33, %36, %42, %50
  %.039 = phi i32 [ %54, %50 ], [ 0, %42 ], [ 0, %36 ], [ 0, %33 ]
  %55 = call i32 @WPACKET_finish(ptr noundef nonnull %11) #4
  %.not44 = icmp eq i32 %55, 0
  %spec.select = select i1 %.not44, i32 0, i32 %.039
  br label %56

56:                                               ; preds = %7, %.loopexit
  %.0 = phi i32 [ %spec.select, %.loopexit ], [ 0, %7 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 2144, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 67, ptr nonnull %8) #4
  ret i32 %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @PACKET_get_bytes(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = { 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 #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, !7, i64 0}
!6 = !{!"slh_dsa_hash_ctx_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 160}
!12 = !{!"slh_dsa_key_st", !8, i64 0, !7, i64 128, !7, i64 136, !7, i64 144, !10, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200}
!13 = !{!14, !10, i64 16}
!14 = !{!"slh_dsa_params_st", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !15, i64 56}
!15 = !{!"long", !8, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!12, !7, i64 176}
!18 = !{!12, !7, i64 168}
!19 = !{!20, !7, i64 40}
!20 = !{!"slh_adrs_func_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!7, !7, i64 0}
!24 = !{!8, !8, i64 0}
!25 = !{!20, !7, i64 80}
!26 = !{!20, !7, i64 16}
!27 = !{!20, !7, i64 32}
!28 = !{!29, !7, i64 40}
!29 = !{!"slh_hash_func_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}


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