; LLVM IR from intel/intel-ipsec-mb :: test/kat-app (zuc_eea3_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.cipher_test = type { i64, i64, i64, ptr, ptr, ptr, ptr, i32, i64 }
%struct.zuc_eea3_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_eea3_128_test_json = external constant [0 x %struct.cipher_test], align 8
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1

; 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

; Function Attrs: nounwind uwtable
define dso_local i32 @validate_zuc_EEA_1_block(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #3 {
  %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 ptr, align 8
  %16 = alloca [50 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.zuc_eea3_128_params, align 8
  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 8, ptr %15) #7
  store ptr @zuc_eea3_128_test_json, ptr %15, align 8, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %21

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

29:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 50, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 16, ptr %19, align 4, !tbaa !9
  %30 = load ptr, ptr %15, align 8, !tbaa !5
  %31 = load i32, ptr %13, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds %struct.cipher_test, ptr %30, i64 %32
  %34 = getelementptr inbounds %struct.cipher_test, ptr %33, i32 0, i32 0
  %35 = load i64, ptr %34, align 8, !tbaa !14
  %36 = udiv i64 %35, 8
  %37 = icmp ne i64 %36, 16
  br i1 %37, label %38, label %54

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #7
  call void @llvm.memset.p0.i64(ptr align 8 %20, i8 0, i64 24, i1 false)
  %39 = load ptr, ptr %15, align 8, !tbaa !5
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds %struct.cipher_test, ptr %39, i64 %41
  call void @zuc_eea3_128_set_params(ptr noundef %42, ptr noundef %20)
  %43 = getelementptr inbounds %struct.zuc_eea3_128_params, ptr %20, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = getelementptr inbounds %struct.zuc_eea3_128_params, ptr %20, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !17
  %48 = load i8, ptr %47, align 1, !tbaa !18
  %49 = getelementptr inbounds %struct.zuc_eea3_128_params, ptr %20, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  %51 = load i8, ptr %50, align 1, !tbaa !18
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = call i32 @zuc_eea3_iv_gen(i32 noundef %45, i8 noundef zeroext %48, i8 noundef zeroext %51, ptr noundef %52)
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #7
  br label %62

54:                                               ; preds = %29
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds %struct.cipher_test, ptr %56, i64 %58
  %60 = getelementptr inbounds %struct.cipher_test, ptr %59, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %55, ptr align 1 %61, i64 16, i1 false)
  br label %62

62:                                               ; preds = %54, %38
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds %struct.cipher_test, ptr %64, i64 %66
  %68 = getelementptr inbounds %struct.cipher_test, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %63, ptr align 1 %69, i64 16, i1 false)
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds %struct.cipher_test, ptr %70, i64 %72
  %74 = getelementptr inbounds %struct.cipher_test, ptr %73, i32 0, i32 8
  %75 = load i64, ptr %74, align 8, !tbaa !22
  %76 = add i64 %75, 7
  %77 = trunc i64 %76 to i32
  %78 = udiv i32 %77, 8
  store i32 %78, ptr %18, align 4, !tbaa !9
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds %struct.cipher_test, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.cipher_test, ptr %83, i32 0, i32 5
  %85 = load ptr, ptr %84, align 8, !tbaa !11
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = zext i32 %86 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %79, ptr align 1 %85, i64 %87, i1 false)
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = icmp eq i32 %88, 1
  br i1 %89, label %90, label %93

90:                                               ; preds = %62
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = call i32 @submit_eea3_jobs(ptr noundef %91, ptr noundef %10, ptr noundef %11, ptr noundef %8, ptr noundef %9, ptr noundef %18, i32 noundef 1, i32 noundef 1, i32 noundef 16, ptr noundef %19)
  br label %102

93:                                               ; preds = %62
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.IMB_MGR, ptr %94, i32 0, i32 58
  %96 = load ptr, ptr %95, align 8, !tbaa !23
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load i32, ptr %18, align 4, !tbaa !9
  call void %96(ptr noundef %97, ptr noundef %98, ptr noundef %99, ptr noundef %100, i32 noundef %101)
  br label %102

102:                                              ; preds = %93, %90
  %103 = getelementptr inbounds [50 x i8], ptr %16, i64 0, i64 0
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds %struct.cipher_test, ptr %104, i64 %106
  %108 = getelementptr inbounds %struct.cipher_test, ptr %107, i32 0, i32 2
  %109 = load i64, ptr %108, align 8, !tbaa !25
  %110 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %103, i64 noundef 50, ptr noundef @.str.4, i64 noundef %109) #7
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds %struct.cipher_test, ptr %112, i64 %114
  %116 = getelementptr inbounds %struct.cipher_test, ptr %115, i32 0, i32 6
  %117 = load ptr, ptr %116, align 8, !tbaa !26
  %118 = load i32, ptr %18, align 4, !tbaa !9
  %119 = load ptr, ptr %15, align 8, !tbaa !5
  %120 = load i32, ptr %13, align 4, !tbaa !9
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds %struct.cipher_test, ptr %119, i64 %121
  %123 = getelementptr inbounds %struct.cipher_test, ptr %122, i32 0, i32 8
  %124 = load i64, ptr %123, align 8, !tbaa !22
  %125 = trunc i64 %124 to i32
  %126 = getelementptr inbounds [50 x i8], ptr %16, i64 0, i64 0
  %127 = call i32 @test_output(ptr noundef %111, ptr noundef %117, i32 noundef %118, i32 noundef %125, ptr noundef %126)
  store i32 %127, ptr %17, align 4, !tbaa !9
  %128 = load i32, ptr %17, align 4, !tbaa !9
  %129 = icmp slt i32 %128, 0
  br i1 %129, label %130, label %132

130:                                              ; preds = %102
  %131 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %131, ptr %14, align 4, !tbaa !9
  br label %132

132:                                              ; preds = %130, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 50, ptr %16) #7
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %13, align 4, !tbaa !9
  %135 = add i32 %134, 1
  store i32 %135, ptr %13, align 4, !tbaa !9
  br label %21, !llvm.loop !27

136:                                              ; preds = %21
  %137 = load i32, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, 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 %137
}

; 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_eea3_128_set_params(ptr noundef, ptr noundef) #3

declare i32 @zuc_eea3_iv_gen(i32 noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #4

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

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #6

; Function Attrs: nounwind uwtable
declare hidden i32 @test_output(ptr noundef, ptr noundef, i32 noundef, i32 noundef, 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 "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 }

!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 40}
!12 = !{!"cipher_test", !13, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !13, i64 64}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"zuc_eea3_128_params", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!16, !6, i64 8}
!18 = !{!7, !7, i64 0}
!19 = !{!16, !6, i64 16}
!20 = !{!12, !6, i64 32}
!21 = !{!12, !6, i64 24}
!22 = !{!12, !13, i64 64}
!23 = !{!24, !6, i64 472}
!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, !13, i64 16}
!26 = !{!12, !6, i64 48}
!27 = distinct !{!27, !28}
!28 = !{!"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.cipher_test = type { i64, i64, i64, ptr, ptr, ptr, ptr, i32, i64 }
%struct.zuc_eea3_128_params = type { ptr, ptr, ptr }

@zuc_eea3_128_test_json = external constant [0 x %struct.cipher_test], align 8
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1

; 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: nounwind uwtable
define dso_local range(i32 -2147483648, 1) i32 @validate_zuc_EEA_1_block(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #3 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [50 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.zuc_eea3_128_params, 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
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @zuc_eea3_128_test_json, i64 40), align 8, !tbaa !9
  %.not29 = icmp eq ptr %15, null
  br i1 %.not29, label %._crit_edge, label %.lr.ph

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

20:                                               ; preds = %.lr.ph, %57
  %21 = phi ptr [ %15, %.lr.ph ], [ %71, %57 ]
  %22 = phi ptr [ @zuc_eea3_128_test_json, %.lr.ph ], [ %69, %57 ]
  %.031 = phi i32 [ 0, %.lr.ph ], [ %67, %57 ]
  %.02630 = phi i32 [ 0, %.lr.ph ], [ %spec.select, %57 ]
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  store i32 16, ptr %13, align 4, !tbaa !13
  %23 = load i64, ptr %22, align 8, !tbaa !14
  %.mask = and i64 %23, -8
  %.not28 = icmp eq i64 %.mask, 128
  br i1 %.not28, label %33, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %14, i8 0, i64 24, i1 false)
  call void @zuc_eea3_128_set_params(ptr noundef nonnull %22, ptr noundef nonnull %14)
  %25 = load ptr, ptr %14, align 8, !tbaa !15
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = load ptr, ptr %16, align 8, !tbaa !17
  %28 = load i8, ptr %27, align 1, !tbaa !18
  %29 = load ptr, ptr %17, align 8, !tbaa !19
  %30 = load i8, ptr %29, align 1, !tbaa !18
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = call i32 @zuc_eea3_iv_gen(i32 noundef %26, i8 noundef zeroext %28, i8 noundef zeroext %30, ptr noundef %31) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #7
  br label %37

33:                                               ; preds = %20
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %22, i64 32
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %34, ptr noundef nonnull align 1 dereferenceable(16) %36, i64 16, i1 false)
  br label %37

37:                                               ; preds = %33, %24
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %22, i64 24
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %38, ptr noundef nonnull align 1 dereferenceable(16) %40, i64 16, i1 false)
  %41 = getelementptr inbounds i8, ptr %22, i64 64
  %42 = load i64, ptr %41, align 8, !tbaa !22
  %43 = trunc i64 %42 to i32
  %44 = add i32 %43, 7
  %45 = lshr i32 %44, 3
  store i32 %45, ptr %12, align 4, !tbaa !13
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = zext nneg i32 %45 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %46, ptr nonnull align 1 %21, i64 %47, i1 false)
  br i1 %18, label %48, label %50

48:                                               ; preds = %37
  %49 = call i32 @submit_eea3_jobs(ptr noundef %0, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %12, i32 noundef 1, i32 noundef 1, i32 noundef 16, ptr noundef nonnull %13)
  br label %57

50:                                               ; preds = %37
  %51 = load ptr, ptr %19, align 8, !tbaa !23
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = load i32, ptr %12, align 4, !tbaa !13
  call void %51(ptr noundef %52, ptr noundef %53, ptr noundef %54, ptr noundef %55, i32 noundef %56) #7
  br label %57

57:                                               ; preds = %50, %48
  %58 = getelementptr inbounds i8, ptr %22, i64 16
  %59 = load i64, ptr %58, align 8, !tbaa !25
  %60 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %11, i64 noundef 50, ptr noundef nonnull @.str.4, i64 noundef %59) #7
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %22, i64 48
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = load i32, ptr %12, align 4, !tbaa !13
  %65 = call i32 @test_output(ptr noundef %61, ptr noundef %63, i32 noundef %64, i32 noundef %43, ptr noundef nonnull %11)
  %66 = icmp slt i32 %65, 0
  %spec.select = select i1 %66, i32 %65, i32 %.02630
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %11) #7
  %67 = add i32 %.031, 1
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds %struct.cipher_test, ptr @zuc_eea3_128_test_json, i64 %68
  %70 = getelementptr inbounds i8, ptr %69, i64 40
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %.not = icmp eq ptr %71, null
  br i1 %.not, label %._crit_edge, label %20, !llvm.loop !27

._crit_edge:                                      ; preds = %57, %6
  %.026.lcssa = phi i32 [ 0, %6 ], [ %spec.select, %57 ]
  ret i32 %.026.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_eea3_128_set_params(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @zuc_eea3_iv_gen(i32 noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden i32 @test_output(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 #7 = { 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, !6, i64 40}
!10 = !{!"cipher_test", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !11, i64 64}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!10, !11, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"zuc_eea3_128_params", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!16, !6, i64 8}
!18 = !{!7, !7, i64 0}
!19 = !{!16, !6, i64 16}
!20 = !{!10, !6, i64 32}
!21 = !{!10, !6, i64 24}
!22 = !{!10, !11, i64 64}
!23 = !{!24, !6, i64 472}
!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, !11, i64 16}
!26 = !{!10, !6, i64 48}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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