; LLVM IR from aws/s2n-tls :: utils (s2n_map)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_result = type { i32 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_map = type { i32, i32, i32, ptr }
%struct.s2n_map_entry = type { %struct.s2n_blob, %struct.s2n_blob }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.8 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [86 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strrchr(ptr noundef, i32 noundef) #1

declare i32 @s2n_calculate_stacktrace() #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #4

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_map_slot(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_map_lookup(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #5 {
  %5 = alloca %struct.s2n_result, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.s2n_result, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.s2n_blob, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %4
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %50, label %18

18:                                               ; preds = %15
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %22 = getelementptr inbounds %struct.s2n_debug_info, ptr %21, i32 0, i32 0
  store ptr @.str.8, ptr %22, align 8, !tbaa !9
  %23 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %24 = getelementptr inbounds %struct.s2n_debug_info, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %25, i64 21
  %27 = call ptr @strrchr(ptr noundef %26, i32 noundef 47) #7
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %36

29:                                               ; preds = %20
  %30 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %31 = getelementptr inbounds %struct.s2n_debug_info, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %32, i64 21
  %34 = call ptr @strrchr(ptr noundef %33, i32 noundef 47) #7
  %35 = getelementptr inbounds i8, ptr %34, i64 1
  br label %41

36:                                               ; preds = %20
  %37 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %38 = getelementptr inbounds %struct.s2n_debug_info, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %39, i64 21
  br label %41

41:                                               ; preds = %36, %29
  %42 = phi ptr [ %35, %29 ], [ %40, %36 ]
  %43 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %44 = getelementptr inbounds %struct.s2n_debug_info, ptr %43, i32 0, i32 1
  store ptr %42, ptr %44, align 8, !tbaa !11
  %45 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %45, align 4, !tbaa !12
  %46 = call i32 @s2n_calculate_stacktrace()
  br label %47

47:                                               ; preds = %41
  %48 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 -1, ptr %48, align 4, !tbaa !14
  br label %191

49:                                               ; No predecessors!
  br label %50

50:                                               ; preds = %49, %15
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.s2n_map, ptr %53, i32 0, i32 2
  %55 = load i32, ptr %54, align 8, !tbaa !16
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %89, label %57

57:                                               ; preds = %52
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %61 = getelementptr inbounds %struct.s2n_debug_info, ptr %60, i32 0, i32 0
  store ptr @.str.9, ptr %61, align 8, !tbaa !9
  %62 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %63 = getelementptr inbounds %struct.s2n_debug_info, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %64, i64 21
  %66 = call ptr @strrchr(ptr noundef %65, i32 noundef 47) #7
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %75

68:                                               ; preds = %59
  %69 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %70 = getelementptr inbounds %struct.s2n_debug_info, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %71, i64 21
  %73 = call ptr @strrchr(ptr noundef %72, i32 noundef 47) #7
  %74 = getelementptr inbounds i8, ptr %73, i64 1
  br label %80

75:                                               ; preds = %59
  %76 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %77 = getelementptr inbounds %struct.s2n_debug_info, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds i8, ptr %78, i64 21
  br label %80

80:                                               ; preds = %75, %68
  %81 = phi ptr [ %74, %68 ], [ %79, %75 ]
  %82 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %83 = getelementptr inbounds %struct.s2n_debug_info, ptr %82, i32 0, i32 1
  store ptr %81, ptr %83, align 8, !tbaa !11
  %84 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653227, ptr %84, align 4, !tbaa !12
  %85 = call i32 @s2n_calculate_stacktrace()
  br label %86

86:                                               ; preds = %80
  %87 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 -1, ptr %87, align 4, !tbaa !14
  br label %191

88:                                               ; No predecessors!
  br label %89

89:                                               ; preds = %88, %52
  br label %90

90:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !12
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = call i32 @s2n_map_slot(ptr noundef %92, ptr noundef %93, ptr noundef %10)
  %95 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %94, ptr %95, align 4
  %96 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %97 = load i32, ptr %96, align 4
  %98 = call zeroext i1 @s2n_result_is_ok(i32 %97)
  br i1 %98, label %101, label %99

99:                                               ; preds = %91
  %100 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 -1, ptr %100, align 4, !tbaa !14
  store i32 1, ptr %12, align 4
  br label %190

101:                                              ; preds = %91
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %104 = load i32, ptr %10, align 4, !tbaa !12
  store i32 %104, ptr %13, align 4, !tbaa !12
  br label %105

105:                                              ; preds = %161, %103
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.s2n_map, ptr %106, i32 0, i32 3
  %108 = load ptr, ptr %107, align 8, !tbaa !18
  %109 = load i32, ptr %10, align 4, !tbaa !12
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds %struct.s2n_map_entry, ptr %108, i64 %110
  %112 = getelementptr inbounds %struct.s2n_map_entry, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.s2n_blob, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 8, !tbaa !19
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %186

116:                                              ; preds = %105
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.s2n_blob, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 8, !tbaa !22
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.s2n_map, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !18
  %123 = load i32, ptr %10, align 4, !tbaa !12
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds %struct.s2n_map_entry, ptr %122, i64 %124
  %126 = getelementptr inbounds %struct.s2n_map_entry, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.s2n_blob, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 8, !tbaa !19
  %129 = icmp ne i32 %119, %128
  br i1 %129, label %149, label %130

130:                                              ; preds = %116
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.s2n_blob, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !23
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.s2n_map, ptr %134, i32 0, i32 3
  %136 = load ptr, ptr %135, align 8, !tbaa !18
  %137 = load i32, ptr %10, align 4, !tbaa !12
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds %struct.s2n_map_entry, ptr %136, i64 %138
  %140 = getelementptr inbounds %struct.s2n_map_entry, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds %struct.s2n_blob, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !24
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.s2n_blob, ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 8, !tbaa !22
  %146 = zext i32 %145 to i64
  %147 = call i32 @memcmp(ptr noundef %133, ptr noundef %142, i64 noundef %146) #7
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %162

149:                                              ; preds = %130, %116
  %150 = load i32, ptr %10, align 4, !tbaa !12
  %151 = add i32 %150, 1
  store i32 %151, ptr %10, align 4, !tbaa !12
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.s2n_map, ptr %152, i32 0, i32 0
  %154 = load i32, ptr %153, align 8, !tbaa !25
  %155 = load i32, ptr %10, align 4, !tbaa !12
  %156 = urem i32 %155, %154
  store i32 %156, ptr %10, align 4, !tbaa !12
  %157 = load i32, ptr %10, align 4, !tbaa !12
  %158 = load i32, ptr %13, align 4, !tbaa !12
  %159 = icmp eq i32 %157, %158
  br i1 %159, label %160, label %161

160:                                              ; preds = %149
  br label %186

161:                                              ; preds = %149
  br label %105, !llvm.loop !26

162:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #8
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.s2n_map, ptr %163, i32 0, i32 3
  %165 = load ptr, ptr %164, align 8, !tbaa !18
  %166 = load i32, ptr %10, align 4, !tbaa !12
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds %struct.s2n_map_entry, ptr %165, i64 %167
  %169 = getelementptr inbounds %struct.s2n_map_entry, ptr %168, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %169, i64 24, i1 false), !tbaa.struct !28
  br label %170

170:                                              ; preds = %162
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.s2n_blob, ptr %14, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !23
  %174 = getelementptr inbounds %struct.s2n_blob, ptr %14, i32 0, i32 1
  %175 = load i32, ptr %174, align 8, !tbaa !22
  %176 = call i32 @s2n_blob_init(ptr noundef %171, ptr noundef %173, i32 noundef %175)
  %177 = icmp sgt i32 %176, -1
  br i1 %177, label %180, label %178

178:                                              ; preds = %170
  %179 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 -1, ptr %179, align 4, !tbaa !14
  store i32 1, ptr %12, align 4
  br label %185

180:                                              ; preds = %170
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  store i8 1, ptr %183, align 1, !tbaa !30
  %184 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 0, ptr %184, align 4, !tbaa !14
  store i32 1, ptr %12, align 4
  br label %185

185:                                              ; preds = %182, %178
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #8
  br label %189

186:                                              ; preds = %160, %105
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  store i8 0, ptr %187, align 1, !tbaa !30
  %188 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 0, ptr %188, align 4, !tbaa !14
  store i32 1, ptr %12, align 4
  br label %189

189:                                              ; preds = %186, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %190

190:                                              ; preds = %189, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %191

191:                                              ; preds = %190, %86, %47
  %192 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  %193 = load i32, ptr %192, align 4
  ret i32 %193
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nounwind willreturn memory(read) "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"", !13, i64 0}
!16 = !{!17, !13, i64 8}
!17 = !{!"s2n_map", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16}
!18 = !{!17, !6, i64 16}
!19 = !{!20, !13, i64 8}
!20 = !{!"s2n_map_entry", !21, i64 0, !21, i64 24}
!21 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!22 = !{!21, !13, i64 8}
!23 = !{!21, !6, i64 0}
!24 = !{!20, !6, i64 0}
!25 = !{!17, !13, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{i64 0, i64 8, !5, i64 8, i64 4, !12, i64 12, i64 4, !12, i64 16, i64 1, !29}
!29 = !{!7, !7, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"_Bool", !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"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_map_entry = type { %struct.s2n_blob, %struct.s2n_blob }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.8 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [86 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_map_slot(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_map_lookup(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #5 {
  %5 = alloca i32, align 4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %14

6:                                                ; preds = %4
  %7 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.8, ptr %7, align 8, !tbaa !5
  %8 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.8, i64 21), i32 noundef 47) #7
  %.not21 = icmp eq ptr %8, null
  %9 = getelementptr inbounds i8, ptr %8, i64 1
  %10 = select i1 %.not21, ptr getelementptr inbounds (i8, ptr @.str.8, i64 21), ptr %9
  %11 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %10, ptr %11, align 8, !tbaa !10
  %12 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %12, align 4, !tbaa !11
  %13 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %55

14:                                               ; preds = %4
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !13
  %.not22 = icmp eq i32 %16, 0
  br i1 %.not22, label %17, label %25

17:                                               ; preds = %14
  %18 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.9, ptr %18, align 8, !tbaa !5
  %19 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.9, i64 21), i32 noundef 47) #7
  %.not23 = icmp eq ptr %19, null
  %20 = getelementptr inbounds i8, ptr %19, i64 1
  %21 = select i1 %.not23, ptr getelementptr inbounds (i8, ptr @.str.9, i64 21), ptr %20
  %22 = getelementptr inbounds i8, ptr %18, i64 8
  store ptr %21, ptr %22, align 8, !tbaa !10
  %23 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653227, ptr %23, align 4, !tbaa !11
  %24 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %55

25:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 0, ptr %5, align 4, !tbaa !11
  %26 = call i32 @s2n_map_slot(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %5)
  %27 = call zeroext i1 @s2n_result_is_ok(i32 %26)
  br i1 %27, label %28, label %54

28:                                               ; preds = %25
  %29 = load i32, ptr %5, align 4, !tbaa !11
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  br label %33

33:                                               ; preds = %45, %28
  %34 = phi i32 [ %48, %45 ], [ %29, %28 ]
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds %struct.s2n_map_entry, ptr %31, i64 %35
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load i32, ptr %37, align 8, !tbaa !16
  %.not24 = icmp eq i32 %38, 0
  br i1 %.not24, label %.sink.split, label %39

39:                                               ; preds = %33
  %40 = load i32, ptr %32, align 8, !tbaa !19
  %.not25 = icmp eq i32 %40, %38
  br i1 %.not25, label %41, label %45

41:                                               ; preds = %39
  %42 = load ptr, ptr %1, align 8, !tbaa !20
  %43 = load ptr, ptr %36, align 8, !tbaa !21
  %44 = zext i32 %38 to i64
  %bcmp = call i32 @bcmp(ptr %42, ptr %43, i64 %44)
  %.not26 = icmp eq i32 %bcmp, 0
  br i1 %.not26, label %50, label %45

45:                                               ; preds = %41, %39
  %46 = add i32 %34, 1
  %47 = load i32, ptr %0, align 8, !tbaa !22
  %48 = urem i32 %46, %47
  store i32 %48, ptr %5, align 4, !tbaa !11
  %49 = icmp eq i32 %48, %29
  br i1 %49, label %.sink.split, label %33, !llvm.loop !23

50:                                               ; preds = %41
  %51 = getelementptr inbounds %struct.s2n_map_entry, ptr %31, i64 %35, i32 1
  %.sroa.0.0.copyload = load ptr, ptr %51, align 8, !tbaa !25
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %51, i64 8
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !11
  %52 = call i32 @s2n_blob_init(ptr noundef %2, ptr noundef %.sroa.0.0.copyload, i32 noundef %.sroa.4.0.copyload) #8
  %53 = icmp sgt i32 %52, -1
  br i1 %53, label %.sink.split, label %54

.sink.split:                                      ; preds = %33, %45, %50
  %.sink = phi i8 [ 1, %50 ], [ 0, %45 ], [ 0, %33 ]
  store i8 %.sink, ptr %3, align 1, !tbaa !26
  br label %54

54:                                               ; preds = %.sink.split, %50, %25
  %.sroa.016.2 = phi i32 [ -1, %25 ], [ -1, %50 ], [ 0, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %55

55:                                               ; preds = %54, %17, %6
  %.sroa.016.3 = phi i32 [ %.sroa.016.2, %54 ], [ -1, %17 ], [ -1, %6 ]
  ret i32 %.sroa.016.3
}

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"s2n_map", !12, i64 0, !12, i64 4, !12, i64 8, !7, i64 16}
!15 = !{!14, !7, i64 16}
!16 = !{!17, !12, i64 8}
!17 = !{!"s2n_map_entry", !18, i64 0, !18, i64 24}
!18 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!19 = !{!18, !12, i64 8}
!20 = !{!18, !7, i64 0}
!21 = !{!17, !7, i64 0}
!22 = !{!14, !12, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"_Bool", !8, i64 0}


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