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

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

@stdin = external global ptr, align 8
@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@options = external hidden global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 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 [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @reqparse_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 ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [1024 x i8], align 16
  %12 = 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
  %13 = load ptr, ptr %4, align 8, !tbaa !9
  %14 = getelementptr inbounds ptr, ptr %13, i64 0
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %15, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr null, ptr %7, align 8, !tbaa !9
  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
  %16 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %16, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %17 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %17, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1024, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %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 = %100, %2
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %105

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 %34, label %30

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

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

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

43:                                               ; preds = %39
  br label %92

44:                                               ; preds = %39
  %45 = load ptr, ptr %4, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i32 1
  store ptr %46, ptr %4, align 8, !tbaa !9
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  store ptr %47, ptr %7, align 8, !tbaa !9
  %48 = load ptr, ptr %7, align 8, !tbaa !9
  %49 = call noalias ptr @fopen(ptr noundef %48, ptr noundef @.str.3)
  store ptr %49, ptr %9, align 8, !tbaa !9
  %50 = icmp ne ptr %49, null
  br i1 %50, label %59, label %51

51:                                               ; preds = %44
  %52 = load ptr, ptr @stderr, align 8, !tbaa !9
  %53 = load ptr, ptr %6, align 8, !tbaa !9
  %54 = load ptr, ptr %7, align 8, !tbaa !9
  %55 = call ptr @__errno_location() #8
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = call ptr @strerror(i32 noundef %56) #6
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.4, ptr noundef %53, ptr noundef %54, ptr noundef %57) #6
  br label %129

59:                                               ; preds = %44
  br label %99

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

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

69:                                               ; preds = %65
  br label %92

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

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

85:                                               ; preds = %70
  br label %98

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

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

98:                                               ; preds = %85
  br label %99

99:                                               ; preds = %98, %59
  br label %100

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

105:                                              ; preds = %22
  %106 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %107 = load ptr, ptr %9, align 8, !tbaa !9
  %108 = call i32 @x509_req_from_pem(ptr noundef %106, ptr noundef %12, i64 noundef 1024, ptr noundef %107)
  %109 = icmp ne i32 %108, 1
  br i1 %109, label %110, label %114

110:                                              ; preds = %105
  %111 = load ptr, ptr @stderr, align 8, !tbaa !9
  %112 = load ptr, ptr %6, align 8, !tbaa !9
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef @.str.9, ptr noundef %112) #6
  br label %129

114:                                              ; preds = %105
  %115 = load ptr, ptr %10, align 8, !tbaa !9
  %116 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %117 = load i64, ptr %12, align 8, !tbaa !13
  %118 = call i32 @x509_req_print(ptr noundef %115, i32 noundef 0, i32 noundef 0, ptr noundef @.str.10, ptr noundef %116, i64 noundef %117)
  %119 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %120 = load i64, ptr %12, align 8, !tbaa !13
  %121 = load ptr, ptr %10, align 8, !tbaa !9
  %122 = call i32 @x509_req_to_pem(ptr noundef %119, i64 noundef %120, ptr noundef %121)
  %123 = icmp ne i32 %122, 1
  br i1 %123, label %124, label %128

124:                                              ; preds = %114
  %125 = load ptr, ptr @stderr, align 8, !tbaa !9
  %126 = load ptr, ptr %6, align 8, !tbaa !9
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.11, ptr noundef %126) #6
  br label %129

128:                                              ; preds = %114
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %128, %124, %110, %92, %86, %77, %51, %30
  %130 = load ptr, ptr %7, align 8, !tbaa !9
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %138

132:                                              ; preds = %129
  %133 = load ptr, ptr %9, align 8, !tbaa !9
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %138

135:                                              ; preds = %132
  %136 = load ptr, ptr %9, align 8, !tbaa !9
  %137 = call i32 @fclose(ptr noundef %136)
  br label %138

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

141:                                              ; preds = %138
  %142 = load ptr, ptr %10, align 8, !tbaa !9
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %147

144:                                              ; preds = %141
  %145 = load ptr, ptr %10, align 8, !tbaa !9
  %146 = call i32 @fclose(ptr noundef %145)
  br label %147

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

; 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 noalias ptr @fopen(ptr noundef, ptr noundef) #3

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

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

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

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

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

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

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


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

@stdin = external local_unnamed_addr global ptr, align 8
@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 [14 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 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 [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %48
  %.0106 = phi ptr [ %.1, %48 ], [ %7, %.lr.ph.preheader ]
  %.038105 = phi ptr [ %.139, %48 ], [ %6, %.lr.ph.preheader ]
  %.041104 = phi ptr [ %.142, %48 ], [ null, %.lr.ph.preheader ]
  %.044103 = phi ptr [ %.145, %48 ], [ null, %.lr.ph.preheader ]
  %.047.in102 = phi i32 [ %.148, %48 ], [ %0, %.lr.ph.preheader ]
  %.050101 = phi ptr [ %49, %48 ], [ %9, %.lr.ph.preheader ]
  %10 = load ptr, ptr %.050101, align 8, !tbaa !5
  %11 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str) #8
  %.not59 = icmp eq i32 %11, 0
  br i1 %.not59, label %12, label %15

12:                                               ; preds = %.lr.ph
  %13 = load ptr, ptr @options, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %5, ptr noundef %13)
  br label %63

15:                                               ; preds = %.lr.ph
  %16 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.2) #8
  %.not60 = icmp eq i32 %16, 0
  br i1 %.not60, label %17, label %28

17:                                               ; preds = %15
  %18 = icmp eq i32 %.047.in102, 2
  br i1 %18, label %45, label %19

19:                                               ; preds = %17
  %20 = getelementptr inbounds i8, ptr %.050101, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = tail call noalias ptr @fopen(ptr noundef %21, ptr noundef nonnull @.str.3)
  %.not61 = icmp eq ptr %22, null
  br i1 %.not61, label %.thread, label %48

.thread:                                          ; preds = %19
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = tail call ptr @__errno_location() #9
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = tail call ptr @strerror(i32 noundef %25) #7
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.4, ptr noundef %5, ptr noundef %21, ptr noundef %26) #10
  br label %68

28:                                               ; preds = %15
  %29 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.5) #8
  %.not62 = icmp eq i32 %29, 0
  br i1 %.not62, label %30, label %42

30:                                               ; preds = %28
  %31 = icmp eq i32 %.047.in102, 2
  br i1 %31, label %45, label %32

32:                                               ; preds = %30
  %33 = getelementptr inbounds i8, ptr %.050101, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = tail call noalias ptr @fopen(ptr noundef %34, ptr noundef nonnull @.str.6)
  %.not63 = icmp eq ptr %35, null
  br i1 %.not63, label %36, label %48

36:                                               ; preds = %32
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = tail call ptr @__errno_location() #9
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = tail call ptr @strerror(i32 noundef %39) #7
  %41 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.4, ptr noundef %5, ptr noundef %34, ptr noundef %40) #10
  br label %63

42:                                               ; preds = %28
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.7, ptr noundef %5, ptr noundef %10) #10
  br label %63

45:                                               ; preds = %30, %17
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.8, ptr noundef %5, ptr noundef %10) #10
  br label %63

48:                                               ; preds = %19, %32
  %.145 = phi ptr [ %.044103, %32 ], [ %21, %19 ]
  %.142 = phi ptr [ %34, %32 ], [ %.041104, %19 ]
  %.139 = phi ptr [ %.038105, %32 ], [ %22, %19 ]
  %.1 = phi ptr [ %35, %32 ], [ %.0106, %19 ]
  %.148 = add nsw i32 %.047.in102, -2
  %49 = getelementptr inbounds i8, ptr %.050101, i64 16
  %50 = icmp sgt i32 %.047.in102, 3
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %48, %2
  %.044.lcssa = phi ptr [ null, %2 ], [ %.145, %48 ]
  %.041.lcssa = phi ptr [ null, %2 ], [ %.142, %48 ]
  %.038.lcssa = phi ptr [ %6, %2 ], [ %.139, %48 ]
  %.0.lcssa = phi ptr [ %7, %2 ], [ %.1, %48 ]
  %51 = call i32 @x509_req_from_pem(ptr noundef nonnull %3, ptr noundef nonnull %4, i64 noundef 1024, ptr noundef %.038.lcssa) #7
  %.not = icmp eq i32 %51, 1
  br i1 %.not, label %55, label %52

52:                                               ; preds = %._crit_edge
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.9, ptr noundef %5) #10
  br label %63

55:                                               ; preds = %._crit_edge
  %56 = load i64, ptr %4, align 8, !tbaa !13
  %57 = call i32 @x509_req_print(ptr noundef %.0.lcssa, i32 noundef 0, i32 noundef 0, ptr noundef nonnull @.str.10, ptr noundef nonnull %3, i64 noundef %56) #7
  %58 = load i64, ptr %4, align 8, !tbaa !13
  %59 = call i32 @x509_req_to_pem(ptr noundef nonnull %3, i64 noundef %58, ptr noundef %.0.lcssa) #7
  %.not58 = icmp eq i32 %59, 1
  br i1 %.not58, label %63, label %60

60:                                               ; preds = %55
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.11, ptr noundef %5) #10
  br label %63

63:                                               ; preds = %55, %60, %52, %45, %42, %36, %12
  %.04494 = phi ptr [ %.044103, %42 ], [ %.044103, %45 ], [ %.044103, %36 ], [ %.044103, %12 ], [ %.044.lcssa, %52 ], [ %.044.lcssa, %60 ], [ %.044.lcssa, %55 ]
  %.03883 = phi ptr [ %.038105, %42 ], [ %.038105, %45 ], [ %.038105, %36 ], [ %.038105, %12 ], [ %.038.lcssa, %52 ], [ %.038.lcssa, %60 ], [ %.038.lcssa, %55 ]
  %.049 = phi i32 [ 1, %42 ], [ 1, %45 ], [ 1, %36 ], [ 1, %12 ], [ 1, %52 ], [ 1, %60 ], [ 0, %55 ]
  %.243 = phi ptr [ %.041104, %42 ], [ %.041104, %45 ], [ %34, %36 ], [ %.041104, %12 ], [ %.041.lcssa, %52 ], [ %.041.lcssa, %60 ], [ %.041.lcssa, %55 ]
  %.2 = phi ptr [ %.0106, %42 ], [ %.0106, %45 ], [ null, %36 ], [ %.0106, %12 ], [ %.0.lcssa, %52 ], [ %.0.lcssa, %60 ], [ %.0.lcssa, %55 ]
  %64 = icmp ne ptr %.04494, null
  %65 = icmp ne ptr %.03883, null
  %or.cond = select i1 %64, i1 %65, i1 false
  br i1 %or.cond, label %66, label %68

66:                                               ; preds = %63
  %67 = call i32 @fclose(ptr noundef nonnull %.03883)
  br label %68

68:                                               ; preds = %.thread, %66, %63
  %.272 = phi ptr [ %.0106, %.thread ], [ %.2, %66 ], [ %.2, %63 ]
  %.24371 = phi ptr [ %.041104, %.thread ], [ %.243, %66 ], [ %.243, %63 ]
  %.04970 = phi i32 [ 1, %.thread ], [ %.049, %66 ], [ %.049, %63 ]
  %69 = icmp ne ptr %.24371, null
  %70 = icmp ne ptr %.272, null
  %or.cond3 = select i1 %69, i1 %70, i1 false
  br i1 %or.cond3, label %71, label %73

71:                                               ; preds = %68
  %72 = call i32 @fclose(ptr noundef nonnull %.272)
  br label %73

73:                                               ; preds = %71, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  ret i32 %.04970
}

; 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

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

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

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

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

declare i32 @x509_req_from_pem(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #6

declare i32 @x509_req_print(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #6

declare i32 @x509_req_to_pem(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #6

; 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 = { 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 = { 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 #6 = { "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 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { cold 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"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


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