; LLVM IR from openssl/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.18 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.19 = 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
@test_providers = external hidden global i32, align 4
@.str.20 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 x i8], align 1
@in = external hidden global ptr, align 8
@.str.23 = external hidden unnamed_addr constant [33 x i8], align 1
@rel_conf_file = external hidden global ptr, align 8
@.str.24 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [25 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
  store ptr null, ptr %2, align 8, !tbaa !5
  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.18, i32 noundef 252, ptr noundef @.str.19, 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 %43

9:                                                ; preds = %0
  br label %10

10:                                               ; preds = %19, %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 %20

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

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

16:                                               ; preds = %13
  store i32 1, ptr @test_providers, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %16, %13, %13, %13, %13, %13, %13
  br label %19

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

19:                                               ; preds = %17, %15
  br label %10, !llvm.loop !11

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

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

30:                                               ; preds = %25, %20
  call void (ptr, ...) @test_note(ptr noundef @.str.23)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %43

31:                                               ; preds = %25
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = call ptr @change_path(ptr noundef %32)
  store ptr %33, ptr @rel_conf_file, align 8, !tbaa !5
  %34 = load ptr, ptr @rel_conf_file, align 8, !tbaa !5
  %35 = call i32 @test_ptr(ptr noundef @.str.18, i32 noundef 281, ptr noundef @.str.24, ptr noundef %34)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  call void (ptr, ...) @test_note(ptr noundef @.str.25)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %43

38:                                               ; preds = %31
  call void @add_test(ptr noundef @.str.26, ptr noundef @test_load_config)
  call void @add_test(ptr noundef @.str.27, ptr noundef @test_check_null_numbers)
  call void @add_test(ptr noundef @.str.28, ptr noundef @test_check_overflow)
  %39 = load i32, ptr @test_providers, align 4, !tbaa !9
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  call void @add_test(ptr noundef @.str.29, ptr noundef @test_available_providers)
  br label %42

42:                                               ; preds = %41, %38
  store i32 1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %43

43:                                               ; preds = %42, %37, %30, %18, %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  %44 = load i32, ptr %1, align 4
  ret i32 %44
}

; 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 ptr @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: nounwind uwtable
declare hidden i32 @test_available_providers() #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.18 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.19 = 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
@test_providers = external hidden local_unnamed_addr global i32, align 4
@.str.20 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 x i8], align 1
@in = external hidden local_unnamed_addr global ptr, align 8
@.str.23 = external hidden unnamed_addr constant [33 x i8], align 1
@rel_conf_file = external hidden local_unnamed_addr global ptr, align 8
@.str.24 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [25 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.18, i32 noundef 252, ptr noundef nonnull @.str.19, 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 %.sink.split
    i32 2, 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
  ]

4:                                                ; preds = %.preheader
  br label %.sink.split

.sink.split:                                      ; preds = %.preheader, %4
  %test_providers.sink = phi ptr [ @test_providers, %4 ], [ @expect_failure, %.preheader ]
  store i32 1, ptr %test_providers.sink, align 4, !tbaa !9
  br label %.preheader.backedge

.preheader.backedge:                              ; preds = %.sink.split, %.preheader, %.preheader, %.preheader, %.preheader, %.preheader, %.preheader
  br label %.preheader, !llvm.loop !11

5:                                                ; preds = %.preheader
  %6 = tail call ptr @test_get_argument(i64 noundef 0) #2
  %7 = tail call i32 @test_ptr(ptr noundef nonnull @.str.18, i32 noundef 270, ptr noundef nonnull @.str.20, 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.22) #2
  store ptr %9, ptr @in, align 8, !tbaa !5
  %10 = tail call i32 @test_ptr(ptr noundef nonnull @.str.18, i32 noundef 271, ptr noundef nonnull @.str.21, 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.23) #2
  br label %.loopexit

12:                                               ; preds = %8
  %13 = tail call ptr @change_path(ptr noundef %6)
  store ptr %13, ptr @rel_conf_file, align 8, !tbaa !5
  %14 = tail call i32 @test_ptr(ptr noundef nonnull @.str.18, i32 noundef 281, ptr noundef nonnull @.str.24, ptr noundef %13) #2
  %.not8 = icmp eq i32 %14, 0
  br i1 %.not8, label %15, label %16

15:                                               ; preds = %12
  tail call void (ptr, ...) @test_note(ptr noundef nonnull @.str.25) #2
  br label %.loopexit

16:                                               ; preds = %12
  tail call void @add_test(ptr noundef nonnull @.str.26, ptr noundef nonnull @test_load_config) #2
  tail call void @add_test(ptr noundef nonnull @.str.27, ptr noundef nonnull @test_check_null_numbers) #2
  tail call void @add_test(ptr noundef nonnull @.str.28, ptr noundef nonnull @test_check_overflow) #2
  %17 = load i32, ptr @test_providers, align 4, !tbaa !9
  %.not9 = icmp eq i32 %17, 0
  br i1 %.not9, label %.loopexit, label %18

18:                                               ; preds = %16
  tail call void @add_test(ptr noundef nonnull @.str.29, ptr noundef nonnull @test_available_providers) #2
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %16, %18, %0, %15, %11
  %.0 = phi i32 [ 0, %15 ], [ 0, %11 ], [ 0, %0 ], [ 1, %18 ], [ 1, %16 ], [ 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 ptr @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

; Function Attrs: nounwind uwtable
declare hidden i32 @test_available_providers() #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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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