; LLVM IR from guanzhi/GmSSL :: tools (crlget)

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

@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@usage = external hidden global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [62 x i8], align 1
@__FUNCTION__.crlget_main = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @crlget_main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %14 = load ptr, ptr %4, align 8, !tbaa !9
  %15 = getelementptr inbounds ptr, ptr %14, i64 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %17 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %17, 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 i64 0, ptr %13, align 8, !tbaa !11
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %3, align 4, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i32 1
  store ptr %21, ptr %4, align 8, !tbaa !9
  br label %22

22:                                               ; preds = %99, %2
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %104

25:                                               ; preds = %22
  %26 = load ptr, ptr %4, align 8, !tbaa !9
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = call i32 @strcmp(ptr noundef %27, ptr noundef @.str) #7
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %36, label %30

30:                                               ; preds = %25
  %31 = load ptr, ptr %6, align 8, !tbaa !9
  %32 = load ptr, ptr @usage, align 8, !tbaa !9
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %31, ptr noundef %32)
  %34 = load ptr, ptr @options, align 8, !tbaa !9
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %34)
  br label %130

36:                                               ; preds = %25
  %37 = load ptr, ptr %4, align 8, !tbaa !9
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = call i32 @strcmp(ptr noundef %38, ptr noundef @.str.3) #7
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %59, label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %3, align 4, !tbaa !5
  %44 = icmp slt i32 %43, 1
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  br label %91

46:                                               ; preds = %41
  %47 = load ptr, ptr %4, align 8, !tbaa !9
  %48 = getelementptr inbounds ptr, ptr %47, i32 1
  store ptr %48, ptr %4, align 8, !tbaa !9
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  store ptr %49, ptr %7, align 8, !tbaa !9
  %50 = load ptr, ptr %7, align 8, !tbaa !9
  %51 = call i32 @x509_cert_new_from_file(ptr noundef %8, ptr noundef %9, ptr noundef %50)
  %52 = icmp ne i32 %51, 1
  br i1 %52, label %53, label %58

53:                                               ; preds = %46
  %54 = load ptr, ptr @stderr, align 8, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !9
  %56 = load ptr, ptr %7, align 8, !tbaa !9
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.4, ptr noundef %55, ptr noundef %56) #6
  br label %130

58:                                               ; preds = %46
  br label %98

59:                                               ; preds = %36
  %60 = load ptr, ptr %4, align 8, !tbaa !9
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = call i32 @strcmp(ptr noundef %61, ptr noundef @.str.5) #7
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %85, label %64

64:                                               ; preds = %59
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %3, align 4, !tbaa !5
  %67 = icmp slt i32 %66, 1
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  br label %91

69:                                               ; preds = %64
  %70 = load ptr, ptr %4, align 8, !tbaa !9
  %71 = getelementptr inbounds ptr, ptr %70, i32 1
  store ptr %71, ptr %4, align 8, !tbaa !9
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  store ptr %72, ptr %10, align 8, !tbaa !9
  %73 = load ptr, ptr %10, align 8, !tbaa !9
  %74 = call noalias ptr @fopen(ptr noundef %73, ptr noundef @.str.6)
  store ptr %74, ptr %11, align 8, !tbaa !9
  %75 = icmp ne ptr %74, null
  br i1 %75, label %84, label %76

76:                                               ; preds = %69
  %77 = load ptr, ptr @stderr, align 8, !tbaa !9
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  %79 = load ptr, ptr %10, align 8, !tbaa !9
  %80 = call ptr @__errno_location() #8
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = call ptr @strerror(i32 noundef %81) #6
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.7, ptr noundef %78, ptr noundef %79, ptr noundef %82) #6
  br label %130

84:                                               ; preds = %69
  br label %97

85:                                               ; preds = %59
  %86 = load ptr, ptr @stderr, align 8, !tbaa !9
  %87 = load ptr, ptr %6, align 8, !tbaa !9
  %88 = load ptr, ptr %4, align 8, !tbaa !9
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.8, ptr noundef %87, ptr noundef %89) #6
  br label %130

91:                                               ; preds = %68, %45
  %92 = load ptr, ptr @stderr, align 8, !tbaa !9
  %93 = load ptr, ptr %6, align 8, !tbaa !9
  %94 = load ptr, ptr %4, align 8, !tbaa !9
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.9, ptr noundef %93, ptr noundef %95) #6
  br label %130

97:                                               ; preds = %84
  br label %98

98:                                               ; preds = %97, %58
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = add nsw i32 %100, -1
  store i32 %101, ptr %3, align 4, !tbaa !5
  %102 = load ptr, ptr %4, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %102, i32 1
  store ptr %103, ptr %4, align 8, !tbaa !9
  br label %22, !llvm.loop !13

104:                                              ; preds = %22
  %105 = load ptr, ptr %8, align 8, !tbaa !9
  %106 = icmp ne ptr %105, null
  br i1 %106, label %114, label %107

107:                                              ; preds = %104
  %108 = load ptr, ptr @stderr, align 8, !tbaa !9
  %109 = load ptr, ptr %6, align 8, !tbaa !9
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.10, ptr noundef %109) #6
  %111 = load ptr, ptr %6, align 8, !tbaa !9
  %112 = load ptr, ptr @usage, align 8, !tbaa !9
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %111, ptr noundef %112)
  br label %130

114:                                              ; preds = %104
  %115 = load ptr, ptr %8, align 8, !tbaa !9
  %116 = load i64, ptr %9, align 8, !tbaa !11
  %117 = call i32 @x509_crl_new_from_cert(ptr noundef %12, ptr noundef %13, ptr noundef %115, i64 noundef %116)
  %118 = icmp ne i32 %117, 1
  br i1 %118, label %119, label %125

119:                                              ; preds = %114
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr @stderr, align 8, !tbaa !9
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.11, ptr noundef @.str.12, i32 noundef 143, ptr noundef @__FUNCTION__.crlget_main) #6
  br label %123

123:                                              ; preds = %120
  br label %124

124:                                              ; preds = %123
  br label %130

125:                                              ; preds = %114
  %126 = load ptr, ptr %12, align 8, !tbaa !9
  %127 = load i64, ptr %13, align 8, !tbaa !11
  %128 = load ptr, ptr %11, align 8, !tbaa !9
  %129 = call i64 @fwrite(ptr noundef %126, i64 noundef %127, i64 noundef 1, ptr noundef %128)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %125, %124, %107, %91, %85, %76, %53, %30
  %131 = load ptr, ptr %8, align 8, !tbaa !9
  %132 = icmp ne ptr %131, null
  br i1 %132, label %133, label %135

133:                                              ; preds = %130
  %134 = load ptr, ptr %8, align 8, !tbaa !9
  call void @free(ptr noundef %134) #6
  br label %135

135:                                              ; preds = %133, %130
  %136 = load ptr, ptr %10, align 8, !tbaa !9
  %137 = icmp ne ptr %136, null
  br i1 %137, label %138, label %144

138:                                              ; preds = %135
  %139 = load ptr, ptr %11, align 8, !tbaa !9
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %144

141:                                              ; preds = %138
  %142 = load ptr, ptr %11, align 8, !tbaa !9
  %143 = call i32 @fclose(ptr noundef %142)
  br label %144

144:                                              ; preds = %141, %138, %135
  %145 = load i32, ptr %5, align 4, !tbaa !5
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret i32 %145
}

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

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

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

declare i32 @x509_cert_new_from_file(ptr noundef, ptr noundef, ptr noundef) #3

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #4

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #5

declare i32 @x509_crl_new_from_cert(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

declare i32 @fclose(ptr noundef) #3

; 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 = { 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 #3 = { "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 "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(none) "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) }
attributes #8 = { nounwind willreturn memory(none) }

!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 = distinct !{!13, !14}
!14 = !{!"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"

@stdout = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@usage = external hidden local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [62 x i8], align 1
@__FUNCTION__.crlget_main = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @crlget_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store i64 0, ptr %4, align 8, !tbaa !9
  %8 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  store i64 0, ptr %6, align 8, !tbaa !9
  %9 = icmp sgt i32 %0, 1
  br i1 %9, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %2
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %49
  %.071 = phi ptr [ %.1, %49 ], [ %8, %.lr.ph.preheader ]
  %.03170 = phi ptr [ %.132, %49 ], [ null, %.lr.ph.preheader ]
  %.034.in69 = phi i32 [ %.135, %49 ], [ %0, %.lr.ph.preheader ]
  %.03668 = phi ptr [ %50, %49 ], [ %10, %.lr.ph.preheader ]
  %11 = load ptr, ptr %.03668, align 8, !tbaa !5
  %12 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str) #9
  %.not46 = icmp eq i32 %12, 0
  br i1 %.not46, label %13, label %18

13:                                               ; preds = %.lr.ph
  %14 = load ptr, ptr @usage, align 8, !tbaa !5
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %7, ptr noundef %14)
  %16 = load ptr, ptr @options, align 8, !tbaa !5
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %16)
  br label %66

18:                                               ; preds = %.lr.ph
  %19 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.3) #9
  %.not47 = icmp eq i32 %19, 0
  br i1 %.not47, label %20, label %29

20:                                               ; preds = %18
  %21 = icmp eq i32 %.034.in69, 2
  br i1 %21, label %46, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %.03668, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = call i32 @x509_cert_new_from_file(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef %24) #8
  %.not48 = icmp eq i32 %25, 1
  br i1 %.not48, label %49, label %26

26:                                               ; preds = %22
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.4, ptr noundef %7, ptr noundef %24) #10
  br label %66

29:                                               ; preds = %18
  %30 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.5) #9
  %.not49 = icmp eq i32 %30, 0
  br i1 %.not49, label %31, label %43

31:                                               ; preds = %29
  %32 = icmp eq i32 %.034.in69, 2
  br i1 %32, label %46, label %33

33:                                               ; preds = %31
  %34 = getelementptr inbounds i8, ptr %.03668, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = call noalias ptr @fopen(ptr noundef %35, ptr noundef nonnull @.str.6)
  %.not50 = icmp eq ptr %36, null
  br i1 %.not50, label %37, label %49

37:                                               ; preds = %33
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = tail call ptr @__errno_location() #11
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = call ptr @strerror(i32 noundef %40) #8
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.7, ptr noundef %7, ptr noundef %35, ptr noundef %41) #10
  br label %66

43:                                               ; preds = %29
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.8, ptr noundef %7, ptr noundef %11) #10
  br label %66

46:                                               ; preds = %31, %20
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.9, ptr noundef %7, ptr noundef %11) #10
  br label %66

49:                                               ; preds = %22, %33
  %.132 = phi ptr [ %35, %33 ], [ %.03170, %22 ]
  %.1 = phi ptr [ %36, %33 ], [ %.071, %22 ]
  %.135 = add nsw i32 %.034.in69, -2
  %50 = getelementptr inbounds i8, ptr %.03668, i64 16
  %51 = icmp sgt i32 %.034.in69, 3
  br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %49
  %.pre = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %.pre, null
  br i1 %.not, label %._crit_edge.thread, label %56

._crit_edge.thread:                               ; preds = %2, %._crit_edge
  %.0.lcssa94 = phi ptr [ %.1, %._crit_edge ], [ %8, %2 ]
  %.031.lcssa93 = phi ptr [ %.132, %._crit_edge ], [ null, %2 ]
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.10, ptr noundef %7) #10
  %54 = load ptr, ptr @usage, align 8, !tbaa !5
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %7, ptr noundef %54)
  br label %66

56:                                               ; preds = %._crit_edge
  %57 = load i64, ptr %4, align 8, !tbaa !9
  %58 = call i32 @x509_crl_new_from_cert(ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %.pre, i64 noundef %57) #8
  %.not45 = icmp eq i32 %58, 1
  br i1 %.not45, label %62, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.12, i32 noundef 143, ptr noundef nonnull @__FUNCTION__.crlget_main) #10
  br label %66

62:                                               ; preds = %56
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load i64, ptr %6, align 8, !tbaa !9
  %65 = call i64 @fwrite(ptr noundef %63, i64 noundef %64, i64 noundef 1, ptr noundef %.1)
  br label %66

66:                                               ; preds = %62, %59, %._crit_edge.thread, %46, %43, %37, %26, %13
  %.038 = phi i32 [ 1, %43 ], [ 1, %46 ], [ 1, %37 ], [ 1, %26 ], [ 1, %13 ], [ 1, %59 ], [ 0, %62 ], [ 1, %._crit_edge.thread ]
  %.233 = phi ptr [ %.03170, %43 ], [ %.03170, %46 ], [ %35, %37 ], [ %.03170, %26 ], [ %.03170, %13 ], [ %.132, %59 ], [ %.132, %62 ], [ %.031.lcssa93, %._crit_edge.thread ]
  %.2 = phi ptr [ %.071, %43 ], [ %.071, %46 ], [ null, %37 ], [ %.071, %26 ], [ %.071, %13 ], [ %.1, %59 ], [ %.1, %62 ], [ %.0.lcssa94, %._crit_edge.thread ]
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %.not51 = icmp eq ptr %67, null
  br i1 %.not51, label %69, label %68

68:                                               ; preds = %66
  call void @free(ptr noundef nonnull %67) #8
  br label %69

69:                                               ; preds = %68, %66
  %70 = icmp ne ptr %.233, null
  %71 = icmp ne ptr %.2, null
  %or.cond = select i1 %70, i1 %71, i1 false
  br i1 %or.cond, label %72, label %74

72:                                               ; preds = %69
  %73 = call i32 @fclose(ptr noundef nonnull %.2)
  br label %74

74:                                               ; preds = %72, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret i32 %.038
}

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

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

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

declare i32 @x509_cert_new_from_file(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

declare i32 @x509_crl_new_from_cert(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7

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

; Function Attrs: mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { "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 "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind willreturn memory(none) }

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


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