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

; 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_ssl_context = type { ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i64, i64, i16, i64, i64, i64, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i64, i64, i8, i32, ptr, ptr, ptr, i64, i32, i64, [12 x i8], [12 x i8] }
%struct.mbedtls_ssl_config = type { [4 x ptr], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.mbedtls_mpi, %struct.mbedtls_mpi, ptr, i64, ptr, i64, ptr, i32, i32, i32, i32, [8 x i8], i32, i32, i8, i8, i8, i8, i32 }
%struct.mbedtls_mpi = type { i32, i64, ptr }

@.str = external hidden unnamed_addr constant [97 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [35 x i8], align 1

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

declare void @mbedtls_debug_print_msg(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

declare void @mbedtls_debug_print_buf(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) #1

declare void @mbedtls_debug_print_ret(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_ssl_fetch_input(ptr noundef, i64 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_ssl_resend(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @mbedtls_ssl_hdr_len(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_ssl_read_record_layer(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %6, i32 0, i32 37
  %8 = load i64, ptr %7, align 8, !tbaa !9
  %9 = icmp ne i64 %8, 0
  br i1 %9, label %10, label %59

10:                                               ; preds = %1
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %11, i32 0, i32 29
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %17

15:                                               ; preds = %10
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %16, i32 noundef 1, ptr noundef @.str, i32 noundef 3800, ptr noundef @.str.4)
  store i32 -27648, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

17:                                               ; preds = %10
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %18, i32 0, i32 37
  %20 = load i64, ptr %19, align 8, !tbaa !9
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %21, i32 0, i32 31
  %23 = load i64, ptr %22, align 8, !tbaa !15
  %24 = icmp ult i64 %20, %23
  br i1 %24, label %25, label %53

25:                                               ; preds = %17
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %26, i32 0, i32 37
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %29, i32 0, i32 31
  %31 = load i64, ptr %30, align 8, !tbaa !15
  %32 = sub i64 %31, %28
  store i64 %32, ptr %30, align 8, !tbaa !15
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %33, i32 0, i32 28
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %36, i32 0, i32 28
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %39, i32 0, i32 37
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %38, i64 %41
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %43, i32 0, i32 31
  %45 = load i64, ptr %44, align 8, !tbaa !15
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %35, ptr align 1 %42, i64 %45, i1 false)
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %47, i32 0, i32 28
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %50, i32 0, i32 31
  %52 = load i64, ptr %51, align 8, !tbaa !15
  call void @mbedtls_debug_print_buf(ptr noundef %46, i32 noundef 4, ptr noundef @.str, i32 noundef 3832, ptr noundef @.str.68, ptr noundef %49, i64 noundef %52)
  br label %56

53:                                               ; preds = %17
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %54, i32 0, i32 31
  store i64 0, ptr %55, align 8, !tbaa !15
  br label %56

56:                                               ; preds = %53, %25
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %57, i32 0, i32 37
  store i64 0, ptr %58, align 8, !tbaa !9
  br label %69

59:                                               ; preds = %1
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %60, i32 0, i32 29
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %65

64:                                               ; preds = %59
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

65:                                               ; preds = %59
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %66, i32 0, i32 31
  store i64 0, ptr %67, align 8, !tbaa !15
  br label %68

68:                                               ; preds = %65
  br label %69

69:                                               ; preds = %68, %56
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %70, i32 0, i32 31
  %72 = load i64, ptr %71, align 8, !tbaa !15
  %73 = icmp ugt i64 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %69
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

75:                                               ; preds = %69
  br label %76

76:                                               ; preds = %216, %121, %75
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = call i64 @mbedtls_ssl_hdr_len(ptr noundef %78)
  %80 = call i32 @mbedtls_ssl_fetch_input(ptr noundef %77, i64 noundef %79)
  store i32 %80, ptr %4, align 4, !tbaa !17
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %86

82:                                               ; preds = %76
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !17
  call void @mbedtls_debug_print_ret(ptr noundef %83, i32 noundef 1, ptr noundef @.str, i32 noundef 3875, ptr noundef @.str.69, i32 noundef %84)
  %85 = load i32, ptr %4, align 4, !tbaa !17
  store i32 %85, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

86:                                               ; preds = %76
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = call i32 @ssl_parse_record_header(ptr noundef %87)
  store i32 %88, ptr %4, align 4, !tbaa !17
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %124

90:                                               ; preds = %86
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %93, i32 0, i32 46
  %95 = load i32, ptr %94, align 4
  %96 = lshr i32 %95, 1
  %97 = and i32 %96, 1
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %122

99:                                               ; preds = %90
  %100 = load i32, ptr %4, align 4, !tbaa !17
  %101 = icmp ne i32 %100, -26496
  br i1 %101, label %102, label %122

102:                                              ; preds = %99
  %103 = load i32, ptr %4, align 4, !tbaa !17
  %104 = icmp eq i32 %103, -26368
  br i1 %104, label %105, label %115

105:                                              ; preds = %102
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %106, i32 0, i32 31
  %108 = load i64, ptr %107, align 8, !tbaa !15
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = call i64 @mbedtls_ssl_hdr_len(ptr noundef %109)
  %111 = add i64 %108, %110
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %112, i32 0, i32 34
  store i64 %111, ptr %113, align 8, !tbaa !19
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %114, i32 noundef 1, ptr noundef @.str, i32 noundef 3892, ptr noundef @.str.70)
  br label %121

115:                                              ; preds = %102
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %116, i32 0, i32 34
  store i64 0, ptr %117, align 8, !tbaa !19
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %118, i32 0, i32 32
  store i64 0, ptr %119, align 8, !tbaa !20
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %120, i32 noundef 1, ptr noundef @.str, i32 noundef 3901, ptr noundef @.str.71)
  br label %121

121:                                              ; preds = %115, %105
  br label %76

122:                                              ; preds = %99, %90
  %123 = load i32, ptr %4, align 4, !tbaa !17
  store i32 %123, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

124:                                              ; preds = %86
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = call i64 @mbedtls_ssl_hdr_len(ptr noundef %126)
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %128, i32 0, i32 31
  %130 = load i64, ptr %129, align 8, !tbaa !15
  %131 = add i64 %127, %130
  %132 = call i32 @mbedtls_ssl_fetch_input(ptr noundef %125, i64 noundef %131)
  store i32 %132, ptr %4, align 4, !tbaa !17
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %138

134:                                              ; preds = %124
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = load i32, ptr %4, align 4, !tbaa !17
  call void @mbedtls_debug_print_ret(ptr noundef %135, i32 noundef 1, ptr noundef @.str, i32 noundef 3917, ptr noundef @.str.69, i32 noundef %136)
  %137 = load i32, ptr %4, align 4, !tbaa !17
  store i32 %137, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

138:                                              ; preds = %124
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !18
  %142 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %141, i32 0, i32 46
  %143 = load i32, ptr %142, align 4
  %144 = lshr i32 %143, 1
  %145 = and i32 %144, 1
  %146 = icmp eq i32 %145, 1
  br i1 %146, label %147, label %156

147:                                              ; preds = %138
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %148, i32 0, i32 31
  %150 = load i64, ptr %149, align 8, !tbaa !15
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = call i64 @mbedtls_ssl_hdr_len(ptr noundef %151)
  %153 = add i64 %150, %152
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %154, i32 0, i32 34
  store i64 %153, ptr %155, align 8, !tbaa !19
  br label %159

156:                                              ; preds = %138
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %157, i32 0, i32 32
  store i64 0, ptr %158, align 8, !tbaa !20
  br label %159

159:                                              ; preds = %156, %147
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = call i32 @ssl_prepare_record_content(ptr noundef %160)
  store i32 %161, ptr %4, align 4, !tbaa !17
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %232

163:                                              ; preds = %159
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !18
  %167 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %166, i32 0, i32 46
  %168 = load i32, ptr %167, align 4
  %169 = lshr i32 %168, 1
  %170 = and i32 %169, 1
  %171 = icmp eq i32 %170, 1
  br i1 %171, label %172, label %224

172:                                              ; preds = %163
  %173 = load i32, ptr %4, align 4, !tbaa !17
  %174 = icmp eq i32 %173, -29184
  br i1 %174, label %178, label %175

175:                                              ; preds = %172
  %176 = load i32, ptr %4, align 4, !tbaa !17
  %177 = icmp eq i32 %176, -29056
  br i1 %177, label %178, label %222

178:                                              ; preds = %175, %172
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 8, !tbaa !21
  %182 = icmp eq i32 %181, 11
  br i1 %182, label %188, label %183

183:                                              ; preds = %178
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 8, !tbaa !21
  %187 = icmp eq i32 %186, 13
  br i1 %187, label %188, label %196

188:                                              ; preds = %183, %178
  %189 = load i32, ptr %4, align 4, !tbaa !17
  %190 = icmp eq i32 %189, -29056
  br i1 %190, label %191, label %194

191:                                              ; preds = %188
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = call i32 @mbedtls_ssl_send_alert_message(ptr noundef %192, i8 noundef zeroext 2, i8 noundef zeroext 20)
  br label %194

194:                                              ; preds = %191, %188
  %195 = load i32, ptr %4, align 4, !tbaa !17
  store i32 %195, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

196:                                              ; preds = %183
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !18
  %200 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %199, i32 0, i32 40
  %201 = load i32, ptr %200, align 8, !tbaa !22
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %216

203:                                              ; preds = %196
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %204, i32 0, i32 6
  %206 = load i32, ptr %205, align 4, !tbaa !25
  %207 = add i32 %206, 1
  store i32 %207, ptr %205, align 4, !tbaa !25
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %208, i32 0, i32 0
  %210 = load ptr, ptr %209, align 8, !tbaa !18
  %211 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %210, i32 0, i32 40
  %212 = load i32, ptr %211, align 8, !tbaa !22
  %213 = icmp uge i32 %207, %212
  br i1 %213, label %214, label %216

214:                                              ; preds = %203
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %215, i32 noundef 1, ptr noundef @.str, i32 noundef 3959, ptr noundef @.str.72)
  store i32 -29056, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

216:                                              ; preds = %203, %196
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %217, i32 0, i32 34
  store i64 0, ptr %218, align 8, !tbaa !19
  %219 = load ptr, ptr %3, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %219, i32 0, i32 32
  store i64 0, ptr %220, align 8, !tbaa !20
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %221, i32 noundef 1, ptr noundef @.str, i32 noundef 3970, ptr noundef @.str.73)
  br label %76

222:                                              ; preds = %175
  %223 = load i32, ptr %4, align 4, !tbaa !17
  store i32 %223, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

224:                                              ; preds = %163
  %225 = load i32, ptr %4, align 4, !tbaa !17
  %226 = icmp eq i32 %225, -29056
  br i1 %226, label %227, label %230

227:                                              ; preds = %224
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  %229 = call i32 @mbedtls_ssl_send_alert_message(ptr noundef %228, i8 noundef zeroext 2, i8 noundef zeroext 20)
  br label %230

230:                                              ; preds = %227, %224
  %231 = load i32, ptr %4, align 4, !tbaa !17
  store i32 %231, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

232:                                              ; preds = %159
  %233 = load ptr, ptr %3, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %233, i32 0, i32 0
  %235 = load ptr, ptr %234, align 8, !tbaa !18
  %236 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %235, i32 0, i32 46
  %237 = load i32, ptr %236, align 4
  %238 = lshr i32 %237, 1
  %239 = and i32 %238, 1
  %240 = icmp eq i32 %239, 1
  br i1 %240, label %241, label %277

241:                                              ; preds = %232
  %242 = load ptr, ptr %3, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %242, i32 0, i32 15
  %244 = load ptr, ptr %243, align 8, !tbaa !26
  %245 = icmp ne ptr %244, null
  br i1 %245, label %246, label %277

246:                                              ; preds = %241
  %247 = load ptr, ptr %3, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %247, i32 0, i32 1
  %249 = load i32, ptr %248, align 8, !tbaa !21
  %250 = icmp eq i32 %249, 16
  br i1 %250, label %251, label %277

251:                                              ; preds = %246
  %252 = load ptr, ptr %3, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %252, i32 0, i32 30
  %254 = load i32, ptr %253, align 8, !tbaa !27
  %255 = icmp eq i32 %254, 22
  br i1 %255, label %256, label %274

256:                                              ; preds = %251
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %257, i32 0, i32 28
  %259 = load ptr, ptr %258, align 8, !tbaa !16
  %260 = getelementptr inbounds i8, ptr %259, i64 0
  %261 = load i8, ptr %260, align 1, !tbaa !28
  %262 = zext i8 %261 to i32
  %263 = icmp eq i32 %262, 20
  br i1 %263, label %264, label %274

264:                                              ; preds = %256
  %265 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %265, i32 noundef 2, ptr noundef @.str, i32 noundef 4015, ptr noundef @.str.74)
  %266 = load ptr, ptr %3, align 8, !tbaa !5
  %267 = call i32 @mbedtls_ssl_resend(ptr noundef %266)
  store i32 %267, ptr %4, align 4, !tbaa !17
  %268 = icmp ne i32 %267, 0
  br i1 %268, label %269, label %273

269:                                              ; preds = %264
  %270 = load ptr, ptr %3, align 8, !tbaa !5
  %271 = load i32, ptr %4, align 4, !tbaa !17
  call void @mbedtls_debug_print_ret(ptr noundef %270, i32 noundef 1, ptr noundef @.str, i32 noundef 4019, ptr noundef @.str.37, i32 noundef %271)
  %272 = load i32, ptr %4, align 4, !tbaa !17
  store i32 %272, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

273:                                              ; preds = %264
  store i32 -26880, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

274:                                              ; preds = %256, %251
  %275 = load ptr, ptr %3, align 8, !tbaa !5
  call void @ssl_handshake_wrapup_free_hs_transform(ptr noundef %275)
  br label %276

276:                                              ; preds = %274
  br label %277

277:                                              ; preds = %276, %246, %241, %232
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %278

278:                                              ; preds = %277, %273, %269, %230, %222, %214, %194, %134, %122, %82, %74, %64, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %279 = load i32, ptr %2, align 4
  ret i32 %279
}

; Function Attrs: nounwind uwtable
declare hidden i32 @ssl_parse_record_header(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ssl_prepare_record_content(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_ssl_send_alert_message(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) #2

; Function Attrs: nounwind uwtable
declare hidden void @ssl_handshake_wrapup_free_hs_transform(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !12, i64 272}
!10 = !{!"mbedtls_ssl_context", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !11, i64 216, !12, i64 224, !12, i64 232, !13, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !11, i64 280, !11, i64 284, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !11, i64 336, !12, i64 344, !12, i64 352, !7, i64 360, !11, i64 364, !6, i64 368, !6, i64 376, !6, i64 384, !12, i64 392, !11, i64 400, !12, i64 408, !7, i64 416, !7, i64 428}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 208}
!15 = !{!10, !12, i64 224}
!16 = !{!10, !6, i64 200}
!17 = !{!11, !11, i64 0}
!18 = !{!10, !6, i64 0}
!19 = !{!10, !12, i64 248}
!20 = !{!10, !12, i64 232}
!21 = !{!10, !11, i64 8}
!22 = !{!23, !11, i64 360}
!23 = !{!"mbedtls_ssl_config", !7, i64 0, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !24, i64 248, !24, i64 272, !6, i64 296, !12, i64 304, !6, i64 312, !12, i64 320, !6, i64 328, !11, i64 336, !11, i64 340, !11, i64 344, !11, i64 348, !7, i64 352, !11, i64 360, !11, i64 364, !7, i64 368, !7, i64 369, !7, i64 370, !7, i64 371, !11, i64 372, !11, i64 372, !11, i64 372, !11, i64 372, !11, i64 372, !11, i64 372, !11, i64 373, !11, i64 373, !11, i64 373, !11, i64 373, !11, i64 373, !11, i64 373, !11, i64 374, !11, i64 374, !11, i64 374}
!24 = !{!"", !11, i64 0, !12, i64 8, !6, i64 16}
!25 = !{!10, !11, i64 28}
!26 = !{!10, !6, i64 96}
!27 = !{!10, !11, i64 216}
!28 = !{!7, !7, i64 0}


; 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 [97 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [35 x i8], align 1

declare void @mbedtls_debug_print_msg(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

declare void @mbedtls_debug_print_buf(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @mbedtls_debug_print_ret(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_ssl_fetch_input(ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @mbedtls_ssl_hdr_len(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_ssl_read_record_layer(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 272
  %3 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %3, 0
  %4 = getelementptr inbounds i8, ptr %0, i64 208
  %5 = load ptr, ptr %4, align 8, !tbaa !13
  %.not89 = icmp eq ptr %5, null
  br i1 %.not, label %12, label %6

6:                                                ; preds = %1
  br i1 %.not89, label %8, label %7

7:                                                ; preds = %6
  tail call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 3800, ptr noundef nonnull @.str.4) #4
  br label %.loopexit

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 224
  %10 = load i64, ptr %9, align 8, !tbaa !14
  %11 = icmp ult i64 %3, %10
  br i1 %11, label %14, label %.thread134

.thread134:                                       ; preds = %8
  store i64 0, ptr %9, align 8, !tbaa !14
  br label %.preheader.sink.split

12:                                               ; preds = %1
  br i1 %.not89, label %.thread, label %.loopexit

.thread:                                          ; preds = %12
  %13 = getelementptr inbounds i8, ptr %0, i64 224
  br label %.preheader.sink.split

14:                                               ; preds = %8
  %15 = sub i64 %10, %3
  store i64 %15, ptr %9, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %0, i64 200
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %17, i64 %3
  tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %17, ptr nonnull align 1 %18, i64 %15, i1 false)
  %19 = load ptr, ptr %16, align 8, !tbaa !15
  %20 = load i64, ptr %9, align 8, !tbaa !14
  tail call void @mbedtls_debug_print_buf(ptr noundef nonnull %0, i32 noundef 4, ptr noundef nonnull @.str, i32 noundef 3832, ptr noundef nonnull @.str.68, ptr noundef %19, i64 noundef %20) #4
  %.pre.pre = load i64, ptr %9, align 8, !tbaa !14
  %21 = icmp eq i64 %.pre.pre, 0
  store i64 0, ptr %2, align 8, !tbaa !5
  br i1 %21, label %.preheader, label %.loopexit

.preheader.sink.split:                            ; preds = %.thread, %.thread134
  %.sink = phi ptr [ %2, %.thread134 ], [ %13, %.thread ]
  store i64 0, ptr %.sink, align 8, !tbaa !16
  br label %.preheader

.preheader:                                       ; preds = %.preheader.sink.split, %14
  %22 = getelementptr inbounds i8, ptr %0, i64 224
  %23 = tail call i64 @mbedtls_ssl_hdr_len(ptr noundef nonnull %0)
  %24 = tail call i32 @mbedtls_ssl_fetch_input(ptr noundef nonnull %0, i64 noundef %23)
  %.not92121 = icmp eq i32 %24, 0
  br i1 %.not92121, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %25 = getelementptr inbounds i8, ptr %0, i64 248
  %26 = getelementptr inbounds i8, ptr %0, i64 232
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = getelementptr inbounds i8, ptr %0, i64 28
  br label %29

._crit_edge:                                      ; preds = %.backedge, %.preheader
  %.lcssa = phi i32 [ %24, %.preheader ], [ %46, %.backedge ]
  tail call void @mbedtls_debug_print_ret(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 3875, ptr noundef nonnull @.str.69, i32 noundef %.lcssa) #4
  br label %.loopexit

29:                                               ; preds = %.lr.ph, %.backedge
  %30 = tail call i32 @ssl_parse_record_header(ptr noundef nonnull %0)
  %.not93 = icmp eq i32 %30, 0
  br i1 %.not93, label %47, label %31

31:                                               ; preds = %29
  %32 = load ptr, ptr %0, align 8, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %32, i64 372
  %34 = load i32, ptr %33, align 4
  %35 = and i32 %34, 2
  %36 = icmp ne i32 %35, 0
  %37 = icmp ne i32 %30, -26496
  %or.cond = and i1 %37, %36
  br i1 %or.cond, label %38, label %.loopexit

38:                                               ; preds = %31
  %39 = icmp eq i32 %30, -26368
  br i1 %39, label %40, label %44

40:                                               ; preds = %38
  %41 = load i64, ptr %22, align 8, !tbaa !14
  %42 = tail call i64 @mbedtls_ssl_hdr_len(ptr noundef nonnull %0)
  %43 = add i64 %42, %41
  store i64 %43, ptr %25, align 8, !tbaa !18
  tail call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 3892, ptr noundef nonnull @.str.70) #4
  br label %.backedge

44:                                               ; preds = %38
  store i64 0, ptr %25, align 8, !tbaa !18
  store i64 0, ptr %26, align 8, !tbaa !19
  tail call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 3901, ptr noundef nonnull @.str.71) #4
  br label %.backedge

.backedge:                                        ; preds = %40, %44, %84
  %45 = tail call i64 @mbedtls_ssl_hdr_len(ptr noundef nonnull %0)
  %46 = tail call i32 @mbedtls_ssl_fetch_input(ptr noundef nonnull %0, i64 noundef %45)
  %.not92 = icmp eq i32 %46, 0
  br i1 %.not92, label %29, label %._crit_edge

47:                                               ; preds = %29
  %48 = tail call i64 @mbedtls_ssl_hdr_len(ptr noundef %0)
  %49 = load i64, ptr %22, align 8, !tbaa !14
  %50 = add i64 %49, %48
  %51 = tail call i32 @mbedtls_ssl_fetch_input(ptr noundef %0, i64 noundef %50)
  %.not94 = icmp eq i32 %51, 0
  br i1 %.not94, label %53, label %52

52:                                               ; preds = %47
  tail call void @mbedtls_debug_print_ret(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 3917, ptr noundef nonnull @.str.69, i32 noundef %51) #4
  br label %.loopexit

53:                                               ; preds = %47
  %54 = load ptr, ptr %0, align 8, !tbaa !17
  %55 = getelementptr inbounds i8, ptr %54, i64 372
  %56 = load i32, ptr %55, align 4
  %57 = and i32 %56, 2
  %.not95 = icmp eq i32 %57, 0
  br i1 %.not95, label %62, label %58

58:                                               ; preds = %53
  %59 = load i64, ptr %22, align 8, !tbaa !14
  %60 = tail call i64 @mbedtls_ssl_hdr_len(ptr noundef nonnull %0)
  %61 = add i64 %60, %59
  store i64 %61, ptr %25, align 8, !tbaa !18
  br label %63

62:                                               ; preds = %53
  store i64 0, ptr %26, align 8, !tbaa !19
  br label %63

63:                                               ; preds = %62, %58
  %64 = tail call i32 @ssl_prepare_record_content(ptr noundef nonnull %0)
  %.not96 = icmp eq i32 %64, 0
  %65 = load ptr, ptr %0, align 8, !tbaa !17
  %66 = getelementptr inbounds i8, ptr %65, i64 372
  %67 = load i32, ptr %66, align 4
  %68 = and i32 %67, 2
  %.not97 = icmp eq i32 %68, 0
  br i1 %.not96, label %89, label %69

69:                                               ; preds = %63
  br i1 %.not97, label %85, label %70

70:                                               ; preds = %69
  switch i32 %64, label %.loopexit [
    i32 -29056, label %71
    i32 -29184, label %71
  ]

71:                                               ; preds = %70, %70
  %72 = load i32, ptr %27, align 8, !tbaa !20
  switch i32 %72, label %77 [
    i32 11, label %73
    i32 13, label %73
  ]

73:                                               ; preds = %71, %71
  %74 = icmp eq i32 %64, -29056
  br i1 %74, label %75, label %.loopexit

75:                                               ; preds = %73
  %76 = tail call i32 @mbedtls_ssl_send_alert_message(ptr noundef nonnull %0, i8 noundef zeroext 2, i8 noundef zeroext 20)
  br label %.loopexit

77:                                               ; preds = %71
  %78 = getelementptr inbounds i8, ptr %65, i64 360
  %79 = load i32, ptr %78, align 8, !tbaa !21
  %.not101 = icmp eq i32 %79, 0
  br i1 %.not101, label %84, label %80

80:                                               ; preds = %77
  %81 = load i32, ptr %28, align 4, !tbaa !24
  %82 = add i32 %81, 1
  store i32 %82, ptr %28, align 4, !tbaa !24
  %.not102 = icmp ult i32 %82, %79
  br i1 %.not102, label %84, label %83

83:                                               ; preds = %80
  tail call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 3959, ptr noundef nonnull @.str.72) #4
  br label %.loopexit

84:                                               ; preds = %80, %77
  store i64 0, ptr %25, align 8, !tbaa !18
  store i64 0, ptr %26, align 8, !tbaa !19
  tail call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 3970, ptr noundef nonnull @.str.73) #4
  br label %.backedge

85:                                               ; preds = %69
  %86 = icmp eq i32 %64, -29056
  br i1 %86, label %87, label %.loopexit

87:                                               ; preds = %85
  %88 = tail call i32 @mbedtls_ssl_send_alert_message(ptr noundef nonnull %0, i8 noundef zeroext 2, i8 noundef zeroext 20)
  br label %.loopexit

89:                                               ; preds = %63
  br i1 %.not97, label %.loopexit, label %90

90:                                               ; preds = %89
  %91 = getelementptr inbounds i8, ptr %0, i64 96
  %92 = load ptr, ptr %91, align 8, !tbaa !25
  %.not98 = icmp eq ptr %92, null
  br i1 %.not98, label %.loopexit, label %93

93:                                               ; preds = %90
  %94 = load i32, ptr %27, align 8, !tbaa !20
  %95 = icmp eq i32 %94, 16
  br i1 %95, label %96, label %.loopexit

96:                                               ; preds = %93
  %97 = getelementptr inbounds i8, ptr %0, i64 216
  %98 = load i32, ptr %97, align 8, !tbaa !26
  %99 = icmp eq i32 %98, 22
  br i1 %99, label %100, label %108

100:                                              ; preds = %96
  %101 = getelementptr inbounds i8, ptr %0, i64 200
  %102 = load ptr, ptr %101, align 8, !tbaa !15
  %103 = load i8, ptr %102, align 1, !tbaa !27
  %104 = icmp eq i8 %103, 20
  br i1 %104, label %105, label %108

105:                                              ; preds = %100
  tail call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 2, ptr noundef nonnull @.str, i32 noundef 4015, ptr noundef nonnull @.str.74) #4
  %106 = tail call i32 @mbedtls_ssl_resend(ptr noundef nonnull %0)
  %.not99 = icmp eq i32 %106, 0
  br i1 %.not99, label %.loopexit, label %107

107:                                              ; preds = %105
  tail call void @mbedtls_debug_print_ret(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 4019, ptr noundef nonnull @.str.37, i32 noundef %106) #4
  br label %.loopexit

108:                                              ; preds = %100, %96
  tail call void @ssl_handshake_wrapup_free_hs_transform(ptr noundef nonnull %0)
  br label %.loopexit

.loopexit:                                        ; preds = %70, %31, %89, %90, %93, %108, %105, %85, %87, %73, %75, %14, %12, %107, %83, %52, %._crit_edge, %7
  %.0 = phi i32 [ -27648, %7 ], [ %.lcssa, %._crit_edge ], [ %51, %52 ], [ -29056, %83 ], [ %106, %107 ], [ 0, %12 ], [ 0, %14 ], [ -29056, %75 ], [ %64, %73 ], [ -29056, %87 ], [ %64, %85 ], [ -26880, %105 ], [ 0, %108 ], [ 0, %93 ], [ 0, %90 ], [ 0, %89 ], [ %64, %70 ], [ %30, %31 ]
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @ssl_parse_record_header(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @ssl_prepare_record_content(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_ssl_send_alert_message(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @ssl_handshake_wrapup_free_hs_transform(ptr noundef) local_unnamed_addr #1

attributes #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 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !11, i64 272}
!6 = !{!"mbedtls_ssl_context", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !10, i64 216, !11, i64 224, !11, i64 232, !12, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !10, i64 280, !10, i64 284, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !10, i64 336, !11, i64 344, !11, i64 352, !8, i64 360, !10, i64 364, !7, i64 368, !7, i64 376, !7, i64 384, !11, i64 392, !10, i64 400, !11, i64 408, !8, i64 416, !8, i64 428}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !7, i64 208}
!14 = !{!6, !11, i64 224}
!15 = !{!6, !7, i64 200}
!16 = !{!11, !11, i64 0}
!17 = !{!6, !7, i64 0}
!18 = !{!6, !11, i64 248}
!19 = !{!6, !11, i64 232}
!20 = !{!6, !10, i64 8}
!21 = !{!22, !10, i64 360}
!22 = !{!"mbedtls_ssl_config", !8, i64 0, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !23, i64 248, !23, i64 272, !7, i64 296, !11, i64 304, !7, i64 312, !11, i64 320, !7, i64 328, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !8, i64 352, !10, i64 360, !10, i64 364, !8, i64 368, !8, i64 369, !8, i64 370, !8, i64 371, !10, i64 372, !10, i64 372, !10, i64 372, !10, i64 372, !10, i64 372, !10, i64 372, !10, i64 373, !10, i64 373, !10, i64 373, !10, i64 373, !10, i64 373, !10, i64 373, !10, i64 374, !10, i64 374, !10, i64 374}
!23 = !{!"", !10, i64 0, !11, i64 8, !7, i64 16}
!24 = !{!6, !10, i64 28}
!25 = !{!6, !7, i64 96}
!26 = !{!6, !10, i64 216}
!27 = !{!8, !8, i64 0}


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