; LLVM IR from specinfo-ua/UAPKI :: library/cm-pkcs12/src/storage (jks-entry)

; 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.JksEntry_st = type { i32, ptr, i64, %union.anon, ptr }
%union.anon = type { ptr }
%struct.JksCertificaties_st = type { ptr, i32 }

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

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

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @jks_entry_free(ptr noundef) #0

declare ptr @get_EncryptedPrivateKeyInfo_desc() #3

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

14:                                               ; preds = %3
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %19, label %17

17:                                               ; preds = %14
  store i32 2, ptr %8, align 4, !tbaa !9
  %18 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 221, i32 noundef %18, ptr noundef null)
  br label %174

19:                                               ; preds = %14
  br label %20

20:                                               ; preds = %19
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %27, label %25

25:                                               ; preds = %22
  store i32 2, ptr %8, align 4, !tbaa !9
  %26 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 222, i32 noundef %26, ptr noundef null)
  br label %174

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 40) #5
  store ptr %31, ptr %10, align 8, !tbaa !5
  %32 = icmp eq ptr null, %31
  br i1 %32, label %33, label %35

33:                                               ; preds = %30
  store i32 1, ptr %8, align 4, !tbaa !9
  %34 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 224, i32 noundef %34, ptr noundef null)
  br label %174

35:                                               ; preds = %30
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.JksEntry_st, ptr %40, i32 0, i32 0
  %42 = call i32 @jks_buffer_read_int(ptr noundef %39, ptr noundef %41)
  store i32 %42, ptr %8, align 4, !tbaa !9
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %38
  %46 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 227, i32 noundef %46)
  br label %174

47:                                               ; preds = %38
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.JksEntry_st, ptr %52, i32 0, i32 1
  %54 = call i32 @jks_buffer_read_string(ptr noundef %51, ptr noundef %53)
  store i32 %54, ptr %8, align 4, !tbaa !9
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %50
  %58 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 229, i32 noundef %58)
  br label %174

59:                                               ; preds = %50
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.JksEntry_st, ptr %64, i32 0, i32 2
  %66 = call i32 @jks_buffer_read_long(ptr noundef %63, ptr noundef %65)
  store i32 %66, ptr %8, align 4, !tbaa !9
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %71

69:                                               ; preds = %62
  %70 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 231, i32 noundef %70)
  br label %174

71:                                               ; preds = %62
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.JksEntry_st, ptr %74, i32 0, i32 0
  %76 = load i32, ptr %75, align 8, !tbaa !11
  switch i32 %76, label %170 [
    i32 1, label %77
    i32 2, label %156
  ]

77:                                               ; preds = %73
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call i32 @jks_buffer_read_data(ptr noundef %79, ptr noundef %9)
  store i32 %80, ptr %8, align 4, !tbaa !9
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %78
  %84 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 237, i32 noundef %84)
  br label %174

85:                                               ; preds = %78
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = call ptr @get_EncryptedPrivateKeyInfo_desc()
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = call ptr @asn_decode_ba_with_alloc(ptr noundef %89, ptr noundef %90)
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.JksEntry_st, ptr %92, i32 0, i32 3
  store ptr %91, ptr %93, align 8, !tbaa !14
  %94 = icmp eq ptr null, %91
  br i1 %94, label %95, label %97

95:                                               ; preds = %88
  store i32 2, ptr %8, align 4, !tbaa !9
  %96 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 238, i32 noundef %96)
  br label %174

97:                                               ; preds = %88
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = call i32 @jks_buffer_read_int(ptr noundef %101, ptr noundef %11)
  store i32 %102, ptr %8, align 4, !tbaa !9
  %103 = load i32, ptr %8, align 4, !tbaa !9
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %100
  %106 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 240, i32 noundef %106)
  br label %174

107:                                              ; preds = %100
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = icmp ugt i32 %110, 0
  br i1 %111, label %112, label %155

112:                                              ; preds = %109
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = call ptr @jks_entry_certs_alloc(i32 noundef %114)
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.JksEntry_st, ptr %116, i32 0, i32 4
  store ptr %115, ptr %117, align 8, !tbaa !15
  %118 = icmp eq ptr null, %115
  br i1 %118, label %119, label %121

119:                                              ; preds = %113
  store i32 2, ptr %8, align 4, !tbaa !9
  %120 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 242, i32 noundef %120)
  br label %174

121:                                              ; preds = %113
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %149, %123
  %125 = load i32, ptr %12, align 4, !tbaa !9
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = icmp ult i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 24, ptr %13, align 4
  br label %152

129:                                              ; preds = %124
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.JksEntry_st, ptr %133, i32 0, i32 4
  %135 = load ptr, ptr %134, align 8, !tbaa !15
  %136 = getelementptr inbounds %struct.JksCertificaties_st, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !16
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = zext i32 %138 to i64
  %140 = getelementptr inbounds ptr, ptr %137, i64 %139
  %141 = call i32 @jks_entry_cert_read(ptr noundef %131, i32 noundef %132, ptr noundef %140)
  store i32 %141, ptr %8, align 4, !tbaa !9
  %142 = load i32, ptr %8, align 4, !tbaa !9
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %146

144:                                              ; preds = %130
  %145 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 244, i32 noundef %145)
  store i32 4, ptr %13, align 4
  br label %152

146:                                              ; preds = %130
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = add i32 %150, 1
  store i32 %151, ptr %12, align 4, !tbaa !9
  br label %124, !llvm.loop !18

152:                                              ; preds = %144, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %153 = load i32, ptr %13, align 4
  switch i32 %153, label %178 [
    i32 24, label %154
    i32 4, label %174
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154, %109
  br label %171

156:                                              ; preds = %73
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = load i32, ptr %6, align 4, !tbaa !9
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.JksEntry_st, ptr %160, i32 0, i32 3
  %162 = call i32 @jks_entry_cert_read(ptr noundef %158, i32 noundef %159, ptr noundef %161)
  store i32 %162, ptr %8, align 4, !tbaa !9
  %163 = load i32, ptr %8, align 4, !tbaa !9
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %167

165:                                              ; preds = %157
  %166 = load i32, ptr %8, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 250, i32 noundef %166)
  br label %174

167:                                              ; preds = %157
  br label %168

168:                                              ; preds = %167
  br label %169

169:                                              ; preds = %168
  br label %171

170:                                              ; preds = %73
  br label %171

171:                                              ; preds = %170, %169, %155
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %172, ptr %173, align 8, !tbaa !5
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %174

174:                                              ; preds = %171, %165, %152, %119, %105, %95, %83, %69, %57, %45, %33, %25, %17
  %175 = load ptr, ptr %10, align 8, !tbaa !5
  call void @jks_entry_free(ptr noundef %175)
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ba_free(ptr noundef %176)
  %177 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %177, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %178

178:                                              ; preds = %174, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %179 = load i32, ptr %4, align 4
  ret i32 %179
}

declare i32 @jks_buffer_read_int(ptr noundef, ptr noundef) #3

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #3

declare i32 @jks_buffer_read_string(ptr noundef, ptr noundef) #3

declare i32 @jks_buffer_read_long(ptr noundef, ptr noundef) #3

declare i32 @jks_buffer_read_data(ptr noundef, ptr noundef) #3

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) #3

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

declare void @ba_free(ptr noundef) #3

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 = { nounwind allocsize(0,1) "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(0,1) }

!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 0}
!12 = !{!"JksEntry_st", !10, i64 0, !6, i64 8, !13, i64 16, !7, i64 24, !6, i64 32}
!13 = !{!"long", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!12, !6, i64 32}
!16 = !{!17, !6, i64 0}
!17 = !{!"JksCertificaties_st", !6, i64 0, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"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"

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

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

declare ptr @get_EncryptedPrivateKeyInfo_desc() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @jks_entry_read(ptr noundef %0, i32 noundef %1, ptr noundef writeonly %2) local_unnamed_addr #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %3
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 221, i32 noundef 2, ptr noundef null) #4
  br label %60

7:                                                ; preds = %3
  %.not66 = icmp eq ptr %2, null
  br i1 %.not66, label %8, label %9

8:                                                ; preds = %7
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 222, i32 noundef 2, ptr noundef null) #4
  br label %60

9:                                                ; preds = %7
  %10 = tail call noalias dereferenceable_or_null(40) ptr @calloc(i64 noundef 1, i64 noundef 40) #5
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %9
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 224, i32 noundef 1, ptr noundef null) #4
  br label %60

13:                                               ; preds = %9
  %14 = tail call i32 @jks_buffer_read_int(ptr noundef nonnull %0, ptr noundef nonnull %10) #4
  %.not67 = icmp eq i32 %14, 0
  br i1 %.not67, label %16, label %15

15:                                               ; preds = %13
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 227, i32 noundef %14) #4
  br label %60

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %10, i64 8
  %18 = tail call i32 @jks_buffer_read_string(ptr noundef nonnull %0, ptr noundef nonnull %17) #4
  %.not68 = icmp eq i32 %18, 0
  br i1 %.not68, label %20, label %19

19:                                               ; preds = %16
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 229, i32 noundef %18) #4
  br label %60

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %10, i64 16
  %22 = tail call i32 @jks_buffer_read_long(ptr noundef nonnull %0, ptr noundef nonnull %21) #4
  %.not69 = icmp eq i32 %22, 0
  br i1 %.not69, label %24, label %23

23:                                               ; preds = %20
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 231, i32 noundef %22) #4
  br label %60

24:                                               ; preds = %20
  %25 = load i32, ptr %10, align 8, !tbaa !11
  switch i32 %25, label %.thread [
    i32 1, label %26
    i32 2, label %56
  ]

26:                                               ; preds = %24
  store i32 0, ptr %5, align 4, !tbaa !9
  %27 = call i32 @jks_buffer_read_data(ptr noundef nonnull %0, ptr noundef nonnull %4) #4
  %.not71 = icmp eq i32 %27, 0
  br i1 %.not71, label %29, label %28

28:                                               ; preds = %26
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 237, i32 noundef %27) #4
  br label %60

29:                                               ; preds = %26
  %30 = call ptr @get_EncryptedPrivateKeyInfo_desc() #4
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call ptr @asn_decode_ba_with_alloc(ptr noundef %30, ptr noundef %31) #4
  %33 = getelementptr inbounds i8, ptr %10, i64 24
  store ptr %32, ptr %33, align 8, !tbaa !14
  %34 = icmp eq ptr %32, null
  br i1 %34, label %35, label %36

35:                                               ; preds = %29
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 238, i32 noundef 2) #4
  br label %60

36:                                               ; preds = %29
  %37 = call i32 @jks_buffer_read_int(ptr noundef nonnull %0, ptr noundef nonnull %5) #4
  %.not72 = icmp eq i32 %37, 0
  br i1 %.not72, label %39, label %38

38:                                               ; preds = %36
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 240, i32 noundef %37) #4
  br label %60

39:                                               ; preds = %36
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %.not73 = icmp eq i32 %40, 0
  br i1 %.not73, label %.thread, label %41

41:                                               ; preds = %39
  %42 = call ptr @jks_entry_certs_alloc(i32 noundef %40)
  %43 = getelementptr inbounds i8, ptr %10, i64 32
  store ptr %42, ptr %43, align 8, !tbaa !15
  %44 = icmp eq ptr %42, null
  br i1 %44, label %46, label %.preheader

.preheader:                                       ; preds = %41
  %45 = load i32, ptr %5, align 4, !tbaa !9
  %.not78 = icmp eq i32 %45, 0
  br i1 %.not78, label %.thread, label %.lr.ph

46:                                               ; preds = %41
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 242, i32 noundef 2) #4
  br label %60

47:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = icmp ult i64 %indvars.iv.next, %49
  br i1 %50, label %.lr.ph, label %.thread, !llvm.loop !16

.lr.ph:                                           ; preds = %.preheader, %47
  %indvars.iv = phi i64 [ %indvars.iv.next, %47 ], [ 0, %.preheader ]
  %51 = load ptr, ptr %43, align 8, !tbaa !15
  %52 = load ptr, ptr %51, align 8, !tbaa !18
  %53 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv
  %54 = call i32 @jks_entry_cert_read(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %53)
  %.not74 = icmp eq i32 %54, 0
  br i1 %.not74, label %47, label %55

55:                                               ; preds = %.lr.ph
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 244, i32 noundef %54) #4
  br label %60

56:                                               ; preds = %24
  %57 = getelementptr inbounds i8, ptr %10, i64 24
  %58 = tail call i32 @jks_entry_cert_read(ptr noundef nonnull %0, i32 noundef %1, ptr noundef nonnull %57)
  %.not70 = icmp eq i32 %58, 0
  br i1 %.not70, label %.thread, label %59

59:                                               ; preds = %56
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 250, i32 noundef %58) #4
  br label %60

.thread:                                          ; preds = %47, %.preheader, %24, %56, %39
  store ptr %10, ptr %2, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %6, %8, %12, %15, %19, %23, %28, %35, %38, %46, %59, %.thread, %55
  %.3 = phi i32 [ 1, %12 ], [ %14, %15 ], [ %18, %19 ], [ %22, %23 ], [ 0, %.thread ], [ %58, %59 ], [ %27, %28 ], [ 2, %35 ], [ %37, %38 ], [ 2, %46 ], [ %54, %55 ], [ 2, %8 ], [ 2, %6 ]
  %.047 = phi ptr [ null, %12 ], [ %10, %15 ], [ %10, %19 ], [ %10, %23 ], [ null, %.thread ], [ %10, %59 ], [ %10, %28 ], [ %10, %35 ], [ %10, %38 ], [ %10, %46 ], [ %10, %55 ], [ null, %8 ], [ null, %6 ]
  call void @jks_entry_free(ptr noundef %.047)
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  call void @ba_free(ptr noundef %61) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret i32 %.3
}

declare i32 @jks_buffer_read_int(ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare i32 @jks_buffer_read_string(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @jks_buffer_read_long(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @jks_buffer_read_data(ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare void @ba_free(ptr noundef) local_unnamed_addr #3

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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(0,1) }

!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 0}
!12 = !{!"JksEntry_st", !10, i64 0, !6, i64 8, !13, i64 16, !7, i64 24, !6, i64 32}
!13 = !{!"long", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!12, !6, i64 32}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !6, i64 0}
!19 = !{!"JksCertificaties_st", !6, i64 0, !10, i64 8}


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