; LLVM IR from guanzhi/GmSSL :: src (tls_trace)

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

@stderr = external global ptr, align 8
@.str.130 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.213 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.222 = external hidden unnamed_addr constant [21 x i8], align 1
@__FUNCTION__.tls13_record_print = external hidden unnamed_addr constant [19 x i8], align 1
@.str.257 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.258 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.259 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

declare i32 @format_print(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ...) #3

declare i32 @format_bytes(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) #3

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

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

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

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

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

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

20:                                               ; preds = %5
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %26

23:                                               ; preds = %20
  %24 = load i64, ptr %11, align 8, !tbaa !11
  %25 = icmp ult i64 %24, 5
  br i1 %25, label %26, label %32

26:                                               ; preds = %23, %20, %5
  br label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1011, ptr noundef @__FUNCTION__.tls13_record_print) #4
  br label %30

30:                                               ; preds = %27
  br label %31

31:                                               ; preds = %30
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

32:                                               ; preds = %23
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 1
  %35 = load i8, ptr %34, align 1, !tbaa !13
  %36 = zext i8 %35 to i16
  %37 = zext i16 %36 to i32
  %38 = shl i32 %37, 8
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 2
  %41 = load i8, ptr %40, align 1, !tbaa !13
  %42 = zext i8 %41 to i32
  %43 = or i32 %38, %42
  store i32 %43, ptr %14, align 4, !tbaa !9
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %44, i32 noundef %45, i32 noundef %46, ptr noundef @.str.257)
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = add nsw i32 %48, 4
  store i32 %49, ptr %9, align 4, !tbaa !9
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 0
  %55 = load i8, ptr %54, align 1, !tbaa !13
  %56 = zext i8 %55 to i32
  %57 = call ptr @tls_record_type_name(i32 noundef %56)
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 0
  %60 = load i8, ptr %59, align 1, !tbaa !13
  %61 = zext i8 %60 to i32
  %62 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %50, i32 noundef %51, i32 noundef %52, ptr noundef @.str.258, ptr noundef %57, i32 noundef %61)
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = call ptr @tls_protocol_name(i32 noundef %66)
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = ashr i32 %68, 8
  %70 = load i32, ptr %14, align 4, !tbaa !9
  %71 = and i32 %70, 255
  %72 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %63, i32 noundef %64, i32 noundef %65, ptr noundef @.str.222, ptr noundef %67, i32 noundef %69, i32 noundef %71)
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 3
  %78 = load i8, ptr %77, align 1, !tbaa !13
  %79 = zext i8 %78 to i16
  %80 = zext i16 %79 to i32
  %81 = shl i32 %80, 8
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %82, i64 4
  %84 = load i8, ptr %83, align 1, !tbaa !13
  %85 = zext i8 %84 to i32
  %86 = or i32 %81, %85
  %87 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %73, i32 noundef %74, i32 noundef %75, ptr noundef @.str.259, i32 noundef %86)
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 5
  store ptr %89, ptr %12, align 8, !tbaa !5
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i64 3
  %92 = load i8, ptr %91, align 1, !tbaa !13
  %93 = zext i8 %92 to i16
  %94 = zext i16 %93 to i32
  %95 = shl i32 %94, 8
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 4
  %98 = load i8, ptr %97, align 1, !tbaa !13
  %99 = zext i8 %98 to i32
  %100 = or i32 %95, %99
  %101 = sext i32 %100 to i64
  store i64 %101, ptr %13, align 8, !tbaa !11
  %102 = load i64, ptr %11, align 8, !tbaa !11
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 3
  %105 = load i8, ptr %104, align 1, !tbaa !13
  %106 = zext i8 %105 to i16
  %107 = zext i16 %106 to i32
  %108 = shl i32 %107, 8
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i64 4
  %111 = load i8, ptr %110, align 1, !tbaa !13
  %112 = zext i8 %111 to i32
  %113 = or i32 %108, %112
  %114 = add nsw i32 5, %113
  %115 = sext i32 %114 to i64
  %116 = icmp ult i64 %102, %115
  br i1 %116, label %117, label %123

117:                                              ; preds = %32
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr @stderr, align 8, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1024, ptr noundef @__FUNCTION__.tls13_record_print) #4
  br label %121

121:                                              ; preds = %118
  br label %122

122:                                              ; preds = %121
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

123:                                              ; preds = %32
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = ashr i32 %124, 24
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %136

127:                                              ; preds = %123
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = load i32, ptr %8, align 4, !tbaa !9
  %130 = load i32, ptr %9, align 4, !tbaa !9
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = load i64, ptr %13, align 8, !tbaa !11
  %133 = call i32 @format_bytes(ptr noundef %128, i32 noundef %129, i32 noundef %130, ptr noundef @.str.260, ptr noundef %131, i64 noundef %132)
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.261) #4
  store i32 1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

136:                                              ; preds = %123
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = getelementptr inbounds i8, ptr %137, i64 0
  %139 = load i8, ptr %138, align 1, !tbaa !13
  %140 = zext i8 %139 to i32
  switch i32 %140, label %193 [
    i32 22, label %141
    i32 21, label %148
    i32 20, label %163
    i32 23, label %178
  ]

141:                                              ; preds = %136
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load i32, ptr %8, align 4, !tbaa !9
  %144 = load i32, ptr %9, align 4, !tbaa !9
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  %146 = load i64, ptr %13, align 8, !tbaa !11
  %147 = call i32 @tls13_handshake_print(ptr noundef %142, i32 noundef %143, i32 noundef %144, ptr noundef %145, i64 noundef %146)
  br label %199

148:                                              ; preds = %136
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = load i64, ptr %13, align 8, !tbaa !11
  %152 = load i32, ptr %8, align 4, !tbaa !9
  %153 = load i32, ptr %9, align 4, !tbaa !9
  %154 = call i32 @tls_alert_print(ptr noundef %149, ptr noundef %150, i64 noundef %151, i32 noundef %152, i32 noundef %153)
  %155 = icmp ne i32 %154, 1
  br i1 %155, label %156, label %162

156:                                              ; preds = %148
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr @stderr, align 8, !tbaa !5
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1041, ptr noundef @__FUNCTION__.tls13_record_print) #4
  br label %160

160:                                              ; preds = %157
  br label %161

161:                                              ; preds = %160
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

162:                                              ; preds = %148
  br label %199

163:                                              ; preds = %136
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  %166 = load i64, ptr %13, align 8, !tbaa !11
  %167 = load i32, ptr %8, align 4, !tbaa !9
  %168 = load i32, ptr %9, align 4, !tbaa !9
  %169 = call i32 @tls_change_cipher_spec_print(ptr noundef %164, ptr noundef %165, i64 noundef %166, i32 noundef %167, i32 noundef %168)
  %170 = icmp ne i32 %169, 1
  br i1 %170, label %171, label %177

171:                                              ; preds = %163
  br label %172

172:                                              ; preds = %171
  %173 = load ptr, ptr @stderr, align 8, !tbaa !5
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1047, ptr noundef @__FUNCTION__.tls13_record_print) #4
  br label %175

175:                                              ; preds = %172
  br label %176

176:                                              ; preds = %175
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

177:                                              ; preds = %163
  br label %199

178:                                              ; preds = %136
  %179 = load ptr, ptr %7, align 8, !tbaa !5
  %180 = load ptr, ptr %12, align 8, !tbaa !5
  %181 = load i64, ptr %13, align 8, !tbaa !11
  %182 = load i32, ptr %8, align 4, !tbaa !9
  %183 = load i32, ptr %9, align 4, !tbaa !9
  %184 = call i32 @tls_application_data_print(ptr noundef %179, ptr noundef %180, i64 noundef %181, i32 noundef %182, i32 noundef %183)
  %185 = icmp ne i32 %184, 1
  br i1 %185, label %186, label %192

186:                                              ; preds = %178
  br label %187

187:                                              ; preds = %186
  %188 = load ptr, ptr @stderr, align 8, !tbaa !5
  %189 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1053, ptr noundef @__FUNCTION__.tls13_record_print) #4
  br label %190

190:                                              ; preds = %187
  br label %191

191:                                              ; preds = %190
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

192:                                              ; preds = %178
  br label %199

193:                                              ; preds = %136
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr @stderr, align 8, !tbaa !5
  %196 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %195, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1058, ptr noundef @__FUNCTION__.tls13_record_print) #4
  br label %197

197:                                              ; preds = %194
  br label %198

198:                                              ; preds = %197
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

199:                                              ; preds = %192, %177, %162, %141
  %200 = load ptr, ptr %10, align 8, !tbaa !5
  %201 = getelementptr inbounds i8, ptr %200, i64 3
  %202 = load i8, ptr %201, align 1, !tbaa !13
  %203 = zext i8 %202 to i16
  %204 = zext i16 %203 to i32
  %205 = shl i32 %204, 8
  %206 = load ptr, ptr %10, align 8, !tbaa !5
  %207 = getelementptr inbounds i8, ptr %206, i64 4
  %208 = load i8, ptr %207, align 1, !tbaa !13
  %209 = zext i8 %208 to i32
  %210 = or i32 %205, %209
  %211 = add nsw i32 5, %210
  %212 = sext i32 %211 to i64
  %213 = load i64, ptr %11, align 8, !tbaa !11
  %214 = sub i64 %213, %212
  store i64 %214, ptr %11, align 8, !tbaa !11
  %215 = load i64, ptr %11, align 8, !tbaa !11
  %216 = icmp ne i64 %215, 0
  br i1 %216, label %217, label %221

217:                                              ; preds = %199
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = load i64, ptr %11, align 8, !tbaa !11
  %220 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %218, i32 noundef 0, i32 noundef 0, ptr noundef @.str.262, i64 noundef %219)
  br label %221

221:                                              ; preds = %217, %199
  %222 = load ptr, ptr %7, align 8, !tbaa !5
  %223 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %222, ptr noundef @.str.261) #4
  store i32 1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

224:                                              ; preds = %221, %198, %191, %176, %161, %127, %122, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %225 = load i32, ptr %6, align 4
  ret i32 %225
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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 = !{!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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.130 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.213 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.222 = external hidden unnamed_addr constant [21 x i8], align 1
@__FUNCTION__.tls13_record_print = external hidden unnamed_addr constant [19 x i8], align 1
@.str.257 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.258 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.259 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare i32 @format_print(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #2

declare i32 @format_bytes(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @tls13_record_print(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #0 {
  %6 = or i32 %1, 50688
  %7 = icmp eq ptr %0, null
  %8 = icmp eq ptr %3, null
  %or.cond.not73 = or i1 %7, %8
  %9 = icmp ult i64 %4, 5
  %or.cond3 = or i1 %or.cond.not73, %9
  br i1 %or.cond3, label %10, label %13

10:                                               ; preds = %5
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1011, ptr noundef nonnull @__FUNCTION__.tls13_record_print) #3
  br label %94

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %3, i64 1
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = zext i8 %15 to i32
  %17 = shl nuw nsw i32 %16, 8
  %18 = getelementptr inbounds i8, ptr %3, i64 2
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = or disjoint i32 %17, %20
  %22 = tail call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef nonnull %0, i32 noundef %6, i32 noundef %2, ptr noundef nonnull @.str.257) #4
  %23 = add nsw i32 %2, 4
  %24 = load i8, ptr %3, align 1, !tbaa !9
  %25 = zext i8 %24 to i32
  %26 = tail call ptr @tls_record_type_name(i32 noundef %25)
  %27 = load i8, ptr %3, align 1, !tbaa !9
  %28 = zext i8 %27 to i32
  %29 = tail call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef nonnull %0, i32 noundef %6, i32 noundef %23, ptr noundef nonnull @.str.258, ptr noundef %26, i32 noundef %28) #4
  %30 = tail call ptr @tls_protocol_name(i32 noundef %21)
  %31 = tail call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef nonnull %0, i32 noundef %6, i32 noundef %23, ptr noundef nonnull @.str.222, ptr noundef %30, i32 noundef %16, i32 noundef %20) #4
  %32 = getelementptr inbounds i8, ptr %3, i64 3
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = zext i8 %33 to i32
  %35 = shl nuw nsw i32 %34, 8
  %36 = getelementptr inbounds i8, ptr %3, i64 4
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = zext i8 %37 to i32
  %39 = or disjoint i32 %35, %38
  %40 = tail call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef nonnull %0, i32 noundef %6, i32 noundef %23, ptr noundef nonnull @.str.259, i32 noundef %39) #4
  %41 = getelementptr inbounds i8, ptr %3, i64 5
  %42 = load i8, ptr %32, align 1, !tbaa !9
  %43 = zext i8 %42 to i32
  %44 = shl nuw nsw i32 %43, 8
  %45 = load i8, ptr %36, align 1, !tbaa !9
  %46 = zext i8 %45 to i32
  %47 = or disjoint i32 %44, %46
  %48 = zext nneg i32 %47 to i64
  %49 = add nuw nsw i32 %47, 5
  %50 = zext nneg i32 %49 to i64
  %51 = icmp ugt i64 %50, %4
  br i1 %51, label %52, label %55

52:                                               ; preds = %13
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1024, ptr noundef nonnull @__FUNCTION__.tls13_record_print) #3
  br label %94

55:                                               ; preds = %13
  %.not = icmp ult i32 %1, 16777216
  br i1 %.not, label %59, label %56

56:                                               ; preds = %55
  %57 = tail call i32 @format_bytes(ptr noundef nonnull %0, i32 noundef %6, i32 noundef %23, ptr noundef nonnull @.str.260, ptr noundef nonnull %41, i64 noundef %48) #4
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %0, ptr noundef nonnull @.str.261) #4
  br label %94

59:                                               ; preds = %55
  %60 = load i8, ptr %3, align 1, !tbaa !9
  switch i8 %60, label %78 [
    i8 22, label %61
    i8 21, label %63
    i8 20, label %68
    i8 23, label %73
  ]

61:                                               ; preds = %59
  %62 = tail call i32 @tls13_handshake_print(ptr noundef nonnull %0, i32 noundef %6, i32 noundef %23, ptr noundef nonnull %41, i64 noundef %48)
  br label %81

63:                                               ; preds = %59
  %64 = tail call i32 @tls_alert_print(ptr noundef nonnull %0, ptr noundef nonnull %41, i64 noundef %48, i32 noundef %6, i32 noundef %23)
  %.not76 = icmp eq i32 %64, 1
  br i1 %.not76, label %81, label %65

65:                                               ; preds = %63
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1041, ptr noundef nonnull @__FUNCTION__.tls13_record_print) #3
  br label %94

68:                                               ; preds = %59
  %69 = tail call i32 @tls_change_cipher_spec_print(ptr noundef nonnull %0, ptr noundef nonnull %41, i64 noundef %48, i32 noundef %6, i32 noundef %23)
  %.not75 = icmp eq i32 %69, 1
  br i1 %.not75, label %81, label %70

70:                                               ; preds = %68
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1047, ptr noundef nonnull @__FUNCTION__.tls13_record_print) #3
  br label %94

73:                                               ; preds = %59
  %74 = tail call i32 @tls_application_data_print(ptr noundef nonnull %0, ptr noundef nonnull %41, i64 noundef %48, i32 noundef %6, i32 noundef %23)
  %.not74 = icmp eq i32 %74, 1
  br i1 %.not74, label %81, label %75

75:                                               ; preds = %73
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1053, ptr noundef nonnull @__FUNCTION__.tls13_record_print) #3
  br label %94

78:                                               ; preds = %59
  %79 = load ptr, ptr @stderr, align 8, !tbaa !5
  %80 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1058, ptr noundef nonnull @__FUNCTION__.tls13_record_print) #3
  br label %94

81:                                               ; preds = %73, %68, %63, %61
  %82 = load i8, ptr %32, align 1, !tbaa !9
  %83 = zext i8 %82 to i64
  %84 = shl nuw nsw i64 %83, 8
  %85 = load i8, ptr %36, align 1, !tbaa !9
  %86 = zext i8 %85 to i64
  %87 = or disjoint i64 %84, %86
  %88 = add nuw nsw i64 %87, 5
  %.not77 = icmp eq i64 %88, %4
  br i1 %.not77, label %92, label %89

89:                                               ; preds = %81
  %90 = sub i64 %4, %88
  %91 = tail call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef nonnull %0, i32 noundef 0, i32 noundef 0, ptr noundef nonnull @.str.262, i64 noundef %90) #4
  br label %92

92:                                               ; preds = %89, %81
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %0, ptr noundef nonnull @.str.261) #4
  br label %94

94:                                               ; preds = %92, %78, %75, %70, %65, %56, %52, %10
  %.0 = phi i32 [ -1, %10 ], [ -1, %52 ], [ 1, %56 ], [ -1, %78 ], [ -1, %75 ], [ 1, %92 ], [ -1, %70 ], [ -1, %65 ]
  ret i32 %.0
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { "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 = { cold nounwind }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}


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