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

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

@initialized = external hidden global i8, align 1
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@atexit_cleanup = external hidden global i8, align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@main_thread = external hidden global i64, align 8
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 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: nounwind uwtable
define dso_local i32 @s2n_init() #3 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.s2n_result, align 4
  %3 = alloca %struct.s2n_result, align 4
  %4 = alloca %struct.s2n_result, align 4
  %5 = alloca %struct.s2n_result, align 4
  %6 = alloca %struct.s2n_result, align 4
  %7 = alloca %struct.s2n_result, align 4
  br label %8

8:                                                ; preds = %0
  %9 = load i8, ptr @initialized, align 1, !tbaa !5, !range !9, !noundef !10
  %10 = trunc i8 %9 to i1
  br i1 %10, label %11, label %42

11:                                               ; preds = %8
  br label %12

12:                                               ; preds = %11
  br label %13

13:                                               ; preds = %12
  %14 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %15 = getelementptr inbounds %struct.s2n_debug_info, ptr %14, i32 0, i32 0
  store ptr @.str.1, ptr %15, align 8, !tbaa !11
  %16 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %17 = getelementptr inbounds %struct.s2n_debug_info, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %18, i64 21
  %20 = call ptr @strrchr(ptr noundef %19, i32 noundef 47) #7
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %29

22:                                               ; preds = %13
  %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 !11
  %26 = getelementptr inbounds i8, ptr %25, i64 21
  %27 = call ptr @strrchr(ptr noundef %26, i32 noundef 47) #7
  %28 = getelementptr inbounds i8, ptr %27, i64 1
  br label %34

29:                                               ; preds = %13
  %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 !11
  %33 = getelementptr inbounds i8, ptr %32, i64 21
  br label %34

34:                                               ; preds = %29, %22
  %35 = phi ptr [ %28, %22 ], [ %33, %29 ]
  %36 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %37 = getelementptr inbounds %struct.s2n_debug_info, ptr %36, i32 0, i32 1
  store ptr %35, ptr %37, align 8, !tbaa !14
  %38 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653195, ptr %38, align 4, !tbaa !15
  %39 = call i32 @s2n_calculate_stacktrace()
  br label %40

40:                                               ; preds = %34
  store i32 -1, ptr %1, align 4
  br label %190

41:                                               ; No predecessors!
  br label %42

42:                                               ; preds = %41, %8
  br label %43

43:                                               ; preds = %42
  %44 = call i64 @pthread_self() #8
  store i64 %44, ptr @main_thread, align 8, !tbaa !17
  %45 = call ptr @getenv(ptr noundef @.str.2) #9
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %54

47:                                               ; preds = %43
  br label %48

48:                                               ; preds = %47
  %49 = call i32 @s2n_in_integ_test_set(i1 noundef zeroext true)
  %50 = icmp sgt i32 %49, -1
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 -1, ptr %1, align 4
  br label %190

52:                                               ; preds = %48
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53, %43
  br label %55

55:                                               ; preds = %54
  %56 = call i32 @s2n_libcrypto_validate_runtime()
  %57 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 %56, ptr %57, align 4
  %58 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  %59 = load i32, ptr %58, align 4
  %60 = call zeroext i1 @s2n_result_is_ok(i32 %59)
  br i1 %60, label %62, label %61

61:                                               ; preds = %55
  store i32 -1, ptr %1, align 4
  br label %190

62:                                               ; preds = %55
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  %65 = call i32 @s2n_mem_init()
  %66 = icmp sgt i32 %65, -1
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  store i32 -1, ptr %1, align 4
  br label %190

68:                                               ; preds = %64
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  %71 = call i32 @s2n_locking_init()
  %72 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 %71, ptr %72, align 4
  %73 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %74 = load i32, ptr %73, align 4
  %75 = call zeroext i1 @s2n_result_is_ok(i32 %74)
  br i1 %75, label %77, label %76

76:                                               ; preds = %70
  store i32 -1, ptr %1, align 4
  br label %190

77:                                               ; preds = %70
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  %80 = call i32 @s2n_fips_init()
  %81 = icmp sgt i32 %80, -1
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  store i32 -1, ptr %1, align 4
  br label %190

83:                                               ; preds = %79
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  %86 = call i32 @s2n_rand_init()
  %87 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 %86, ptr %87, align 4
  %88 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  %89 = load i32, ptr %88, align 4
  %90 = call zeroext i1 @s2n_result_is_ok(i32 %89)
  br i1 %90, label %92, label %91

91:                                               ; preds = %85
  store i32 -1, ptr %1, align 4
  br label %190

92:                                               ; preds = %85
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  %95 = call i32 (...) @s2n_hash_algorithms_init()
  %96 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 %95, ptr %96, align 4
  %97 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  %98 = load i32, ptr %97, align 4
  %99 = call zeroext i1 @s2n_result_is_ok(i32 %98)
  br i1 %99, label %101, label %100

100:                                              ; preds = %94
  store i32 -1, ptr %1, align 4
  br label %190

101:                                              ; preds = %94
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  %104 = call i32 @s2n_cipher_suites_init()
  %105 = icmp sgt i32 %104, -1
  br i1 %105, label %107, label %106

106:                                              ; preds = %103
  store i32 -1, ptr %1, align 4
  br label %190

107:                                              ; preds = %103
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  %110 = call i32 (...) @s2n_security_policies_init()
  %111 = icmp sgt i32 %110, -1
  br i1 %111, label %113, label %112

112:                                              ; preds = %109
  store i32 -1, ptr %1, align 4
  br label %190

113:                                              ; preds = %109
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  %116 = call i32 @s2n_config_defaults_init()
  %117 = icmp sgt i32 %116, -1
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 -1, ptr %1, align 4
  br label %190

119:                                              ; preds = %115
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120
  %122 = call i32 (...) @s2n_extension_type_init()
  %123 = icmp sgt i32 %122, -1
  br i1 %123, label %125, label %124

124:                                              ; preds = %121
  store i32 -1, ptr %1, align 4
  br label %190

125:                                              ; preds = %121
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = call i32 (...) @s2n_tls13_empty_transcripts_init()
  %129 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 %128, ptr %129, align 4
  %130 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  %131 = load i32, ptr %130, align 4
  %132 = call zeroext i1 @s2n_result_is_ok(i32 %131)
  br i1 %132, label %134, label %133

133:                                              ; preds = %127
  store i32 -1, ptr %1, align 4
  br label %190

134:                                              ; preds = %127
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  %137 = call i32 (...) @s2n_atomic_init()
  %138 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  store i32 %137, ptr %138, align 4
  %139 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  %140 = load i32, ptr %139, align 4
  %141 = call zeroext i1 @s2n_result_is_ok(i32 %140)
  br i1 %141, label %143, label %142

142:                                              ; preds = %136
  store i32 -1, ptr %1, align 4
  br label %190

143:                                              ; preds = %136
  br label %144

144:                                              ; preds = %143
  %145 = load i8, ptr @atexit_cleanup, align 1, !tbaa !5, !range !9, !noundef !10
  %146 = trunc i8 %145 to i1
  br i1 %146, label %147, label %184

147:                                              ; preds = %144
  br label %148

148:                                              ; preds = %147
  %149 = call i32 @atexit(ptr noundef @s2n_cleanup_atexit) #9
  %150 = icmp sgt i32 %149, -1
  br i1 %150, label %182, label %151

151:                                              ; preds = %148
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  %154 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %155 = getelementptr inbounds %struct.s2n_debug_info, ptr %154, i32 0, i32 0
  store ptr @.str.3, ptr %155, align 8, !tbaa !11
  %156 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %157 = getelementptr inbounds %struct.s2n_debug_info, ptr %156, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !11
  %159 = getelementptr inbounds i8, ptr %158, i64 21
  %160 = call ptr @strrchr(ptr noundef %159, i32 noundef 47) #7
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %169

162:                                              ; preds = %153
  %163 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %164 = getelementptr inbounds %struct.s2n_debug_info, ptr %163, i32 0, i32 0
  %165 = load ptr, ptr %164, align 8, !tbaa !11
  %166 = getelementptr inbounds i8, ptr %165, i64 21
  %167 = call ptr @strrchr(ptr noundef %166, i32 noundef 47) #7
  %168 = getelementptr inbounds i8, ptr %167, i64 1
  br label %174

169:                                              ; preds = %153
  %170 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %171 = getelementptr inbounds %struct.s2n_debug_info, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !11
  %173 = getelementptr inbounds i8, ptr %172, i64 21
  br label %174

174:                                              ; preds = %169, %162
  %175 = phi ptr [ %168, %162 ], [ %173, %169 ]
  %176 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %177 = getelementptr inbounds %struct.s2n_debug_info, ptr %176, i32 0, i32 1
  store ptr %175, ptr %177, align 8, !tbaa !14
  %178 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653191, ptr %178, align 4, !tbaa !15
  %179 = call i32 @s2n_calculate_stacktrace()
  br label %180

180:                                              ; preds = %174
  store i32 -1, ptr %1, align 4
  br label %190

181:                                              ; No predecessors!
  br label %182

182:                                              ; preds = %181, %148
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183, %144
  %185 = call ptr @getenv(ptr noundef @.str.4) #9
  %186 = icmp ne ptr %185, null
  br i1 %186, label %187, label %189

187:                                              ; preds = %184
  %188 = call i32 @s2n_stack_traces_enabled_set(i1 noundef zeroext true)
  br label %189

189:                                              ; preds = %187, %184
  store i8 1, ptr @initialized, align 1, !tbaa !5
  store i32 0, ptr %1, align 4
  br label %190

190:                                              ; preds = %189, %180, %142, %133, %124, %118, %112, %106, %100, %91, %82, %76, %67, %61, %51, %40
  %191 = load i32, ptr %1, align 4
  ret i32 %191
}

; Function Attrs: nounwind willreturn memory(none)
declare i64 @pthread_self() #4

; Function Attrs: nounwind
declare ptr @getenv(ptr noundef) #5

declare i32 @s2n_in_integ_test_set(i1 noundef zeroext) #2

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

declare i32 @s2n_libcrypto_validate_runtime() #2

declare i32 @s2n_mem_init() #2

declare i32 @s2n_locking_init() #2

declare i32 @s2n_fips_init() #2

declare i32 @s2n_rand_init() #2

declare i32 @s2n_hash_algorithms_init(...) #2

declare i32 @s2n_cipher_suites_init() #2

declare i32 @s2n_security_policies_init(...) #2

declare i32 @s2n_config_defaults_init() #2

declare i32 @s2n_extension_type_init(...) #2

declare i32 @s2n_tls13_empty_transcripts_init(...) #2

declare i32 @s2n_atomic_init(...) #2

; Function Attrs: nounwind
declare i32 @atexit(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden void @s2n_cleanup_atexit() #3

declare i32 @s2n_stack_traces_enabled_set(i1 noundef zeroext) #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 = { 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 #4 = { nounwind willreturn memory(none) "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 "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 = { 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { 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 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !13, i64 0}
!12 = !{!"s2n_debug_info", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !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 }

@initialized = external hidden local_unnamed_addr global i8, align 1
@_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
@atexit_cleanup = external hidden local_unnamed_addr global i8, align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@main_thread = external hidden local_unnamed_addr global i64, align 8
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 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: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_init() local_unnamed_addr #3 {
  %1 = load i8, ptr @initialized, align 1, !tbaa !5, !range !9, !noundef !10
  %2 = trunc nuw i8 %1 to i1
  br i1 %2, label %3, label %11

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

11:                                               ; preds = %0
  %12 = tail call i64 @pthread_self() #10
  store i64 %12, ptr @main_thread, align 8, !tbaa !17
  %13 = tail call ptr @getenv(ptr noundef nonnull @.str.2) #9
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %17, label %14

14:                                               ; preds = %11
  %15 = tail call i32 @s2n_in_integ_test_set(i1 noundef zeroext true) #9
  %16 = icmp sgt i32 %15, -1
  br i1 %16, label %17, label %72

17:                                               ; preds = %11, %14
  %18 = tail call i32 @s2n_libcrypto_validate_runtime() #9
  %19 = tail call zeroext i1 @s2n_result_is_ok(i32 %18)
  br i1 %19, label %20, label %72

20:                                               ; preds = %17
  %21 = tail call i32 @s2n_mem_init() #9
  %22 = icmp sgt i32 %21, -1
  br i1 %22, label %23, label %72

23:                                               ; preds = %20
  %24 = tail call i32 @s2n_locking_init() #9
  %25 = tail call zeroext i1 @s2n_result_is_ok(i32 %24)
  br i1 %25, label %26, label %72

26:                                               ; preds = %23
  %27 = tail call i32 @s2n_fips_init() #9
  %28 = icmp sgt i32 %27, -1
  br i1 %28, label %29, label %72

29:                                               ; preds = %26
  %30 = tail call i32 @s2n_rand_init() #9
  %31 = tail call zeroext i1 @s2n_result_is_ok(i32 %30)
  br i1 %31, label %32, label %72

32:                                               ; preds = %29
  %33 = tail call i32 (...) @s2n_hash_algorithms_init() #9
  %34 = tail call zeroext i1 @s2n_result_is_ok(i32 %33)
  br i1 %34, label %35, label %72

35:                                               ; preds = %32
  %36 = tail call i32 @s2n_cipher_suites_init() #9
  %37 = icmp sgt i32 %36, -1
  br i1 %37, label %38, label %72

38:                                               ; preds = %35
  %39 = tail call i32 (...) @s2n_security_policies_init() #9
  %40 = icmp sgt i32 %39, -1
  br i1 %40, label %41, label %72

41:                                               ; preds = %38
  %42 = tail call i32 @s2n_config_defaults_init() #9
  %43 = icmp sgt i32 %42, -1
  br i1 %43, label %44, label %72

44:                                               ; preds = %41
  %45 = tail call i32 (...) @s2n_extension_type_init() #9
  %46 = icmp sgt i32 %45, -1
  br i1 %46, label %47, label %72

47:                                               ; preds = %44
  %48 = tail call i32 (...) @s2n_tls13_empty_transcripts_init() #9
  %49 = tail call zeroext i1 @s2n_result_is_ok(i32 %48)
  br i1 %49, label %50, label %72

50:                                               ; preds = %47
  %51 = tail call i32 (...) @s2n_atomic_init() #9
  %52 = tail call zeroext i1 @s2n_result_is_ok(i32 %51)
  br i1 %52, label %53, label %72

53:                                               ; preds = %50
  %54 = load i8, ptr @atexit_cleanup, align 1, !tbaa !5, !range !9, !noundef !10
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %56, label %67

56:                                               ; preds = %53
  %57 = tail call i32 @atexit(ptr noundef nonnull @s2n_cleanup_atexit) #9
  %58 = icmp sgt i32 %57, -1
  br i1 %58, label %67, label %59

59:                                               ; preds = %56
  %60 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.3, ptr %60, align 8, !tbaa !11
  %61 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.3, i64 21), i32 noundef 47) #8
  %.not8 = icmp eq ptr %61, null
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = select i1 %.not8, ptr getelementptr inbounds (i8, ptr @.str.3, i64 21), ptr %62
  %64 = getelementptr inbounds i8, ptr %60, i64 8
  store ptr %63, ptr %64, align 8, !tbaa !14
  %65 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653191, ptr %65, align 4, !tbaa !15
  %66 = tail call i32 @s2n_calculate_stacktrace() #9
  br label %72

67:                                               ; preds = %56, %53
  %68 = tail call ptr @getenv(ptr noundef nonnull @.str.4) #9
  %.not9 = icmp eq ptr %68, null
  br i1 %.not9, label %71, label %69

69:                                               ; preds = %67
  %70 = tail call i32 @s2n_stack_traces_enabled_set(i1 noundef zeroext true) #9
  br label %71

71:                                               ; preds = %69, %67
  store i8 1, ptr @initialized, align 1, !tbaa !5
  br label %72

72:                                               ; preds = %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14, %71, %59, %3
  %.0 = phi i32 [ -1, %3 ], [ 0, %71 ], [ -1, %59 ], [ -1, %14 ], [ -1, %17 ], [ -1, %20 ], [ -1, %23 ], [ -1, %26 ], [ -1, %29 ], [ -1, %32 ], [ -1, %35 ], [ -1, %38 ], [ -1, %41 ], [ -1, %44 ], [ -1, %47 ], [ -1, %50 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @pthread_self() local_unnamed_addr #4

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #5

declare i32 @s2n_in_integ_test_set(i1 noundef zeroext) local_unnamed_addr #2

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

declare i32 @s2n_libcrypto_validate_runtime() local_unnamed_addr #2

declare i32 @s2n_mem_init() local_unnamed_addr #2

declare i32 @s2n_locking_init() local_unnamed_addr #2

declare i32 @s2n_fips_init() local_unnamed_addr #2

declare i32 @s2n_rand_init() local_unnamed_addr #2

declare i32 @s2n_hash_algorithms_init(...) local_unnamed_addr #2

declare i32 @s2n_cipher_suites_init() local_unnamed_addr #2

declare i32 @s2n_security_policies_init(...) local_unnamed_addr #2

declare i32 @s2n_config_defaults_init() local_unnamed_addr #2

declare i32 @s2n_extension_type_init(...) local_unnamed_addr #2

declare i32 @s2n_tls13_empty_transcripts_init(...) local_unnamed_addr #2

declare i32 @s2n_atomic_init(...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare i32 @atexit(ptr noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
declare hidden void @s2n_cleanup_atexit() #3

declare i32 @s2n_stack_traces_enabled_set(i1 noundef zeroext) local_unnamed_addr #2

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 = { 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 #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { nofree nounwind 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 #6 = { 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 #7 = { 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 #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(none) }

!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 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !13, i64 0}
!12 = !{!"s2n_debug_info", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}


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