; LLVM IR from tleonhardt/practical_cryptography_engineering :: mbedtls (x509_crl)

; 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.mbedtls_asn1_buf = type { i32, i64, ptr }
%struct.mbedtls_x509_crl = type { %struct.mbedtls_asn1_buf, %struct.mbedtls_asn1_buf, i32, %struct.mbedtls_asn1_buf, %struct.mbedtls_asn1_buf, %struct.mbedtls_asn1_named_data, %struct.mbedtls_x509_time, %struct.mbedtls_x509_time, %struct.mbedtls_x509_crl_entry, %struct.mbedtls_asn1_buf, %struct.mbedtls_asn1_buf, %struct.mbedtls_asn1_buf, i32, i32, ptr, ptr }
%struct.mbedtls_asn1_named_data = type { %struct.mbedtls_asn1_buf, %struct.mbedtls_asn1_buf, ptr, i8 }
%struct.mbedtls_x509_time = type { i32, i32, i32, i32, i32, i32 }
%struct.mbedtls_x509_crl_entry = type { %struct.mbedtls_asn1_buf, %struct.mbedtls_asn1_buf, %struct.mbedtls_x509_time, %struct.mbedtls_asn1_buf, ptr }

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

20:                                               ; preds = %3
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %20, %3
  store i32 -10240, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

24:                                               ; preds = %20
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 24, i1 false)
  br label %25

25:                                               ; preds = %37, %24
  %26 = load ptr, ptr %15, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %26, i32 0, i32 2
  %28 = load i32, ptr %27, align 8, !tbaa !11
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %35

30:                                               ; preds = %25
  %31 = load ptr, ptr %15, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %31, i32 0, i32 15
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %34 = icmp ne ptr %33, null
  br label %35

35:                                               ; preds = %30, %25
  %36 = phi i1 [ false, %25 ], [ %34, %30 ]
  br i1 %36, label %37, label %41

37:                                               ; preds = %35
  %38 = load ptr, ptr %15, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %38, i32 0, i32 15
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  store ptr %40, ptr %15, align 8, !tbaa !5
  br label %25, !llvm.loop !19

41:                                               ; preds = %35
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %42, i32 0, i32 2
  %44 = load i32, ptr %43, align 8, !tbaa !11
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %68

46:                                               ; preds = %41
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %47, i32 0, i32 15
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %68

51:                                               ; preds = %46
  %52 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 416) #8
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %53, i32 0, i32 15
  store ptr %52, ptr %54, align 8, !tbaa !18
  %55 = load ptr, ptr %15, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %55, i32 0, i32 15
  %57 = load ptr, ptr %56, align 8, !tbaa !18
  %58 = icmp eq ptr %57, null
  br i1 %58, label %59, label %61

59:                                               ; preds = %51
  %60 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %60)
  store i32 -10368, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

61:                                               ; preds = %51
  %62 = load ptr, ptr %15, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %62, i32 0, i32 15
  %64 = load ptr, ptr %63, align 8, !tbaa !18
  call void @mbedtls_x509_crl_init(ptr noundef %64)
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %65, i32 0, i32 15
  %67 = load ptr, ptr %66, align 8, !tbaa !18
  store ptr %67, ptr %15, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %61, %46, %41
  %69 = load i64, ptr %7, align 8, !tbaa !9
  %70 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %69) #8
  store ptr %70, ptr %10, align 8, !tbaa !5
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  store i32 -10368, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

73:                                               ; preds = %68
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i64, ptr %7, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %74, ptr align 1 %75, i64 %76, i1 false)
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %79, i32 0, i32 2
  store ptr %77, ptr %80, align 8, !tbaa !21
  %81 = load i64, ptr %7, align 8, !tbaa !9
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %83, i32 0, i32 1
  store i64 %81, ptr %84, align 8, !tbaa !22
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = load i64, ptr %7, align 8, !tbaa !9
  %87 = getelementptr inbounds i8, ptr %85, i64 %86
  store ptr %87, ptr %11, align 8, !tbaa !5
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = call i32 @mbedtls_asn1_get_tag(ptr noundef %10, ptr noundef %88, ptr noundef %9, i32 noundef 48)
  store i32 %89, ptr %8, align 4, !tbaa !23
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %93

91:                                               ; preds = %73
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %92)
  store i32 -8576, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

93:                                               ; preds = %73
  %94 = load i64, ptr %9, align 8, !tbaa !9
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = ptrtoint ptr %95 to i64
  %98 = ptrtoint ptr %96 to i64
  %99 = sub i64 %97, %98
  %100 = icmp ne i64 %94, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %93
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %102)
  store i32 -8678, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

103:                                              ; preds = %93
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %106, i32 0, i32 2
  store ptr %104, ptr %107, align 8, !tbaa !24
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = call i32 @mbedtls_asn1_get_tag(ptr noundef %10, ptr noundef %108, ptr noundef %9, i32 noundef 48)
  store i32 %109, ptr %8, align 4, !tbaa !23
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %115

111:                                              ; preds = %103
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %112)
  %113 = load i32, ptr %8, align 4, !tbaa !23
  %114 = add nsw i32 -8576, %113
  store i32 %114, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

115:                                              ; preds = %103
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = load i64, ptr %9, align 8, !tbaa !9
  %118 = getelementptr inbounds i8, ptr %116, i64 %117
  store ptr %118, ptr %11, align 8, !tbaa !5
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = load ptr, ptr %15, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %120, i32 0, i32 1
  %122 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %121, i32 0, i32 2
  %123 = load ptr, ptr %122, align 8, !tbaa !24
  %124 = ptrtoint ptr %119 to i64
  %125 = ptrtoint ptr %123 to i64
  %126 = sub i64 %124, %125
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %127, i32 0, i32 1
  %129 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %128, i32 0, i32 1
  store i64 %126, ptr %129, align 8, !tbaa !25
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = load ptr, ptr %15, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %131, i32 0, i32 2
  %133 = call i32 @x509_crl_get_version(ptr noundef %10, ptr noundef %130, ptr noundef %132)
  store i32 %133, ptr %8, align 4, !tbaa !23
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %141, label %135

135:                                              ; preds = %115
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %137, i32 0, i32 3
  %139 = call i32 @mbedtls_x509_get_alg(ptr noundef %10, ptr noundef %136, ptr noundef %138, ptr noundef %12)
  store i32 %139, ptr %8, align 4, !tbaa !23
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %144

141:                                              ; preds = %135, %115
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %142)
  %143 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %143, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

144:                                              ; preds = %135
  %145 = load ptr, ptr %15, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %145, i32 0, i32 2
  %147 = load i32, ptr %146, align 8, !tbaa !11
  %148 = icmp slt i32 %147, 0
  br i1 %148, label %154, label %149

149:                                              ; preds = %144
  %150 = load ptr, ptr %15, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %150, i32 0, i32 2
  %152 = load i32, ptr %151, align 8, !tbaa !11
  %153 = icmp sgt i32 %152, 1
  br i1 %153, label %154, label %156

154:                                              ; preds = %149, %144
  %155 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %155)
  store i32 -9600, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

156:                                              ; preds = %149
  %157 = load ptr, ptr %15, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %157, i32 0, i32 2
  %159 = load i32, ptr %158, align 8, !tbaa !11
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %158, align 8, !tbaa !11
  %161 = load ptr, ptr %15, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %161, i32 0, i32 3
  %163 = load ptr, ptr %15, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %163, i32 0, i32 12
  %165 = load ptr, ptr %15, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %165, i32 0, i32 13
  %167 = load ptr, ptr %15, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %167, i32 0, i32 14
  %169 = call i32 @mbedtls_x509_get_sig_alg(ptr noundef %162, ptr noundef %12, ptr noundef %164, ptr noundef %166, ptr noundef %168)
  store i32 %169, ptr %8, align 4, !tbaa !23
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %173

171:                                              ; preds = %156
  %172 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %172)
  store i32 -9728, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

173:                                              ; preds = %156
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = load ptr, ptr %15, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %175, i32 0, i32 4
  %177 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %176, i32 0, i32 2
  store ptr %174, ptr %177, align 8, !tbaa !26
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = call i32 @mbedtls_asn1_get_tag(ptr noundef %10, ptr noundef %178, ptr noundef %9, i32 noundef 48)
  store i32 %179, ptr %8, align 4, !tbaa !23
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %185

181:                                              ; preds = %173
  %182 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %182)
  %183 = load i32, ptr %8, align 4, !tbaa !23
  %184 = add nsw i32 -8576, %183
  store i32 %184, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

185:                                              ; preds = %173
  %186 = load ptr, ptr %10, align 8, !tbaa !5
  %187 = load i64, ptr %9, align 8, !tbaa !9
  %188 = getelementptr inbounds i8, ptr %186, i64 %187
  %189 = load ptr, ptr %15, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %189, i32 0, i32 5
  %191 = call i32 @mbedtls_x509_get_name(ptr noundef %10, ptr noundef %188, ptr noundef %190)
  store i32 %191, ptr %8, align 4, !tbaa !23
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %196

193:                                              ; preds = %185
  %194 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %194)
  %195 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %195, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

196:                                              ; preds = %185
  %197 = load ptr, ptr %10, align 8, !tbaa !5
  %198 = load ptr, ptr %15, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %198, i32 0, i32 4
  %200 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %199, i32 0, i32 2
  %201 = load ptr, ptr %200, align 8, !tbaa !26
  %202 = ptrtoint ptr %197 to i64
  %203 = ptrtoint ptr %201 to i64
  %204 = sub i64 %202, %203
  %205 = load ptr, ptr %15, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %205, i32 0, i32 4
  %207 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %206, i32 0, i32 1
  store i64 %204, ptr %207, align 8, !tbaa !27
  %208 = load ptr, ptr %11, align 8, !tbaa !5
  %209 = load ptr, ptr %15, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %209, i32 0, i32 6
  %211 = call i32 @mbedtls_x509_get_time(ptr noundef %10, ptr noundef %208, ptr noundef %210)
  store i32 %211, ptr %8, align 4, !tbaa !23
  %212 = icmp ne i32 %211, 0
  br i1 %212, label %213, label %216

213:                                              ; preds = %196
  %214 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %214)
  %215 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %215, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

216:                                              ; preds = %196
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  %218 = load ptr, ptr %15, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %218, i32 0, i32 7
  %220 = call i32 @mbedtls_x509_get_time(ptr noundef %10, ptr noundef %217, ptr noundef %219)
  store i32 %220, ptr %8, align 4, !tbaa !23
  %221 = icmp ne i32 %220, 0
  br i1 %221, label %222, label %232

222:                                              ; preds = %216
  %223 = load i32, ptr %8, align 4, !tbaa !23
  %224 = icmp ne i32 %223, -9314
  br i1 %224, label %225, label %231

225:                                              ; preds = %222
  %226 = load i32, ptr %8, align 4, !tbaa !23
  %227 = icmp ne i32 %226, -9312
  br i1 %227, label %228, label %231

228:                                              ; preds = %225
  %229 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %229)
  %230 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %230, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

231:                                              ; preds = %225, %222
  br label %232

232:                                              ; preds = %231, %216
  %233 = load ptr, ptr %11, align 8, !tbaa !5
  %234 = load ptr, ptr %15, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %234, i32 0, i32 8
  %236 = call i32 @x509_get_entries(ptr noundef %10, ptr noundef %233, ptr noundef %235)
  store i32 %236, ptr %8, align 4, !tbaa !23
  %237 = icmp ne i32 %236, 0
  br i1 %237, label %238, label %241

238:                                              ; preds = %232
  %239 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %239)
  %240 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %240, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

241:                                              ; preds = %232
  %242 = load ptr, ptr %15, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %242, i32 0, i32 2
  %244 = load i32, ptr %243, align 8, !tbaa !11
  %245 = icmp eq i32 %244, 2
  br i1 %245, label %246, label %257

246:                                              ; preds = %241
  %247 = load ptr, ptr %11, align 8, !tbaa !5
  %248 = load ptr, ptr %15, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %248, i32 0, i32 9
  %250 = call i32 @x509_get_crl_ext(ptr noundef %10, ptr noundef %247, ptr noundef %249)
  store i32 %250, ptr %8, align 4, !tbaa !23
  %251 = load i32, ptr %8, align 4, !tbaa !23
  %252 = icmp ne i32 %251, 0
  br i1 %252, label %253, label %256

253:                                              ; preds = %246
  %254 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %254)
  %255 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %255, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

256:                                              ; preds = %246
  br label %257

257:                                              ; preds = %256, %241
  %258 = load ptr, ptr %10, align 8, !tbaa !5
  %259 = load ptr, ptr %11, align 8, !tbaa !5
  %260 = icmp ne ptr %258, %259
  br i1 %260, label %261, label %263

261:                                              ; preds = %257
  %262 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %262)
  store i32 -8678, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

263:                                              ; preds = %257
  %264 = load ptr, ptr %15, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %264, i32 0, i32 0
  %266 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %265, i32 0, i32 2
  %267 = load ptr, ptr %266, align 8, !tbaa !21
  %268 = load ptr, ptr %15, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %268, i32 0, i32 0
  %270 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %269, i32 0, i32 1
  %271 = load i64, ptr %270, align 8, !tbaa !22
  %272 = getelementptr inbounds i8, ptr %267, i64 %271
  store ptr %272, ptr %11, align 8, !tbaa !5
  %273 = load ptr, ptr %11, align 8, !tbaa !5
  %274 = call i32 @mbedtls_x509_get_alg(ptr noundef %10, ptr noundef %273, ptr noundef %14, ptr noundef %13)
  store i32 %274, ptr %8, align 4, !tbaa !23
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %276, label %279

276:                                              ; preds = %263
  %277 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %277)
  %278 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %278, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

279:                                              ; preds = %263
  %280 = load ptr, ptr %15, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %280, i32 0, i32 3
  %282 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %281, i32 0, i32 1
  %283 = load i64, ptr %282, align 8, !tbaa !28
  %284 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %14, i32 0, i32 1
  %285 = load i64, ptr %284, align 8, !tbaa !29
  %286 = icmp ne i64 %283, %285
  br i1 %286, label %319, label %287

287:                                              ; preds = %279
  %288 = load ptr, ptr %15, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %288, i32 0, i32 3
  %290 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %289, i32 0, i32 2
  %291 = load ptr, ptr %290, align 8, !tbaa !30
  %292 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %14, i32 0, i32 2
  %293 = load ptr, ptr %292, align 8, !tbaa !31
  %294 = load ptr, ptr %15, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %294, i32 0, i32 3
  %296 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %295, i32 0, i32 1
  %297 = load i64, ptr %296, align 8, !tbaa !28
  %298 = call i32 @memcmp(ptr noundef %291, ptr noundef %293, i64 noundef %297) #9
  %299 = icmp ne i32 %298, 0
  br i1 %299, label %319, label %300

300:                                              ; preds = %287
  %301 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %12, i32 0, i32 1
  %302 = load i64, ptr %301, align 8, !tbaa !29
  %303 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %13, i32 0, i32 1
  %304 = load i64, ptr %303, align 8, !tbaa !29
  %305 = icmp ne i64 %302, %304
  br i1 %305, label %319, label %306

306:                                              ; preds = %300
  %307 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %12, i32 0, i32 1
  %308 = load i64, ptr %307, align 8, !tbaa !29
  %309 = icmp ne i64 %308, 0
  br i1 %309, label %310, label %321

310:                                              ; preds = %306
  %311 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %12, i32 0, i32 2
  %312 = load ptr, ptr %311, align 8, !tbaa !31
  %313 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %13, i32 0, i32 2
  %314 = load ptr, ptr %313, align 8, !tbaa !31
  %315 = getelementptr inbounds %struct.mbedtls_asn1_buf, ptr %12, i32 0, i32 1
  %316 = load i64, ptr %315, align 8, !tbaa !29
  %317 = call i32 @memcmp(ptr noundef %312, ptr noundef %314, i64 noundef %316) #9
  %318 = icmp ne i32 %317, 0
  br i1 %318, label %319, label %321

319:                                              ; preds = %310, %300, %287, %279
  %320 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %320)
  store i32 -9856, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

321:                                              ; preds = %310, %306
  %322 = load ptr, ptr %11, align 8, !tbaa !5
  %323 = load ptr, ptr %15, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.mbedtls_x509_crl, ptr %323, i32 0, i32 11
  %325 = call i32 @mbedtls_x509_get_sig(ptr noundef %10, ptr noundef %322, ptr noundef %324)
  store i32 %325, ptr %8, align 4, !tbaa !23
  %326 = icmp ne i32 %325, 0
  br i1 %326, label %327, label %330

327:                                              ; preds = %321
  %328 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %328)
  %329 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %329, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

330:                                              ; preds = %321
  %331 = load ptr, ptr %10, align 8, !tbaa !5
  %332 = load ptr, ptr %11, align 8, !tbaa !5
  %333 = icmp ne ptr %331, %332
  br i1 %333, label %334, label %336

334:                                              ; preds = %330
  %335 = load ptr, ptr %15, align 8, !tbaa !5
  call void @mbedtls_x509_crl_free(ptr noundef %335)
  store i32 -8678, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

336:                                              ; preds = %330
  store i32 0, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %337

337:                                              ; preds = %336, %334, %327, %319, %276, %261, %253, %238, %228, %213, %193, %181, %171, %154, %141, %111, %101, %91, %72, %59, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %338 = load i32, ptr %4, align 4
  ret i32 %338
}

; 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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @mbedtls_x509_crl_init(ptr noundef) #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) #4

declare i32 @mbedtls_asn1_get_tag(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

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

declare i32 @mbedtls_x509_get_alg(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #5

declare i32 @mbedtls_x509_get_sig_alg(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #5

declare i32 @mbedtls_x509_get_name(ptr noundef, ptr noundef, ptr noundef) #5

declare i32 @mbedtls_x509_get_time(ptr noundef, ptr noundef, ptr noundef) #5

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

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

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

declare i32 @mbedtls_x509_get_sig(ptr noundef, ptr noundef, ptr noundef) #5

; 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 allocsize(0,1) }
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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !14, i64 48}
!12 = !{!"mbedtls_x509_crl", !13, i64 0, !13, i64 24, !14, i64 48, !13, i64 56, !13, i64 80, !15, i64 104, !16, i64 168, !16, i64 192, !17, i64 216, !13, i64 320, !13, i64 344, !13, i64 368, !14, i64 392, !14, i64 396, !6, i64 400, !6, i64 408}
!13 = !{!"mbedtls_asn1_buf", !14, i64 0, !10, i64 8, !6, i64 16}
!14 = !{!"int", !7, i64 0}
!15 = !{!"mbedtls_asn1_named_data", !13, i64 0, !13, i64 24, !6, i64 48, !7, i64 56}
!16 = !{!"mbedtls_x509_time", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!17 = !{!"mbedtls_x509_crl_entry", !13, i64 0, !13, i64 24, !16, i64 48, !13, i64 72, !6, i64 96}
!18 = !{!12, !6, i64 408}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !6, i64 16}
!22 = !{!12, !10, i64 8}
!23 = !{!14, !14, i64 0}
!24 = !{!12, !6, i64 40}
!25 = !{!12, !10, i64 32}
!26 = !{!12, !6, i64 96}
!27 = !{!12, !10, i64 88}
!28 = !{!12, !10, i64 64}
!29 = !{!13, !10, i64 8}
!30 = !{!12, !6, i64 72}
!31 = !{!13, !6, i64 16}


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

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_x509_crl_parse_der(ptr noundef %0, ptr noundef readonly %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.mbedtls_asn1_buf, align 8
  %7 = alloca %struct.mbedtls_asn1_buf, align 8
  %8 = alloca %struct.mbedtls_asn1_buf, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  %9 = icmp eq ptr %0, null
  %10 = icmp eq ptr %1, null
  %or.cond = or i1 %9, %10
  br i1 %or.cond, label %145, label %11

11:                                               ; preds = %3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %8, i8 0, i64 24, i1 false)
  br label %12

12:                                               ; preds = %15, %11
  %.0 = phi ptr [ %0, %11 ], [ %17, %15 ]
  %13 = getelementptr inbounds i8, ptr %.0, i64 48
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %.critedge.thread, label %15

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %.0, i64 408
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %.not116 = icmp eq ptr %17, null
  br i1 %.not116, label %.critedge, label %12, !llvm.loop !17

.critedge:                                        ; preds = %15
  %18 = getelementptr inbounds i8, ptr %.0, i64 408
  %19 = tail call noalias dereferenceable_or_null(416) ptr @calloc(i64 noundef 1, i64 noundef 416) #8
  store ptr %19, ptr %18, align 8, !tbaa !16
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %.critedge
  tail call void @mbedtls_x509_crl_free(ptr noundef nonnull %.0)
  br label %145

22:                                               ; preds = %.critedge
  tail call void @mbedtls_x509_crl_init(ptr noundef nonnull %19)
  %23 = load ptr, ptr %18, align 8, !tbaa !16
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %12, %22
  %.1 = phi ptr [ %23, %22 ], [ %.0, %12 ]
  %24 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %2) #8
  store ptr %24, ptr %5, align 8, !tbaa !19
  %25 = icmp eq ptr %24, null
  br i1 %25, label %145, label %26

26:                                               ; preds = %.critedge.thread
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %24, ptr align 1 %1, i64 %2, i1 false)
  %27 = getelementptr inbounds i8, ptr %.1, i64 16
  store ptr %24, ptr %27, align 8, !tbaa !20
  %28 = getelementptr inbounds i8, ptr %.1, i64 8
  store i64 %2, ptr %28, align 8, !tbaa !21
  %29 = getelementptr inbounds i8, ptr %24, i64 %2
  %30 = call i32 @mbedtls_asn1_get_tag(ptr noundef nonnull %5, ptr noundef nonnull %29, ptr noundef nonnull %4, i32 noundef 48) #7
  %.not118 = icmp eq i32 %30, 0
  br i1 %.not118, label %32, label %31

31:                                               ; preds = %26
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

32:                                               ; preds = %26
  %33 = load i64, ptr %4, align 8, !tbaa !22
  %34 = load ptr, ptr %5, align 8, !tbaa !19
  %35 = ptrtoint ptr %29 to i64
  %36 = ptrtoint ptr %34 to i64
  %37 = sub i64 %35, %36
  %.not119 = icmp eq i64 %33, %37
  br i1 %.not119, label %39, label %38

38:                                               ; preds = %32
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

39:                                               ; preds = %32
  %40 = getelementptr inbounds i8, ptr %.1, i64 40
  store ptr %34, ptr %40, align 8, !tbaa !23
  %41 = call i32 @mbedtls_asn1_get_tag(ptr noundef nonnull %5, ptr noundef nonnull %29, ptr noundef nonnull %4, i32 noundef 48) #7
  %.not120 = icmp eq i32 %41, 0
  br i1 %.not120, label %44, label %42

42:                                               ; preds = %39
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  %43 = add nsw i32 %41, -8576
  br label %145

44:                                               ; preds = %39
  %45 = load ptr, ptr %5, align 8, !tbaa !19
  %46 = load i64, ptr %4, align 8, !tbaa !22
  %47 = getelementptr inbounds i8, ptr %45, i64 %46
  %48 = load ptr, ptr %40, align 8, !tbaa !23
  %49 = ptrtoint ptr %47 to i64
  %50 = ptrtoint ptr %48 to i64
  %51 = sub i64 %49, %50
  %52 = getelementptr inbounds i8, ptr %.1, i64 32
  store i64 %51, ptr %52, align 8, !tbaa !24
  %53 = getelementptr inbounds i8, ptr %.1, i64 48
  %54 = call i32 @x509_crl_get_version(ptr noundef nonnull %5, ptr noundef %47, ptr noundef nonnull %53)
  %.not121 = icmp eq i32 %54, 0
  br i1 %.not121, label %55, label %58

55:                                               ; preds = %44
  %56 = getelementptr inbounds i8, ptr %.1, i64 56
  %57 = call i32 @mbedtls_x509_get_alg(ptr noundef nonnull %5, ptr noundef %47, ptr noundef nonnull %56, ptr noundef nonnull %6) #7
  %.not122 = icmp eq i32 %57, 0
  br i1 %.not122, label %59, label %58

58:                                               ; preds = %55, %44
  %.095 = phi i32 [ %54, %44 ], [ %57, %55 ]
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

59:                                               ; preds = %55
  %60 = load i32, ptr %53, align 8, !tbaa !5
  %or.cond140 = icmp ugt i32 %60, 1
  br i1 %or.cond140, label %61, label %62

61:                                               ; preds = %59
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

62:                                               ; preds = %59
  %63 = add nuw nsw i32 %60, 1
  store i32 %63, ptr %53, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %.1, i64 392
  %65 = getelementptr inbounds i8, ptr %.1, i64 396
  %66 = getelementptr inbounds i8, ptr %.1, i64 400
  %67 = call i32 @mbedtls_x509_get_sig_alg(ptr noundef nonnull %56, ptr noundef nonnull %6, ptr noundef nonnull %64, ptr noundef nonnull %65, ptr noundef nonnull %66) #7
  %.not123 = icmp eq i32 %67, 0
  br i1 %.not123, label %69, label %68

68:                                               ; preds = %62
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

69:                                               ; preds = %62
  %70 = load ptr, ptr %5, align 8, !tbaa !19
  %71 = getelementptr inbounds i8, ptr %.1, i64 96
  store ptr %70, ptr %71, align 8, !tbaa !25
  %72 = call i32 @mbedtls_asn1_get_tag(ptr noundef nonnull %5, ptr noundef %47, ptr noundef nonnull %4, i32 noundef 48) #7
  %.not124 = icmp eq i32 %72, 0
  br i1 %.not124, label %75, label %73

73:                                               ; preds = %69
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  %74 = add nsw i32 %72, -8576
  br label %145

75:                                               ; preds = %69
  %76 = load ptr, ptr %5, align 8, !tbaa !19
  %77 = load i64, ptr %4, align 8, !tbaa !22
  %78 = getelementptr inbounds i8, ptr %76, i64 %77
  %79 = getelementptr inbounds i8, ptr %.1, i64 104
  %80 = call i32 @mbedtls_x509_get_name(ptr noundef nonnull %5, ptr noundef %78, ptr noundef nonnull %79) #7
  %.not125 = icmp eq i32 %80, 0
  br i1 %.not125, label %82, label %81

81:                                               ; preds = %75
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

82:                                               ; preds = %75
  %83 = load ptr, ptr %5, align 8, !tbaa !19
  %84 = load ptr, ptr %71, align 8, !tbaa !25
  %85 = ptrtoint ptr %83 to i64
  %86 = ptrtoint ptr %84 to i64
  %87 = sub i64 %85, %86
  %88 = getelementptr inbounds i8, ptr %.1, i64 88
  store i64 %87, ptr %88, align 8, !tbaa !26
  %89 = getelementptr inbounds i8, ptr %.1, i64 168
  %90 = call i32 @mbedtls_x509_get_time(ptr noundef nonnull %5, ptr noundef %47, ptr noundef nonnull %89) #7
  %.not126 = icmp eq i32 %90, 0
  br i1 %.not126, label %92, label %91

91:                                               ; preds = %82
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

92:                                               ; preds = %82
  %93 = getelementptr inbounds i8, ptr %.1, i64 192
  %94 = call i32 @mbedtls_x509_get_time(ptr noundef nonnull %5, ptr noundef %47, ptr noundef nonnull %93) #7
  switch i32 %94, label %95 [
    i32 0, label %96
    i32 -9312, label %96
    i32 -9314, label %96
  ]

95:                                               ; preds = %92
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

96:                                               ; preds = %92, %92, %92
  %97 = getelementptr inbounds i8, ptr %.1, i64 216
  %98 = call i32 @x509_get_entries(ptr noundef nonnull %5, ptr noundef %47, ptr noundef nonnull %97)
  %.not128 = icmp eq i32 %98, 0
  br i1 %.not128, label %100, label %99

99:                                               ; preds = %96
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

100:                                              ; preds = %96
  %101 = load i32, ptr %53, align 8, !tbaa !5
  %102 = icmp eq i32 %101, 2
  br i1 %102, label %103, label %107

103:                                              ; preds = %100
  %104 = getelementptr inbounds i8, ptr %.1, i64 320
  %105 = call i32 @x509_get_crl_ext(ptr noundef nonnull %5, ptr noundef %47, ptr noundef nonnull %104)
  %.not129 = icmp eq i32 %105, 0
  br i1 %.not129, label %107, label %106

106:                                              ; preds = %103
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

107:                                              ; preds = %103, %100
  %108 = load ptr, ptr %5, align 8, !tbaa !19
  %.not130 = icmp eq ptr %108, %47
  br i1 %.not130, label %110, label %109

109:                                              ; preds = %107
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

110:                                              ; preds = %107
  %111 = load ptr, ptr %27, align 8, !tbaa !20
  %112 = load i64, ptr %28, align 8, !tbaa !21
  %113 = getelementptr inbounds i8, ptr %111, i64 %112
  %114 = call i32 @mbedtls_x509_get_alg(ptr noundef nonnull %5, ptr noundef %113, ptr noundef nonnull %8, ptr noundef nonnull %7) #7
  %.not131 = icmp eq i32 %114, 0
  br i1 %.not131, label %116, label %115

115:                                              ; preds = %110
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

116:                                              ; preds = %110
  %117 = getelementptr inbounds i8, ptr %.1, i64 64
  %118 = load i64, ptr %117, align 8, !tbaa !27
  %119 = getelementptr inbounds i8, ptr %8, i64 8
  %120 = load i64, ptr %119, align 8, !tbaa !28
  %.not132 = icmp eq i64 %118, %120
  br i1 %.not132, label %121, label %137

121:                                              ; preds = %116
  %122 = getelementptr inbounds i8, ptr %.1, i64 72
  %123 = load ptr, ptr %122, align 8, !tbaa !29
  %124 = getelementptr inbounds i8, ptr %8, i64 16
  %125 = load ptr, ptr %124, align 8, !tbaa !30
  %bcmp = call i32 @bcmp(ptr %123, ptr %125, i64 %118)
  %.not133 = icmp eq i32 %bcmp, 0
  br i1 %.not133, label %126, label %137

126:                                              ; preds = %121
  %127 = getelementptr inbounds i8, ptr %6, i64 8
  %128 = load i64, ptr %127, align 8, !tbaa !28
  %129 = getelementptr inbounds i8, ptr %7, i64 8
  %130 = load i64, ptr %129, align 8, !tbaa !28
  %.not134 = icmp eq i64 %128, %130
  br i1 %.not134, label %131, label %137

131:                                              ; preds = %126
  %.not135 = icmp eq i64 %128, 0
  br i1 %.not135, label %138, label %132

132:                                              ; preds = %131
  %133 = getelementptr inbounds i8, ptr %6, i64 16
  %134 = load ptr, ptr %133, align 8, !tbaa !30
  %135 = getelementptr inbounds i8, ptr %7, i64 16
  %136 = load ptr, ptr %135, align 8, !tbaa !30
  %bcmp136 = call i32 @bcmp(ptr %134, ptr %136, i64 %128)
  %.not137 = icmp eq i32 %bcmp136, 0
  br i1 %.not137, label %138, label %137

137:                                              ; preds = %132, %126, %121, %116
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

138:                                              ; preds = %132, %131
  %139 = getelementptr inbounds i8, ptr %.1, i64 368
  %140 = call i32 @mbedtls_x509_get_sig(ptr noundef nonnull %5, ptr noundef %113, ptr noundef nonnull %139) #7
  %.not138 = icmp eq i32 %140, 0
  br i1 %.not138, label %142, label %141

141:                                              ; preds = %138
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

142:                                              ; preds = %138
  %143 = load ptr, ptr %5, align 8, !tbaa !19
  %.not139 = icmp eq ptr %143, %113
  br i1 %.not139, label %145, label %144

144:                                              ; preds = %142
  call void @mbedtls_x509_crl_free(ptr noundef nonnull %.1)
  br label %145

145:                                              ; preds = %142, %.critedge.thread, %3, %144, %141, %137, %115, %109, %106, %99, %95, %91, %81, %73, %68, %61, %58, %42, %38, %31, %21
  %.096 = phi i32 [ -10368, %21 ], [ -8576, %31 ], [ -8678, %38 ], [ %43, %42 ], [ %.095, %58 ], [ -9600, %61 ], [ -9728, %68 ], [ %74, %73 ], [ %80, %81 ], [ %90, %91 ], [ %94, %95 ], [ %98, %99 ], [ %105, %106 ], [ -8678, %109 ], [ %114, %115 ], [ -9856, %137 ], [ %140, %141 ], [ -8678, %144 ], [ -10240, %3 ], [ -10368, %.critedge.thread ], [ 0, %142 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  ret i32 %.096
}

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @mbedtls_x509_crl_init(ptr noundef) local_unnamed_addr #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) #4

declare i32 @mbedtls_asn1_get_tag(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

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

declare i32 @mbedtls_x509_get_alg(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @mbedtls_x509_get_sig_alg(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @mbedtls_x509_get_name(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @mbedtls_x509_get_time(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

declare i32 @mbedtls_x509_get_sig(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6

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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #7 = { nounwind }
attributes #8 = { 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, !8, i64 48}
!6 = !{!"mbedtls_x509_crl", !7, i64 0, !7, i64 24, !8, i64 48, !7, i64 56, !7, i64 80, !13, i64 104, !14, i64 168, !14, i64 192, !15, i64 216, !7, i64 320, !7, i64 344, !7, i64 368, !8, i64 392, !8, i64 396, !12, i64 400, !12, i64 408}
!7 = !{!"mbedtls_asn1_buf", !8, i64 0, !11, i64 8, !12, i64 16}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"mbedtls_asn1_named_data", !7, i64 0, !7, i64 24, !12, i64 48, !9, i64 56}
!14 = !{!"mbedtls_x509_time", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20}
!15 = !{!"mbedtls_x509_crl_entry", !7, i64 0, !7, i64 24, !14, i64 48, !7, i64 72, !12, i64 96}
!16 = !{!6, !12, i64 408}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!12, !12, i64 0}
!20 = !{!6, !12, i64 16}
!21 = !{!6, !11, i64 8}
!22 = !{!11, !11, i64 0}
!23 = !{!6, !12, i64 40}
!24 = !{!6, !11, i64 32}
!25 = !{!6, !12, i64 96}
!26 = !{!6, !11, i64 88}
!27 = !{!6, !11, i64 64}
!28 = !{!7, !11, i64 8}
!29 = !{!6, !12, i64 72}
!30 = !{!7, !12, i64 16}


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