; LLVM IR from openanolis/openssl :: apps/lib (tlssrp_depr)

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

@bio_err = external global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @set_up_srp_arg(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  %12 = load i32, ptr %9, align 4, !tbaa !9
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %24, label %14

14:                                               ; preds = %5
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.srp_arg_st, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = call i32 @SSL_CTX_set_srp_username(ptr noundef %15, ptr noundef %18)
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %24, label %21

21:                                               ; preds = %14
  %22 = load ptr, ptr @bio_err, align 8, !tbaa !5
  %23 = call i32 (ptr, ptr, ...) @BIO_printf(ptr noundef %22, ptr noundef @.str)
  store i32 0, ptr %6, align 4
  br label %54

24:                                               ; preds = %14, %5
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.srp_arg_st, ptr %26, i32 0, i32 2
  store i32 %25, ptr %27, align 8, !tbaa !13
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.srp_arg_st, ptr %29, i32 0, i32 3
  store i32 %28, ptr %30, align 4, !tbaa !14
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call i32 @SSL_CTX_set_srp_cb_arg(ptr noundef %31, ptr noundef %8)
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = call i32 @SSL_CTX_set_srp_client_pwd_callback(ptr noundef %33, ptr noundef @ssl_give_srp_client_pwd_cb)
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.srp_arg_st, ptr %36, i32 0, i32 5
  %38 = load i32, ptr %37, align 4, !tbaa !15
  %39 = call i32 @SSL_CTX_set_srp_strength(ptr noundef %35, i32 noundef %38)
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %50, label %42

42:                                               ; preds = %24
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %50, label %45

45:                                               ; preds = %42
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.srp_arg_st, ptr %46, i32 0, i32 4
  %48 = load i32, ptr %47, align 8, !tbaa !16
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %53

50:                                               ; preds = %45, %42, %24
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = call i32 @SSL_CTX_set_srp_verify_param_callback(ptr noundef %51, ptr noundef @ssl_srp_verify_param_cb)
  br label %53

53:                                               ; preds = %50, %45
  store i32 1, ptr %6, align 4
  br label %54

54:                                               ; preds = %53, %21
  %55 = load i32, ptr %6, align 4
  ret i32 %55
}

declare i32 @SSL_CTX_set_srp_username(ptr noundef, ptr noundef) #1

declare i32 @BIO_printf(ptr noundef, ptr noundef, ...) #1

declare i32 @SSL_CTX_set_srp_cb_arg(ptr noundef, ptr noundef) #1

declare i32 @SSL_CTX_set_srp_client_pwd_callback(ptr noundef, ptr noundef) #1

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

declare i32 @SSL_CTX_set_srp_strength(ptr noundef, i32 noundef) #1

declare i32 @SSL_CTX_set_srp_verify_param_callback(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @ssl_srp_verify_param_cb(ptr noundef, ptr noundef) #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" }

!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 = !{!12, !6, i64 8}
!12 = !{!"srp_arg_st", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!13 = !{!12, !10, i64 16}
!14 = !{!12, !10, i64 20}
!15 = !{!12, !10, i64 28}
!16 = !{!12, !10, i64 24}


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

@bio_err = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @set_up_srp_arg(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca ptr, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %7, label %14

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = tail call i32 @SSL_CTX_set_srp_username(ptr noundef %0, ptr noundef %9) #2
  %.not11 = icmp eq i32 %10, 0
  br i1 %.not11, label %11, label %14

11:                                               ; preds = %7
  %12 = load ptr, ptr @bio_err, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ptr, ...) @BIO_printf(ptr noundef %12, ptr noundef nonnull @.str) #2
  br label %31

14:                                               ; preds = %7, %5
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  store i32 %3, ptr %15, align 8, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 %4, ptr %16, align 4, !tbaa !13
  %17 = call i32 @SSL_CTX_set_srp_cb_arg(ptr noundef %0, ptr noundef nonnull %6) #2
  %18 = call i32 @SSL_CTX_set_srp_client_pwd_callback(ptr noundef %0, ptr noundef nonnull @ssl_give_srp_client_pwd_cb) #2
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 28
  %21 = load i32, ptr %20, align 4, !tbaa !14
  %22 = call i32 @SSL_CTX_set_srp_strength(ptr noundef %0, i32 noundef %21) #2
  %23 = or i32 %4, %3
  %or.cond.not = icmp eq i32 %23, 0
  br i1 %or.cond.not, label %24, label %29

24:                                               ; preds = %14
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 24
  %27 = load i32, ptr %26, align 8, !tbaa !15
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %31

29:                                               ; preds = %24, %14
  %30 = call i32 @SSL_CTX_set_srp_verify_param_callback(ptr noundef %0, ptr noundef nonnull @ssl_srp_verify_param_cb) #2
  br label %31

31:                                               ; preds = %24, %29, %11
  %.0 = phi i32 [ 0, %11 ], [ 1, %29 ], [ 1, %24 ]
  ret i32 %.0
}

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

declare i32 @BIO_printf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @ssl_srp_verify_param_cb(ptr noundef, ptr noundef) #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, !6, i64 8}
!10 = !{!"srp_arg_st", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!10, !11, i64 20}
!14 = !{!10, !11, i64 28}
!15 = !{!10, !11, i64 24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass