; LLVM IR from intel/intel-ipsec-mb :: test/imb-provider (prov_sw_gcm)

; 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.prov_gcm_ctx_st = type { %struct.gcm_key_data, %struct.gcm_context_data, i32, i32, ptr, i32, ptr, ptr, i32, ptr, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i64, i64, i64, i64, i64, i64, i8, [16 x i8], ptr, ptr, [48 x i8] }
%struct.gcm_key_data = type { [240 x i8], %union.anon }
%union.anon = type { %struct.anon.1 }
%struct.anon.1 = type { [1024 x i8] }
%struct.gcm_context_data = type { [16 x i8], i64, i64, [16 x i8], [16 x i8], [16 x i8], i64 }

@.str = external hidden unnamed_addr constant [86 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @vaesgcm_ciphers_init(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %13, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !9
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %4
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %175

17:                                               ; preds = %4
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %19, i32 0, i32 26
  %21 = trunc i32 %18 to i8
  %22 = load i8, ptr %20, align 8
  %23 = and i8 %21, 1
  %24 = and i8 %22, -2
  %25 = or i8 %24, %23
  store i8 %25, ptr %20, align 8
  %26 = zext i8 %23 to i32
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %17
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %175

30:                                               ; preds = %17
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %31, i32 0, i32 3
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %47

35:                                               ; preds = %30
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %36, i32 0, i32 8
  %38 = load i32, ptr %37, align 16, !tbaa !16
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %47

40:                                               ; preds = %35
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %41, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 16 %42, i8 0, i64 88, i1 false)
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %43, i32 0, i32 15
  store i32 0, ptr %44, align 4, !tbaa !17
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %45, i32 0, i32 8
  store i32 0, ptr %46, align 16, !tbaa !16
  br label %47

47:                                               ; preds = %40, %35, %30
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 32, !tbaa !18
  %51 = icmp ne ptr %50, null
  br i1 %51, label %69, label %52

52:                                               ; preds = %47
  %53 = call ptr @CRYPTO_zalloc(i64 noundef 16, ptr noundef @.str, i32 noundef 115)
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %54, i32 0, i32 6
  store ptr %53, ptr %55, align 32, !tbaa !18
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %56, i32 0, i32 6
  %58 = load ptr, ptr %57, align 32, !tbaa !18
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %65

60:                                               ; preds = %52
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %61, i32 0, i32 12
  store i32 16, ptr %62, align 8, !tbaa !19
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %63, i32 0, i32 15
  store i32 0, ptr %64, align 4, !tbaa !17
  br label %68

65:                                               ; preds = %52
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %66, i32 0, i32 12
  store i32 0, ptr %67, align 8, !tbaa !19
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %175

68:                                               ; preds = %60
  br label %69

69:                                               ; preds = %68, %47
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %70, i32 0, i32 15
  store i32 0, ptr %71, align 4, !tbaa !17
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %72, i32 0, i32 7
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = icmp ne ptr %74, null
  br i1 %75, label %91, label %76

76:                                               ; preds = %69
  %77 = call ptr @CRYPTO_zalloc(i64 noundef 16, ptr noundef @.str, i32 noundef 130)
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %78, i32 0, i32 7
  store ptr %77, ptr %79, align 8, !tbaa !20
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %80, i32 0, i32 7
  %82 = load ptr, ptr %81, align 8, !tbaa !20
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %87

84:                                               ; preds = %76
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %85, i32 0, i32 8
  store i32 0, ptr %86, align 16, !tbaa !16
  br label %90

87:                                               ; preds = %76
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %88, i32 0, i32 12
  store i32 0, ptr %89, align 8, !tbaa !19
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %175

90:                                               ; preds = %84
  br label %91

91:                                               ; preds = %90, %69
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %92, i32 0, i32 13
  %94 = load i32, ptr %93, align 4, !tbaa !21
  %95 = icmp sle i32 %94, 0
  br i1 %95, label %96, label %99

96:                                               ; preds = %91
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %97, i32 0, i32 13
  store i32 12, ptr %98, align 4, !tbaa !21
  br label %99

99:                                               ; preds = %96, %91
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %100, i32 0, i32 18
  %102 = load ptr, ptr %101, align 8, !tbaa !22
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %103, i32 0, i32 13
  %105 = load i32, ptr %104, align 4, !tbaa !21
  %106 = sext i32 %105 to i64
  %107 = call ptr @CRYPTO_realloc(ptr noundef %102, i64 noundef %106, ptr noundef @.str, i32 noundef 148)
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %108, i32 0, i32 18
  store ptr %107, ptr %109, align 8, !tbaa !22
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %110, i32 0, i32 17
  %112 = load ptr, ptr %111, align 32, !tbaa !23
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %113, i32 0, i32 13
  %115 = load i32, ptr %114, align 4, !tbaa !21
  %116 = sext i32 %115 to i64
  %117 = call ptr @CRYPTO_realloc(ptr noundef %112, i64 noundef %116, ptr noundef @.str, i32 noundef 149)
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %118, i32 0, i32 17
  store ptr %117, ptr %119, align 32, !tbaa !23
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %120, i32 0, i32 14
  store i32 0, ptr %121, align 16, !tbaa !24
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %151

124:                                              ; preds = %99
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %125, i32 0, i32 18
  %127 = load ptr, ptr %126, align 8, !tbaa !22
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %148

129:                                              ; preds = %124
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %130, i32 0, i32 18
  %132 = load ptr, ptr %131, align 8, !tbaa !22
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %134, i32 0, i32 13
  %136 = load i32, ptr %135, align 4, !tbaa !21
  %137 = sext i32 %136 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %132, ptr align 1 %133, i64 %137, i1 false)
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %138, i32 0, i32 17
  %140 = load ptr, ptr %139, align 32, !tbaa !23
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %142, i32 0, i32 13
  %144 = load i32, ptr %143, align 4, !tbaa !21
  %145 = sext i32 %144 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %140, ptr align 1 %141, i64 %145, i1 false)
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %146, i32 0, i32 14
  store i32 1, ptr %147, align 16, !tbaa !24
  br label %148

148:                                              ; preds = %129, %124
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %149, i32 0, i32 16
  store i32 0, ptr %150, align 8, !tbaa !25
  br label %151

151:                                              ; preds = %148, %99
  %152 = load ptr, ptr %10, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %152, i32 0, i32 11
  store i32 -1, ptr %153, align 4, !tbaa !26
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = icmp ne ptr %154, null
  br i1 %155, label %156, label %160

156:                                              ; preds = %151
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = call i32 @vaesgcm_init_key(ptr noundef %157, ptr noundef %158)
  store i32 %159, ptr %11, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %156, %151
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %161, i32 0, i32 3
  %163 = load i32, ptr %162, align 4, !tbaa !11
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %173

165:                                              ; preds = %160
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.prov_gcm_ctx_st, ptr %166, i32 0, i32 14
  %168 = load i32, ptr %167, align 16, !tbaa !24
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %173

170:                                              ; preds = %165
  %171 = load ptr, ptr %6, align 8, !tbaa !5
  %172 = call i32 @vaesgcm_init_gcm(ptr noundef %171)
  store i32 %172, ptr %11, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %170, %165, %160
  %174 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %174, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %175

175:                                              ; preds = %173, %87, %65, %29, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %176 = load i32, ptr %5, align 4
  ret i32 %176
}

; 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

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

; 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: 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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, !10, i64 1356}
!12 = !{!"prov_gcm_ctx_st", !13, i64 0, !14, i64 1264, !10, i64 1352, !10, i64 1356, !6, i64 1360, !10, i64 1368, !6, i64 1376, !6, i64 1384, !10, i64 1392, !6, i64 1400, !10, i64 1408, !10, i64 1412, !10, i64 1416, !10, i64 1420, !10, i64 1424, !10, i64 1428, !10, i64 1432, !6, i64 1440, !6, i64 1448, !10, i64 1456, !15, i64 1464, !15, i64 1472, !15, i64 1480, !15, i64 1488, !15, i64 1496, !15, i64 1504, !10, i64 1512, !10, i64 1512, !10, i64 1512, !7, i64 1513, !6, i64 1536, !6, i64 1544}
!13 = !{!"gcm_key_data", !7, i64 0, !7, i64 240}
!14 = !{!"gcm_context_data", !7, i64 0, !15, i64 16, !15, i64 24, !7, i64 32, !7, i64 48, !7, i64 64, !15, i64 80}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !10, i64 1392}
!17 = !{!12, !10, i64 1428}
!18 = !{!12, !6, i64 1376}
!19 = !{!12, !10, i64 1416}
!20 = !{!12, !6, i64 1384}
!21 = !{!12, !10, i64 1420}
!22 = !{!12, !6, i64 1448}
!23 = !{!12, !6, i64 1440}
!24 = !{!12, !10, i64 1424}
!25 = !{!12, !10, i64 1432}
!26 = !{!12, !10, i64 1412}


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

@.str = external hidden unnamed_addr constant [86 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @vaesgcm_ciphers_init(ptr noundef %0, ptr noundef %1, ptr noundef readonly %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = icmp eq ptr %0, null
  br i1 %5, label %76, label %6

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 1512
  %8 = trunc i32 %3 to i8
  %9 = load i8, ptr %7, align 8
  %10 = and i8 %8, 1
  %11 = and i8 %9, -2
  %12 = or disjoint i8 %11, %10
  store i8 %12, ptr %7, align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 1356
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %21, label %15

15:                                               ; preds = %6
  %16 = getelementptr inbounds i8, ptr %0, i64 1392
  %17 = load i32, ptr %16, align 16, !tbaa !14
  %.not54 = icmp eq i32 %17, 0
  br i1 %.not54, label %21, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 1264
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(88) %19, i8 0, i64 88, i1 false)
  %20 = getelementptr inbounds i8, ptr %0, i64 1428
  store i32 0, ptr %20, align 4, !tbaa !15
  store i32 0, ptr %16, align 16, !tbaa !14
  br label %21

21:                                               ; preds = %18, %15, %6
  %22 = getelementptr inbounds i8, ptr %0, i64 1376
  %23 = load ptr, ptr %22, align 32, !tbaa !16
  %.not55 = icmp eq ptr %23, null
  br i1 %.not55, label %24, label %29

24:                                               ; preds = %21
  %25 = tail call ptr @CRYPTO_zalloc(i64 noundef 16, ptr noundef nonnull @.str, i32 noundef 115) #4
  store ptr %25, ptr %22, align 32, !tbaa !16
  %.not56 = icmp eq ptr %25, null
  %26 = getelementptr inbounds i8, ptr %0, i64 1416
  br i1 %.not56, label %28, label %27

27:                                               ; preds = %24
  store i32 16, ptr %26, align 8, !tbaa !17
  br label %29

28:                                               ; preds = %24
  store i32 0, ptr %26, align 8, !tbaa !17
  br label %76

29:                                               ; preds = %27, %21
  %30 = getelementptr inbounds i8, ptr %0, i64 1428
  store i32 0, ptr %30, align 4, !tbaa !15
  %31 = getelementptr inbounds i8, ptr %0, i64 1384
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %.not57 = icmp eq ptr %32, null
  br i1 %.not57, label %33, label %39

33:                                               ; preds = %29
  %34 = tail call ptr @CRYPTO_zalloc(i64 noundef 16, ptr noundef nonnull @.str, i32 noundef 130) #4
  store ptr %34, ptr %31, align 8, !tbaa !18
  %.not58 = icmp eq ptr %34, null
  br i1 %.not58, label %37, label %35

35:                                               ; preds = %33
  %36 = getelementptr inbounds i8, ptr %0, i64 1392
  store i32 0, ptr %36, align 16, !tbaa !14
  br label %39

37:                                               ; preds = %33
  %38 = getelementptr inbounds i8, ptr %0, i64 1416
  store i32 0, ptr %38, align 8, !tbaa !17
  br label %76

39:                                               ; preds = %35, %29
  %40 = getelementptr inbounds i8, ptr %0, i64 1420
  %41 = load i32, ptr %40, align 4, !tbaa !19
  %42 = icmp slt i32 %41, 1
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  store i32 12, ptr %40, align 4, !tbaa !19
  br label %44

44:                                               ; preds = %43, %39
  %45 = phi i32 [ 12, %43 ], [ %41, %39 ]
  %46 = getelementptr inbounds i8, ptr %0, i64 1448
  %47 = load ptr, ptr %46, align 8, !tbaa !20
  %48 = zext nneg i32 %45 to i64
  %49 = tail call ptr @CRYPTO_realloc(ptr noundef %47, i64 noundef %48, ptr noundef nonnull @.str, i32 noundef 148) #4
  store ptr %49, ptr %46, align 8, !tbaa !20
  %50 = getelementptr inbounds i8, ptr %0, i64 1440
  %51 = load ptr, ptr %50, align 32, !tbaa !21
  %52 = load i32, ptr %40, align 4, !tbaa !19
  %53 = sext i32 %52 to i64
  %54 = tail call ptr @CRYPTO_realloc(ptr noundef %51, i64 noundef %53, ptr noundef nonnull @.str, i32 noundef 149) #4
  store ptr %54, ptr %50, align 32, !tbaa !21
  %55 = getelementptr inbounds i8, ptr %0, i64 1424
  store i32 0, ptr %55, align 16, !tbaa !22
  %.not59 = icmp eq ptr %2, null
  br i1 %.not59, label %66, label %56

56:                                               ; preds = %44
  %57 = load ptr, ptr %46, align 8, !tbaa !20
  %.not60 = icmp eq ptr %57, null
  br i1 %.not60, label %64, label %58

58:                                               ; preds = %56
  %59 = load i32, ptr %40, align 4, !tbaa !19
  %60 = sext i32 %59 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %57, ptr nonnull align 1 %2, i64 %60, i1 false)
  %61 = load ptr, ptr %50, align 32, !tbaa !21
  %62 = load i32, ptr %40, align 4, !tbaa !19
  %63 = sext i32 %62 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %61, ptr nonnull align 1 %2, i64 %63, i1 false)
  store i32 1, ptr %55, align 16, !tbaa !22
  br label %64

64:                                               ; preds = %58, %56
  %65 = getelementptr inbounds i8, ptr %0, i64 1432
  store i32 0, ptr %65, align 8, !tbaa !23
  br label %66

66:                                               ; preds = %64, %44
  %67 = getelementptr inbounds i8, ptr %0, i64 1412
  store i32 -1, ptr %67, align 4, !tbaa !24
  %.not61 = icmp eq ptr %1, null
  br i1 %.not61, label %70, label %68

68:                                               ; preds = %66
  %69 = tail call i32 @vaesgcm_init_key(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %70

70:                                               ; preds = %68, %66
  %.0 = phi i32 [ %69, %68 ], [ 1, %66 ]
  %71 = load i32, ptr %13, align 4, !tbaa !5
  %.not62 = icmp eq i32 %71, 0
  br i1 %.not62, label %76, label %72

72:                                               ; preds = %70
  %73 = load i32, ptr %55, align 16, !tbaa !22
  %.not63 = icmp eq i32 %73, 0
  br i1 %.not63, label %76, label %74

74:                                               ; preds = %72
  %75 = tail call i32 @vaesgcm_init_gcm(ptr noundef nonnull %0)
  br label %76

76:                                               ; preds = %70, %72, %74, %4, %37, %28
  %.049 = phi i32 [ 0, %37 ], [ 0, %28 ], [ 0, %4 ], [ %75, %74 ], [ %.0, %72 ], [ %.0, %70 ]
  ret i32 %.049
}

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

declare ptr @CRYPTO_zalloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @CRYPTO_realloc(ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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 nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 1356}
!6 = !{!"prov_gcm_ctx_st", !7, i64 0, !10, i64 1264, !12, i64 1352, !12, i64 1356, !13, i64 1360, !12, i64 1368, !13, i64 1376, !13, i64 1384, !12, i64 1392, !13, i64 1400, !12, i64 1408, !12, i64 1412, !12, i64 1416, !12, i64 1420, !12, i64 1424, !12, i64 1428, !12, i64 1432, !13, i64 1440, !13, i64 1448, !12, i64 1456, !11, i64 1464, !11, i64 1472, !11, i64 1480, !11, i64 1488, !11, i64 1496, !11, i64 1504, !12, i64 1512, !12, i64 1512, !12, i64 1512, !8, i64 1513, !13, i64 1536, !13, i64 1544}
!7 = !{!"gcm_key_data", !8, i64 0, !8, i64 240}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"gcm_context_data", !8, i64 0, !11, i64 16, !11, i64 24, !8, i64 32, !8, i64 48, !8, i64 64, !11, i64 80}
!11 = !{!"long", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!6, !12, i64 1392}
!15 = !{!6, !12, i64 1428}
!16 = !{!6, !13, i64 1376}
!17 = !{!6, !12, i64 1416}
!18 = !{!6, !13, i64 1384}
!19 = !{!6, !12, i64 1420}
!20 = !{!6, !13, i64 1448}
!21 = !{!6, !13, i64 1440}
!22 = !{!6, !12, i64 1424}
!23 = !{!6, !12, i64 1432}
!24 = !{!6, !12, i64 1412}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass