; LLVM IR from openanolis/openssl :: test (conf_include_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"

@.str.16 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@conf = external hidden global ptr, align 8
@expect_failure = external hidden global i32, align 4
@.str.18 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@in = external hidden global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @setup_tests() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %5 = call ptr @NCONF_new(ptr noundef null)
  store ptr %5, ptr @conf, align 8, !tbaa !5
  %6 = call i32 @test_ptr(ptr noundef @.str.16, i32 noundef 199, ptr noundef @.str.17, ptr noundef %5)
  %7 = icmp ne i32 %6, 0
  br i1 %7, label %9, label %8

8:                                                ; preds = %0
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %33

9:                                                ; preds = %0
  br label %10

10:                                               ; preds = %18, %9
  %11 = call i32 @opt_next()
  store i32 %11, ptr %3, align 4, !tbaa !9
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %13, label %19

13:                                               ; preds = %10
  %14 = load i32, ptr %3, align 4, !tbaa !9
  switch i32 %14, label %17 [
    i32 1, label %15
    i32 500, label %16
    i32 501, label %16
    i32 502, label %16
    i32 503, label %16
    i32 504, label %16
    i32 505, label %16
  ]

15:                                               ; preds = %13
  store i32 1, ptr @expect_failure, align 4, !tbaa !9
  br label %18

16:                                               ; preds = %13, %13, %13, %13, %13, %13
  br label %18

17:                                               ; preds = %13
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %33

18:                                               ; preds = %16, %15
  br label %10, !llvm.loop !11

19:                                               ; preds = %10
  %20 = call ptr @test_get_argument(i64 noundef 0)
  store ptr %20, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = call i32 @test_ptr(ptr noundef @.str.16, i32 noundef 215, ptr noundef @.str.18, ptr noundef %21)
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %29

24:                                               ; preds = %19
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = call ptr @BIO_new_file(ptr noundef %25, ptr noundef @.str.20)
  store ptr %26, ptr @in, align 8, !tbaa !5
  %27 = call i32 @test_ptr(ptr noundef @.str.16, i32 noundef 216, ptr noundef @.str.19, ptr noundef %26)
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %30, label %29

29:                                               ; preds = %24, %19
  call void (ptr, ...) @test_note(ptr noundef @.str.21)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %33

30:                                               ; preds = %24
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = call i32 @change_path(ptr noundef %31)
  call void @add_test(ptr noundef @.str.22, ptr noundef @test_load_config)
  call void @add_test(ptr noundef @.str.23, ptr noundef @test_check_null_numbers)
  call void @add_test(ptr noundef @.str.24, ptr noundef @test_check_overflow)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %33

33:                                               ; preds = %30, %29, %17, %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  %34 = load i32, ptr %1, align 4
  ret i32 %34
}

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

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

declare ptr @NCONF_new(ptr noundef) #2

declare i32 @opt_next() #2

declare ptr @test_get_argument(i64 noundef) #2

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

declare void @test_note(ptr noundef, ...) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @test_load_config() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @test_check_null_numbers() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @test_check_overflow() #0

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

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 }

!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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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.16 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@conf = external hidden local_unnamed_addr global ptr, align 8
@expect_failure = external hidden local_unnamed_addr global i32, align 4
@.str.18 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@in = external hidden local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @setup_tests() local_unnamed_addr #0 {
  %1 = tail call ptr @NCONF_new(ptr noundef null) #2
  store ptr %1, ptr @conf, align 8, !tbaa !5
  %2 = tail call i32 @test_ptr(ptr noundef nonnull @.str.16, i32 noundef 199, ptr noundef nonnull @.str.17, ptr noundef %1) #2
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %0, %.preheader.backedge
  %3 = tail call i32 @opt_next() #2
  switch i32 %3, label %.loopexit [
    i32 0, label %5
    i32 1, label %4
    i32 500, label %.preheader.backedge
    i32 501, label %.preheader.backedge
    i32 502, label %.preheader.backedge
    i32 503, label %.preheader.backedge
    i32 504, label %.preheader.backedge
    i32 505, label %.preheader.backedge
  ]

.preheader.backedge:                              ; preds = %.preheader, %.preheader, %.preheader, %.preheader, %.preheader, %.preheader, %4
  br label %.preheader, !llvm.loop !9

4:                                                ; preds = %.preheader
  store i32 1, ptr @expect_failure, align 4, !tbaa !11
  br label %.preheader.backedge

5:                                                ; preds = %.preheader
  %6 = tail call ptr @test_get_argument(i64 noundef 0) #2
  %7 = tail call i32 @test_ptr(ptr noundef nonnull @.str.16, i32 noundef 215, ptr noundef nonnull @.str.18, ptr noundef %6) #2
  %.not6 = icmp eq i32 %7, 0
  br i1 %.not6, label %11, label %8

8:                                                ; preds = %5
  %9 = tail call ptr @BIO_new_file(ptr noundef %6, ptr noundef nonnull @.str.20) #2
  store ptr %9, ptr @in, align 8, !tbaa !5
  %10 = tail call i32 @test_ptr(ptr noundef nonnull @.str.16, i32 noundef 216, ptr noundef nonnull @.str.19, ptr noundef %9) #2
  %.not7 = icmp eq i32 %10, 0
  br i1 %.not7, label %11, label %12

11:                                               ; preds = %8, %5
  tail call void (ptr, ...) @test_note(ptr noundef nonnull @.str.21) #2
  br label %.loopexit

12:                                               ; preds = %8
  %13 = tail call i32 @change_path(ptr noundef %6)
  tail call void @add_test(ptr noundef nonnull @.str.22, ptr noundef nonnull @test_load_config) #2
  tail call void @add_test(ptr noundef nonnull @.str.23, ptr noundef nonnull @test_check_null_numbers) #2
  tail call void @add_test(ptr noundef nonnull @.str.24, ptr noundef nonnull @test_check_overflow) #2
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %0, %12, %11
  %.0 = phi i32 [ 1, %12 ], [ 0, %11 ], [ 0, %0 ], [ 0, %.preheader ]
  ret i32 %.0
}

declare i32 @test_ptr(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @NCONF_new(ptr noundef) local_unnamed_addr #1

declare i32 @opt_next() local_unnamed_addr #1

declare ptr @test_get_argument(i64 noundef) local_unnamed_addr #1

declare ptr @BIO_new_file(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @test_note(ptr noundef, ...) local_unnamed_addr #1

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

declare void @add_test(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @test_load_config() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @test_check_null_numbers() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @test_check_overflow() #0

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 = { "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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass