; 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.93 = external hidden unnamed_addr constant [23 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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

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

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

16:                                               ; preds = %2
  %17 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 16717) #6
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %18, i32 0, i32 40
  store ptr %17, ptr %19, align 8, !tbaa !16
  %20 = icmp eq ptr %17, null
  br i1 %20, label %21, label %28

21:                                               ; preds = %16, %2
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %22, i32 noundef 1, ptr noundef @.str, i32 noundef 5619, ptr noundef @.str.93, i64 noundef 16717)
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %23, i32 0, i32 23
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  call void @free(ptr noundef %25) #5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %26, i32 0, i32 23
  store ptr null, ptr %27, align 8, !tbaa !15
  store i32 -32512, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %160

28:                                               ; preds = %16
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %29, i32 0, i32 46
  %31 = load i32, ptr %30, align 4
  %32 = lshr i32 %31, 1
  %33 = and i32 %32, 1
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %35, label %94

35:                                               ; preds = %28
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %36, i32 0, i32 40
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %39, i32 0, i32 42
  store ptr %38, ptr %40, align 8, !tbaa !17
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %41, i32 0, i32 40
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = getelementptr inbounds i8, ptr %43, i64 3
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %45, i32 0, i32 41
  store ptr %44, ptr %46, align 8, !tbaa !18
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %47, i32 0, i32 40
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = getelementptr inbounds i8, ptr %49, i64 11
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %51, i32 0, i32 43
  store ptr %50, ptr %52, align 8, !tbaa !19
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %53, i32 0, i32 40
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %55, i64 13
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %57, i32 0, i32 44
  store ptr %56, ptr %58, align 8, !tbaa !20
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %59, i32 0, i32 40
  %61 = load ptr, ptr %60, align 8, !tbaa !16
  %62 = getelementptr inbounds i8, ptr %61, i64 13
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %63, i32 0, i32 45
  store ptr %62, ptr %64, align 8, !tbaa !21
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %65, i32 0, i32 23
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %68, i32 0, i32 25
  store ptr %67, ptr %69, align 8, !tbaa !22
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %70, i32 0, i32 23
  %72 = load ptr, ptr %71, align 8, !tbaa !15
  %73 = getelementptr inbounds i8, ptr %72, i64 3
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %74, i32 0, i32 24
  store ptr %73, ptr %75, align 8, !tbaa !23
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %76, i32 0, i32 23
  %78 = load ptr, ptr %77, align 8, !tbaa !15
  %79 = getelementptr inbounds i8, ptr %78, i64 11
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %80, i32 0, i32 26
  store ptr %79, ptr %81, align 8, !tbaa !24
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %82, i32 0, i32 23
  %84 = load ptr, ptr %83, align 8, !tbaa !15
  %85 = getelementptr inbounds i8, ptr %84, i64 13
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %86, i32 0, i32 27
  store ptr %85, ptr %87, align 8, !tbaa !25
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %88, i32 0, i32 23
  %90 = load ptr, ptr %89, align 8, !tbaa !15
  %91 = getelementptr inbounds i8, ptr %90, i64 13
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %92, i32 0, i32 28
  store ptr %91, ptr %93, align 8, !tbaa !26
  br label %153

94:                                               ; preds = %28
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %95, i32 0, i32 40
  %97 = load ptr, ptr %96, align 8, !tbaa !16
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %98, i32 0, i32 41
  store ptr %97, ptr %99, align 8, !tbaa !18
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %100, i32 0, i32 40
  %102 = load ptr, ptr %101, align 8, !tbaa !16
  %103 = getelementptr inbounds i8, ptr %102, i64 8
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %104, i32 0, i32 42
  store ptr %103, ptr %105, align 8, !tbaa !17
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %106, i32 0, i32 40
  %108 = load ptr, ptr %107, align 8, !tbaa !16
  %109 = getelementptr inbounds i8, ptr %108, i64 11
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %110, i32 0, i32 43
  store ptr %109, ptr %111, align 8, !tbaa !19
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %112, i32 0, i32 40
  %114 = load ptr, ptr %113, align 8, !tbaa !16
  %115 = getelementptr inbounds i8, ptr %114, i64 13
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %116, i32 0, i32 44
  store ptr %115, ptr %117, align 8, !tbaa !20
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %118, i32 0, i32 40
  %120 = load ptr, ptr %119, align 8, !tbaa !16
  %121 = getelementptr inbounds i8, ptr %120, i64 13
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %122, i32 0, i32 45
  store ptr %121, ptr %123, align 8, !tbaa !21
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %124, i32 0, i32 23
  %126 = load ptr, ptr %125, align 8, !tbaa !15
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %127, i32 0, i32 24
  store ptr %126, ptr %128, align 8, !tbaa !23
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %129, i32 0, i32 23
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  %132 = getelementptr inbounds i8, ptr %131, i64 8
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %133, i32 0, i32 25
  store ptr %132, ptr %134, align 8, !tbaa !22
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %135, i32 0, i32 23
  %137 = load ptr, ptr %136, align 8, !tbaa !15
  %138 = getelementptr inbounds i8, ptr %137, i64 11
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %139, i32 0, i32 26
  store ptr %138, ptr %140, align 8, !tbaa !24
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %141, i32 0, i32 23
  %143 = load ptr, ptr %142, align 8, !tbaa !15
  %144 = getelementptr inbounds i8, ptr %143, i64 13
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %145, i32 0, i32 27
  store ptr %144, ptr %146, align 8, !tbaa !25
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %147, i32 0, i32 23
  %149 = load ptr, ptr %148, align 8, !tbaa !15
  %150 = getelementptr inbounds i8, ptr %149, i64 13
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %151, i32 0, i32 28
  store ptr %150, ptr %152, align 8, !tbaa !26
  br label %153

153:                                              ; preds = %94, %35
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = call i32 @ssl_handshake_init(ptr noundef %154)
  store i32 %155, ptr %6, align 4, !tbaa !27
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %159

157:                                              ; preds = %153
  %158 = load i32, ptr %6, align 4, !tbaa !27
  store i32 %158, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %160

159:                                              ; preds = %153
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %160

160:                                              ; preds = %159, %157, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %161 = load i32, ptr %3, align 4
  ret i32 %161
}

; Function Attrs: nounwind uwtable
declare hidden i32 @ssl_handshake_init(ptr noundef) #4

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 "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 = { 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 = { 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 }
attributes #6 = { nounwind allocsize(0,1) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"mbedtls_ssl_context", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, 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, !13, i64 216, !10, i64 224, !10, i64 232, !14, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !13, i64 280, !13, i64 284, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !13, i64 336, !10, i64 344, !10, i64 352, !7, i64 360, !13, i64 364, !6, i64 368, !6, i64 376, !6, i64 384, !10, i64 392, !13, i64 400, !10, i64 408, !7, i64 416, !7, i64 428}
!13 = !{!"int", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!12, !6, i64 160}
!16 = !{!12, !6, i64 288}
!17 = !{!12, !6, i64 304}
!18 = !{!12, !6, i64 296}
!19 = !{!12, !6, i64 312}
!20 = !{!12, !6, i64 320}
!21 = !{!12, !6, i64 328}
!22 = !{!12, !6, i64 176}
!23 = !{!12, !6, i64 168}
!24 = !{!12, !6, i64 184}
!25 = !{!12, !6, i64 192}
!26 = !{!12, !6, i64 200}
!27 = !{!13, !13, 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.93 = external hidden unnamed_addr constant [23 x i8], align 1

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_ssl_setup(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  store ptr %1, ptr %0, align 8, !tbaa !5
  %3 = tail call noalias dereferenceable_or_null(16717) ptr @calloc(i64 noundef 1, i64 noundef 16717) #4
  %4 = getelementptr inbounds i8, ptr %0, i64 160
  store ptr %3, ptr %4, align 8, !tbaa !13
  %5 = icmp eq ptr %3, null
  br i1 %5, label %10, label %6

6:                                                ; preds = %2
  %7 = tail call noalias dereferenceable_or_null(16717) ptr @calloc(i64 noundef 1, i64 noundef 16717) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 288
  store ptr %7, ptr %8, align 8, !tbaa !14
  %9 = icmp eq ptr %7, null
  br i1 %9, label %10, label %12

10:                                               ; preds = %6, %2
  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 5619, ptr noundef nonnull @.str.93, i64 noundef 16717) #5
  %11 = load ptr, ptr %4, align 8, !tbaa !13
  tail call void @free(ptr noundef %11) #5
  store ptr null, ptr %4, align 8, !tbaa !13
  br label %35

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %1, i64 372
  %14 = load i32, ptr %13, align 4
  %15 = and i32 %14, 2
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %20, label %16

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %7, i64 3
  %18 = getelementptr inbounds i8, ptr %0, i64 296
  store ptr %17, ptr %18, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %3, i64 3
  br label %24

20:                                               ; preds = %12
  %21 = getelementptr inbounds i8, ptr %0, i64 296
  store ptr %7, ptr %21, align 8, !tbaa !15
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  %23 = getelementptr inbounds i8, ptr %3, i64 8
  br label %24

24:                                               ; preds = %20, %16
  %.sink60 = phi ptr [ %22, %20 ], [ %7, %16 ]
  %.sink56 = phi ptr [ %3, %20 ], [ %19, %16 ]
  %.sink55 = phi ptr [ %23, %20 ], [ %3, %16 ]
  %.sink53 = getelementptr inbounds i8, ptr %3, i64 13
  %.sink54 = getelementptr inbounds i8, ptr %3, i64 11
  %.sink58 = getelementptr inbounds i8, ptr %7, i64 13
  %.sink59 = getelementptr inbounds i8, ptr %7, i64 11
  %25 = getelementptr inbounds i8, ptr %0, i64 304
  store ptr %.sink60, ptr %25, align 8
  %26 = getelementptr inbounds i8, ptr %0, i64 312
  store ptr %.sink59, ptr %26, align 8
  %27 = getelementptr inbounds i8, ptr %0, i64 320
  store ptr %.sink58, ptr %27, align 8
  %28 = getelementptr inbounds i8, ptr %0, i64 328
  store ptr %.sink58, ptr %28, align 8
  %29 = getelementptr inbounds i8, ptr %0, i64 168
  store ptr %.sink56, ptr %29, align 8
  %30 = getelementptr inbounds i8, ptr %0, i64 176
  store ptr %.sink55, ptr %30, align 8
  %31 = getelementptr inbounds i8, ptr %0, i64 184
  store ptr %.sink54, ptr %31, align 8
  %32 = getelementptr inbounds i8, ptr %0, i64 192
  store ptr %.sink53, ptr %32, align 8
  %33 = getelementptr inbounds i8, ptr %0, i64 200
  store ptr %.sink53, ptr %33, align 8
  %34 = tail call i32 @ssl_handshake_init(ptr noundef nonnull %0)
  br label %35

35:                                               ; preds = %24, %10
  %.0 = phi i32 [ -32512, %10 ], [ %34, %24 ]
  ret i32 %.0
}

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass