; LLVM IR from aws/s2n-tls :: bin (common)

; 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.session_cache_entry = type { [32 x i8], i8, [255 x i8], i8 }
%struct.s2n_debug_info = type { ptr, ptr }
%struct.conn_settings = type { i16, i32, i32, ptr, ptr, ptr, ptr, [10 x ptr], i64 }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@ticket_key_name = external dso_local global [16 x i8], align 16
@default_ticket_key = external dso_local global [32 x i8], align 16
@stderr = external global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1
@dhparams = external hidden global [425 x i8], align 16
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1
@session_cache = external dso_local global [256 x %struct.session_cache_entry], align 16
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [83 x 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
@.str.27 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #1

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

declare void @print_s2n_error(ptr noundef) #4

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

16:                                               ; preds = %5
  %17 = load ptr, ptr %8, align 8, !tbaa !9
  %18 = call i32 @s2n_config_set_max_blinding_delay(ptr noundef %17, i32 noundef 0)
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %16
  call void @print_s2n_error(ptr noundef @.str.14)
  call void @exit(i32 noundef 1) #7
  unreachable

21:                                               ; preds = %16
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = load ptr, ptr %8, align 8, !tbaa !9
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = call i32 @s2n_config_set_server_max_early_data_size(ptr noundef %24, i32 noundef %25)
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  call void @print_s2n_error(ptr noundef @.str.15)
  call void @exit(i32 noundef 1) #7
  unreachable

29:                                               ; preds = %23
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr %8, align 8, !tbaa !9
  %33 = call i32 @s2n_config_add_dhparams(ptr noundef %32, ptr noundef @dhparams)
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  call void @print_s2n_error(ptr noundef @.str.16)
  call void @exit(i32 noundef 1) #7
  unreachable

36:                                               ; preds = %31
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %8, align 8, !tbaa !9
  %40 = load ptr, ptr %9, align 8, !tbaa !9
  %41 = call i32 @s2n_config_set_cipher_preferences(ptr noundef %39, ptr noundef %40)
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %38
  call void @print_s2n_error(ptr noundef @.str.17)
  call void @exit(i32 noundef 1) #7
  unreachable

44:                                               ; preds = %38
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %8, align 8, !tbaa !9
  %48 = call i32 @s2n_config_set_cache_store_callback(ptr noundef %47, ptr noundef @cache_store_callback, ptr noundef @session_cache)
  %49 = icmp slt i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %46
  call void @print_s2n_error(ptr noundef @.str.18)
  call void @exit(i32 noundef 1) #7
  unreachable

51:                                               ; preds = %46
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %8, align 8, !tbaa !9
  %55 = call i32 @s2n_config_set_cache_retrieve_callback(ptr noundef %54, ptr noundef @cache_retrieve_callback, ptr noundef @session_cache)
  %56 = icmp slt i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  call void @print_s2n_error(ptr noundef @.str.19)
  call void @exit(i32 noundef 1) #7
  unreachable

58:                                               ; preds = %53
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr %8, align 8, !tbaa !9
  %62 = call i32 @s2n_config_set_cache_delete_callback(ptr noundef %61, ptr noundef @cache_delete_callback, ptr noundef @session_cache)
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %60
  call void @print_s2n_error(ptr noundef @.str.19)
  call void @exit(i32 noundef 1) #7
  unreachable

65:                                               ; preds = %60
  br label %66

66:                                               ; preds = %65
  %67 = load i16, ptr %2, align 8
  %68 = lshr i16 %67, 5
  %69 = and i16 %68, 1
  %70 = zext i16 %69 to i32
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %80

72:                                               ; preds = %66
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %8, align 8, !tbaa !9
  %75 = call i32 @s2n_config_accept_max_fragment_length(ptr noundef %74)
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %73
  call void @print_s2n_error(ptr noundef @.str.20)
  call void @exit(i32 noundef 1) #7
  unreachable

78:                                               ; preds = %73
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79, %66
  %81 = load ptr, ptr %8, align 8, !tbaa !9
  %82 = call i32 @s2n_config_set_verify_host_callback(ptr noundef %81, ptr noundef @unsafe_verify_host_fn, ptr noundef null)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %80
  call void @print_s2n_error(ptr noundef @.str.21)
  call void @exit(i32 noundef 1) #7
  unreachable

85:                                               ; preds = %80
  %86 = load i16, ptr %2, align 8
  %87 = lshr i16 %86, 6
  %88 = and i16 %87, 1
  %89 = zext i16 %88 to i32
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %99

91:                                               ; preds = %85
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %8, align 8, !tbaa !9
  %94 = call i32 @s2n_config_set_session_tickets_onoff(ptr noundef %93, i8 noundef zeroext 1)
  %95 = icmp slt i32 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %92
  call void @print_s2n_error(ptr noundef @.str.22)
  call void @exit(i32 noundef 1) #7
  unreachable

97:                                               ; preds = %92
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98, %85
  %100 = load i16, ptr %2, align 8
  %101 = lshr i16 %100, 7
  %102 = and i16 %101, 1
  %103 = zext i16 %102 to i32
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %113

105:                                              ; preds = %99
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %8, align 8, !tbaa !9
  %108 = call i32 @s2n_config_set_session_cache_onoff(ptr noundef %107, i8 noundef zeroext 1)
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %106
  call void @print_s2n_error(ptr noundef @.str.23)
  call void @exit(i32 noundef 1) #7
  unreachable

111:                                              ; preds = %106
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112, %99
  %114 = load i16, ptr %2, align 8
  %115 = lshr i16 %114, 6
  %116 = and i16 %115, 1
  %117 = zext i16 %116 to i32
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %125, label %119

119:                                              ; preds = %113
  %120 = load i16, ptr %2, align 8
  %121 = lshr i16 %120, 7
  %122 = and i16 %121, 1
  %123 = zext i16 %122 to i32
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %216

125:                                              ; preds = %119, %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store ptr null, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  %126 = load ptr, ptr %10, align 8, !tbaa !9
  %127 = icmp ne ptr %126, null
  br i1 %127, label %128, label %197

128:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %129 = load ptr, ptr %10, align 8, !tbaa !9
  %130 = call i32 (ptr, i32, ...) @open(ptr noundef %129, i32 noundef 0)
  store i32 %130, ptr %13, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %128
  %132 = load i32, ptr %13, align 4, !tbaa !5
  %133 = icmp slt i32 %132, 0
  br i1 %133, label %134, label %135

134:                                              ; preds = %131
  call void @print_s2n_error(ptr noundef @.str.24)
  call void @exit(i32 noundef 1) #7
  unreachable

135:                                              ; preds = %131
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 144, ptr %14) #8
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = call i32 @fstat(i32 noundef %139, ptr noundef %14) #8
  %141 = icmp slt i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %138
  call void @print_s2n_error(ptr noundef @.str.25)
  call void @exit(i32 noundef 1) #7
  unreachable

143:                                              ; preds = %138
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  %146 = getelementptr inbounds %struct.stat, ptr %14, i32 0, i32 8
  %147 = load i64, ptr %146, align 8, !tbaa !11
  %148 = load i32, ptr %13, align 4, !tbaa !5
  %149 = call ptr @mmap(ptr noundef null, i64 noundef %147, i32 noundef 1, i32 noundef 2, i32 noundef %148, i64 noundef 0) #8
  store ptr %149, ptr %11, align 8, !tbaa !9
  br label %150

150:                                              ; preds = %145
  %151 = load ptr, ptr %11, align 8, !tbaa !9
  %152 = icmp ne ptr %151, inttoptr (i64 -1 to ptr)
  br i1 %152, label %186, label %153

153:                                              ; preds = %150
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  %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
  store ptr @.str.26, ptr %157, align 8, !tbaa !15
  %158 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %159 = getelementptr inbounds %struct.s2n_debug_info, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !15
  %161 = getelementptr inbounds i8, ptr %160, i64 21
  %162 = call ptr @strrchr(ptr noundef %161, i32 noundef 47) #9
  %163 = icmp ne ptr %162, null
  br i1 %163, label %164, label %171

164:                                              ; preds = %155
  %165 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %166 = getelementptr inbounds %struct.s2n_debug_info, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !15
  %168 = getelementptr inbounds i8, ptr %167, i64 21
  %169 = call ptr @strrchr(ptr noundef %168, i32 noundef 47) #9
  %170 = getelementptr inbounds i8, ptr %169, i64 1
  br label %176

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

176:                                              ; preds = %171, %164
  %177 = phi ptr [ %170, %164 ], [ %175, %171 ]
  %178 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %179 = getelementptr inbounds %struct.s2n_debug_info, ptr %178, i32 0, i32 1
  store ptr %177, ptr %179, align 8, !tbaa !17
  %180 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653190, ptr %180, align 4, !tbaa !5
  %181 = call i32 @s2n_calculate_stacktrace()
  br label %182

182:                                              ; preds = %176
  br label %183

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

184:                                              ; No predecessors!
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185, %150
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = getelementptr inbounds %struct.stat, ptr %14, i32 0, i32 8
  %190 = load i64, ptr %189, align 8, !tbaa !11
  %191 = trunc i64 %190 to i32
  store i32 %191, ptr %12, align 4, !tbaa !5
  %192 = load i32, ptr %13, align 4, !tbaa !5
  %193 = call i32 @close(i32 noundef %192)
  store i32 0, ptr %15, align 4
  br label %194

194:                                              ; preds = %188, %183
  call void @llvm.lifetime.end.p0(i64 144, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  %195 = load i32, ptr %15, align 4
  switch i32 %195, label %213 [
    i32 0, label %196
  ]

196:                                              ; preds = %194
  br label %198

197:                                              ; preds = %125
  store ptr @default_ticket_key, ptr %11, align 8, !tbaa !9
  store i32 32, ptr %12, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %197, %196
  %199 = load ptr, ptr %8, align 8, !tbaa !9
  %200 = call i64 @strlen(ptr noundef @ticket_key_name) #9
  %201 = trunc i64 %200 to i32
  %202 = load ptr, ptr %11, align 8, !tbaa !9
  %203 = load i32, ptr %12, align 4, !tbaa !5
  %204 = call i32 @s2n_config_add_ticket_crypto_key(ptr noundef %199, ptr noundef @ticket_key_name, i32 noundef %201, ptr noundef %202, i32 noundef %203, i64 noundef 0)
  %205 = icmp ne i32 %204, 0
  br i1 %205, label %206, label %212

206:                                              ; preds = %198
  %207 = load ptr, ptr @stderr, align 8, !tbaa !9
  %208 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = call ptr @s2n_strerror(i32 noundef %209, ptr noundef @.str.28)
  %211 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %207, ptr noundef @.str.27, ptr noundef %210) #8
  call void @exit(i32 noundef 1) #7
  unreachable

212:                                              ; preds = %198
  store i32 0, ptr %15, align 4
  br label %213

213:                                              ; preds = %212, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  %214 = load i32, ptr %15, align 4
  switch i32 %214, label %219 [
    i32 0, label %215
    i32 1, label %217
  ]

215:                                              ; preds = %213
  br label %216

216:                                              ; preds = %215, %119
  store i32 0, ptr %6, align 4
  br label %217

217:                                              ; preds = %216, %213
  %218 = load i32, ptr %6, align 4
  ret i32 %218

219:                                              ; preds = %213
  unreachable
}

declare i32 @s2n_config_set_max_blinding_delay(ptr noundef, i32 noundef) #4

declare i32 @s2n_config_set_server_max_early_data_size(ptr noundef, i32 noundef) #4

declare i32 @s2n_config_add_dhparams(ptr noundef, ptr noundef) #4

declare i32 @s2n_config_set_cipher_preferences(ptr noundef, ptr noundef) #4

declare i32 @s2n_config_set_cache_store_callback(ptr noundef, ptr noundef, ptr noundef) #4

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

declare i32 @s2n_config_set_cache_retrieve_callback(ptr noundef, ptr noundef, ptr noundef) #4

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

declare i32 @s2n_config_set_cache_delete_callback(ptr noundef, ptr noundef, ptr noundef) #4

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

declare i32 @s2n_config_accept_max_fragment_length(ptr noundef) #4

declare i32 @s2n_config_set_verify_host_callback(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @unsafe_verify_host_fn(ptr noundef, i64 noundef, ptr noundef) #5

declare i32 @s2n_config_set_session_tickets_onoff(ptr noundef, i8 noundef zeroext) #4

declare i32 @s2n_config_set_session_cache_onoff(ptr noundef, i8 noundef zeroext) #4

declare i32 @open(ptr noundef, i32 noundef, ...) #4

; Function Attrs: nounwind
declare i32 @fstat(i32 noundef, ptr noundef) #0

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

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

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

declare i32 @s2n_calculate_stacktrace() #4

declare i32 @close(i32 noundef) #4

declare i32 @s2n_config_add_ticket_crypto_key(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i64 noundef) #4

declare ptr @s2n_strerror(i32 noundef, ptr noundef) #4

attributes #0 = { 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 #1 = { noreturn 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 = { 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 #4 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 48}
!12 = !{!"stat", !13, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !14, i64 88, !14, i64 104, !7, i64 120}
!13 = !{!"long", !7, i64 0}
!14 = !{!"timespec", !13, i64 0, !13, i64 8}
!15 = !{!16, !10, i64 0}
!16 = !{!"s2n_debug_info", !10, i64 0, !10, i64 8}
!17 = !{!16, !10, i64 8}


; 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.session_cache_entry = type { [32 x i8], i8, [255 x i8], i8 }
%struct.s2n_debug_info = type { ptr, ptr }
%struct.conn_settings = type { i16, i32, i32, ptr, ptr, ptr, ptr, [10 x ptr], i64 }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@ticket_key_name = external dso_local global [16 x i8], align 16
@default_ticket_key = external dso_local global [32 x i8], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1
@dhparams = external hidden global [425 x i8], align 16
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1
@session_cache = external dso_local global [256 x %struct.session_cache_entry], align 16
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [83 x 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
@.str.27 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

declare void @print_s2n_error(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_set_common_server_config(i32 noundef %0, ptr noundef %1, ptr nocapture noundef readonly byval(%struct.conn_settings) align 8 %2, ptr noundef %3, ptr noundef readonly %4) local_unnamed_addr #5 {
  %6 = alloca %struct.stat, align 8
  %7 = tail call i32 @s2n_config_set_max_blinding_delay(ptr noundef %1, i32 noundef 0) #9
  %8 = icmp slt i32 %7, 0
  br i1 %8, label %9, label %10

9:                                                ; preds = %5
  tail call void @print_s2n_error(ptr noundef nonnull @.str.14) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

10:                                               ; preds = %5
  %11 = tail call i32 @s2n_config_set_server_max_early_data_size(ptr noundef %1, i32 noundef %0) #9
  %12 = icmp slt i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %10
  tail call void @print_s2n_error(ptr noundef nonnull @.str.15) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

14:                                               ; preds = %10
  %15 = tail call i32 @s2n_config_add_dhparams(ptr noundef %1, ptr noundef nonnull @dhparams) #9
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %14
  tail call void @print_s2n_error(ptr noundef nonnull @.str.16) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

18:                                               ; preds = %14
  %19 = tail call i32 @s2n_config_set_cipher_preferences(ptr noundef %1, ptr noundef %3) #9
  %20 = icmp slt i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %18
  tail call void @print_s2n_error(ptr noundef nonnull @.str.17) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

22:                                               ; preds = %18
  %23 = tail call i32 @s2n_config_set_cache_store_callback(ptr noundef %1, ptr noundef nonnull @cache_store_callback, ptr noundef nonnull @session_cache) #9
  %24 = icmp slt i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  tail call void @print_s2n_error(ptr noundef nonnull @.str.18) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

26:                                               ; preds = %22
  %27 = tail call i32 @s2n_config_set_cache_retrieve_callback(ptr noundef %1, ptr noundef nonnull @cache_retrieve_callback, ptr noundef nonnull @session_cache) #9
  %28 = icmp slt i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  tail call void @print_s2n_error(ptr noundef nonnull @.str.19) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

30:                                               ; preds = %26
  %31 = tail call i32 @s2n_config_set_cache_delete_callback(ptr noundef %1, ptr noundef nonnull @cache_delete_callback, ptr noundef nonnull @session_cache) #9
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  tail call void @print_s2n_error(ptr noundef nonnull @.str.19) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

34:                                               ; preds = %30
  %35 = load i16, ptr %2, align 8
  %36 = and i16 %35, 32
  %.not = icmp eq i16 %36, 0
  br i1 %.not, label %41, label %37

37:                                               ; preds = %34
  %38 = tail call i32 @s2n_config_accept_max_fragment_length(ptr noundef %1) #9
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  tail call void @print_s2n_error(ptr noundef nonnull @.str.20) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

41:                                               ; preds = %37, %34
  %42 = tail call i32 @s2n_config_set_verify_host_callback(ptr noundef %1, ptr noundef nonnull @unsafe_verify_host_fn, ptr noundef null) #9
  %.not33 = icmp eq i32 %42, 0
  br i1 %.not33, label %44, label %43

43:                                               ; preds = %41
  tail call void @print_s2n_error(ptr noundef nonnull @.str.21) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

44:                                               ; preds = %41
  %45 = and i16 %35, 64
  %.not34 = icmp eq i16 %45, 0
  br i1 %.not34, label %50, label %46

46:                                               ; preds = %44
  %47 = tail call i32 @s2n_config_set_session_tickets_onoff(ptr noundef %1, i8 noundef zeroext 1) #9
  %48 = icmp slt i32 %47, 0
  br i1 %48, label %49, label %.thread48

49:                                               ; preds = %46
  tail call void @print_s2n_error(ptr noundef nonnull @.str.22) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

50:                                               ; preds = %44
  %51 = and i16 %35, 128
  %.not35 = icmp eq i16 %51, 0
  br i1 %.not35, label %.thread45, label %53

.thread48:                                        ; preds = %46
  %52 = and i16 %35, 128
  %.not3549 = icmp eq i16 %52, 0
  br i1 %.not3549, label %.thread, label %53

53:                                               ; preds = %.thread48, %50
  %54 = tail call i32 @s2n_config_set_session_cache_onoff(ptr noundef %1, i8 noundef zeroext 1) #9
  %55 = icmp slt i32 %54, 0
  br i1 %55, label %56, label %.thread

56:                                               ; preds = %53
  tail call void @print_s2n_error(ptr noundef nonnull @.str.23) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

.thread:                                          ; preds = %.thread48, %53
  %.not38 = icmp eq ptr %4, null
  br i1 %.not38, label %72, label %57

57:                                               ; preds = %.thread
  %58 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull %4, i32 noundef 0) #9
  %59 = icmp slt i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %57
  tail call void @print_s2n_error(ptr noundef nonnull @.str.24) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %6) #9
  %62 = call i32 @fstat(i32 noundef %58, ptr noundef nonnull %6) #9
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  tail call void @print_s2n_error(ptr noundef nonnull @.str.25) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

65:                                               ; preds = %61
  %66 = getelementptr inbounds i8, ptr %6, i64 48
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = tail call ptr @mmap(ptr noundef null, i64 noundef %67, i32 noundef 1, i32 noundef 2, i32 noundef %58, i64 noundef 0) #9
  %.not39.not = icmp eq ptr %68, inttoptr (i64 -1 to ptr)
  br i1 %.not39.not, label %82, label %69

69:                                               ; preds = %65
  %70 = trunc i64 %67 to i32
  %71 = tail call i32 @close(i32 noundef %58) #9
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %6) #9
  br label %72

72:                                               ; preds = %69, %.thread
  %.029 = phi ptr [ %68, %69 ], [ @default_ticket_key, %.thread ]
  %.128 = phi i32 [ %70, %69 ], [ 32, %.thread ]
  %73 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @ticket_key_name) #11
  %74 = trunc i64 %73 to i32
  %75 = tail call i32 @s2n_config_add_ticket_crypto_key(ptr noundef %1, ptr noundef nonnull @ticket_key_name, i32 noundef %74, ptr noundef %.029, i32 noundef %.128, i64 noundef 0) #9
  %.not41 = icmp eq i32 %75, 0
  br i1 %.not41, label %.thread45, label %76

76:                                               ; preds = %72
  %77 = load ptr, ptr @stderr, align 8, !tbaa !12
  %78 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %79 = load i32, ptr %78, align 4, !tbaa !14
  %80 = tail call ptr @s2n_strerror(i32 noundef %79, ptr noundef nonnull @.str.28) #9
  %81 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.27, ptr noundef %80) #12
  tail call void @exit(i32 noundef 1) #10
  unreachable

82:                                               ; preds = %65
  %83 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.26, ptr %83, align 8, !tbaa !15
  %84 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.26, i64 21), i32 noundef 47) #11
  %.not40 = icmp eq ptr %84, null
  %85 = getelementptr inbounds i8, ptr %84, i64 1
  %86 = select i1 %.not40, ptr getelementptr inbounds (i8, ptr @.str.26, i64 21), ptr %85
  %87 = getelementptr inbounds i8, ptr %83, i64 8
  store ptr %86, ptr %87, align 8, !tbaa !17
  %88 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653190, ptr %88, align 4, !tbaa !14
  %89 = tail call i32 @s2n_calculate_stacktrace() #9
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %6) #9
  br label %.thread45

.thread45:                                        ; preds = %50, %72, %82
  %.3 = phi i32 [ -1, %82 ], [ 0, %72 ], [ 0, %50 ]
  ret i32 %.3
}

declare i32 @s2n_config_set_max_blinding_delay(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @s2n_config_set_server_max_early_data_size(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @s2n_config_add_dhparams(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @s2n_config_set_cipher_preferences(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @s2n_config_set_cache_store_callback(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @s2n_config_set_cache_retrieve_callback(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @s2n_config_set_cache_delete_callback(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @s2n_config_accept_max_fragment_length(ptr noundef) local_unnamed_addr #4

declare i32 @s2n_config_set_verify_host_callback(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @unsafe_verify_host_fn(ptr noundef, i64 noundef, ptr noundef) #5

declare i32 @s2n_config_set_session_tickets_onoff(ptr noundef, i8 noundef zeroext) local_unnamed_addr #4

declare i32 @s2n_config_set_session_cache_onoff(ptr noundef, i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @fstat(i32 noundef, ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #7

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #4

declare i32 @close(i32 noundef) local_unnamed_addr #4

declare i32 @s2n_config_add_ticket_crypto_key(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #4

declare ptr @s2n_strerror(i32 noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { 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 #1 = { noreturn 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 = { 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 #4 = { "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 "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 "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { 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, !7, i64 48}
!6 = !{!"stat", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !11, i64 72, !11, i64 88, !11, i64 104, !8, i64 120}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"timespec", !7, i64 0, !7, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !13, i64 0}
!16 = !{!"s2n_debug_info", !13, i64 0, !13, i64 8}
!17 = !{!16, !13, i64 8}


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