; LLVM IR from intel/intel-ipsec-mb :: test/kat-app (hmac_sha256_sha512_test)

; 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.mac_test = type { i64, i64, i64, ptr, ptr, ptr, i32, i64, ptr, i64 }
%struct.test_suite_context = type { i32, i32, ptr }

@__const.hmac_sha256_sha512_test.sha_types_tab = external hidden unnamed_addr constant [4 x i32], align 16
@hmac_sha256_sha512_test.sha_names_tab = external hidden constant [4 x ptr], align 16
@hmac_sha224_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [93 x i8], align 1
@__PRETTY_FUNCTION__.hmac_sha256_sha512_test = external hidden unnamed_addr constant [46 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@hmac_sha256_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@hmac_sha384_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@hmac_sha512_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @hmac_sha256_sha512_test(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca [4 x i32], align 16
  %4 = alloca %struct.test_suite_context, align 8
  %5 = alloca %struct.test_suite_context, align 8
  %6 = alloca %struct.test_suite_context, align 8
  %7 = alloca %struct.test_suite_context, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [4 x ptr], align 16
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.hmac_sha256_sha512_test.sha_types_tab, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %17 = load ptr, ptr @hmac_sha256_sha512_test.sha_names_tab, align 16, !tbaa !5
  call void @test_suite_start(ptr noundef %4, ptr noundef %17)
  %18 = load ptr, ptr getelementptr inbounds ([4 x ptr], ptr @hmac_sha256_sha512_test.sha_names_tab, i64 0, i64 1), align 8, !tbaa !5
  call void @test_suite_start(ptr noundef %5, ptr noundef %18)
  %19 = load ptr, ptr getelementptr inbounds ([4 x ptr], ptr @hmac_sha256_sha512_test.sha_names_tab, i64 0, i64 2), align 16, !tbaa !5
  call void @test_suite_start(ptr noundef %6, ptr noundef %19)
  %20 = load ptr, ptr getelementptr inbounds ([4 x ptr], ptr @hmac_sha256_sha512_test.sha_names_tab, i64 0, i64 3), align 8, !tbaa !5
  call void @test_suite_start(ptr noundef %7, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  store ptr %4, ptr %12, align 8, !tbaa !5
  %21 = getelementptr inbounds ptr, ptr %12, i64 1
  store ptr %5, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds ptr, ptr %12, i64 2
  store ptr %6, ptr %22, align 8, !tbaa !5
  %23 = getelementptr inbounds ptr, ptr %12, i64 3
  store ptr %7, ptr %23, align 8, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %47, %1
  %25 = load i32, ptr %8, align 4, !tbaa !9
  %26 = zext i32 %25 to i64
  %27 = icmp ult i64 %26, 4
  br i1 %27, label %28, label %50

28:                                               ; preds = %24
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %43, %28
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = icmp ule i32 %30, 32
  br i1 %31, label %32, label %46

32:                                               ; preds = %29
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds [4 x ptr], ptr %12, i64 0, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  call void @test_hmac_shax_std_vectors(ptr noundef %33, i32 noundef %37, i32 noundef %38, ptr noundef %42)
  br label %43

43:                                               ; preds = %32
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = add i32 %44, 1
  store i32 %45, ptr %9, align 4, !tbaa !9
  br label %29, !llvm.loop !11

46:                                               ; preds = %29
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = add i32 %48, 1
  store i32 %49, ptr %8, align 4, !tbaa !9
  br label %24, !llvm.loop !13

50:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr @hmac_sha224_test_kat_json, ptr %13, align 8, !tbaa !5
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.mac_test, ptr %51, i32 0, i32 1
  %53 = load i64, ptr %52, align 8, !tbaa !14
  %54 = udiv i64 %53, 8
  %55 = icmp eq i64 %54, 28
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  br label %58

57:                                               ; preds = %50
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.5, i32 noundef 648, ptr noundef @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

58:                                               ; preds = %56
  store i32 4, ptr %11, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %76, %58
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = icmp ule i32 %60, 28
  br i1 %61, label %62, label %79

62:                                               ; preds = %59
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 0
  %66 = load i32, ptr %65, align 16, !tbaa !9
  %67 = load i32, ptr %11, align 4, !tbaa !9
  %68 = zext i32 %67 to i64
  %69 = call i32 @test_hmac_shax(ptr noundef %63, ptr noundef %64, i32 noundef 128, i32 noundef %66, i64 noundef %68)
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %74

71:                                               ; preds = %62
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %72)
  call void @test_suite_update(ptr noundef %4, i32 noundef 0, i32 noundef 1)
  br label %75

74:                                               ; preds = %62
  call void @test_suite_update(ptr noundef %4, i32 noundef 1, i32 noundef 0)
  br label %75

75:                                               ; preds = %74, %71
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = add i32 %77, 1
  store i32 %78, ptr %11, align 4, !tbaa !9
  br label %59, !llvm.loop !17

79:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr @hmac_sha256_test_kat_json, ptr %14, align 8, !tbaa !5
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.mac_test, ptr %80, i32 0, i32 1
  %82 = load i64, ptr %81, align 8, !tbaa !14
  %83 = udiv i64 %82, 8
  %84 = icmp eq i64 %83, 32
  br i1 %84, label %85, label %86

85:                                               ; preds = %79
  br label %87

86:                                               ; preds = %79
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.5, i32 noundef 660, ptr noundef @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

87:                                               ; preds = %85
  store i32 4, ptr %11, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %105, %87
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = icmp ule i32 %89, 32
  br i1 %90, label %91, label %108

91:                                               ; preds = %88
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 1
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = call i32 @test_hmac_shax(ptr noundef %92, ptr noundef %93, i32 noundef 128, i32 noundef %95, i64 noundef %97)
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %103

100:                                              ; preds = %91
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %101)
  call void @test_suite_update(ptr noundef %5, i32 noundef 0, i32 noundef 1)
  br label %104

103:                                              ; preds = %91
  call void @test_suite_update(ptr noundef %5, i32 noundef 1, i32 noundef 0)
  br label %104

104:                                              ; preds = %103, %100
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = add i32 %106, 1
  store i32 %107, ptr %11, align 4, !tbaa !9
  br label %88, !llvm.loop !18

108:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr @hmac_sha384_test_kat_json, ptr %15, align 8, !tbaa !5
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.mac_test, ptr %109, i32 0, i32 1
  %111 = load i64, ptr %110, align 8, !tbaa !14
  %112 = udiv i64 %111, 8
  %113 = icmp eq i64 %112, 48
  br i1 %113, label %114, label %115

114:                                              ; preds = %108
  br label %116

115:                                              ; preds = %108
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.5, i32 noundef 672, ptr noundef @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

116:                                              ; preds = %114
  store i32 4, ptr %11, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %134, %116
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = icmp ule i32 %118, 48
  br i1 %119, label %120, label %137

120:                                              ; preds = %117
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 2
  %124 = load i32, ptr %123, align 8, !tbaa !9
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = call i32 @test_hmac_shax(ptr noundef %121, ptr noundef %122, i32 noundef 128, i32 noundef %124, i64 noundef %126)
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %132

129:                                              ; preds = %120
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %130)
  call void @test_suite_update(ptr noundef %6, i32 noundef 0, i32 noundef 1)
  br label %133

132:                                              ; preds = %120
  call void @test_suite_update(ptr noundef %6, i32 noundef 1, i32 noundef 0)
  br label %133

133:                                              ; preds = %132, %129
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %11, align 4, !tbaa !9
  %136 = add i32 %135, 1
  store i32 %136, ptr %11, align 4, !tbaa !9
  br label %117, !llvm.loop !19

137:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr @hmac_sha512_test_kat_json, ptr %16, align 8, !tbaa !5
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.mac_test, ptr %138, i32 0, i32 1
  %140 = load i64, ptr %139, align 8, !tbaa !14
  %141 = udiv i64 %140, 8
  %142 = icmp eq i64 %141, 64
  br i1 %142, label %143, label %144

143:                                              ; preds = %137
  br label %145

144:                                              ; preds = %137
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.5, i32 noundef 684, ptr noundef @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

145:                                              ; preds = %143
  store i32 4, ptr %11, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %163, %145
  %147 = load i32, ptr %11, align 4, !tbaa !9
  %148 = icmp ule i32 %147, 64
  br i1 %148, label %149, label %166

149:                                              ; preds = %146
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 3
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = load i32, ptr %11, align 4, !tbaa !9
  %155 = zext i32 %154 to i64
  %156 = call i32 @test_hmac_shax(ptr noundef %150, ptr noundef %151, i32 noundef 128, i32 noundef %153, i64 noundef %155)
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %161

158:                                              ; preds = %149
  %159 = load i32, ptr %11, align 4, !tbaa !9
  %160 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %159)
  call void @test_suite_update(ptr noundef %7, i32 noundef 0, i32 noundef 1)
  br label %162

161:                                              ; preds = %149
  call void @test_suite_update(ptr noundef %7, i32 noundef 1, i32 noundef 0)
  br label %162

162:                                              ; preds = %161, %158
  br label %163

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

166:                                              ; preds = %146
  %167 = call i32 @test_suite_end(ptr noundef %4)
  %168 = load i32, ptr %10, align 4, !tbaa !9
  %169 = add nsw i32 %168, %167
  store i32 %169, ptr %10, align 4, !tbaa !9
  %170 = call i32 @test_suite_end(ptr noundef %5)
  %171 = load i32, ptr %10, align 4, !tbaa !9
  %172 = add nsw i32 %171, %170
  store i32 %172, ptr %10, align 4, !tbaa !9
  %173 = call i32 @test_suite_end(ptr noundef %6)
  %174 = load i32, ptr %10, align 4, !tbaa !9
  %175 = add nsw i32 %174, %173
  store i32 %175, ptr %10, align 4, !tbaa !9
  %176 = call i32 @test_suite_end(ptr noundef %7)
  %177 = load i32, ptr %10, align 4, !tbaa !9
  %178 = add nsw i32 %177, %176
  store i32 %178, ptr %10, align 4, !tbaa !9
  %179 = load i32, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  ret i32 %179
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare void @test_suite_start(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @test_hmac_shax_std_vectors(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @test_hmac_shax(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i64 noundef) #0

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

declare void @test_suite_update(ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @test_suite_end(ptr noundef) #3

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

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 = { nocallback nofree 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 = { noreturn 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !16, i64 8}
!15 = !{!"mac_test", !16, i64 0, !16, i64 8, !16, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !16, i64 56, !6, i64 64, !16, i64 72}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


; 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.mac_test = type { i64, i64, i64, ptr, ptr, ptr, i32, i64, ptr, i64 }
%struct.test_suite_context = type { i32, i32, ptr }

@__const.hmac_sha256_sha512_test.sha_types_tab = external hidden unnamed_addr constant [4 x i32], align 16
@hmac_sha256_sha512_test.sha_names_tab = external hidden local_unnamed_addr constant [4 x ptr], align 16
@hmac_sha224_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [93 x i8], align 1
@__PRETTY_FUNCTION__.hmac_sha256_sha512_test = external hidden unnamed_addr constant [46 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@hmac_sha256_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@hmac_sha384_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@hmac_sha512_test_kat_json = external constant [0 x %struct.mac_test], align 8
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @hmac_sha256_sha512_test(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.test_suite_context, align 8
  %3 = alloca %struct.test_suite_context, align 8
  %4 = alloca %struct.test_suite_context, align 8
  %5 = alloca %struct.test_suite_context, align 8
  %6 = alloca [4 x ptr], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %7 = load ptr, ptr @hmac_sha256_sha512_test.sha_names_tab, align 16, !tbaa !5
  call void @test_suite_start(ptr noundef nonnull %2, ptr noundef %7) #5
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @hmac_sha256_sha512_test.sha_names_tab, i64 8), align 8, !tbaa !5
  call void @test_suite_start(ptr noundef nonnull %3, ptr noundef %8) #5
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @hmac_sha256_sha512_test.sha_names_tab, i64 16), align 16, !tbaa !5
  call void @test_suite_start(ptr noundef nonnull %4, ptr noundef %9) #5
  %10 = load ptr, ptr getelementptr inbounds (i8, ptr @hmac_sha256_sha512_test.sha_names_tab, i64 24), align 8, !tbaa !5
  call void @test_suite_start(ptr noundef nonnull %5, ptr noundef %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  store ptr %2, ptr %6, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %3, ptr %11, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %4, ptr %12, align 16, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %5, ptr %13, align 8, !tbaa !5
  br label %.preheader52

.preheader52:                                     ; preds = %1, %.preheader52
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %.preheader52 ]
  %14 = getelementptr inbounds [4 x i32], ptr @__const.hmac_sha256_sha512_test.sha_types_tab, i64 0, i64 %indvars.iv
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = getelementptr inbounds [4 x ptr], ptr %6, i64 0, i64 %indvars.iv
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 1, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 2, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 3, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 4, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 5, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 6, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 7, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 8, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 9, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 10, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 11, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 12, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 13, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 14, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 15, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 16, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 17, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 18, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 19, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 20, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 21, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 22, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 23, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 24, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 25, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 26, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 27, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 28, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 29, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 30, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 31, ptr noundef %17)
  call void @test_hmac_shax_std_vectors(ptr noundef %0, i32 noundef %15, i32 noundef 32, ptr noundef %17)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 4
  br i1 %exitcond.not, label %18, label %.preheader52, !llvm.loop !11

18:                                               ; preds = %.preheader52
  %19 = load i64, ptr getelementptr inbounds (i8, ptr @hmac_sha224_test_kat_json, i64 8), align 8, !tbaa !13
  %.mask = and i64 %19, -8
  %20 = icmp eq i64 %.mask, 224
  br i1 %20, label %.preheader51, label %22

.preheader51:                                     ; preds = %18
  %21 = load i32, ptr @__const.hmac_sha256_sha512_test.sha_types_tab, align 16, !tbaa !9
  br label %23

22:                                               ; preds = %18
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, i32 noundef 648, ptr noundef nonnull @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

23:                                               ; preds = %.preheader51, %29
  %indvars.iv60 = phi i64 [ 4, %.preheader51 ], [ %indvars.iv.next61, %29 ]
  %24 = call i32 @test_hmac_shax(ptr noundef %0, ptr noundef nonnull @hmac_sha224_test_kat_json, i32 noundef 128, i32 noundef %21, i64 noundef %indvars.iv60)
  %.not48 = icmp eq i32 %24, 0
  br i1 %.not48, label %28, label %25

25:                                               ; preds = %23
  %26 = trunc nuw nsw i64 %indvars.iv60 to i32
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %26)
  call void @test_suite_update(ptr noundef nonnull %2, i32 noundef 0, i32 noundef 1) #5
  br label %29

28:                                               ; preds = %23
  call void @test_suite_update(ptr noundef nonnull %2, i32 noundef 1, i32 noundef 0) #5
  br label %29

29:                                               ; preds = %25, %28
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next61, 29
  br i1 %exitcond63.not, label %30, label %23, !llvm.loop !16

30:                                               ; preds = %29
  %31 = load i64, ptr getelementptr inbounds (i8, ptr @hmac_sha256_test_kat_json, i64 8), align 8, !tbaa !13
  %.mask43 = and i64 %31, -8
  %32 = icmp eq i64 %.mask43, 256
  br i1 %32, label %.preheader50, label %34

.preheader50:                                     ; preds = %30
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @__const.hmac_sha256_sha512_test.sha_types_tab, i64 4), align 4, !tbaa !9
  br label %35

34:                                               ; preds = %30
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.5, i32 noundef 660, ptr noundef nonnull @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

35:                                               ; preds = %.preheader50, %41
  %indvars.iv64 = phi i64 [ 4, %.preheader50 ], [ %indvars.iv.next65, %41 ]
  %36 = call i32 @test_hmac_shax(ptr noundef %0, ptr noundef nonnull @hmac_sha256_test_kat_json, i32 noundef 128, i32 noundef %33, i64 noundef %indvars.iv64)
  %.not47 = icmp eq i32 %36, 0
  br i1 %.not47, label %40, label %37

37:                                               ; preds = %35
  %38 = trunc nuw nsw i64 %indvars.iv64 to i32
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %38)
  call void @test_suite_update(ptr noundef nonnull %3, i32 noundef 0, i32 noundef 1) #5
  br label %41

40:                                               ; preds = %35
  call void @test_suite_update(ptr noundef nonnull %3, i32 noundef 1, i32 noundef 0) #5
  br label %41

41:                                               ; preds = %37, %40
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next65, 33
  br i1 %exitcond67.not, label %42, label %35, !llvm.loop !17

42:                                               ; preds = %41
  %43 = load i64, ptr getelementptr inbounds (i8, ptr @hmac_sha384_test_kat_json, i64 8), align 8, !tbaa !13
  %.mask44 = and i64 %43, -8
  %44 = icmp eq i64 %.mask44, 384
  br i1 %44, label %.preheader49, label %46

.preheader49:                                     ; preds = %42
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @__const.hmac_sha256_sha512_test.sha_types_tab, i64 8), align 8, !tbaa !9
  br label %47

46:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.5, i32 noundef 672, ptr noundef nonnull @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

47:                                               ; preds = %.preheader49, %53
  %indvars.iv68 = phi i64 [ 4, %.preheader49 ], [ %indvars.iv.next69, %53 ]
  %48 = call i32 @test_hmac_shax(ptr noundef %0, ptr noundef nonnull @hmac_sha384_test_kat_json, i32 noundef 128, i32 noundef %45, i64 noundef %indvars.iv68)
  %.not46 = icmp eq i32 %48, 0
  br i1 %.not46, label %52, label %49

49:                                               ; preds = %47
  %50 = trunc nuw nsw i64 %indvars.iv68 to i32
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %50)
  call void @test_suite_update(ptr noundef nonnull %4, i32 noundef 0, i32 noundef 1) #5
  br label %53

52:                                               ; preds = %47
  call void @test_suite_update(ptr noundef nonnull %4, i32 noundef 1, i32 noundef 0) #5
  br label %53

53:                                               ; preds = %49, %52
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next69, 49
  br i1 %exitcond71.not, label %54, label %47, !llvm.loop !18

54:                                               ; preds = %53
  %55 = load i64, ptr getelementptr inbounds (i8, ptr @hmac_sha512_test_kat_json, i64 8), align 8, !tbaa !13
  %.mask45 = and i64 %55, -8
  %56 = icmp eq i64 %.mask45, 512
  br i1 %56, label %.preheader, label %58

.preheader:                                       ; preds = %54
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @__const.hmac_sha256_sha512_test.sha_types_tab, i64 12), align 4, !tbaa !9
  br label %59

58:                                               ; preds = %54
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.5, i32 noundef 684, ptr noundef nonnull @__PRETTY_FUNCTION__.hmac_sha256_sha512_test) #6
  unreachable

59:                                               ; preds = %.preheader, %65
  %indvars.iv72 = phi i64 [ 4, %.preheader ], [ %indvars.iv.next73, %65 ]
  %60 = call i32 @test_hmac_shax(ptr noundef %0, ptr noundef nonnull @hmac_sha512_test_kat_json, i32 noundef 128, i32 noundef %57, i64 noundef %indvars.iv72)
  %.not = icmp eq i32 %60, 0
  br i1 %.not, label %64, label %61

61:                                               ; preds = %59
  %62 = trunc nuw nsw i64 %indvars.iv72 to i32
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %62)
  call void @test_suite_update(ptr noundef nonnull %5, i32 noundef 0, i32 noundef 1) #5
  br label %65

64:                                               ; preds = %59
  call void @test_suite_update(ptr noundef nonnull %5, i32 noundef 1, i32 noundef 0) #5
  br label %65

65:                                               ; preds = %61, %64
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next73, 65
  br i1 %exitcond75.not, label %66, label %59, !llvm.loop !19

66:                                               ; preds = %65
  %67 = call i32 @test_suite_end(ptr noundef nonnull %2) #5
  %68 = call i32 @test_suite_end(ptr noundef nonnull %3) #5
  %69 = add nsw i32 %68, %67
  %70 = call i32 @test_suite_end(ptr noundef nonnull %4) #5
  %71 = add nsw i32 %69, %70
  %72 = call i32 @test_suite_end(ptr noundef nonnull %5) #5
  %73 = add nsw i32 %71, %72
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  ret i32 %73
}

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

declare void @test_suite_start(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @test_hmac_shax_std_vectors(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @test_hmac_shax(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

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

declare void @test_suite_update(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @test_suite_end(ptr noundef) local_unnamed_addr #2

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !15, i64 8}
!14 = !{!"mac_test", !15, i64 0, !15, i64 8, !15, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !15, i64 56, !6, i64 64, !15, i64 72}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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