; LLVM IR from guanzhi/GmSSL :: src (sm3_lms)

; 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.SM3_LMS_SIGNATURE = type { [4 x i8], [4 x i8], %struct.anon, [25 x [32 x i8]] }
%struct.anon = type { [4 x i8], [34 x [32 x i8]], [32 x i8] }

@stderr = external global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [1 x i8], align 1
@__FUNCTION__.sm3_lms_signature_print = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

declare i32 @format_print(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ...) #3

declare i32 @format_bytes(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @sm3_lms_signature_print(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %16 = load ptr, ptr %11, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %16, i32 0, i32 0
  %18 = getelementptr inbounds [4 x i8], ptr %17, i64 0, i64 0
  %19 = load i8, ptr %18, align 1, !tbaa !11
  %20 = zext i8 %19 to i32
  %21 = shl i32 %20, 24
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds [4 x i8], ptr %23, i64 0, i64 1
  %25 = load i8, ptr %24, align 1, !tbaa !11
  %26 = zext i8 %25 to i32
  %27 = shl i32 %26, 16
  %28 = or i32 %21, %27
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds [4 x i8], ptr %30, i64 0, i64 2
  %32 = load i8, ptr %31, align 1, !tbaa !11
  %33 = zext i8 %32 to i32
  %34 = shl i32 %33, 8
  %35 = or i32 %28, %34
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds [4 x i8], ptr %37, i64 0, i64 3
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = zext i8 %39 to i32
  %41 = or i32 %35, %40
  store i32 %41, ptr %12, align 4, !tbaa !9
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = call i32 @sm3_lms_type_to_height(i32 noundef %42, ptr noundef %13)
  %44 = icmp ne i32 %43, 1
  br i1 %44, label %45, label %51

45:                                               ; preds = %5
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.14, ptr noundef @.str.15, i32 noundef 631, ptr noundef @__FUNCTION__.sm3_lms_signature_print) #4
  br label %49

49:                                               ; preds = %46
  br label %50

50:                                               ; preds = %49
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %215

51:                                               ; preds = %5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %52, i32 noundef %53, i32 noundef %54, ptr noundef @.str.16, ptr noundef %55)
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = add nsw i32 %57, 4
  store i32 %58, ptr %9, align 4, !tbaa !9
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds [4 x i8], ptr %63, i64 0, i64 0
  %65 = load i8, ptr %64, align 1, !tbaa !11
  %66 = zext i8 %65 to i32
  %67 = shl i32 %66, 24
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds [4 x i8], ptr %69, i64 0, i64 1
  %71 = load i8, ptr %70, align 1, !tbaa !11
  %72 = zext i8 %71 to i32
  %73 = shl i32 %72, 16
  %74 = or i32 %67, %73
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds [4 x i8], ptr %76, i64 0, i64 2
  %78 = load i8, ptr %77, align 1, !tbaa !11
  %79 = zext i8 %78 to i32
  %80 = shl i32 %79, 8
  %81 = or i32 %74, %80
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds [4 x i8], ptr %83, i64 0, i64 3
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = zext i8 %85 to i32
  %87 = or i32 %81, %86
  %88 = call ptr @sm3_lms_type_name(i32 noundef %87)
  %89 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %59, i32 noundef %60, i32 noundef %61, ptr noundef @.str.17, ptr noundef %88)
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %93, i32 0, i32 1
  %95 = getelementptr inbounds [4 x i8], ptr %94, i64 0, i64 0
  %96 = load i8, ptr %95, align 1, !tbaa !11
  %97 = zext i8 %96 to i32
  %98 = shl i32 %97, 24
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %99, i32 0, i32 1
  %101 = getelementptr inbounds [4 x i8], ptr %100, i64 0, i64 1
  %102 = load i8, ptr %101, align 1, !tbaa !11
  %103 = zext i8 %102 to i32
  %104 = shl i32 %103, 16
  %105 = or i32 %98, %104
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds [4 x i8], ptr %107, i64 0, i64 2
  %109 = load i8, ptr %108, align 1, !tbaa !11
  %110 = zext i8 %109 to i32
  %111 = shl i32 %110, 8
  %112 = or i32 %105, %111
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %113, i32 0, i32 1
  %115 = getelementptr inbounds [4 x i8], ptr %114, i64 0, i64 3
  %116 = load i8, ptr %115, align 1, !tbaa !11
  %117 = zext i8 %116 to i32
  %118 = or i32 %112, %117
  %119 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %90, i32 noundef %91, i32 noundef %92, ptr noundef @.str.27, i32 noundef %118)
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = load i32, ptr %8, align 4, !tbaa !9
  %122 = load i32, ptr %9, align 4, !tbaa !9
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %123, i32 0, i32 2
  %125 = getelementptr inbounds %struct.anon, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds [4 x i8], ptr %125, i64 0, i64 0
  %127 = load i8, ptr %126, align 1, !tbaa !11
  %128 = zext i8 %127 to i32
  %129 = shl i32 %128, 24
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %130, i32 0, i32 2
  %132 = getelementptr inbounds %struct.anon, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds [4 x i8], ptr %132, i64 0, i64 1
  %134 = load i8, ptr %133, align 1, !tbaa !11
  %135 = zext i8 %134 to i32
  %136 = shl i32 %135, 16
  %137 = or i32 %129, %136
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds %struct.anon, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds [4 x i8], ptr %140, i64 0, i64 2
  %142 = load i8, ptr %141, align 1, !tbaa !11
  %143 = zext i8 %142 to i32
  %144 = shl i32 %143, 8
  %145 = or i32 %137, %144
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %146, i32 0, i32 2
  %148 = getelementptr inbounds %struct.anon, ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds [4 x i8], ptr %148, i64 0, i64 3
  %150 = load i8, ptr %149, align 1, !tbaa !11
  %151 = zext i8 %150 to i32
  %152 = or i32 %145, %151
  %153 = call ptr @sm3_lmots_type_name(i32 noundef %152)
  %154 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %120, i32 noundef %121, i32 noundef %122, ptr noundef @.str.18, ptr noundef %153)
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = load i32, ptr %8, align 4, !tbaa !9
  %157 = load i32, ptr %9, align 4, !tbaa !9
  %158 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %155, i32 noundef %156, i32 noundef %157, ptr noundef @.str.28)
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %179, %51
  %160 = load i32, ptr %14, align 4, !tbaa !9
  %161 = icmp slt i32 %160, 34
  br i1 %161, label %162, label %182

162:                                              ; preds = %159
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = load i32, ptr %8, align 4, !tbaa !9
  %165 = load i32, ptr %9, align 4, !tbaa !9
  %166 = add nsw i32 %165, 4
  %167 = load i32, ptr %14, align 4, !tbaa !9
  %168 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %163, i32 noundef %164, i32 noundef %166, ptr noundef @.str.25, i32 noundef %167)
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = load i32, ptr %8, align 4, !tbaa !9
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %171, i32 0, i32 2
  %173 = getelementptr inbounds %struct.anon, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %14, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [34 x [32 x i8]], ptr %173, i64 0, i64 %175
  %177 = getelementptr inbounds [32 x i8], ptr %176, i64 0, i64 0
  %178 = call i32 @format_bytes(ptr noundef %169, i32 noundef %170, i32 noundef 0, ptr noundef @.str.26, ptr noundef %177, i64 noundef 32)
  br label %179

179:                                              ; preds = %162
  %180 = load i32, ptr %14, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %14, align 4, !tbaa !9
  br label %159, !llvm.loop !12

182:                                              ; preds = %159
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = load i32, ptr %8, align 4, !tbaa !9
  %185 = load i32, ptr %9, align 4, !tbaa !9
  %186 = load ptr, ptr %11, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %186, i32 0, i32 2
  %188 = getelementptr inbounds %struct.anon, ptr %187, i32 0, i32 2
  %189 = getelementptr inbounds [32 x i8], ptr %188, i64 0, i64 0
  %190 = call i32 @format_bytes(ptr noundef %183, i32 noundef %184, i32 noundef %185, ptr noundef @.str.29, ptr noundef %189, i64 noundef 32)
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = load i32, ptr %8, align 4, !tbaa !9
  %193 = load i32, ptr %9, align 4, !tbaa !9
  %194 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %191, i32 noundef %192, i32 noundef %193, ptr noundef @.str.30)
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %195

195:                                              ; preds = %211, %182
  %196 = load i32, ptr %14, align 4, !tbaa !9
  %197 = load i32, ptr %13, align 4, !tbaa !9
  %198 = icmp slt i32 %196, %197
  br i1 %198, label %199, label %214

199:                                              ; preds = %195
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = load i32, ptr %8, align 4, !tbaa !9
  %202 = load i32, ptr %9, align 4, !tbaa !9
  %203 = add nsw i32 %202, 4
  %204 = load ptr, ptr %11, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.SM3_LMS_SIGNATURE, ptr %204, i32 0, i32 3
  %206 = load i32, ptr %14, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [25 x [32 x i8]], ptr %205, i64 0, i64 %207
  %209 = getelementptr inbounds [32 x i8], ptr %208, i64 0, i64 0
  %210 = call i32 @format_bytes(ptr noundef %200, i32 noundef %201, i32 noundef %203, ptr noundef @.str.26, ptr noundef %209, i64 noundef 32)
  br label %211

211:                                              ; preds = %199
  %212 = load i32, ptr %14, align 4, !tbaa !9
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %14, align 4, !tbaa !9
  br label %195, !llvm.loop !14

214:                                              ; preds = %195
  store i32 1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %215

215:                                              ; preds = %214, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %216 = load i32, ptr %6, align 4
  ret i32 %216
}

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


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [1 x i8], align 1
@__FUNCTION__.sm3_lms_signature_print = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

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

declare i32 @format_print(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #3

declare i32 @format_bytes(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @sm3_lms_signature_print(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %7 = load i8, ptr %4, align 1, !tbaa !5
  %8 = zext i8 %7 to i32
  %9 = shl nuw i32 %8, 24
  %10 = getelementptr inbounds i8, ptr %4, i64 1
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = zext i8 %11 to i32
  %13 = shl nuw nsw i32 %12, 16
  %14 = or disjoint i32 %13, %9
  %15 = getelementptr inbounds i8, ptr %4, i64 2
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = zext i8 %16 to i32
  %18 = shl nuw nsw i32 %17, 8
  %19 = or disjoint i32 %14, %18
  %20 = getelementptr inbounds i8, ptr %4, i64 3
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = zext i8 %21 to i32
  %23 = or disjoint i32 %19, %22
  %24 = call i32 @sm3_lms_type_to_height(i32 noundef %23, ptr noundef nonnull %6)
  %.not = icmp eq i32 %24, 1
  br i1 %.not, label %28, label %25

25:                                               ; preds = %5
  %26 = load ptr, ptr @stderr, align 8, !tbaa !8
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.15, i32 noundef 631, ptr noundef nonnull @__FUNCTION__.sm3_lms_signature_print) #5
  br label %.loopexit

28:                                               ; preds = %5
  %29 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull @.str.16, ptr noundef %3) #4
  %30 = add nsw i32 %2, 4
  %31 = load i8, ptr %4, align 1, !tbaa !5
  %32 = zext i8 %31 to i32
  %33 = shl nuw i32 %32, 24
  %34 = load i8, ptr %10, align 1, !tbaa !5
  %35 = zext i8 %34 to i32
  %36 = shl nuw nsw i32 %35, 16
  %37 = or disjoint i32 %36, %33
  %38 = load i8, ptr %15, align 1, !tbaa !5
  %39 = zext i8 %38 to i32
  %40 = shl nuw nsw i32 %39, 8
  %41 = or disjoint i32 %37, %40
  %42 = load i8, ptr %20, align 1, !tbaa !5
  %43 = zext i8 %42 to i32
  %44 = or disjoint i32 %41, %43
  %45 = call ptr @sm3_lms_type_name(i32 noundef %44)
  %46 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %1, i32 noundef %30, ptr noundef nonnull @.str.17, ptr noundef %45) #4
  %47 = getelementptr inbounds i8, ptr %4, i64 4
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %49 = zext i8 %48 to i32
  %50 = shl nuw i32 %49, 24
  %51 = getelementptr inbounds i8, ptr %4, i64 5
  %52 = load i8, ptr %51, align 1, !tbaa !5
  %53 = zext i8 %52 to i32
  %54 = shl nuw nsw i32 %53, 16
  %55 = or disjoint i32 %54, %50
  %56 = getelementptr inbounds i8, ptr %4, i64 6
  %57 = load i8, ptr %56, align 1, !tbaa !5
  %58 = zext i8 %57 to i32
  %59 = shl nuw nsw i32 %58, 8
  %60 = or disjoint i32 %55, %59
  %61 = getelementptr inbounds i8, ptr %4, i64 7
  %62 = load i8, ptr %61, align 1, !tbaa !5
  %63 = zext i8 %62 to i32
  %64 = or disjoint i32 %60, %63
  %65 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %1, i32 noundef %30, ptr noundef nonnull @.str.27, i32 noundef %64) #4
  %66 = getelementptr inbounds i8, ptr %4, i64 8
  %67 = load i8, ptr %66, align 1, !tbaa !5
  %68 = zext i8 %67 to i32
  %69 = shl nuw i32 %68, 24
  %70 = getelementptr inbounds i8, ptr %4, i64 9
  %71 = load i8, ptr %70, align 1, !tbaa !5
  %72 = zext i8 %71 to i32
  %73 = shl nuw nsw i32 %72, 16
  %74 = or disjoint i32 %73, %69
  %75 = getelementptr inbounds i8, ptr %4, i64 10
  %76 = load i8, ptr %75, align 1, !tbaa !5
  %77 = zext i8 %76 to i32
  %78 = shl nuw nsw i32 %77, 8
  %79 = or disjoint i32 %74, %78
  %80 = getelementptr inbounds i8, ptr %4, i64 11
  %81 = load i8, ptr %80, align 1, !tbaa !5
  %82 = zext i8 %81 to i32
  %83 = or disjoint i32 %79, %82
  %84 = call ptr @sm3_lmots_type_name(i32 noundef %83)
  %85 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %1, i32 noundef %30, ptr noundef nonnull @.str.18, ptr noundef %84) #4
  %86 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %1, i32 noundef %30, ptr noundef nonnull @.str.28) #4
  %87 = add nsw i32 %2, 8
  %88 = getelementptr inbounds i8, ptr %4, i64 12
  br label %89

89:                                               ; preds = %28, %89
  %indvars.iv = phi i64 [ 0, %28 ], [ %indvars.iv.next, %89 ]
  %90 = trunc nuw nsw i64 %indvars.iv to i32
  %91 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %1, i32 noundef %87, ptr noundef nonnull @.str.25, i32 noundef %90) #4
  %92 = getelementptr inbounds [34 x [32 x i8]], ptr %88, i64 0, i64 %indvars.iv
  %93 = call i32 @format_bytes(ptr noundef %0, i32 noundef %1, i32 noundef 0, ptr noundef nonnull @.str.26, ptr noundef nonnull %92, i64 noundef 32) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 34
  br i1 %exitcond.not, label %94, label %89, !llvm.loop !10

94:                                               ; preds = %89
  %95 = getelementptr inbounds i8, ptr %4, i64 1100
  %96 = call i32 @format_bytes(ptr noundef %0, i32 noundef %1, i32 noundef %30, ptr noundef nonnull @.str.29, ptr noundef nonnull %95, i64 noundef 32) #4
  %97 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %1, i32 noundef %30, ptr noundef nonnull @.str.30) #4
  %98 = load i32, ptr %6, align 4, !tbaa !12
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %94
  %100 = getelementptr inbounds i8, ptr %4, i64 1132
  br label %101

101:                                              ; preds = %.lr.ph, %101
  %indvars.iv62 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next63, %101 ]
  %102 = getelementptr inbounds [25 x [32 x i8]], ptr %100, i64 0, i64 %indvars.iv62
  %103 = call i32 @format_bytes(ptr noundef %0, i32 noundef %1, i32 noundef %87, ptr noundef nonnull @.str.26, ptr noundef nonnull %102, i64 noundef 32) #4
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %104 = load i32, ptr %6, align 4, !tbaa !12
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next63, %105
  br i1 %106, label %101, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %101, %94, %25
  %.058 = phi i32 [ -1, %25 ], [ 1, %94 ], [ 1, %101 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  ret i32 %.058
}

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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }
attributes #5 = { cold 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !6, i64 0}
!14 = distinct !{!14, !11}


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