; 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
@__FUNCTION__.tls_extension_print = external hidden unnamed_addr constant [20 x i8], align 1
@.str.214 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.215 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.216 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.217 = external hidden unnamed_addr constant [9 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_extension_name(i32 noundef) #0

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @tls_extension_print(ptr noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, i32 noundef %4, i32 noundef %5) #0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i16, align 2
  %18 = alloca i16, align 2
  %19 = alloca i8, align 1
  %20 = alloca i16, align 2
  %21 = alloca i16, align 2
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  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 i64 %3, ptr %11, align 8, !tbaa !11
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = load i32, ptr %12, align 4, !tbaa !9
  %26 = load i32, ptr %13, align 4, !tbaa !9
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = call ptr @tls_extension_name(i32 noundef %27)
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %24, i32 noundef %25, i32 noundef %26, ptr noundef @.str.212, ptr noundef %28, i32 noundef %29)
  %31 = load i32, ptr %13, align 4, !tbaa !9
  %32 = add nsw i32 %31, 4
  store i32 %32, ptr %13, align 4, !tbaa !9
  %33 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %33, label %207 [
    i32 43, label %34
    i32 10, label %67
    i32 11, label %99
    i32 13, label %127
    i32 51, label %159
  ]

34:                                               ; preds = %6
  %35 = call i32 @tls_uint16array_from_bytes(ptr noundef %14, ptr noundef %15, ptr noundef %10, ptr noundef %11)
  %36 = icmp ne i32 %35, 1
  br i1 %36, label %45, label %37

37:                                               ; preds = %34
  %38 = load i64, ptr %11, align 8, !tbaa !11
  %39 = call i32 @tls_length_is_zero(i64 noundef %38)
  %40 = icmp ne i32 %39, 1
  br i1 %40, label %45, label %41

41:                                               ; preds = %37
  %42 = load i64, ptr %15, align 8, !tbaa !11
  %43 = urem i64 %42, 2
  %44 = icmp ne i64 %43, 0
  br i1 %44, label %45, label %51

45:                                               ; preds = %41, %37, %34
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 378, ptr noundef @__FUNCTION__.tls_extension_print) #4
  br label %49

49:                                               ; preds = %46
  br label %50

50:                                               ; preds = %49
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %215

51:                                               ; preds = %41
  br label %52

52:                                               ; preds = %55, %51
  %53 = load i64, ptr %15, align 8, !tbaa !11
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %66

55:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #4
  %56 = call i32 @tls_uint16_from_bytes(ptr noundef %17, ptr noundef %14, ptr noundef %15)
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = load i16, ptr %17, align 2, !tbaa !13
  %61 = zext i16 %60 to i32
  %62 = call ptr @tls_protocol_name(i32 noundef %61)
  %63 = load i16, ptr %17, align 2, !tbaa !13
  %64 = zext i16 %63 to i32
  %65 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %57, i32 noundef %58, i32 noundef %59, ptr noundef @.str.214, ptr noundef %62, i32 noundef %64)
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #4
  br label %52, !llvm.loop !15

66:                                               ; preds = %52
  br label %214

67:                                               ; preds = %6
  %68 = call i32 @tls_uint16array_from_bytes(ptr noundef %14, ptr noundef %15, ptr noundef %10, ptr noundef %11)
  %69 = icmp ne i32 %68, 1
  br i1 %69, label %77, label %70

70:                                               ; preds = %67
  %71 = load i64, ptr %11, align 8, !tbaa !11
  %72 = icmp ne i64 %71, 0
  br i1 %72, label %77, label %73

73:                                               ; preds = %70
  %74 = load i64, ptr %15, align 8, !tbaa !11
  %75 = urem i64 %74, 2
  %76 = icmp ne i64 %75, 0
  br i1 %76, label %77, label %83

77:                                               ; preds = %73, %70, %67
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr @stderr, align 8, !tbaa !5
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 392, ptr noundef @__FUNCTION__.tls_extension_print) #4
  br label %81

81:                                               ; preds = %78
  br label %82

82:                                               ; preds = %81
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %215

83:                                               ; preds = %73
  br label %84

84:                                               ; preds = %87, %83
  %85 = load i64, ptr %15, align 8, !tbaa !11
  %86 = icmp ne i64 %85, 0
  br i1 %86, label %87, label %98

87:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #4
  %88 = call i32 @tls_uint16_from_bytes(ptr noundef %18, ptr noundef %14, ptr noundef %15)
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = load i32, ptr %13, align 4, !tbaa !9
  %92 = load i16, ptr %18, align 2, !tbaa !13
  %93 = zext i16 %92 to i32
  %94 = call ptr @tls_curve_name(i32 noundef %93)
  %95 = load i16, ptr %18, align 2, !tbaa !13
  %96 = zext i16 %95 to i32
  %97 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %89, i32 noundef %90, i32 noundef %91, ptr noundef @.str.212, ptr noundef %94, i32 noundef %96)
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #4
  br label %84, !llvm.loop !17

98:                                               ; preds = %84
  br label %214

99:                                               ; preds = %6
  %100 = call i32 @tls_uint8array_from_bytes(ptr noundef %14, ptr noundef %15, ptr noundef %10, ptr noundef %11)
  %101 = icmp ne i32 %100, 1
  br i1 %101, label %105, label %102

102:                                              ; preds = %99
  %103 = load i64, ptr %11, align 8, !tbaa !11
  %104 = icmp ne i64 %103, 0
  br i1 %104, label %105, label %111

105:                                              ; preds = %102, %99
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr @stderr, align 8, !tbaa !5
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 405, ptr noundef @__FUNCTION__.tls_extension_print) #4
  br label %109

109:                                              ; preds = %106
  br label %110

110:                                              ; preds = %109
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %215

111:                                              ; preds = %102
  br label %112

112:                                              ; preds = %115, %111
  %113 = load i64, ptr %15, align 8, !tbaa !11
  %114 = icmp ne i64 %113, 0
  br i1 %114, label %115, label %126

115:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #4
  %116 = call i32 @tls_uint8_from_bytes(ptr noundef %19, ptr noundef %14, ptr noundef %15)
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = load i32, ptr %12, align 4, !tbaa !9
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = load i8, ptr %19, align 1, !tbaa !18
  %121 = zext i8 %120 to i32
  %122 = call ptr @tls_ec_point_format_name(i32 noundef %121)
  %123 = load i8, ptr %19, align 1, !tbaa !18
  %124 = zext i8 %123 to i32
  %125 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %117, i32 noundef %118, i32 noundef %119, ptr noundef @.str.212, ptr noundef %122, i32 noundef %124)
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #4
  br label %112, !llvm.loop !19

126:                                              ; preds = %112
  br label %214

127:                                              ; preds = %6
  %128 = call i32 @tls_uint16array_from_bytes(ptr noundef %14, ptr noundef %15, ptr noundef %10, ptr noundef %11)
  %129 = icmp ne i32 %128, 1
  br i1 %129, label %137, label %130

130:                                              ; preds = %127
  %131 = load i64, ptr %11, align 8, !tbaa !11
  %132 = icmp ne i64 %131, 0
  br i1 %132, label %137, label %133

133:                                              ; preds = %130
  %134 = load i64, ptr %15, align 8, !tbaa !11
  %135 = urem i64 %134, 2
  %136 = icmp ne i64 %135, 0
  br i1 %136, label %137, label %143

137:                                              ; preds = %133, %130, %127
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.213, ptr noundef @.str.130, i32 noundef 419, ptr noundef @__FUNCTION__.tls_extension_print) #4
  br label %141

141:                                              ; preds = %138
  br label %142

142:                                              ; preds = %141
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %215

143:                                              ; preds = %133
  br label %144

144:                                              ; preds = %147, %143
  %145 = load i64, ptr %15, align 8, !tbaa !11
  %146 = icmp ne i64 %145, 0
  br i1 %146, label %147, label %158

147:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #4
  %148 = call i32 @tls_uint16_from_bytes(ptr noundef %20, ptr noundef %14, ptr noundef %15)
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = load i32, ptr %13, align 4, !tbaa !9
  %152 = load i16, ptr %20, align 2, !tbaa !13
  %153 = zext i16 %152 to i32
  %154 = call ptr @tls_signature_scheme_name(i32 noundef %153)
  %155 = load i16, ptr %20, align 2, !tbaa !13
  %156 = zext i16 %155 to i32
  %157 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %149, i32 noundef %150, i32 noundef %151, ptr noundef @.str.214, ptr noundef %154, i32 noundef %156)
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #4
  br label %144, !llvm.loop !20

158:                                              ; preds = %144
  br label %214

159:                                              ; preds = %6
  %160 = call i32 @tls_uint16array_from_bytes(ptr noundef %14, ptr noundef %15, ptr noundef %10, ptr noundef %11)
  %161 = icmp ne i32 %160, 1
  br i1 %161, label %165, label %162

162:                                              ; preds = %159
  %163 = load i64, ptr %11, align 8, !tbaa !11
  %164 = icmp ne i64 %163, 0
  br i1 %164, label %165, label %171

165:                                              ; preds = %162, %159
  br label %166

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

169:                                              ; preds = %166
  br label %170

170:                                              ; preds = %169
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %215

171:                                              ; preds = %162
  br label %172

172:                                              ; preds = %205, %171
  %173 = load i64, ptr %15, align 8, !tbaa !11
  %174 = icmp ne i64 %173, 0
  br i1 %174, label %175, label %206

175:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 2, 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
  %176 = call i32 @tls_uint16_from_bytes(ptr noundef %21, ptr noundef %14, ptr noundef %15)
  %177 = icmp ne i32 %176, 1
  br i1 %177, label %181, label %178

178:                                              ; preds = %175
  %179 = call i32 @tls_uint16array_from_bytes(ptr noundef %22, ptr noundef %23, ptr noundef %14, ptr noundef %15)
  %180 = icmp ne i32 %179, 1
  br i1 %180, label %181, label %187

181:                                              ; preds = %178, %175
  br label %182

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

185:                                              ; preds = %182
  br label %186

186:                                              ; preds = %185
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %203

187:                                              ; preds = %178
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  %189 = load i32, ptr %12, align 4, !tbaa !9
  %190 = load i32, ptr %13, align 4, !tbaa !9
  %191 = load i16, ptr %21, align 2, !tbaa !13
  %192 = zext i16 %191 to i32
  %193 = call ptr @tls_curve_name(i32 noundef %192)
  %194 = load i16, ptr %21, align 2, !tbaa !13
  %195 = zext i16 %194 to i32
  %196 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %188, i32 noundef %189, i32 noundef %190, ptr noundef @.str.215, ptr noundef %193, i32 noundef %195)
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = load i32, ptr %12, align 4, !tbaa !9
  %199 = load i32, ptr %13, align 4, !tbaa !9
  %200 = load ptr, ptr %22, align 8, !tbaa !5
  %201 = load i64, ptr %23, align 8, !tbaa !11
  %202 = call i32 @format_bytes(ptr noundef %197, i32 noundef %198, i32 noundef %199, ptr noundef @.str.216, ptr noundef %200, i64 noundef %201)
  store i32 0, ptr %16, align 4
  br label %203

203:                                              ; preds = %187, %186
  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 2, ptr %21) #4
  %204 = load i32, ptr %16, align 4
  switch i32 %204, label %215 [
    i32 0, label %205
  ]

205:                                              ; preds = %203
  br label %172, !llvm.loop !21

206:                                              ; preds = %172
  br label %214

207:                                              ; preds = %6
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = load i32, ptr %12, align 4, !tbaa !9
  %210 = load i32, ptr %13, align 4, !tbaa !9
  %211 = load ptr, ptr %10, align 8, !tbaa !5
  %212 = load i64, ptr %11, align 8, !tbaa !11
  %213 = call i32 @format_bytes(ptr noundef %208, i32 noundef %209, i32 noundef %210, ptr noundef @.str.217, ptr noundef %211, i64 noundef %212)
  br label %214

214:                                              ; preds = %207, %206, %158, %126, %98, %66
  store i32 1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %215

215:                                              ; preds = %214, %203, %170, %142, %110, %82, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %216 = load i32, ptr %7, align 4
  ret i32 %216
}

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

declare i32 @tls_length_is_zero(i64 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

declare i32 @tls_uint8_from_bytes(ptr 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !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
@__FUNCTION__.tls_extension_print = external hidden unnamed_addr constant [20 x i8], align 1
@.str.214 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.215 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.216 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.217 = external hidden unnamed_addr constant [9 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_extension_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 ptr @tls_ec_point_format_name(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @tls_extension_print(ptr noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i8, align 1
  %14 = alloca i16, align 2
  %15 = alloca i16, align 2
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %18 = tail call ptr @tls_extension_name(i32 noundef %1)
  %19 = tail call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %4, i32 noundef %5, ptr noundef nonnull @.str.212, ptr noundef %18, i32 noundef %1) #4
  %20 = add nsw i32 %5, 4
  switch i32 %1, label %117 [
    i32 43, label %21
    i32 10, label %39
    i32 11, label %57
    i32 13, label %74
    i32 51, label %92
  ]

21:                                               ; preds = %6
  %22 = call i32 @tls_uint16array_from_bytes(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8) #4
  %.not44 = icmp eq i32 %22, 1
  br i1 %.not44, label %23, label %29

23:                                               ; preds = %21
  %24 = load i64, ptr %8, align 8, !tbaa !9
  %25 = call i32 @tls_length_is_zero(i64 noundef %24) #4
  %.not45 = icmp eq i32 %25, 1
  br i1 %.not45, label %26, label %29

26:                                               ; preds = %23
  %27 = load i64, ptr %10, align 8, !tbaa !9
  %28 = and i64 %27, 1
  %.not46 = icmp eq i64 %28, 0
  br i1 %.not46, label %.preheader, label %29

.preheader:                                       ; preds = %26
  %.not4765 = icmp eq i64 %27, 0
  br i1 %.not4765, label %.loopexit, label %.lr.ph66

29:                                               ; preds = %21, %23, %26
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 378, ptr noundef nonnull @__FUNCTION__.tls_extension_print) #5
  br label %.loopexit

.lr.ph66:                                         ; preds = %.preheader, %.lr.ph66
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %11) #4
  %32 = call i32 @tls_uint16_from_bytes(ptr noundef nonnull %11, ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %33 = load i16, ptr %11, align 2, !tbaa !11
  %34 = zext i16 %33 to i32
  %35 = call ptr @tls_protocol_name(i32 noundef %34)
  %36 = load i16, ptr %11, align 2, !tbaa !11
  %37 = zext i16 %36 to i32
  %38 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %4, i32 noundef %20, ptr noundef nonnull @.str.214, ptr noundef %35, i32 noundef %37) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %11) #4
  %.pr = load i64, ptr %10, align 8, !tbaa !9
  %.not47 = icmp eq i64 %.pr, 0
  br i1 %.not47, label %.loopexit, label %.lr.ph66, !llvm.loop !13

39:                                               ; preds = %6
  %40 = call i32 @tls_uint16array_from_bytes(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8) #4
  %41 = icmp ne i32 %40, 1
  %42 = load i64, ptr %8, align 8
  %43 = icmp ne i64 %42, 0
  %or.cond = select i1 %41, i1 true, i1 %43
  br i1 %or.cond, label %47, label %44

44:                                               ; preds = %39
  %45 = load i64, ptr %10, align 8, !tbaa !9
  %46 = and i64 %45, 1
  %.not42 = icmp eq i64 %46, 0
  br i1 %.not42, label %.preheader50, label %47

.preheader50:                                     ; preds = %44
  %.not4363 = icmp eq i64 %45, 0
  br i1 %.not4363, label %.loopexit, label %.lr.ph64

47:                                               ; preds = %39, %44
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 392, ptr noundef nonnull @__FUNCTION__.tls_extension_print) #5
  br label %.loopexit

.lr.ph64:                                         ; preds = %.preheader50, %.lr.ph64
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %12) #4
  %50 = call i32 @tls_uint16_from_bytes(ptr noundef nonnull %12, ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %51 = load i16, ptr %12, align 2, !tbaa !11
  %52 = zext i16 %51 to i32
  %53 = call ptr @tls_curve_name(i32 noundef %52)
  %54 = load i16, ptr %12, align 2, !tbaa !11
  %55 = zext i16 %54 to i32
  %56 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %4, i32 noundef %20, ptr noundef nonnull @.str.212, ptr noundef %53, i32 noundef %55) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %12) #4
  %.pr48 = load i64, ptr %10, align 8, !tbaa !9
  %.not43 = icmp eq i64 %.pr48, 0
  br i1 %.not43, label %.loopexit, label %.lr.ph64, !llvm.loop !15

57:                                               ; preds = %6
  %58 = call i32 @tls_uint8array_from_bytes(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8) #4
  %59 = icmp ne i32 %58, 1
  %60 = load i64, ptr %8, align 8
  %61 = icmp ne i64 %60, 0
  %or.cond3 = select i1 %59, i1 true, i1 %61
  br i1 %or.cond3, label %63, label %.preheader52

.preheader52:                                     ; preds = %57
  %62 = load i64, ptr %10, align 8, !tbaa !9
  %.not4161 = icmp eq i64 %62, 0
  br i1 %.not4161, label %.loopexit, label %.lr.ph62

63:                                               ; preds = %57
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 405, ptr noundef nonnull @__FUNCTION__.tls_extension_print) #5
  br label %.loopexit

.lr.ph62:                                         ; preds = %.preheader52, %.lr.ph62
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #4
  %66 = call i32 @tls_uint8_from_bytes(ptr noundef nonnull %13, ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %67 = load i8, ptr %13, align 1, !tbaa !16
  %68 = zext i8 %67 to i32
  %69 = call ptr @tls_ec_point_format_name(i32 noundef %68)
  %70 = load i8, ptr %13, align 1, !tbaa !16
  %71 = zext i8 %70 to i32
  %72 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %4, i32 noundef %20, ptr noundef nonnull @.str.212, ptr noundef %69, i32 noundef %71) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #4
  %73 = load i64, ptr %10, align 8, !tbaa !9
  %.not41 = icmp eq i64 %73, 0
  br i1 %.not41, label %.loopexit, label %.lr.ph62, !llvm.loop !17

74:                                               ; preds = %6
  %75 = call i32 @tls_uint16array_from_bytes(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8) #4
  %76 = icmp ne i32 %75, 1
  %77 = load i64, ptr %8, align 8
  %78 = icmp ne i64 %77, 0
  %or.cond5 = select i1 %76, i1 true, i1 %78
  br i1 %or.cond5, label %82, label %79

79:                                               ; preds = %74
  %80 = load i64, ptr %10, align 8, !tbaa !9
  %81 = and i64 %80, 1
  %.not39 = icmp eq i64 %81, 0
  br i1 %.not39, label %.preheader54, label %82

.preheader54:                                     ; preds = %79
  %.not4059 = icmp eq i64 %80, 0
  br i1 %.not4059, label %.loopexit, label %.lr.ph60

82:                                               ; preds = %74, %79
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 419, ptr noundef nonnull @__FUNCTION__.tls_extension_print) #5
  br label %.loopexit

.lr.ph60:                                         ; preds = %.preheader54, %.lr.ph60
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %14) #4
  %85 = call i32 @tls_uint16_from_bytes(ptr noundef nonnull %14, ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %86 = load i16, ptr %14, align 2, !tbaa !11
  %87 = zext i16 %86 to i32
  %88 = call ptr @tls_signature_scheme_name(i32 noundef %87)
  %89 = load i16, ptr %14, align 2, !tbaa !11
  %90 = zext i16 %89 to i32
  %91 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %4, i32 noundef %20, ptr noundef nonnull @.str.214, ptr noundef %88, i32 noundef %90) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %14) #4
  %.pr49 = load i64, ptr %10, align 8, !tbaa !9
  %.not40 = icmp eq i64 %.pr49, 0
  br i1 %.not40, label %.loopexit, label %.lr.ph60, !llvm.loop !18

92:                                               ; preds = %6
  %93 = call i32 @tls_uint16array_from_bytes(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %8) #4
  %94 = icmp ne i32 %93, 1
  %95 = load i64, ptr %8, align 8
  %96 = icmp ne i64 %95, 0
  %or.cond7 = select i1 %94, i1 true, i1 %96
  br i1 %or.cond7, label %98, label %.preheader56

.preheader56:                                     ; preds = %92
  %97 = load i64, ptr %10, align 8, !tbaa !9
  %.not58 = icmp eq i64 %97, 0
  br i1 %.not58, label %.loopexit, label %.lr.ph

98:                                               ; preds = %92
  %99 = load ptr, ptr @stderr, align 8, !tbaa !5
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 432, ptr noundef nonnull @__FUNCTION__.tls_extension_print) #5
  br label %.loopexit

.lr.ph:                                           ; preds = %.preheader56, %106
  call void @llvm.lifetime.start.p0(i64 2, 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
  %101 = call i32 @tls_uint16_from_bytes(ptr noundef nonnull %15, ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %.not37 = icmp eq i32 %101, 1
  br i1 %.not37, label %102, label %.critedge

102:                                              ; preds = %.lr.ph
  %103 = call i32 @tls_uint16array_from_bytes(ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %.not38 = icmp eq i32 %103, 1
  br i1 %.not38, label %106, label %.critedge

.critedge:                                        ; preds = %.lr.ph, %102
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.213, ptr noundef nonnull @.str.130, i32 noundef 442, ptr noundef nonnull @__FUNCTION__.tls_extension_print) #5
  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 2, ptr nonnull %15) #4
  br label %.loopexit

106:                                              ; preds = %102
  %107 = load i16, ptr %15, align 2, !tbaa !11
  %108 = zext i16 %107 to i32
  %109 = call ptr @tls_curve_name(i32 noundef %108)
  %110 = load i16, ptr %15, align 2, !tbaa !11
  %111 = zext i16 %110 to i32
  %112 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %0, i32 noundef %4, i32 noundef %20, ptr noundef nonnull @.str.215, ptr noundef %109, i32 noundef %111) #4
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = load i64, ptr %17, align 8, !tbaa !9
  %115 = call i32 @format_bytes(ptr noundef %0, i32 noundef %4, i32 noundef %20, ptr noundef nonnull @.str.216, ptr noundef %113, i64 noundef %114) #4
  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 2, ptr nonnull %15) #4
  %116 = load i64, ptr %10, align 8, !tbaa !9
  %.not = icmp eq i64 %116, 0
  br i1 %.not, label %.loopexit, label %.lr.ph, !llvm.loop !19

117:                                              ; preds = %6
  %118 = tail call i32 @format_bytes(ptr noundef %0, i32 noundef %4, i32 noundef %20, ptr noundef nonnull @.str.217, ptr noundef %2, i64 noundef %3) #4
  br label %.loopexit

.loopexit:                                        ; preds = %106, %.lr.ph60, %.lr.ph62, %.lr.ph64, %.lr.ph66, %.preheader56, %.preheader54, %.preheader52, %.preheader50, %.preheader, %117, %.critedge, %98, %82, %63, %47, %29
  %.2 = phi i32 [ -1, %98 ], [ -1, %82 ], [ -1, %63 ], [ -1, %47 ], [ -1, %29 ], [ -1, %.critedge ], [ 1, %117 ], [ 1, %.preheader ], [ 1, %.preheader50 ], [ 1, %.preheader52 ], [ 1, %.preheader54 ], [ 1, %.preheader56 ], [ 1, %.lr.ph66 ], [ 1, %.lr.ph64 ], [ 1, %.lr.ph62 ], [ 1, %.lr.ph60 ], [ 1, %106 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  ret i32 %.2
}

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

declare i32 @tls_length_is_zero(i64 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

declare i32 @tls_uint8_from_bytes(ptr 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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass