; LLVM IR from intel/intel-ipsec-mb :: test/kat-app (zuc_eia3_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.zuc_eia3_128_params = type { ptr, ptr, ptr }
%struct.IMB_MGR = type { i64, i64, [4 x i64], [7 x i8], i8, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, [256 x %struct.IMB_JOB], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.IMB_JOB = type { ptr, ptr, i64, %union.anon, %union.anon.0, %union.anon.1, %union.anon.2, i64, %union.anon.3, ptr, i64, ptr, i64, %union.anon.4, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, %union.anon.5, [2 x i32], i32 }
%union.anon = type { ptr }
%union.anon.0 = type { ptr }
%union.anon.1 = type { i64 }
%union.anon.2 = type { i64 }
%union.anon.3 = type { i64 }
%union.anon.4 = type { %struct._AES_XCBC_specific_fields }
%struct._AES_XCBC_specific_fields = type { ptr, ptr, ptr }
%union.anon.5 = type { %struct._CBCS_specific_fields }
%struct._CBCS_specific_fields = type { ptr }

@zuc_eia3_128_test_json = external constant [0 x %struct.mac_test], align 8
@.str.4 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@stdout = external global ptr, align 8

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @validate_zuc_EIA_1_block(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #4 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %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
  %16 = alloca ptr, align 8
  %17 = alloca %struct.zuc_eia3_128_params, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr @zuc_eia3_128_test_json, ptr %16, align 8, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %130, %6
  %23 = load ptr, ptr %16, align 8, !tbaa !5
  %24 = load i32, ptr %13, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  %26 = getelementptr inbounds %struct.mac_test, ptr %23, i64 %25
  %27 = getelementptr inbounds %struct.mac_test, ptr %26, i32 0, i32 4
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %133

30:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #7
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %31 = load ptr, ptr %16, align 8, !tbaa !5
  %32 = load i32, ptr %13, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds %struct.mac_test, ptr %31, i64 %33
  %35 = getelementptr inbounds %struct.mac_test, ptr %34, i32 0, i32 9
  %36 = load i64, ptr %35, align 8, !tbaa !14
  %37 = udiv i64 %36, 8
  store i64 %37, ptr %18, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 4, ptr %19, align 8, !tbaa !15
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %16, align 8, !tbaa !5
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds %struct.mac_test, ptr %39, i64 %41
  %43 = getelementptr inbounds %struct.mac_test, ptr %42, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %38, ptr align 1 %44, i64 16, i1 false)
  %45 = load ptr, ptr %16, align 8, !tbaa !5
  %46 = load i32, ptr %13, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds %struct.mac_test, ptr %45, i64 %47
  call void @zuc_eia3_128_set_params(ptr noundef %48, ptr noundef %17)
  %49 = getelementptr inbounds %struct.zuc_eia3_128_params, ptr %17, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !17
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = getelementptr inbounds %struct.zuc_eia3_128_params, ptr %17, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = load i8, ptr %53, align 1, !tbaa !20
  %55 = getelementptr inbounds %struct.zuc_eia3_128_params, ptr %17, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = load i8, ptr %56, align 1, !tbaa !20
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = call i32 @zuc_eia3_iv_gen(i32 noundef %51, i8 noundef zeroext %54, i8 noundef zeroext %57, ptr noundef %58)
  %60 = load ptr, ptr %16, align 8, !tbaa !5
  %61 = load i32, ptr %13, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds %struct.mac_test, ptr %60, i64 %62
  %64 = getelementptr inbounds %struct.mac_test, ptr %63, i32 0, i32 7
  %65 = load i64, ptr %64, align 8, !tbaa !22
  %66 = trunc i64 %65 to i32
  store i32 %66, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %67 = load i32, ptr %15, align 4, !tbaa !9
  %68 = add i32 %67, 7
  %69 = udiv i32 %68, 8
  store i32 %69, ptr %20, align 4, !tbaa !9
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds %struct.mac_test, ptr %71, i64 %73
  %75 = getelementptr inbounds %struct.mac_test, ptr %74, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = load i32, ptr %20, align 4, !tbaa !9
  %78 = zext i32 %77 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %70, ptr align 1 %76, i64 %78, i1 false)
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = icmp eq i32 %79, 1
  br i1 %80, label %81, label %84

81:                                               ; preds = %30
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = call i32 @submit_eia3_jobs(ptr noundef %82, ptr noundef %10, ptr noundef %11, ptr noundef %8, ptr noundef %9, ptr noundef %15, i32 noundef 1, i32 noundef 16, ptr noundef %19, ptr noundef %18)
  br label %93

84:                                               ; preds = %30
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.IMB_MGR, ptr %85, i32 0, i32 61
  %87 = load ptr, ptr %86, align 8, !tbaa !23
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = load i32, ptr %15, align 4, !tbaa !9
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  call void %87(ptr noundef %88, ptr noundef %89, ptr noundef %90, i32 noundef %91, ptr noundef %92)
  br label %93

93:                                               ; preds = %84, %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = load ptr, ptr %16, align 8, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds %struct.mac_test, ptr %95, i64 %97
  %99 = getelementptr inbounds %struct.mac_test, ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !25
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds %struct.mac_test, ptr %101, i64 %103
  %105 = getelementptr inbounds %struct.mac_test, ptr %104, i32 0, i32 1
  %106 = load i64, ptr %105, align 8, !tbaa !26
  %107 = udiv i64 %106, 8
  %108 = call i32 @memcmp(ptr noundef %94, ptr noundef %100, i64 noundef %107) #8
  store i32 %108, ptr %21, align 4, !tbaa !9
  %109 = load i32, ptr %21, align 4, !tbaa !9
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %127

111:                                              ; preds = %93
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds %struct.mac_test, ptr %112, i64 %114
  %116 = getelementptr inbounds %struct.mac_test, ptr %115, i32 0, i32 2
  %117 = load i64, ptr %116, align 8, !tbaa !27
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %117)
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = load i32, ptr %13, align 4, !tbaa !9
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds %struct.mac_test, ptr %119, i64 %121
  %123 = getelementptr inbounds %struct.mac_test, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !25
  call void @byte_hexdump(ptr noundef @.str.5, ptr noundef %124, i32 noundef 4)
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  call void @byte_hexdump(ptr noundef @.str.6, ptr noundef %125, i32 noundef 4)
  %126 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %126, ptr %14, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %111, %93
  %128 = load ptr, ptr @stdout, align 8, !tbaa !5
  %129 = call i32 @fflush(ptr noundef %128)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %130

130:                                              ; preds = %127
  %131 = load i32, ptr %13, align 4, !tbaa !9
  %132 = add i32 %131, 1
  store i32 %132, ptr %13, align 4, !tbaa !9
  br label %22, !llvm.loop !28

133:                                              ; preds = %22
  %134 = load i32, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  ret i32 %134
}

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

; Function Attrs: nounwind uwtable
declare hidden void @zuc_eia3_128_set_params(ptr noundef, ptr noundef) #4

declare i32 @zuc_eia3_iv_gen(i32 noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @submit_eia3_jobs(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #6

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

declare i32 @fflush(ptr noundef) #3

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"mac_test", !13, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !13, i64 56, !6, i64 64, !13, i64 72}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 72}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !6, i64 24}
!17 = !{!18, !6, i64 0}
!18 = !{!"zuc_eia3_128_params", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!18, !6, i64 8}
!20 = !{!7, !7, i64 0}
!21 = !{!18, !6, i64 16}
!22 = !{!12, !13, i64 56}
!23 = !{!24, !6, i64 496}
!24 = !{!"IMB_MGR", !13, i64 0, !13, i64 8, !7, i64 16, !7, i64 48, !7, i64 55, !10, i64 56, !10, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !6, i64 872, !6, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !6, i64 984, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !10, i64 1104, !10, i64 1108, !7, i64 1112, !6, i64 56408, !6, i64 56416, !6, i64 56424, !6, i64 56432, !6, i64 56440, !6, i64 56448, !6, i64 56456, !6, i64 56464, !6, i64 56472, !6, i64 56480, !6, i64 56488, !6, i64 56496, !6, i64 56504, !6, i64 56512, !6, i64 56520, !6, i64 56528, !6, i64 56536, !6, i64 56544, !6, i64 56552, !6, i64 56560, !6, i64 56568, !6, i64 56576, !6, i64 56584, !6, i64 56592, !6, i64 56600, !6, i64 56608, !6, i64 56616, !6, i64 56624, !6, i64 56632, !6, i64 56640, !6, i64 56648, !6, i64 56656, !6, i64 56664, !6, i64 56672, !6, i64 56680, !6, i64 56688, !6, i64 56696, !6, i64 56704, !6, i64 56712, !6, i64 56720, !6, i64 56728, !6, i64 56736}
!25 = !{!12, !6, i64 40}
!26 = !{!12, !13, i64 8}
!27 = !{!12, !13, i64 16}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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.zuc_eia3_128_params = type { ptr, ptr, ptr }

@zuc_eia3_128_test_json = external constant [0 x %struct.mac_test], align 8
@.str.4 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: mustprogress 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) #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @validate_zuc_EIA_1_block(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #4 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.zuc_eia3_128_params, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @zuc_eia3_128_test_json, i64 32), align 8, !tbaa !9
  %.not30 = icmp eq ptr %15, null
  br i1 %.not30, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %16 = getelementptr inbounds i8, ptr %12, i64 8
  %17 = getelementptr inbounds i8, ptr %12, i64 16
  %18 = icmp eq i32 %5, 1
  %19 = getelementptr inbounds i8, ptr %0, i64 496
  br label %20

20:                                               ; preds = %.lr.ph, %66
  %21 = phi ptr [ %15, %.lr.ph ], [ %73, %66 ]
  %22 = phi ptr [ @zuc_eia3_128_test_json, %.lr.ph ], [ %71, %66 ]
  %.032 = phi i32 [ 0, %.lr.ph ], [ %69, %66 ]
  %.02731 = phi i32 [ 0, %.lr.ph ], [ %.1, %66 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %12, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %23 = getelementptr inbounds i8, ptr %22, i64 72
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %25 = lshr i64 %24, 3
  store i64 %25, ptr %13, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  store i64 4, ptr %14, align 8, !tbaa !14
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %22, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %26, ptr noundef nonnull align 1 dereferenceable(16) %28, i64 16, i1 false)
  call void @zuc_eia3_128_set_params(ptr noundef nonnull %22, ptr noundef nonnull %12)
  %29 = load ptr, ptr %12, align 8, !tbaa !16
  %30 = load i32, ptr %29, align 4, !tbaa !18
  %31 = load ptr, ptr %16, align 8, !tbaa !19
  %32 = load i8, ptr %31, align 1, !tbaa !20
  %33 = load ptr, ptr %17, align 8, !tbaa !21
  %34 = load i8, ptr %33, align 1, !tbaa !20
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = call i32 @zuc_eia3_iv_gen(i32 noundef %30, i8 noundef zeroext %32, i8 noundef zeroext %34, ptr noundef %35) #8
  %37 = getelementptr inbounds i8, ptr %22, i64 56
  %38 = load i64, ptr %37, align 8, !tbaa !22
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %11, align 4, !tbaa !18
  %40 = add i64 %38, 7
  %41 = lshr i64 %40, 3
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = and i64 %41, 536870911
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %42, ptr nonnull align 1 %21, i64 %43, i1 false)
  br i1 %18, label %44, label %46

44:                                               ; preds = %20
  %45 = call i32 @submit_eia3_jobs(ptr noundef %0, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %11, i32 noundef 1, i32 noundef 16, ptr noundef nonnull %14, ptr noundef nonnull %13)
  br label %53

46:                                               ; preds = %20
  %47 = load ptr, ptr %19, align 8, !tbaa !23
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load i32, ptr %11, align 4, !tbaa !18
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  call void %47(ptr noundef %48, ptr noundef %49, ptr noundef %50, i32 noundef %51, ptr noundef %52) #8
  br label %53

53:                                               ; preds = %46, %44
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %22, i64 40
  %56 = load ptr, ptr %55, align 8, !tbaa !25
  %57 = getelementptr inbounds i8, ptr %22, i64 8
  %58 = load i64, ptr %57, align 8, !tbaa !26
  %59 = lshr i64 %58, 3
  %60 = call i32 @memcmp(ptr noundef %54, ptr noundef %56, i64 noundef %59) #9
  %.not29 = icmp eq i32 %60, 0
  br i1 %.not29, label %66, label %61

61:                                               ; preds = %53
  %62 = getelementptr inbounds i8, ptr %22, i64 16
  %63 = load i64, ptr %62, align 8, !tbaa !27
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %63)
  call void @byte_hexdump(ptr noundef nonnull @.str.5, ptr noundef %56, i32 noundef 4) #8
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  call void @byte_hexdump(ptr noundef nonnull @.str.6, ptr noundef %65, i32 noundef 4) #8
  br label %66

66:                                               ; preds = %61, %53
  %.1 = phi i32 [ %60, %61 ], [ %.02731, %53 ]
  %67 = load ptr, ptr @stdout, align 8, !tbaa !5
  %68 = call i32 @fflush(ptr noundef %67)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  %69 = add i32 %.032, 1
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds %struct.mac_test, ptr @zuc_eia3_128_test_json, i64 %70
  %72 = getelementptr inbounds i8, ptr %71, i64 32
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %.not = icmp eq ptr %73, null
  br i1 %.not, label %._crit_edge, label %20, !llvm.loop !28

._crit_edge:                                      ; preds = %66, %6
  %.027.lcssa = phi i32 [ 0, %6 ], [ %.1, %66 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  ret i32 %.027.lcssa
}

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

; Function Attrs: nounwind uwtable
declare hidden void @zuc_eia3_128_set_params(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @zuc_eia3_iv_gen(i32 noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @submit_eia3_jobs(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #7

declare void @byte_hexdump(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"mac_test", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !11, i64 56, !6, i64 64, !11, i64 72}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !11, i64 72}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 24}
!16 = !{!17, !6, i64 0}
!17 = !{!"zuc_eia3_128_params", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!12, !12, i64 0}
!19 = !{!17, !6, i64 8}
!20 = !{!7, !7, i64 0}
!21 = !{!17, !6, i64 16}
!22 = !{!10, !11, i64 56}
!23 = !{!24, !6, i64 496}
!24 = !{!"IMB_MGR", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 48, !7, i64 55, !12, i64 56, !12, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !6, i64 872, !6, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !6, i64 984, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !12, i64 1104, !12, i64 1108, !7, i64 1112, !6, i64 56408, !6, i64 56416, !6, i64 56424, !6, i64 56432, !6, i64 56440, !6, i64 56448, !6, i64 56456, !6, i64 56464, !6, i64 56472, !6, i64 56480, !6, i64 56488, !6, i64 56496, !6, i64 56504, !6, i64 56512, !6, i64 56520, !6, i64 56528, !6, i64 56536, !6, i64 56544, !6, i64 56552, !6, i64 56560, !6, i64 56568, !6, i64 56576, !6, i64 56584, !6, i64 56592, !6, i64 56600, !6, i64 56608, !6, i64 56616, !6, i64 56624, !6, i64 56632, !6, i64 56640, !6, i64 56648, !6, i64 56656, !6, i64 56664, !6, i64 56672, !6, i64 56680, !6, i64 56688, !6, i64 56696, !6, i64 56704, !6, i64 56712, !6, i64 56720, !6, i64 56728, !6, i64 56736}
!25 = !{!10, !6, i64 40}
!26 = !{!10, !11, i64 8}
!27 = !{!10, !11, i64 16}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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