; 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
@.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.261 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [23 x i8], align 1
@__FUNCTION__.tls_record_print = external hidden unnamed_addr constant [17 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

; 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 @tls_handshake_print(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 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 @tls_record_print(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %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 ptr %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !11
  store i32 %4, ptr %11, align 4, !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 ptr, ptr %7, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %24

18:                                               ; preds = %5
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = load i64, ptr %9, align 8, !tbaa !9
  %23 = icmp ult i64 %22, 5
  br i1 %23, label %24, label %30

24:                                               ; preds = %21, %18, %5
  br label %25

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

28:                                               ; preds = %25
  br label %29

29:                                               ; preds = %28
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %217

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

115:                                              ; preds = %30
  br label %116

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

119:                                              ; preds = %116
  br label %120

120:                                              ; preds = %119
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %217

121:                                              ; preds = %30
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %122, i64 0
  %124 = load i8, ptr %123, align 1, !tbaa !13
  %125 = zext i8 %124 to i32
  switch i32 %125, label %186 [
    i32 22, label %126
    i32 21, label %141
    i32 20, label %156
    i32 23, label %171
  ]

126:                                              ; preds = %121
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = load i64, ptr %13, align 8, !tbaa !9
  %130 = load i32, ptr %10, align 4, !tbaa !11
  %131 = load i32, ptr %11, align 4, !tbaa !11
  %132 = call i32 @tls_handshake_print(ptr noundef %127, ptr noundef %128, i64 noundef %129, i32 noundef %130, i32 noundef %131)
  %133 = icmp ne i32 %132, 1
  br i1 %133, label %134, label %140

134:                                              ; preds = %126
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr @stderr, align 8, !tbaa !5
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1110, ptr noundef @__FUNCTION__.tls_record_print) #4
  br label %138

138:                                              ; preds = %135
  br label %139

139:                                              ; preds = %138
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %217

140:                                              ; preds = %126
  br label %192

141:                                              ; preds = %121
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load ptr, ptr %12, align 8, !tbaa !5
  %144 = load i64, ptr %13, align 8, !tbaa !9
  %145 = load i32, ptr %10, align 4, !tbaa !11
  %146 = load i32, ptr %11, align 4, !tbaa !11
  %147 = call i32 @tls_alert_print(ptr noundef %142, ptr noundef %143, i64 noundef %144, i32 noundef %145, i32 noundef %146)
  %148 = icmp ne i32 %147, 1
  br i1 %148, label %149, label %155

149:                                              ; preds = %141
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr @stderr, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1116, ptr noundef @__FUNCTION__.tls_record_print) #4
  br label %153

153:                                              ; preds = %150
  br label %154

154:                                              ; preds = %153
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %217

155:                                              ; preds = %141
  br label %192

156:                                              ; preds = %121
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = load i64, ptr %13, align 8, !tbaa !9
  %160 = load i32, ptr %10, align 4, !tbaa !11
  %161 = load i32, ptr %11, align 4, !tbaa !11
  %162 = call i32 @tls_change_cipher_spec_print(ptr noundef %157, ptr noundef %158, i64 noundef %159, i32 noundef %160, i32 noundef %161)
  %163 = icmp ne i32 %162, 1
  br i1 %163, label %164, label %170

164:                                              ; preds = %156
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr @stderr, align 8, !tbaa !5
  %167 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1122, ptr noundef @__FUNCTION__.tls_record_print) #4
  br label %168

168:                                              ; preds = %165
  br label %169

169:                                              ; preds = %168
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %217

170:                                              ; preds = %156
  br label %192

171:                                              ; preds = %121
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = load ptr, ptr %12, align 8, !tbaa !5
  %174 = load i64, ptr %13, align 8, !tbaa !9
  %175 = load i32, ptr %10, align 4, !tbaa !11
  %176 = load i32, ptr %11, align 4, !tbaa !11
  %177 = call i32 @tls_application_data_print(ptr noundef %172, ptr noundef %173, i64 noundef %174, i32 noundef %175, i32 noundef %176)
  %178 = icmp ne i32 %177, 1
  br i1 %178, label %179, label %185

179:                                              ; preds = %171
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr @stderr, align 8, !tbaa !5
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 1128, ptr noundef @__FUNCTION__.tls_record_print) #4
  br label %183

183:                                              ; preds = %180
  br label %184

184:                                              ; preds = %183
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %217

185:                                              ; preds = %171
  br label %192

186:                                              ; preds = %121
  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 1133, ptr noundef @__FUNCTION__.tls_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 %217

192:                                              ; preds = %185, %170, %155, %140
  %193 = load ptr, ptr %8, align 8, !tbaa !5
  %194 = getelementptr inbounds i8, ptr %193, i64 3
  %195 = load i8, ptr %194, align 1, !tbaa !13
  %196 = zext i8 %195 to i16
  %197 = zext i16 %196 to i32
  %198 = shl i32 %197, 8
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds i8, ptr %199, i64 4
  %201 = load i8, ptr %200, align 1, !tbaa !13
  %202 = zext i8 %201 to i32
  %203 = or i32 %198, %202
  %204 = add nsw i32 5, %203
  %205 = sext i32 %204 to i64
  %206 = load i64, ptr %9, align 8, !tbaa !9
  %207 = sub i64 %206, %205
  store i64 %207, ptr %9, align 8, !tbaa !9
  %208 = load i64, ptr %9, align 8, !tbaa !9
  %209 = icmp ne i64 %208, 0
  br i1 %209, label %210, label %214

210:                                              ; preds = %192
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = load i64, ptr %9, align 8, !tbaa !9
  %213 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %211, i32 noundef 0, i32 noundef 0, ptr noundef @.str.262, i64 noundef %212)
  br label %214

214:                                              ; preds = %210, %192
  %215 = load ptr, ptr %7, align 8, !tbaa !5
  %216 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %215, ptr noundef @.str.261) #4
  store i32 1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %217

217:                                              ; preds = %214, %191, %184, %169, %154, %139, %120, %29
  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
  %218 = load i32, ptr %6, align 4
  ret i32 %218
}

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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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
@.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.261 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [23 x i8], align 1
@__FUNCTION__.tls_record_print = external hidden unnamed_addr constant [17 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

; Function Attrs: nounwind uwtable
declare dso_local i32 @tls_handshake_print(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 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 @tls_record_print(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = icmp eq ptr %0, null
  %7 = icmp eq ptr %1, null
  %or.cond.not65 = or i1 %6, %7
  %8 = icmp ult i64 %2, 5
  %or.cond3 = or i1 %or.cond.not65, %8
  br i1 %or.cond3, label %9, label %12

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

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

51:                                               ; preds = %12
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1103, ptr noundef nonnull @__FUNCTION__.tls_record_print) #3
  br label %92

54:                                               ; preds = %12
  %55 = load i8, ptr %1, align 1, !tbaa !9
  switch i8 %55, label %76 [
    i8 22, label %56
    i8 21, label %61
    i8 20, label %66
    i8 23, label %71
  ]

56:                                               ; preds = %54
  %57 = tail call i32 @tls_handshake_print(ptr noundef nonnull %0, ptr noundef nonnull %40, i64 noundef %47, i32 noundef %3, i32 noundef %22)
  %.not68 = icmp eq i32 %57, 1
  br i1 %.not68, label %79, label %58

58:                                               ; preds = %56
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1110, ptr noundef nonnull @__FUNCTION__.tls_record_print) #3
  br label %92

61:                                               ; preds = %54
  %62 = tail call i32 @tls_alert_print(ptr noundef nonnull %0, ptr noundef nonnull %40, i64 noundef %47, i32 noundef %3, i32 noundef %22)
  %.not67 = icmp eq i32 %62, 1
  br i1 %.not67, label %79, label %63

63:                                               ; preds = %61
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1116, ptr noundef nonnull @__FUNCTION__.tls_record_print) #3
  br label %92

66:                                               ; preds = %54
  %67 = tail call i32 @tls_change_cipher_spec_print(ptr noundef nonnull %0, ptr noundef nonnull %40, i64 noundef %47, i32 noundef %3, i32 noundef %22)
  %.not66 = icmp eq i32 %67, 1
  br i1 %.not66, label %79, label %68

68:                                               ; preds = %66
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  %70 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1122, ptr noundef nonnull @__FUNCTION__.tls_record_print) #3
  br label %92

71:                                               ; preds = %54
  %72 = tail call i32 @tls_application_data_print(ptr noundef nonnull %0, ptr noundef nonnull %40, i64 noundef %47, i32 noundef %3, i32 noundef %22)
  %.not = icmp eq i32 %72, 1
  br i1 %.not, label %79, label %73

73:                                               ; preds = %71
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1128, ptr noundef nonnull @__FUNCTION__.tls_record_print) #3
  br label %92

76:                                               ; preds = %54
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 1133, ptr noundef nonnull @__FUNCTION__.tls_record_print) #3
  br label %92

79:                                               ; preds = %71, %66, %61, %56
  %80 = load i8, ptr %31, align 1, !tbaa !9
  %81 = zext i8 %80 to i64
  %82 = shl nuw nsw i64 %81, 8
  %83 = load i8, ptr %35, align 1, !tbaa !9
  %84 = zext i8 %83 to i64
  %85 = or disjoint i64 %82, %84
  %86 = add nuw nsw i64 %85, 5
  %.not69 = icmp eq i64 %86, %2
  br i1 %.not69, label %90, label %87

87:                                               ; preds = %79
  %88 = sub i64 %2, %86
  %89 = 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 %88) #4
  br label %90

90:                                               ; preds = %87, %79
  %91 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %0, ptr noundef nonnull @.str.261) #4
  br label %92

92:                                               ; preds = %90, %76, %73, %68, %63, %58, %51, %9
  %.0 = phi i32 [ -1, %9 ], [ -1, %51 ], [ -1, %76 ], [ -1, %73 ], [ 1, %90 ], [ -1, %68 ], [ -1, %63 ], [ -1, %58 ]
  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