; LLVM IR from openssl/openssl :: apps/lib (opt)

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

@OPT_HELP_STR = external dso_local constant [3 x i8], align 1
@OPT_MORE_STR = external dso_local constant [3 x i8], align 1
@OPT_SECTION_STR = external dso_local constant [3 x i8], align 1
@OPT_PARAM_STR = external dso_local constant [3 x i8], align 1
@prog = external hidden global [40 x i8], align 16
@.str.58 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [20 x i8], align 1

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @opt_help(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 5, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.options_st, ptr %8, i64 0
  %10 = getelementptr inbounds %struct.options_st, ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = icmp ne ptr %11, @OPT_HELP_STR
  %13 = zext i1 %12 to i32
  store i32 %13, ptr %7, align 4, !tbaa !9
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %14, ptr %3, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %53, %1
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.options_st, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %56

20:                                               ; preds = %15
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.options_st, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = icmp eq ptr %23, @OPT_MORE_STR
  br i1 %24, label %25, label %26

25:                                               ; preds = %20
  br label %53

26:                                               ; preds = %20
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.options_st, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = call i64 @strlen(ptr noundef %29) #5
  %31 = trunc i64 %30 to i32
  %32 = add nsw i32 2, %31
  store i32 %32, ptr %4, align 4, !tbaa !9
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.options_st, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %36 = icmp ne i32 %35, 45
  br i1 %36, label %37, label %46

37:                                               ; preds = %26
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = call ptr @valtype2param(ptr noundef %38)
  %40 = call i64 @strlen(ptr noundef %39) #5
  %41 = add i64 1, %40
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = add i64 %43, %41
  %45 = trunc i64 %44 to i32
  store i32 %45, ptr %4, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %37, %26
  %47 = load i32, ptr %4, align 4, !tbaa !9
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = icmp sgt i32 %47, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %46
  %51 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %51, ptr %6, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %50, %46
  br label %53

53:                                               ; preds = %52, %25
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.options_st, ptr %54, i32 1
  store ptr %55, ptr %3, align 8, !tbaa !5
  br label %15, !llvm.loop !14

56:                                               ; preds = %15
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = icmp sgt i32 %57, 30
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  store i32 30, ptr %6, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %59, %56
  %61 = load i32, ptr %7, align 4, !tbaa !9
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %73

63:                                               ; preds = %60
  %64 = call i32 (ptr, ...) @opt_printf_stderr(ptr noundef @.str.58, ptr noundef @prog)
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.options_st, ptr %65, i64 0
  %67 = getelementptr inbounds %struct.options_st, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = icmp ne ptr %68, @OPT_SECTION_STR
  br i1 %69, label %70, label %72

70:                                               ; preds = %63
  %71 = call i32 (ptr, ...) @opt_printf_stderr(ptr noundef @.str.59, ptr noundef @prog)
  br label %72

72:                                               ; preds = %70, %63
  br label %73

73:                                               ; preds = %72, %60
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %74, ptr %3, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %90, %73
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.options_st, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !11
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %93

80:                                               ; preds = %75
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.options_st, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = icmp eq ptr %83, @OPT_PARAM_STR
  br i1 %84, label %85, label %86

85:                                               ; preds = %80
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %85, %80
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = load i32, ptr %6, align 4, !tbaa !9
  call void @opt_print(ptr noundef %87, i32 noundef %88, i32 noundef %89)
  br label %90

90:                                               ; preds = %86
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.options_st, ptr %91, i32 1
  store ptr %92, ptr %3, align 8, !tbaa !5
  br label %75, !llvm.loop !16

93:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden ptr @valtype2param(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @opt_print(ptr noundef, i32 noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"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 0}
!12 = !{!"options_st", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!13 = !{!12, !10, i64 12}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !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"

@OPT_HELP_STR = external dso_local constant [3 x i8], align 1
@OPT_MORE_STR = external dso_local constant [3 x i8], align 1
@OPT_SECTION_STR = external dso_local constant [3 x i8], align 1
@OPT_PARAM_STR = external dso_local constant [3 x i8], align 1
@prog = external hidden global [40 x i8], align 16
@.str.58 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @opt_help(ptr noundef %0) local_unnamed_addr #2 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %2, @OPT_HELP_STR
  %.not2833 = icmp eq ptr %2, null
  br i1 %.not2833, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %1, %18
  %.035 = phi ptr [ %19, %18 ], [ %0, %1 ]
  %.02134 = phi i32 [ %.122, %18 ], [ 5, %1 ]
  %3 = phi ptr [ %.pr, %18 ], [ %2, %1 ]
  %4 = icmp eq ptr %3, @OPT_MORE_STR
  br i1 %4, label %18, label %5

5:                                                ; preds = %.lr.ph
  %6 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #4
  %7 = trunc i64 %6 to i32
  %8 = add nsw i32 %7, 2
  %9 = getelementptr inbounds i8, ptr %.035, i64 12
  %10 = load i32, ptr %9, align 4, !tbaa !11
  %.not31 = icmp eq i32 %10, 45
  br i1 %.not31, label %17, label %11

11:                                               ; preds = %5
  %12 = tail call ptr @valtype2param(ptr noundef nonnull %.035)
  %13 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %12) #4
  %14 = trunc i64 %13 to i32
  %15 = add i32 %7, 3
  %16 = add i32 %15, %14
  br label %17

17:                                               ; preds = %11, %5
  %.025 = phi i32 [ %16, %11 ], [ %8, %5 ]
  %spec.select = tail call i32 @llvm.smax.i32(i32 %.025, i32 %.02134)
  br label %18

18:                                               ; preds = %17, %.lr.ph
  %.122 = phi i32 [ %.02134, %.lr.ph ], [ %spec.select, %17 ]
  %19 = getelementptr inbounds i8, ptr %.035, i64 24
  %.pr = load ptr, ptr %19, align 8, !tbaa !5
  %.not28 = icmp eq ptr %.pr, null
  br i1 %.not28, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %18
  %spec.store.select = tail call i32 @llvm.smin.i32(i32 %.122, i32 30)
  br i1 %.not, label %24, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %1, %._crit_edge
  %spec.store.select44 = phi i32 [ %spec.store.select, %._crit_edge ], [ 5, %1 ]
  %20 = tail call i32 (ptr, ...) @opt_printf_stderr(ptr noundef nonnull @.str.58, ptr noundef nonnull @prog) #5
  %21 = load ptr, ptr %0, align 8, !tbaa !5
  %.not29 = icmp eq ptr %21, @OPT_SECTION_STR
  br i1 %.not29, label %.lr.ph40.preheader, label %22

22:                                               ; preds = %._crit_edge.thread
  %23 = tail call i32 (ptr, ...) @opt_printf_stderr(ptr noundef nonnull @.str.59, ptr noundef nonnull @prog) #5
  br label %24

24:                                               ; preds = %22, %._crit_edge
  %spec.store.select45.ph = phi i32 [ %spec.store.select, %._crit_edge ], [ %spec.store.select44, %22 ]
  %.pr46 = load ptr, ptr %0, align 8, !tbaa !5
  %.not3036 = icmp eq ptr %.pr46, null
  br i1 %.not3036, label %._crit_edge41, label %.lr.ph40.preheader

.lr.ph40.preheader:                               ; preds = %._crit_edge.thread, %24
  %spec.store.select4549 = phi i32 [ %spec.store.select45.ph, %24 ], [ %spec.store.select44, %._crit_edge.thread ]
  %25 = phi ptr [ %.pr46, %24 ], [ @OPT_SECTION_STR, %._crit_edge.thread ]
  br label %.lr.ph40

.lr.ph40:                                         ; preds = %.lr.ph40.preheader, %.lr.ph40
  %26 = phi ptr [ %29, %.lr.ph40 ], [ %25, %.lr.ph40.preheader ]
  %.138 = phi ptr [ %28, %.lr.ph40 ], [ %0, %.lr.ph40.preheader ]
  %.02337 = phi i32 [ %spec.select32, %.lr.ph40 ], [ 0, %.lr.ph40.preheader ]
  %27 = icmp eq ptr %26, @OPT_PARAM_STR
  %spec.select32 = select i1 %27, i32 1, i32 %.02337
  tail call void @opt_print(ptr noundef nonnull %.138, i32 noundef %spec.select32, i32 noundef %spec.store.select4549)
  %28 = getelementptr inbounds i8, ptr %.138, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %.not30 = icmp eq ptr %29, null
  br i1 %.not30, label %._crit_edge41, label %.lr.ph40, !llvm.loop !14

._crit_edge41:                                    ; preds = %.lr.ph40, %24
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden ptr @valtype2param(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @opt_print(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

attributes #0 = { 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 #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 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind willreturn memory(read) }
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, !7, i64 0}
!6 = !{!"options_st", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 12}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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