; LLVM IR from openanolis/openssl :: demos/bio (server-conf)

; 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.CONF_VALUE = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@stdout = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca [512 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr @.str, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 -1, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 512, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %21 = call ptr @TLS_server_method()
  %22 = call ptr @SSL_CTX_new(ptr noundef %21)
  store ptr %22, ptr %10, align 8, !tbaa !9
  %23 = call ptr @NCONF_new(ptr noundef null)
  store ptr %23, ptr %12, align 8, !tbaa !9
  %24 = load ptr, ptr %12, align 8, !tbaa !9
  %25 = call i32 @NCONF_load(ptr noundef %24, ptr noundef @.str.1, ptr noundef %15)
  %26 = icmp sle i32 %25, 0
  br i1 %26, label %27, label %38

27:                                               ; preds = %2
  %28 = load i64, ptr %15, align 8, !tbaa !11
  %29 = icmp sle i64 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.2) #6
  br label %37

33:                                               ; preds = %27
  %34 = load ptr, ptr @stderr, align 8, !tbaa !9
  %35 = load i64, ptr %15, align 8, !tbaa !11
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.3, i64 noundef %35) #6
  br label %37

37:                                               ; preds = %33, %30
  br label %167

38:                                               ; preds = %2
  %39 = load ptr, ptr %12, align 8, !tbaa !9
  %40 = call ptr @NCONF_get_section(ptr noundef %39, ptr noundef @.str.4)
  store ptr %40, ptr %13, align 8, !tbaa !9
  %41 = load ptr, ptr %13, align 8, !tbaa !9
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %46

43:                                               ; preds = %38
  %44 = load ptr, ptr @stderr, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.5) #6
  br label %167

46:                                               ; preds = %38
  %47 = call ptr @SSL_CONF_CTX_new()
  store ptr %47, ptr %11, align 8, !tbaa !9
  %48 = load ptr, ptr %11, align 8, !tbaa !9
  %49 = call i32 @SSL_CONF_CTX_set_flags(ptr noundef %48, i32 noundef 8)
  %50 = load ptr, ptr %11, align 8, !tbaa !9
  %51 = call i32 @SSL_CONF_CTX_set_flags(ptr noundef %50, i32 noundef 32)
  %52 = load ptr, ptr %11, align 8, !tbaa !9
  %53 = call i32 @SSL_CONF_CTX_set_flags(ptr noundef %52, i32 noundef 2)
  %54 = load ptr, ptr %11, align 8, !tbaa !9
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  call void @SSL_CONF_CTX_set_ssl_ctx(ptr noundef %54, ptr noundef %55)
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %111, %46
  %57 = load i32, ptr %18, align 4, !tbaa !5
  %58 = load ptr, ptr %13, align 8, !tbaa !9
  %59 = call ptr @ossl_check_const_CONF_VALUE_sk_type(ptr noundef %58)
  %60 = call i32 @OPENSSL_sk_num(ptr noundef %59)
  %61 = icmp slt i32 %57, %60
  br i1 %61, label %62, label %114

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %63 = load ptr, ptr %13, align 8, !tbaa !9
  %64 = call ptr @ossl_check_const_CONF_VALUE_sk_type(ptr noundef %63)
  %65 = load i32, ptr %18, align 4, !tbaa !5
  %66 = call ptr @OPENSSL_sk_value(ptr noundef %64, i32 noundef %65)
  store ptr %66, ptr %14, align 8, !tbaa !9
  %67 = load ptr, ptr %11, align 8, !tbaa !9
  %68 = load ptr, ptr %14, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.CONF_VALUE, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = load ptr, ptr %14, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.CONF_VALUE, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !15
  %74 = call i32 @SSL_CONF_cmd(ptr noundef %67, ptr noundef %70, ptr noundef %73)
  store i32 %74, ptr %19, align 4, !tbaa !5
  %75 = load i32, ptr %19, align 4, !tbaa !5
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %62
  store i32 5, ptr %20, align 4
  br label %108

78:                                               ; preds = %62
  %79 = load i32, ptr %19, align 4, !tbaa !5
  %80 = icmp ne i32 %79, -2
  br i1 %80, label %81, label %91

81:                                               ; preds = %78
  %82 = load ptr, ptr @stderr, align 8, !tbaa !9
  %83 = load ptr, ptr %14, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.CONF_VALUE, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !13
  %86 = load ptr, ptr %14, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.CONF_VALUE, ptr %86, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !15
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.6, ptr noundef %85, ptr noundef %88) #6
  %90 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %90)
  store i32 2, ptr %20, align 4
  br label %108

91:                                               ; preds = %78
  %92 = load ptr, ptr %14, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.CONF_VALUE, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !13
  %95 = call i32 @strcmp(ptr noundef %94, ptr noundef @.str.7) #7
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %101

97:                                               ; preds = %91
  %98 = load ptr, ptr %14, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.CONF_VALUE, ptr %98, i32 0, i32 2
  %100 = load ptr, ptr %99, align 8, !tbaa !15
  store ptr %100, ptr %6, align 8, !tbaa !9
  br label %107

101:                                              ; preds = %91
  %102 = load ptr, ptr @stderr, align 8, !tbaa !9
  %103 = load ptr, ptr %14, align 8, !tbaa !9
  %104 = getelementptr inbounds %struct.CONF_VALUE, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !13
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str.8, ptr noundef %105) #6
  store i32 2, ptr %20, align 4
  br label %108

107:                                              ; preds = %97
  store i32 0, ptr %20, align 4
  br label %108

108:                                              ; preds = %107, %101, %81, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %109 = load i32, ptr %20, align 4
  switch i32 %109, label %176 [
    i32 0, label %110
    i32 5, label %111
    i32 2, label %167
  ]

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110, %108
  %112 = load i32, ptr %18, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %18, align 4, !tbaa !5
  br label %56, !llvm.loop !16

114:                                              ; preds = %56
  %115 = load ptr, ptr %11, align 8, !tbaa !9
  %116 = call i32 @SSL_CONF_CTX_finish(ptr noundef %115)
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %122, label %118

118:                                              ; preds = %114
  %119 = load ptr, ptr @stderr, align 8, !tbaa !9
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str.9) #6
  %121 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %121)
  br label %167

122:                                              ; preds = %114
  %123 = load ptr, ptr %10, align 8, !tbaa !9
  %124 = call ptr @BIO_new_ssl(ptr noundef %123, i32 noundef 0)
  store ptr %124, ptr %8, align 8, !tbaa !9
  %125 = load ptr, ptr %6, align 8, !tbaa !9
  %126 = call ptr @BIO_new_accept(ptr noundef %125)
  store ptr %126, ptr %7, align 8, !tbaa !9
  %127 = icmp eq ptr %126, null
  br i1 %127, label %128, label %129

128:                                              ; preds = %122
  br label %167

129:                                              ; preds = %122
  %130 = load ptr, ptr %7, align 8, !tbaa !9
  %131 = load ptr, ptr %8, align 8, !tbaa !9
  %132 = call i64 @BIO_ctrl(ptr noundef %130, i32 noundef 118, i64 noundef 3, ptr noundef %131)
  br label %133

133:                                              ; preds = %145, %129
  %134 = load ptr, ptr %7, align 8, !tbaa !9
  %135 = call i64 @BIO_ctrl(ptr noundef %134, i32 noundef 101, i64 noundef 0, ptr noundef null)
  %136 = icmp sle i64 %135, 0
  br i1 %136, label %137, label %138

137:                                              ; preds = %133
  br label %167

138:                                              ; preds = %133
  br label %139

139:                                              ; preds = %159, %157, %138
  %140 = load ptr, ptr %7, align 8, !tbaa !9
  %141 = getelementptr inbounds [512 x i8], ptr %16, i64 0, i64 0
  %142 = call i32 @BIO_read(ptr noundef %140, ptr noundef %141, i32 noundef 512)
  store i32 %142, ptr %18, align 4, !tbaa !5
  %143 = load i32, ptr %18, align 4, !tbaa !5
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %145, label %150

145:                                              ; preds = %139
  %146 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %147 = load ptr, ptr %7, align 8, !tbaa !9
  %148 = call ptr @BIO_pop(ptr noundef %147)
  store ptr %148, ptr %9, align 8, !tbaa !9
  %149 = load ptr, ptr %9, align 8, !tbaa !9
  call void @BIO_free_all(ptr noundef %149)
  br label %133

150:                                              ; preds = %139
  %151 = load i32, ptr %18, align 4, !tbaa !5
  %152 = icmp slt i32 %151, 0
  br i1 %152, label %153, label %159

153:                                              ; preds = %150
  %154 = load ptr, ptr %7, align 8, !tbaa !9
  %155 = call i32 @BIO_test_flags(ptr noundef %154, i32 noundef 8)
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %153
  br label %139

158:                                              ; preds = %153
  br label %167

159:                                              ; preds = %150
  %160 = getelementptr inbounds [512 x i8], ptr %16, i64 0, i64 0
  %161 = load i32, ptr %18, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = load ptr, ptr @stdout, align 8, !tbaa !9
  %164 = call i64 @fwrite(ptr noundef %160, i64 noundef 1, i64 noundef %162, ptr noundef %163)
  %165 = load ptr, ptr @stdout, align 8, !tbaa !9
  %166 = call i32 @fflush(ptr noundef %165)
  br label %139

167:                                              ; preds = %158, %137, %128, %118, %108, %43, %37
  %168 = load i32, ptr %17, align 4, !tbaa !5
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %172

170:                                              ; preds = %167
  %171 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %171)
  br label %172

172:                                              ; preds = %170, %167
  %173 = load ptr, ptr %7, align 8, !tbaa !9
  %174 = call i32 @BIO_free(ptr noundef %173)
  %175 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %175, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %176

176:                                              ; preds = %172, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %177 = load i32, ptr %3, align 4
  ret i32 %177
}

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

declare ptr @SSL_CTX_new(ptr noundef) #2

declare ptr @TLS_server_method() #2

declare ptr @NCONF_new(ptr noundef) #2

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

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

declare ptr @NCONF_get_section(ptr noundef, ptr noundef) #2

declare ptr @SSL_CONF_CTX_new() #2

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

declare void @SSL_CONF_CTX_set_ssl_ctx(ptr noundef, ptr noundef) #2

declare i32 @OPENSSL_sk_num(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_const_CONF_VALUE_sk_type(ptr noundef) #4

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

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

declare void @ERR_print_errors_fp(ptr noundef) #2

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

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

declare i32 @SSL_CONF_CTX_finish(ptr noundef) #2

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

declare ptr @BIO_new_accept(ptr noundef) #2

declare i64 @BIO_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) #2

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

declare i32 @printf(ptr noundef, ...) #2

declare ptr @BIO_pop(ptr noundef) #2

declare void @BIO_free_all(ptr noundef) #2

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare i32 @fflush(ptr noundef) #2

declare i32 @BIO_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 = { 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 #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 #6 = { nounwind }
attributes #7 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!14, !10, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  %4 = alloca [512 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 -1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %4) #6
  %5 = tail call ptr @TLS_server_method() #6
  %6 = tail call ptr @SSL_CTX_new(ptr noundef %5) #6
  %7 = tail call ptr @NCONF_new(ptr noundef null) #6
  %8 = call i32 @NCONF_load(ptr noundef %7, ptr noundef nonnull @.str.1, ptr noundef nonnull %3) #6
  %9 = icmp slt i32 %8, 1
  br i1 %9, label %10, label %18

10:                                               ; preds = %2
  %11 = load i64, ptr %3, align 8, !tbaa !5
  %12 = icmp slt i64 %11, 1
  %13 = load ptr, ptr @stderr, align 8, !tbaa !9
  br i1 %12, label %14, label %16

14:                                               ; preds = %10
  %15 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.2) #7
  br label %.loopexit

16:                                               ; preds = %10
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.3, i64 noundef %11) #7
  br label %.loopexit

18:                                               ; preds = %2
  %19 = call ptr @NCONF_get_section(ptr noundef %7, ptr noundef nonnull @.str.4) #6
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = load ptr, ptr @stderr, align 8, !tbaa !9
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.5) #7
  br label %.loopexit

24:                                               ; preds = %18
  %25 = call ptr @SSL_CONF_CTX_new() #6
  %26 = call i32 @SSL_CONF_CTX_set_flags(ptr noundef %25, i32 noundef 8) #6
  %27 = call i32 @SSL_CONF_CTX_set_flags(ptr noundef %25, i32 noundef 32) #6
  %28 = call i32 @SSL_CONF_CTX_set_flags(ptr noundef %25, i32 noundef 2) #6
  call void @SSL_CONF_CTX_set_ssl_ctx(ptr noundef %25, ptr noundef %6) #6
  %29 = call ptr @ossl_check_const_CONF_VALUE_sk_type(ptr noundef nonnull %19)
  %30 = call i32 @OPENSSL_sk_num(ptr noundef %29) #6
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %24, %56
  %.04163 = phi i32 [ %57, %56 ], [ 0, %24 ]
  %.04262 = phi ptr [ %.1.ph, %56 ], [ @.str, %24 ]
  %32 = call ptr @ossl_check_const_CONF_VALUE_sk_type(ptr noundef nonnull %19)
  %33 = call ptr @OPENSSL_sk_value(ptr noundef %32, i32 noundef %.04163) #6
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = getelementptr inbounds i8, ptr %33, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  %38 = call i32 @SSL_CONF_cmd(ptr noundef %25, ptr noundef %35, ptr noundef %37) #6
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %56, label %40

40:                                               ; preds = %.lr.ph
  %.not51 = icmp eq i32 %38, -2
  br i1 %.not51, label %47, label %41

41:                                               ; preds = %40
  %42 = load ptr, ptr @stderr, align 8, !tbaa !9
  %43 = load ptr, ptr %34, align 8, !tbaa !11
  %44 = load ptr, ptr %36, align 8, !tbaa !13
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.6, ptr noundef %43, ptr noundef %44) #7
  %46 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %46) #6
  br label %.loopexit

47:                                               ; preds = %40
  %48 = load ptr, ptr %34, align 8, !tbaa !11
  %49 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %48, ptr noundef nonnull dereferenceable(1) @.str.7) #8
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %53

51:                                               ; preds = %47
  %52 = load ptr, ptr %36, align 8, !tbaa !13
  br label %56

53:                                               ; preds = %47
  %54 = load ptr, ptr @stderr, align 8, !tbaa !9
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.8, ptr noundef %48) #7
  br label %.loopexit

56:                                               ; preds = %51, %.lr.ph
  %.1.ph = phi ptr [ %.04262, %.lr.ph ], [ %52, %51 ]
  %57 = add nuw nsw i32 %.04163, 1
  %58 = call ptr @ossl_check_const_CONF_VALUE_sk_type(ptr noundef nonnull %19)
  %59 = call i32 @OPENSSL_sk_num(ptr noundef %58) #6
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %56, %24
  %.042.lcssa = phi ptr [ @.str, %24 ], [ %.1.ph, %56 ]
  %61 = call i32 @SSL_CONF_CTX_finish(ptr noundef %25) #6
  %.not = icmp eq i32 %61, 0
  br i1 %.not, label %62, label %66

62:                                               ; preds = %._crit_edge
  %63 = load ptr, ptr @stderr, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str.9) #7
  %65 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %65) #6
  br label %.loopexit

66:                                               ; preds = %._crit_edge
  %67 = call ptr @BIO_new_ssl(ptr noundef %6, i32 noundef 0) #6
  %68 = call ptr @BIO_new_accept(ptr noundef %.042.lcssa) #6
  %69 = icmp eq ptr %68, null
  br i1 %69, label %.loopexit, label %70

70:                                               ; preds = %66
  %71 = call i64 @BIO_ctrl(ptr noundef nonnull %68, i32 noundef 118, i64 noundef 3, ptr noundef %67) #6
  %72 = call i64 @BIO_ctrl(ptr noundef nonnull %68, i32 noundef 101, i64 noundef 0, ptr noundef null) #6
  %73 = icmp slt i64 %72, 1
  br i1 %73, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %70, %._crit_edge65
  %74 = call i32 @BIO_read(ptr noundef nonnull %68, ptr noundef nonnull %4, i32 noundef 512) #6
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %._crit_edge65, label %.lr.ph64

._crit_edge65:                                    ; preds = %.backedge, %.preheader
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %77 = call ptr @BIO_pop(ptr noundef nonnull %68) #6
  call void @BIO_free_all(ptr noundef %77) #6
  %78 = call i64 @BIO_ctrl(ptr noundef nonnull %68, i32 noundef 101, i64 noundef 0, ptr noundef null) #6
  %79 = icmp slt i64 %78, 1
  br i1 %79, label %.loopexit, label %.preheader

.lr.ph64:                                         ; preds = %.preheader, %.backedge
  %80 = phi i32 [ %90, %.backedge ], [ %74, %.preheader ]
  %81 = icmp slt i32 %80, 0
  br i1 %81, label %82, label %84

82:                                               ; preds = %.lr.ph64
  %83 = call i32 @BIO_test_flags(ptr noundef nonnull %68, i32 noundef 8) #6
  %.not50 = icmp eq i32 %83, 0
  br i1 %.not50, label %.loopexit, label %.backedge

84:                                               ; preds = %.lr.ph64
  %85 = zext nneg i32 %80 to i64
  %86 = load ptr, ptr @stdout, align 8, !tbaa !9
  %87 = call i64 @fwrite(ptr noundef nonnull %4, i64 noundef 1, i64 noundef %85, ptr noundef %86)
  %88 = load ptr, ptr @stdout, align 8, !tbaa !9
  %89 = call i32 @fflush(ptr noundef %88)
  br label %.backedge

.backedge:                                        ; preds = %84, %82
  %90 = call i32 @BIO_read(ptr noundef nonnull %68, ptr noundef nonnull %4, i32 noundef 512) #6
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %._crit_edge65, label %.lr.ph64

.loopexit:                                        ; preds = %._crit_edge65, %82, %70, %66, %14, %16, %62, %21, %53, %41
  %.043 = phi ptr [ null, %14 ], [ null, %16 ], [ null, %21 ], [ null, %66 ], [ null, %62 ], [ null, %53 ], [ null, %41 ], [ %68, %70 ], [ %68, %82 ], [ %68, %._crit_edge65 ]
  %92 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %92) #6
  %93 = call i32 @BIO_free(ptr noundef %.043) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 1
}

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

declare ptr @SSL_CTX_new(ptr noundef) local_unnamed_addr #2

declare ptr @TLS_server_method() local_unnamed_addr #2

declare ptr @NCONF_new(ptr noundef) local_unnamed_addr #2

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

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

declare ptr @NCONF_get_section(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @SSL_CONF_CTX_new() local_unnamed_addr #2

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

declare void @SSL_CONF_CTX_set_ssl_ctx(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @OPENSSL_sk_num(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_const_CONF_VALUE_sk_type(ptr noundef) local_unnamed_addr #4

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

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

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #2

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

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

declare i32 @SSL_CONF_CTX_finish(ptr noundef) local_unnamed_addr #2

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

declare ptr @BIO_new_accept(ptr noundef) local_unnamed_addr #2

declare i64 @BIO_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

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

declare ptr @BIO_pop(ptr noundef) local_unnamed_addr #2

declare void @BIO_free_all(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

declare i32 @BIO_free(ptr noundef) local_unnamed_addr #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 = { 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 = { 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 #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { cold nounwind }
attributes #8 = { 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 = !{!"long", !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, !10, i64 8}
!12 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!12, !10, i64 16}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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