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

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

@debug_threshold = external hidden global i32, align 4
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @debug_send_line(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 i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local void @mbedtls_debug_print_buf(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, i64 noundef %6) #3 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca [512 x i8], align 16
  %16 = alloca [17 x i8], align 16
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i32 %3, ptr %11, align 4, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store i64 %6, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 512, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 17, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store i64 0, ptr %18, align 8, !tbaa !11
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = icmp eq ptr %22, null
  br i1 %23, label %35, label %24

24:                                               ; preds = %7
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.mbedtls_ssl_context, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds %struct.mbedtls_ssl_config, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = icmp eq ptr %29, null
  br i1 %30, label %35, label %31

31:                                               ; preds = %24
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = load i32, ptr @debug_threshold, align 4, !tbaa !9
  %34 = icmp sgt i32 %32, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %31, %24, %7
  store i32 1, ptr %19, align 4
  br label %172

36:                                               ; preds = %31
  %37 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  %38 = load i64, ptr %18, align 8, !tbaa !11
  %39 = getelementptr inbounds i8, ptr %37, i64 %38
  %40 = load i64, ptr %18, align 8, !tbaa !11
  %41 = sub i64 512, %40
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = load i64, ptr %14, align 8, !tbaa !11
  %44 = trunc i64 %43 to i32
  %45 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %39, i64 noundef %41, ptr noundef @.str.1, ptr noundef %42, i32 noundef %44) #5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  call void @debug_send_line(ptr noundef %46, i32 noundef %47, ptr noundef %48, i32 noundef %49, ptr noundef %50)
  store i64 0, ptr %18, align 8, !tbaa !11
  %51 = getelementptr inbounds [17 x i8], ptr %16, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %51, i8 0, i64 17, i1 false)
  store i64 0, ptr %17, align 8, !tbaa !11
  br label %52

52:                                               ; preds = %134, %36
  %53 = load i64, ptr %17, align 8, !tbaa !11
  %54 = load i64, ptr %14, align 8, !tbaa !11
  %55 = icmp ult i64 %53, %54
  br i1 %55, label %56, label %137

56:                                               ; preds = %52
  %57 = load i64, ptr %17, align 8, !tbaa !11
  %58 = icmp uge i64 %57, 4096
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  br label %137

60:                                               ; preds = %56
  %61 = load i64, ptr %17, align 8, !tbaa !11
  %62 = urem i64 %61, 16
  %63 = icmp eq i64 %62, 0
  br i1 %63, label %64, label %93

64:                                               ; preds = %60
  %65 = load i64, ptr %17, align 8, !tbaa !11
  %66 = icmp ugt i64 %65, 0
  br i1 %66, label %67, label %81

67:                                               ; preds = %64
  %68 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  %69 = load i64, ptr %18, align 8, !tbaa !11
  %70 = getelementptr inbounds i8, ptr %68, i64 %69
  %71 = load i64, ptr %18, align 8, !tbaa !11
  %72 = sub i64 512, %71
  %73 = getelementptr inbounds [17 x i8], ptr %16, i64 0, i64 0
  %74 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %70, i64 noundef %72, ptr noundef @.str.2, ptr noundef %73) #5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  call void @debug_send_line(ptr noundef %75, i32 noundef %76, ptr noundef %77, i32 noundef %78, ptr noundef %79)
  store i64 0, ptr %18, align 8, !tbaa !11
  %80 = getelementptr inbounds [17 x i8], ptr %16, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %80, i8 0, i64 17, i1 false)
  br label %81

81:                                               ; preds = %67, %64
  %82 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  %83 = load i64, ptr %18, align 8, !tbaa !11
  %84 = getelementptr inbounds i8, ptr %82, i64 %83
  %85 = load i64, ptr %18, align 8, !tbaa !11
  %86 = sub i64 512, %85
  %87 = load i64, ptr %17, align 8, !tbaa !11
  %88 = trunc i64 %87 to i32
  %89 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %84, i64 noundef %86, ptr noundef @.str.3, i32 noundef %88) #5
  %90 = sext i32 %89 to i64
  %91 = load i64, ptr %18, align 8, !tbaa !11
  %92 = add i64 %91, %90
  store i64 %92, ptr %18, align 8, !tbaa !11
  br label %93

93:                                               ; preds = %81, %60
  %94 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  %95 = load i64, ptr %18, align 8, !tbaa !11
  %96 = getelementptr inbounds i8, ptr %94, i64 %95
  %97 = load i64, ptr %18, align 8, !tbaa !11
  %98 = sub i64 512, %97
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = load i64, ptr %17, align 8, !tbaa !11
  %101 = getelementptr inbounds i8, ptr %99, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !19
  %103 = zext i8 %102 to i32
  %104 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %96, i64 noundef %98, ptr noundef @.str.4, i32 noundef %103) #5
  %105 = sext i32 %104 to i64
  %106 = load i64, ptr %18, align 8, !tbaa !11
  %107 = add i64 %106, %105
  store i64 %107, ptr %18, align 8, !tbaa !11
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = load i64, ptr %17, align 8, !tbaa !11
  %110 = getelementptr inbounds i8, ptr %108, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !19
  %112 = zext i8 %111 to i32
  %113 = icmp sgt i32 %112, 31
  br i1 %113, label %114, label %127

114:                                              ; preds = %93
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = load i64, ptr %17, align 8, !tbaa !11
  %117 = getelementptr inbounds i8, ptr %115, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !19
  %119 = zext i8 %118 to i32
  %120 = icmp slt i32 %119, 127
  br i1 %120, label %121, label %127

121:                                              ; preds = %114
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = load i64, ptr %17, align 8, !tbaa !11
  %124 = getelementptr inbounds i8, ptr %122, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !19
  %126 = zext i8 %125 to i32
  br label %128

127:                                              ; preds = %114, %93
  br label %128

128:                                              ; preds = %127, %121
  %129 = phi i32 [ %126, %121 ], [ 46, %127 ]
  %130 = trunc i32 %129 to i8
  %131 = load i64, ptr %17, align 8, !tbaa !11
  %132 = urem i64 %131, 16
  %133 = getelementptr inbounds [17 x i8], ptr %16, i64 0, i64 %132
  store i8 %130, ptr %133, align 1, !tbaa !19
  br label %134

134:                                              ; preds = %128
  %135 = load i64, ptr %17, align 8, !tbaa !11
  %136 = add i64 %135, 1
  store i64 %136, ptr %17, align 8, !tbaa !11
  br label %52, !llvm.loop !20

137:                                              ; preds = %59, %52
  %138 = load i64, ptr %14, align 8, !tbaa !11
  %139 = icmp ugt i64 %138, 0
  br i1 %139, label %140, label %171

140:                                              ; preds = %137
  br label %141

141:                                              ; preds = %155, %140
  %142 = load i64, ptr %17, align 8, !tbaa !11
  %143 = urem i64 %142, 16
  %144 = icmp ne i64 %143, 0
  br i1 %144, label %145, label %158

145:                                              ; preds = %141
  %146 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  %147 = load i64, ptr %18, align 8, !tbaa !11
  %148 = getelementptr inbounds i8, ptr %146, i64 %147
  %149 = load i64, ptr %18, align 8, !tbaa !11
  %150 = sub i64 512, %149
  %151 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %148, i64 noundef %150, ptr noundef @.str.5) #5
  %152 = sext i32 %151 to i64
  %153 = load i64, ptr %18, align 8, !tbaa !11
  %154 = add i64 %153, %152
  store i64 %154, ptr %18, align 8, !tbaa !11
  br label %155

155:                                              ; preds = %145
  %156 = load i64, ptr %17, align 8, !tbaa !11
  %157 = add i64 %156, 1
  store i64 %157, ptr %17, align 8, !tbaa !11
  br label %141, !llvm.loop !22

158:                                              ; preds = %141
  %159 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  %160 = load i64, ptr %18, align 8, !tbaa !11
  %161 = getelementptr inbounds i8, ptr %159, i64 %160
  %162 = load i64, ptr %18, align 8, !tbaa !11
  %163 = sub i64 512, %162
  %164 = getelementptr inbounds [17 x i8], ptr %16, i64 0, i64 0
  %165 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %161, i64 noundef %163, ptr noundef @.str.2, ptr noundef %164) #5
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = load i32, ptr %9, align 4, !tbaa !9
  %168 = load ptr, ptr %10, align 8, !tbaa !5
  %169 = load i32, ptr %11, align 4, !tbaa !9
  %170 = getelementptr inbounds [512 x i8], ptr %15, i64 0, i64 0
  call void @debug_send_line(ptr noundef %166, i32 noundef %167, ptr noundef %168, i32 noundef %169, ptr noundef %170)
  br label %171

171:                                              ; preds = %158, %137
  store i32 0, ptr %19, align 4
  br label %172

172:                                              ; preds = %171, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 17, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr %15) #5
  %173 = load i32, ptr %19, align 4
  switch i32 %173, label %175 [
    i32 0, label %174
    i32 1, label %174
  ]

174:                                              ; preds = %172, %172
  ret void

175:                                              ; preds = %172
  unreachable
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"mbedtls_ssl_context", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, 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, !10, i64 216, !12, i64 224, !12, i64 232, !15, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !10, i64 280, !10, i64 284, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !10, i64 336, !12, i64 344, !12, i64 352, !7, i64 360, !10, i64 364, !6, i64 368, !6, i64 376, !6, i64 384, !12, i64 392, !10, i64 400, !12, i64 408, !7, i64 416, !7, i64 428}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !6, i64 32}
!17 = !{!"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, !18, i64 248, !18, i64 272, !6, i64 296, !12, i64 304, !6, i64 312, !12, i64 320, !6, i64 328, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !7, i64 352, !10, i64 360, !10, i64 364, !7, i64 368, !7, i64 369, !7, i64 370, !7, 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}
!18 = !{!"", !10, i64 0, !12, i64 8, !6, i64 16}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

@debug_threshold = external hidden local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @debug_send_line(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @mbedtls_debug_print_buf(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr nocapture noundef readonly %5, i64 noundef %6) local_unnamed_addr #3 {
  %8 = alloca [512 x i8], align 16
  %9 = alloca [17 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %9) #6
  %10 = load ptr, ptr %0, align 8, !tbaa !5
  %11 = icmp eq ptr %10, null
  br i1 %11, label %._crit_edge.thread, label %12

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %10, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = icmp eq ptr %14, null
  %16 = load i32, ptr @debug_threshold, align 4
  %17 = icmp slt i32 %16, %1
  %or.cond59 = select i1 %15, i1 true, i1 %17
  br i1 %or.cond59, label %._crit_edge.thread, label %18

18:                                               ; preds = %12
  %19 = trunc i64 %6 to i32
  %20 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %8, i64 noundef 512, ptr noundef nonnull @.str.1, ptr noundef %4, i32 noundef %19) #6
  call void @debug_send_line(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(17) %9, i8 0, i64 17, i1 false)
  %21 = icmp eq i64 %6, 0
  br i1 %21, label %._crit_edge.thread, label %22

22:                                               ; preds = %18
  %23 = add i64 %6, -1
  %umin = call i64 @llvm.umin.i64(i64 %23, i64 4095)
  %24 = add nuw nsw i64 %umin, 1
  %25 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %8, i64 noundef 512, ptr noundef nonnull @.str.3, i32 noundef 0) #6
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %8, i64 %26
  %28 = sub nsw i64 512, %26
  %29 = load i8, ptr %5, align 1, !tbaa !16
  %30 = zext i8 %29 to i32
  %31 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %27, i64 noundef %28, ptr noundef nonnull @.str.4, i32 noundef %30) #6
  %32 = sext i32 %31 to i64
  %33 = add nsw i64 %26, %32
  %34 = load i8, ptr %5, align 1, !tbaa !16
  %35 = add i8 %34, -32
  %or.cond60.peel = icmp ult i8 %35, 95
  %36 = select i1 %or.cond60.peel, i8 %34, i8 46
  store i8 %36, ptr %9, align 16, !tbaa !16
  %exitcond.peel = icmp eq i64 %23, 0
  br i1 %exitcond.peel, label %.lr.ph67.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %22, %46
  %.062 = phi i64 [ %54, %46 ], [ %33, %22 ]
  %.05161 = phi i64 [ %59, %46 ], [ 1, %22 ]
  %37 = and i64 %.05161, 15
  %38 = icmp eq i64 %37, 0
  br i1 %38, label %39, label %46

39:                                               ; preds = %.lr.ph
  %40 = getelementptr inbounds i8, ptr %8, i64 %.062
  %41 = sub i64 512, %.062
  %42 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %40, i64 noundef %41, ptr noundef nonnull @.str.2, ptr noundef nonnull %9) #6
  call void @debug_send_line(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(17) %9, i8 0, i64 17, i1 false)
  %43 = trunc nuw nsw i64 %.05161 to i32
  %44 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %8, i64 noundef 512, ptr noundef nonnull @.str.3, i32 noundef %43) #6
  %45 = sext i32 %44 to i64
  br label %46

46:                                               ; preds = %39, %.lr.ph
  %.2 = phi i64 [ %45, %39 ], [ %.062, %.lr.ph ]
  %47 = getelementptr inbounds i8, ptr %8, i64 %.2
  %48 = sub i64 512, %.2
  %49 = getelementptr inbounds i8, ptr %5, i64 %.05161
  %50 = load i8, ptr %49, align 1, !tbaa !16
  %51 = zext i8 %50 to i32
  %52 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %47, i64 noundef %48, ptr noundef nonnull @.str.4, i32 noundef %51) #6
  %53 = sext i32 %52 to i64
  %54 = add i64 %.2, %53
  %55 = load i8, ptr %49, align 1, !tbaa !16
  %56 = add i8 %55, -32
  %or.cond60 = icmp ult i8 %56, 95
  %57 = select i1 %or.cond60, i8 %55, i8 46
  %58 = getelementptr inbounds [17 x i8], ptr %9, i64 0, i64 %37
  store i8 %57, ptr %58, align 1, !tbaa !16
  %59 = add nuw nsw i64 %.05161, 1
  %exitcond = icmp eq i64 %.05161, %umin
  br i1 %exitcond, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %46
  br i1 %21, label %._crit_edge.thread, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %60 = and i64 %24, 15
  %.not5764 = icmp eq i64 %60, 0
  br i1 %.not5764, label %._crit_edge68, label %.lr.ph67.preheader

.lr.ph67.preheader:                               ; preds = %22, %.preheader
  %.366.ph = phi i64 [ %33, %22 ], [ %54, %.preheader ]
  %.15265.ph = phi i64 [ 1, %22 ], [ %24, %.preheader ]
  br label %.lr.ph67

.lr.ph67:                                         ; preds = %.lr.ph67.preheader, %.lr.ph67
  %.366 = phi i64 [ %65, %.lr.ph67 ], [ %.366.ph, %.lr.ph67.preheader ]
  %.15265 = phi i64 [ %66, %.lr.ph67 ], [ %.15265.ph, %.lr.ph67.preheader ]
  %61 = getelementptr inbounds i8, ptr %8, i64 %.366
  %62 = sub i64 512, %.366
  %63 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %61, i64 noundef %62, ptr noundef nonnull @.str.5) #6
  %64 = sext i32 %63 to i64
  %65 = add i64 %.366, %64
  %66 = add nuw nsw i64 %.15265, 1
  %67 = and i64 %66, 15
  %exitcond73 = icmp eq i64 %67, 0
  br i1 %exitcond73, label %._crit_edge68, label %.lr.ph67, !llvm.loop !20

._crit_edge68:                                    ; preds = %.lr.ph67, %.preheader
  %.3.lcssa = phi i64 [ %54, %.preheader ], [ %65, %.lr.ph67 ]
  %68 = getelementptr inbounds i8, ptr %8, i64 %.3.lcssa
  %69 = sub i64 512, %.3.lcssa
  %70 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %68, i64 noundef %69, ptr noundef nonnull @.str.2, ptr noundef nonnull %9) #6
  call void @debug_send_line(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef nonnull %8)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %18, %._crit_edge, %._crit_edge68, %7, %12
  call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %8) #6
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nofree 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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = !{!14, !7, i64 32}
!14 = !{!"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, !15, i64 248, !15, 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}
!15 = !{!"", !10, i64 0, !11, i64 8, !7, i64 16}
!16 = !{!8, !8, i64 0}
!17 = distinct !{!17, !18, !19}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.peeled.count", i32 1}
!20 = distinct !{!20, !18}


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