; LLVM IR from aws/s2n-tls :: tests/fuzz (s2n_select_server_cert_test)

; 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_connection = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [22 x i8], [22 x i8], [22 x i8], i32, i32, %struct.s2n_timer, i64, i64, [32 x i8], i8, i8, i8, i8, i8, i8, i8, ptr, ptr, %struct.s2n_secrets, ptr, ptr, %struct.s2n_kex_parameters, %struct.s2n_handshake_parameters, %struct.s2n_psk_parameters, ptr, i8, i32, [5 x i8], %struct.s2n_stuffer, %struct.s2n_stuffer, %struct.s2n_stuffer, %struct.s2n_stuffer, i32, i64, [2 x i8], %struct.s2n_stuffer, i8, i8, i8, i8, %struct.s2n_atomic_flag, %struct.s2n_atomic_flag, %struct.s2n_handshake, i16, i32, i16, i64, i8, i64, i64, i64, %struct.s2n_atomic_flag, %struct.s2n_atomic_flag, [256 x i8], [256 x i8], i32, %struct.s2n_blob, i32, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_client_hello, %struct.s2n_x509_validator, ptr, ptr, i8, i32, %struct.s2n_blob, i32, %struct.s2n_ticket_fields, [138 x i8], %struct.s2n_stuffer, %struct.s2n_blob, %struct.s2n_blob, i8, i8, i8, i16, i16, i32, i32, %struct.s2n_blob, i32, %struct.s2n_post_handshake, %struct.s2n_atomic_flag, i8, i8 }
%struct.s2n_timer = type { i64 }
%struct.s2n_secrets = type { %union.anon, i32 }
%union.anon = type { %struct.s2n_tls13_secrets }
%struct.s2n_tls13_secrets = type { [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], i32 }
%struct.s2n_kex_parameters = type { %struct.s2n_dh_params, %struct.s2n_ecc_evp_params, [4 x ptr], %struct.s2n_ecc_evp_params, %struct.s2n_kem_group_params, %struct.s2n_kem_group_params, [8 x ptr], %struct.s2n_kem_params, %struct.s2n_blob, %struct.s2n_blob }
%struct.s2n_dh_params = type { ptr }
%struct.s2n_ecc_evp_params = type { ptr, ptr }
%struct.s2n_kem_group_params = type { ptr, %struct.s2n_kem_params, %struct.s2n_ecc_evp_params }
%struct.s2n_kem_params = type { ptr, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, i8 }
%struct.s2n_handshake_parameters = type { %struct.s2n_pkey, %struct.s2n_pkey, %struct.s2n_blob, i32, %struct.s2n_sig_scheme_list, ptr, ptr, ptr, [4 x ptr], [4 x ptr], i8, i8, [32 x i8], [32 x i8] }
%struct.s2n_pkey = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.s2n_sig_scheme_list = type { [128 x i16], i8 }
%struct.s2n_psk_parameters = type { i32, %struct.s2n_array, i16, i16, ptr, i32 }
%struct.s2n_array = type { %struct.s2n_blob, i32, i32 }
%struct.s2n_handshake = type { %struct.s2n_stuffer, ptr, [8 x i8], [48 x i8], [48 x i8], i8, i32, i32, i32, i32, %struct.s2n_offered_early_data, i8, i32 }
%struct.s2n_offered_early_data = type { ptr }
%struct.s2n_client_hello = type { %struct.s2n_blob, %struct.s2n_parsed_extensions_list, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, i8, i8, i8 }
%struct.s2n_parsed_extensions_list = type { [21 x %struct.s2n_parsed_extension], %struct.s2n_blob, i16 }
%struct.s2n_parsed_extension = type { %struct.s2n_blob, i16, i16, i8 }
%struct.s2n_x509_validator = type { ptr, ptr, i8, i8, i16, ptr, i32, ptr, %struct.s2n_cert_validation_info, i8 }
%struct.s2n_cert_validation_info = type { i8, [3 x i8] }
%struct.s2n_ticket_fields = type { %struct.s2n_blob, i32 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_post_handshake = type { %struct.s2n_stuffer, [4 x i8] }
%struct.s2n_atomic_flag = type { i32 }
%struct.s2n_cert_chain_and_key = type { ptr, ptr, %struct.s2n_blob, %struct.s2n_blob, ptr, ptr, ptr }
%struct.s2n_cert_chain = type { i32, ptr }

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_fuzz_test(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [256 x ptr], align 16
  %9 = alloca [1024 x ptr], align 16
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %17 = call ptr @s2n_config_new()
  store ptr %17, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %18 = call ptr @s2n_connection_new(i32 noundef 0)
  store ptr %18, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr %8) #5
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 2048, i1 false)
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %27

21:                                               ; preds = %2
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %27

24:                                               ; preds = %21
  %25 = load i64, ptr %5, align 8, !tbaa !9
  %26 = icmp eq i64 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %24, %21, %2
  br label %101

28:                                               ; preds = %24
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 8192, i1 false)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i64, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds [1024 x ptr], ptr %9, i64 0, i64 0
  %32 = call i64 @find_strings(ptr noundef %29, i64 noundef %30, ptr noundef %31, i64 noundef 1024)
  store i64 %32, ptr %10, align 8, !tbaa !9
  %33 = load i64, ptr %10, align 8, !tbaa !9
  %34 = icmp eq i64 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %28
  br label %101

36:                                               ; preds = %28
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call i32 @s2n_connection_set_config(ptr noundef %37, ptr noundef %38)
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %36
  br label %101

42:                                               ; preds = %36
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 0
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = zext i8 %45 to i32
  %47 = srem i32 %46, 256
  store i32 %47, ptr %11, align 4, !tbaa !12
  %48 = getelementptr inbounds [1024 x ptr], ptr %9, i64 0, i64 0
  %49 = load i64, ptr %10, align 8, !tbaa !9
  %50 = trunc i64 %49 to i32
  %51 = getelementptr inbounds [256 x ptr], ptr %8, i64 0, i64 0
  %52 = load i32, ptr %11, align 4, !tbaa !12
  %53 = call i64 @create_certs(ptr noundef %48, i32 noundef %50, ptr noundef %51, i32 noundef %52)
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %12, align 4, !tbaa !12
  %55 = load i32, ptr %12, align 4, !tbaa !12
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %42
  br label %101

58:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !12
  br label %59

59:                                               ; preds = %74, %58
  %60 = load i32, ptr %13, align 4, !tbaa !12
  %61 = load i32, ptr %12, align 4, !tbaa !12
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 3, ptr %14, align 4
  br label %77

64:                                               ; preds = %59
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = load i32, ptr %13, align 4, !tbaa !12
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [256 x ptr], ptr %8, i64 0, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = call i32 @s2n_config_add_cert_chain_and_key_to_store(ptr noundef %65, ptr noundef %69)
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %64
  store i32 2, ptr %14, align 4
  br label %77

73:                                               ; preds = %64
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %13, align 4, !tbaa !12
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %13, align 4, !tbaa !12
  br label %59, !llvm.loop !14

77:                                               ; preds = %72, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %78 = load i32, ptr %14, align 4
  switch i32 %78, label %150 [
    i32 3, label %79
    i32 2, label %101
  ]

79:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !12
  br label %80

80:                                               ; preds = %97, %79
  %81 = load i32, ptr %15, align 4, !tbaa !12
  %82 = sext i32 %81 to i64
  %83 = load i64, ptr %10, align 8, !tbaa !9
  %84 = icmp ult i64 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  store i32 6, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %100

86:                                               ; preds = %80
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.s2n_connection, ptr %87, i32 0, i32 63
  %89 = getelementptr inbounds [256 x i8], ptr %88, i64 0, i64 0
  %90 = load i32, ptr %15, align 4, !tbaa !12
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1024 x ptr], ptr %9, i64 0, i64 %91
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = call ptr @strncpy(ptr noundef %89, ptr noundef %93, i64 noundef 255) #5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = call i32 @s2n_conn_find_name_matching_certs(ptr noundef %95)
  br label %97

97:                                               ; preds = %86
  %98 = load i32, ptr %15, align 4, !tbaa !12
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %15, align 4, !tbaa !12
  br label %80, !llvm.loop !16

100:                                              ; preds = %85
  br label %101

101:                                              ; preds = %100, %77, %57, %41, %35, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !12
  br label %102

102:                                              ; preds = %134, %101
  %103 = load i32, ptr %16, align 4, !tbaa !12
  %104 = icmp slt i32 %103, 256
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  store i32 9, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %137

106:                                              ; preds = %102
  %107 = load i32, ptr %16, align 4, !tbaa !12
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [256 x ptr], ptr %8, i64 0, i64 %108
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %133

112:                                              ; preds = %106
  %113 = load i32, ptr %16, align 4, !tbaa !12
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [256 x ptr], ptr %8, i64 0, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.s2n_cert_chain_and_key, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !17
  %119 = getelementptr inbounds %struct.s2n_cert_chain, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !20
  call void @free(ptr noundef %120) #5
  %121 = load i32, ptr %16, align 4, !tbaa !12
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [256 x ptr], ptr %8, i64 0, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.s2n_cert_chain_and_key, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !17
  %127 = getelementptr inbounds %struct.s2n_cert_chain, ptr %126, i32 0, i32 1
  store ptr null, ptr %127, align 8, !tbaa !20
  %128 = load i32, ptr %16, align 4, !tbaa !12
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [256 x ptr], ptr %8, i64 0, i64 %129
  %131 = load ptr, ptr %130, align 8, !tbaa !5
  %132 = call i32 @s2n_cert_chain_and_key_free(ptr noundef %131)
  br label %133

133:                                              ; preds = %112, %106
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %16, align 4, !tbaa !12
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %16, align 4, !tbaa !12
  br label %102, !llvm.loop !22

137:                                              ; preds = %105
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %143

140:                                              ; preds = %137
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = call i32 @s2n_connection_free(ptr noundef %141)
  br label %143

143:                                              ; preds = %140, %137
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %149

146:                                              ; preds = %143
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = call i32 @s2n_config_free(ptr noundef %147)
  br label %149

149:                                              ; preds = %146, %143
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %150

150:                                              ; preds = %149, %77
  call void @llvm.lifetime.end.p0(i64 2048, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %151 = load i32, ptr %3, align 4
  ret i32 %151
}

declare ptr @s2n_config_new() #2

declare ptr @s2n_connection_new(i32 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #4

declare i32 @s2n_conn_find_name_matching_certs(ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

declare i32 @s2n_cert_chain_and_key_free(ptr noundef) #2

declare i32 @s2n_connection_free(ptr noundef) #2

declare i32 @s2n_config_free(ptr noundef) #2

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

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

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


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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @s2n_fuzz_test(ptr noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca [256 x ptr], align 16
  %4 = alloca [1024 x ptr], align 16
  %5 = tail call ptr @s2n_config_new() #7
  %6 = tail call ptr @s2n_connection_new(i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %3) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2048) %3, i8 0, i64 2048, i1 false)
  %7 = icmp eq ptr %5, null
  %8 = icmp eq ptr %6, null
  %or.cond.not48 = select i1 %7, i1 true, i1 %8
  %9 = icmp eq i64 %1, 0
  %or.cond3 = or i1 %9, %or.cond.not48
  br i1 %or.cond3, label %.thread.preheader, label %10

.thread.preheader:                                ; preds = %.lr.ph, %30, %16, %13, %10, %2
  br label %.thread

10:                                               ; preds = %2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8192) %4, i8 0, i64 8192, i1 false)
  %11 = call i64 @find_strings(ptr noundef %0, i64 noundef %1, ptr noundef nonnull %4, i64 noundef 1024)
  %12 = icmp eq i64 %11, 0
  br i1 %12, label %.thread.preheader, label %13

13:                                               ; preds = %10
  %14 = call i32 @s2n_connection_set_config(ptr noundef nonnull %6, ptr noundef nonnull %5) #7
  %15 = icmp slt i32 %14, 0
  br i1 %15, label %.thread.preheader, label %16

16:                                               ; preds = %13
  %17 = load i8, ptr %0, align 1, !tbaa !5
  %18 = zext i8 %17 to i32
  %19 = trunc i64 %11 to i32
  %20 = call i64 @create_certs(ptr noundef nonnull %4, i32 noundef %19, ptr noundef nonnull %3, i32 noundef %18)
  %21 = trunc i64 %20 to i32
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %.thread.preheader, label %.preheader52

.preheader52:                                     ; preds = %16
  %23 = icmp sgt i32 %21, 0
  br i1 %23, label %.lr.ph.preheader, label %.preheader

.lr.ph.preheader:                                 ; preds = %.preheader52
  %wide.trip.count = and i64 %20, 2147483647
  br label %.lr.ph

24:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !8

.preheader:                                       ; preds = %24, %.preheader52
  %25 = getelementptr inbounds i8, ptr %6, i64 2272
  %umax = call i64 @llvm.umax.i64(i64 %11, i64 1)
  br label %30

.lr.ph:                                           ; preds = %.lr.ph.preheader, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %24 ]
  %26 = getelementptr inbounds [256 x ptr], ptr %3, i64 0, i64 %indvars.iv
  %27 = load ptr, ptr %26, align 8, !tbaa !10
  %28 = call i32 @s2n_config_add_cert_chain_and_key_to_store(ptr noundef %5, ptr noundef %27) #7
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %.thread.preheader, label %24

30:                                               ; preds = %.preheader, %30
  %indvars.iv59 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next60, %30 ]
  %31 = getelementptr inbounds [1024 x ptr], ptr %4, i64 0, i64 %indvars.iv59
  %32 = load ptr, ptr %31, align 8, !tbaa !10
  %33 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %25, ptr noundef nonnull dereferenceable(1) %32, i64 noundef 255) #7
  %34 = call i32 @s2n_conn_find_name_matching_certs(ptr noundef %6) #7
  %indvars.iv.next60 = add nuw i64 %indvars.iv59, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next60, %umax
  br i1 %exitcond62.not, label %.thread.preheader, label %30, !llvm.loop !12

35:                                               ; preds = %47
  br i1 %8, label %50, label %48

.thread:                                          ; preds = %.thread.preheader, %47
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %47 ], [ 0, %.thread.preheader ]
  %36 = getelementptr inbounds [256 x ptr], ptr %3, i64 0, i64 %indvars.iv63
  %37 = load ptr, ptr %36, align 8, !tbaa !10
  %.not = icmp eq ptr %37, null
  br i1 %.not, label %47, label %38

38:                                               ; preds = %.thread
  %39 = load ptr, ptr %37, align 8, !tbaa !13
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !17
  call void @free(ptr noundef %41) #7
  %42 = load ptr, ptr %36, align 8, !tbaa !10
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  store ptr null, ptr %44, align 8, !tbaa !17
  %45 = load ptr, ptr %36, align 8, !tbaa !10
  %46 = call i32 @s2n_cert_chain_and_key_free(ptr noundef %45) #7
  br label %47

47:                                               ; preds = %.thread, %38
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next64, 256
  br i1 %exitcond66.not, label %35, label %.thread, !llvm.loop !19

48:                                               ; preds = %35
  %49 = call i32 @s2n_connection_free(ptr noundef nonnull %6) #7
  br label %50

50:                                               ; preds = %48, %35
  br i1 %7, label %53, label %51

51:                                               ; preds = %50
  %52 = call i32 @s2n_config_free(ptr noundef nonnull %5) #7
  br label %53

53:                                               ; preds = %50, %51
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %3) #7
  ret i32 0
}

declare ptr @s2n_config_new() local_unnamed_addr #2

declare ptr @s2n_connection_new(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #4

declare i32 @s2n_conn_find_name_matching_certs(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

declare i32 @s2n_cert_chain_and_key_free(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_connection_free(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_config_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #6

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = !{!14, !11, i64 0}
!14 = !{!"s2n_cert_chain_and_key", !11, i64 0, !11, i64 8, !15, i64 16, !15, i64 40, !11, i64 64, !11, i64 72, !11, i64 80}
!15 = !{!"s2n_blob", !11, i64 0, !16, i64 8, !16, i64 12, !16, i64 16}
!16 = !{!"int", !6, i64 0}
!17 = !{!18, !11, i64 8}
!18 = !{!"s2n_cert_chain", !16, i64 0, !11, i64 8}
!19 = distinct !{!19, !9}


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