; 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.212 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.213 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.214 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.221 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.222 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.223 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.224 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.tls_client_hello_print = external hidden unnamed_addr constant [23 x i8], align 1
@.str.225 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

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

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

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

; 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

declare i32 @tls_uint16array_from_bytes(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_uint16_from_bytes(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_uint8array_from_bytes(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @tls_client_hello_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 i32, align 4
  %13 = alloca i16, align 2
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i16, align 2
  %25 = 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 4, ptr %12) #4
  store i32 -1, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load i32, ptr %10, align 4, !tbaa !11
  %28 = load i32, ptr %11, align 4, !tbaa !11
  %29 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %26, i32 noundef %27, i32 noundef %28, ptr noundef @.str.221)
  %30 = load i32, ptr %11, align 4, !tbaa !11
  %31 = add nsw i32 %30, 4
  store i32 %31, ptr %11, align 4, !tbaa !11
  %32 = call i32 @tls_uint16_from_bytes(ptr noundef %13, ptr noundef %8, ptr noundef %9)
  %33 = icmp ne i32 %32, 1
  br i1 %33, label %34, label %35

34:                                               ; preds = %5
  br label %163

35:                                               ; preds = %5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load i32, ptr %10, align 4, !tbaa !11
  %38 = load i32, ptr %11, align 4, !tbaa !11
  %39 = load i16, ptr %13, align 2, !tbaa !13
  %40 = zext i16 %39 to i32
  %41 = call ptr @tls_protocol_name(i32 noundef %40)
  %42 = load i16, ptr %13, align 2, !tbaa !13
  %43 = zext i16 %42 to i32
  %44 = ashr i32 %43, 8
  %45 = load i16, ptr %13, align 2, !tbaa !13
  %46 = zext i16 %45 to i32
  %47 = and i32 %46, 255
  %48 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %36, i32 noundef %37, i32 noundef %38, ptr noundef @.str.222, ptr noundef %41, i32 noundef %44, i32 noundef %47)
  %49 = call i32 @tls_array_from_bytes(ptr noundef %14, i64 noundef 32, ptr noundef %8, ptr noundef %9)
  %50 = icmp ne i32 %49, 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %35
  br label %163

52:                                               ; preds = %35
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = load i32, ptr %10, align 4, !tbaa !11
  %56 = load i32, ptr %11, align 4, !tbaa !11
  %57 = call i32 @tls_random_print(ptr noundef %53, ptr noundef %54, i32 noundef %55, i32 noundef %56)
  %58 = call i32 @tls_uint8array_from_bytes(ptr noundef %15, ptr noundef %19, ptr noundef %8, ptr noundef %9)
  %59 = icmp ne i32 %58, 1
  br i1 %59, label %60, label %61

60:                                               ; preds = %52
  br label %163

61:                                               ; preds = %52
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !11
  %64 = load i32, ptr %11, align 4, !tbaa !11
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = load i64, ptr %19, align 8, !tbaa !9
  %67 = call i32 @format_bytes(ptr noundef %62, i32 noundef %63, i32 noundef %64, ptr noundef @.str.223, ptr noundef %65, i64 noundef %66)
  %68 = call i32 @tls_uint16array_from_bytes(ptr noundef %16, ptr noundef %20, ptr noundef %8, ptr noundef %9)
  %69 = icmp ne i32 %68, 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %61
  br label %163

71:                                               ; preds = %61
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = load i32, ptr %10, align 4, !tbaa !11
  %74 = load i32, ptr %11, align 4, !tbaa !11
  %75 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %72, i32 noundef %73, i32 noundef %74, ptr noundef @.str.224)
  br label %76

76:                                               ; preds = %96, %71
  %77 = load i64, ptr %20, align 8, !tbaa !9
  %78 = icmp uge i64 %77, 2
  br i1 %78, label %79, label %97

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 2, ptr %24) #4
  %80 = call i32 @tls_uint16_from_bytes(ptr noundef %24, ptr noundef %16, ptr noundef %20)
  %81 = icmp ne i32 %80, 1
  br i1 %81, label %82, label %83

82:                                               ; preds = %79
  store i32 2, ptr %25, align 4
  br label %94

83:                                               ; preds = %79
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = load i32, ptr %10, align 4, !tbaa !11
  %86 = load i32, ptr %11, align 4, !tbaa !11
  %87 = add nsw i32 %86, 4
  %88 = load i16, ptr %24, align 2, !tbaa !13
  %89 = zext i16 %88 to i32
  %90 = call ptr @tls_cipher_suite_name(i32 noundef %89)
  %91 = load i16, ptr %24, align 2, !tbaa !13
  %92 = zext i16 %91 to i32
  %93 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %84, i32 noundef %85, i32 noundef %87, ptr noundef @.str.214, ptr noundef %90, i32 noundef %92)
  store i32 0, ptr %25, align 4
  br label %94

94:                                               ; preds = %83, %82
  call void @llvm.lifetime.end.p0(i64 2, ptr %24) #4
  %95 = load i32, ptr %25, align 4
  switch i32 %95, label %165 [
    i32 0, label %96
    i32 2, label %163
  ]

96:                                               ; preds = %94
  br label %76, !llvm.loop !15

97:                                               ; preds = %76
  %98 = load i64, ptr %20, align 8, !tbaa !9
  %99 = icmp ne i64 %98, 0
  br i1 %99, label %100, label %106

100:                                              ; preds = %97
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr @stderr, align 8, !tbaa !5
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 572, ptr noundef @__FUNCTION__.tls_client_hello_print) #4
  br label %104

104:                                              ; preds = %101
  br label %105

105:                                              ; preds = %104
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %25, align 4
  br label %165

106:                                              ; preds = %97
  %107 = call i32 @tls_uint8array_from_bytes(ptr noundef %17, ptr noundef %21, ptr noundef %8, ptr noundef %9)
  %108 = icmp ne i32 %107, 1
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  br label %163

110:                                              ; preds = %106
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !11
  %113 = load i32, ptr %11, align 4, !tbaa !11
  %114 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %111, i32 noundef %112, i32 noundef %113, ptr noundef @.str.225)
  store i64 0, ptr %23, align 8, !tbaa !9
  br label %115

115:                                              ; preds = %136, %110
  %116 = load i64, ptr %23, align 8, !tbaa !9
  %117 = load i64, ptr %21, align 8, !tbaa !9
  %118 = icmp ult i64 %116, %117
  br i1 %118, label %119, label %139

119:                                              ; preds = %115
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = load i32, ptr %10, align 4, !tbaa !11
  %122 = load i32, ptr %11, align 4, !tbaa !11
  %123 = add nsw i32 %122, 4
  %124 = load ptr, ptr %17, align 8, !tbaa !5
  %125 = load i64, ptr %23, align 8, !tbaa !9
  %126 = getelementptr inbounds i8, ptr %124, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !17
  %128 = zext i8 %127 to i32
  %129 = call ptr @tls_compression_method_name(i32 noundef %128)
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  %131 = load i64, ptr %23, align 8, !tbaa !9
  %132 = getelementptr inbounds i8, ptr %130, i64 %131
  %133 = load i8, ptr %132, align 1, !tbaa !17
  %134 = zext i8 %133 to i32
  %135 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %120, i32 noundef %121, i32 noundef %123, ptr noundef @.str.212, ptr noundef %129, i32 noundef %134)
  br label %136

136:                                              ; preds = %119
  %137 = load i64, ptr %23, align 8, !tbaa !9
  %138 = add i64 %137, 1
  store i64 %138, ptr %23, align 8, !tbaa !9
  br label %115, !llvm.loop !18

139:                                              ; preds = %115
  %140 = load i64, ptr %9, align 8, !tbaa !9
  %141 = icmp ugt i64 %140, 0
  br i1 %141, label %142, label %153

142:                                              ; preds = %139
  %143 = call i32 @tls_uint16array_from_bytes(ptr noundef %18, ptr noundef %22, ptr noundef %8, ptr noundef %9)
  %144 = icmp ne i32 %143, 1
  br i1 %144, label %145, label %146

145:                                              ; preds = %142
  br label %163

146:                                              ; preds = %142
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = load i32, ptr %10, align 4, !tbaa !11
  %149 = load i32, ptr %11, align 4, !tbaa !11
  %150 = load ptr, ptr %18, align 8, !tbaa !5
  %151 = load i64, ptr %22, align 8, !tbaa !9
  %152 = call i32 @tls13_extensions_print(ptr noundef %147, i32 noundef %148, i32 noundef %149, i32 noundef 1, ptr noundef %150, i64 noundef %151)
  br label %153

153:                                              ; preds = %146, %139
  %154 = load i64, ptr %9, align 8, !tbaa !9
  %155 = icmp ugt i64 %154, 0
  br i1 %155, label %156, label %162

156:                                              ; preds = %153
  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 587, ptr noundef @__FUNCTION__.tls_client_hello_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 %25, align 4
  br label %165

162:                                              ; preds = %153
  store i32 1, ptr %12, align 4, !tbaa !11
  br label %163

163:                                              ; preds = %162, %145, %109, %94, %70, %60, %51, %34
  %164 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %164, ptr %6, align 4
  store i32 1, ptr %25, align 4
  br label %165

165:                                              ; preds = %163, %161, %105, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %166 = load i32, ptr %6, align 4
  ret i32 %166
}

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

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 = !{!14, !14, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !16}


; 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.212 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.213 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.214 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.221 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.222 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.223 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.224 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.tls_client_hello_print = external hidden unnamed_addr constant [23 x i8], align 1
@.str.225 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @tls_compression_method_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

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

; Function Attrs: mustprogress 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, ...) local_unnamed_addr #3

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

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

declare i32 @tls_uint16array_from_bytes(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @tls_uint16_from_bytes(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @tls_uint8array_from_bytes(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @tls_client_hello_print(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i16, align 2
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #4
  %19 = tail call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %3, i32 noundef %4, ptr noundef nonnull @.str.221) #4
  %20 = add nsw i32 %4, 4
  %21 = call i32 @tls_uint16_from_bytes(ptr noundef nonnull %8, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %.not = icmp eq i32 %21, 1
  br i1 %.not, label %22, label %.thread50

22:                                               ; preds = %5
  %23 = load i16, ptr %8, align 2, !tbaa !11
  %24 = zext i16 %23 to i32
  %25 = call ptr @tls_protocol_name(i32 noundef %24)
  %26 = load i16, ptr %8, align 2, !tbaa !11
  %27 = zext i16 %26 to i32
  %28 = lshr i32 %27, 8
  %29 = and i32 %27, 255
  %30 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %3, i32 noundef %20, ptr noundef nonnull @.str.222, ptr noundef %25, i32 noundef %28, i32 noundef %29) #4
  %31 = call i32 @tls_array_from_bytes(ptr noundef nonnull %9, i64 noundef 32, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %.not38 = icmp eq i32 %31, 1
  br i1 %.not38, label %32, label %.thread50

32:                                               ; preds = %22
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = call i32 @tls_random_print(ptr noundef %0, ptr noundef %33, i32 noundef %3, i32 noundef %20)
  %35 = call i32 @tls_uint8array_from_bytes(ptr noundef nonnull %10, ptr noundef nonnull %14, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %.not39 = icmp eq i32 %35, 1
  br i1 %.not39, label %36, label %.thread50

36:                                               ; preds = %32
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load i64, ptr %14, align 8, !tbaa !9
  %39 = call i32 @format_bytes(ptr noundef %0, i32 noundef %3, i32 noundef %20, ptr noundef nonnull @.str.223, ptr noundef %37, i64 noundef %38) #4
  %40 = call i32 @tls_uint16array_from_bytes(ptr noundef nonnull %11, ptr noundef nonnull %15, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %.not40 = icmp eq i32 %40, 1
  br i1 %.not40, label %41, label %.thread50

41:                                               ; preds = %36
  %42 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %3, i32 noundef %20, ptr noundef nonnull @.str.224) #4
  %43 = load i64, ptr %15, align 8, !tbaa !9
  %44 = icmp ugt i64 %43, 1
  br i1 %44, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %41
  %45 = add nsw i32 %4, 8
  br label %46

46:                                               ; preds = %.lr.ph, %48
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %18) #4
  %47 = call i32 @tls_uint16_from_bytes(ptr noundef nonnull %18, ptr noundef nonnull %11, ptr noundef nonnull %15) #4
  %.not46 = icmp eq i32 %47, 1
  br i1 %.not46, label %48, label %.thread

.thread:                                          ; preds = %46
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %18) #4
  br label %.thread50

48:                                               ; preds = %46
  %49 = load i16, ptr %18, align 2, !tbaa !11
  %50 = zext i16 %49 to i32
  %51 = call ptr @tls_cipher_suite_name(i32 noundef %50)
  %52 = load i16, ptr %18, align 2, !tbaa !11
  %53 = zext i16 %52 to i32
  %54 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %3, i32 noundef %45, ptr noundef nonnull @.str.214, ptr noundef %51, i32 noundef %53) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %18) #4
  %55 = load i64, ptr %15, align 8, !tbaa !9
  %56 = icmp ugt i64 %55, 1
  br i1 %56, label %46, label %._crit_edge

._crit_edge:                                      ; preds = %48, %41
  %.lcssa = phi i64 [ %43, %41 ], [ %55, %48 ]
  %.not41 = icmp eq i64 %.lcssa, 0
  br i1 %.not41, label %60, label %57

57:                                               ; preds = %._crit_edge
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 572, ptr noundef nonnull @__FUNCTION__.tls_client_hello_print) #5
  br label %.thread50

60:                                               ; preds = %._crit_edge
  %61 = call i32 @tls_uint8array_from_bytes(ptr noundef nonnull %12, ptr noundef nonnull %16, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %.not42 = icmp eq i32 %61, 1
  br i1 %.not42, label %62, label %.thread50

62:                                               ; preds = %60
  %63 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %3, i32 noundef %20, ptr noundef nonnull @.str.225) #4
  %64 = load i64, ptr %16, align 8, !tbaa !9
  %.not57 = icmp eq i64 %64, 0
  br i1 %.not57, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; preds = %62
  %65 = add nsw i32 %4, 8
  br label %66

66:                                               ; preds = %.lr.ph55, %66
  %.03453 = phi i64 [ 0, %.lr.ph55 ], [ %77, %66 ]
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 %.03453
  %69 = load i8, ptr %68, align 1, !tbaa !13
  %70 = zext i8 %69 to i32
  %71 = call ptr @tls_compression_method_name(i32 noundef %70)
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 %.03453
  %74 = load i8, ptr %73, align 1, !tbaa !13
  %75 = zext i8 %74 to i32
  %76 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %3, i32 noundef %65, ptr noundef nonnull @.str.212, ptr noundef %71, i32 noundef %75) #4
  %77 = add nuw i64 %.03453, 1
  %78 = load i64, ptr %16, align 8, !tbaa !9
  %79 = icmp ult i64 %77, %78
  br i1 %79, label %66, label %._crit_edge56, !llvm.loop !14

._crit_edge56:                                    ; preds = %66, %62
  %80 = load i64, ptr %7, align 8, !tbaa !9
  %.not43 = icmp eq i64 %80, 0
  br i1 %.not43, label %.thread50, label %81

81:                                               ; preds = %._crit_edge56
  %82 = call i32 @tls_uint16array_from_bytes(ptr noundef nonnull %13, ptr noundef nonnull %17, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %.not44 = icmp eq i32 %82, 1
  br i1 %.not44, label %83, label %.thread50

83:                                               ; preds = %81
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = load i64, ptr %17, align 8, !tbaa !9
  %86 = call i32 @tls13_extensions_print(ptr noundef %0, i32 noundef %3, i32 noundef %20, i32 noundef 1, ptr noundef %84, i64 noundef %85)
  %.pr = load i64, ptr %7, align 8, !tbaa !9
  %.not45 = icmp eq i64 %.pr, 0
  br i1 %.not45, label %.thread50, label %87

87:                                               ; preds = %83
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 587, ptr noundef nonnull @__FUNCTION__.tls_client_hello_print) #5
  br label %.thread50

.thread50:                                        ; preds = %._crit_edge56, %.thread, %5, %22, %32, %36, %60, %81, %83, %87, %57
  %.036 = phi i32 [ -1, %57 ], [ -1, %87 ], [ -1, %5 ], [ -1, %22 ], [ -1, %32 ], [ -1, %36 ], [ -1, %60 ], [ -1, %81 ], [ 1, %83 ], [ -1, %.thread ], [ 1, %._crit_edge56 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #4
  ret i32 %.036
}

declare i32 @tls_array_from_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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 = { mustprogress 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 }
attributes #5 = { cold 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 = !{!"short", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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