; LLVM IR from mbheinen/bpa-ipf-tsp :: ipf (prs_cmdfil)

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

@prs_cmdfil.rname = external hidden global [16 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [35 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @prs_cmdfil(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [133 x i8], align 16
  %10 = alloca [133 x i8], align 16
  %11 = alloca [4096 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 133, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 133, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4096, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noalias ptr @fopen(ptr noundef %18, ptr noundef @.str.2)
  store ptr %19, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %29

22:                                               ; preds = %3
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %23, ptr noundef @.str.3, ptr noundef %24) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load i32, ptr %12, align 4, !tbaa !9
  call void @apnd_stat_cw(ptr noundef %26, i32 noundef %27, ptr noundef @prs_cmdfil.rname)
  %28 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %28, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %144

29:                                               ; preds = %3
  br label %30

30:                                               ; preds = %41, %29
  %31 = getelementptr inbounds [133 x i8], ptr %9, i64 0, i64 0
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = call ptr @fgets(ptr noundef %31, i32 noundef 132, ptr noundef %32)
  store ptr %33, ptr %14, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %42

35:                                               ; preds = %30
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = icmp eq i32 %38, 47
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  br label %42

41:                                               ; preds = %35
  br label %30, !llvm.loop !12

42:                                               ; preds = %40, %30
  %43 = load ptr, ptr %14, align 8, !tbaa !5
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %54

45:                                               ; preds = %42
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %46, ptr noundef @.str.4, ptr noundef %47) #5
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = call i32 @fclose(ptr noundef %49)
  store i32 1, ptr %12, align 4, !tbaa !9
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load i32, ptr %12, align 4, !tbaa !9
  call void @apnd_stat_cw(ptr noundef %51, i32 noundef %52, ptr noundef @prs_cmdfil.rname)
  %53 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %53, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %144

54:                                               ; preds = %42
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = call ptr @strcpy(ptr noundef %55, ptr noundef %56) #5
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  %59 = call i64 @strlen(ptr noundef %58) #6
  %60 = trunc i64 %59 to i32
  store i32 %60, ptr %13, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %127, %76, %54
  %62 = getelementptr inbounds [133 x i8], ptr %9, i64 0, i64 0
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = call ptr @fgets(ptr noundef %62, i32 noundef 132, ptr noundef %63)
  store ptr %64, ptr %14, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %128

66:                                               ; preds = %61
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = icmp eq i32 %69, 46
  br i1 %70, label %76, label %71

71:                                               ; preds = %66
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = sext i8 %73 to i32
  %75 = icmp eq i32 %74, 40
  br i1 %75, label %76, label %77

76:                                               ; preds = %71, %66
  br label %61, !llvm.loop !14

77:                                               ; preds = %71
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = load i8, ptr %78, align 1, !tbaa !11
  %80 = sext i8 %79 to i32
  %81 = icmp eq i32 %80, 47
  br i1 %81, label %82, label %99

82:                                               ; preds = %77
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = call ptr @strcat(ptr noundef %83, ptr noundef @.str.5) #5
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds [4096 x i8], ptr %11, i64 0, i64 0
  %87 = call i32 @srv_cmdprs(ptr noundef %85, ptr noundef %86)
  store i32 %87, ptr %12, align 4, !tbaa !9
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %97

90:                                               ; preds = %82
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = call i32 @fclose(ptr noundef %91)
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds [4096 x i8], ptr %11, i64 0, i64 0
  %95 = call ptr @strcpy(ptr noundef %93, ptr noundef %94) #5
  %96 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %96, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %144

97:                                               ; preds = %82
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  store i8 0, ptr %98, align 1, !tbaa !11
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %97, %77
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = call i64 @strlen(ptr noundef %100) #6
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = add i64 %103, %101
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr %13, align 4, !tbaa !9
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = icmp slt i32 %106, 3990
  br i1 %107, label %108, label %112

108:                                              ; preds = %99
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load ptr, ptr %14, align 8, !tbaa !5
  %111 = call ptr @strcat(ptr noundef %109, ptr noundef %110) #5
  br label %127

112:                                              ; preds = %99
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %113, ptr noundef @.str.6, ptr noundef %114) #5
  %116 = getelementptr inbounds [133 x i8], ptr %10, i64 0, i64 0
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %116, ptr noundef @.str.7, ptr noundef %117) #5
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds [133 x i8], ptr %10, i64 0, i64 0
  %121 = call ptr @strcat(ptr noundef %119, ptr noundef %120) #5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = call i32 @fclose(ptr noundef %122)
  store i32 1, ptr %12, align 4, !tbaa !9
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load i32, ptr %12, align 4, !tbaa !9
  call void @apnd_stat_cw(ptr noundef %124, i32 noundef %125, ptr noundef @prs_cmdfil.rname)
  %126 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %126, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %144

127:                                              ; preds = %108
  br label %61, !llvm.loop !14

128:                                              ; preds = %61
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = call ptr @strcat(ptr noundef %129, ptr noundef @.str.5) #5
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds [4096 x i8], ptr %11, i64 0, i64 0
  %133 = call i32 @srv_cmdprs(ptr noundef %131, ptr noundef %132)
  store i32 %133, ptr %12, align 4, !tbaa !9
  %134 = load i32, ptr %12, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %140

136:                                              ; preds = %128
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds [4096 x i8], ptr %11, i64 0, i64 0
  %139 = call ptr @strcpy(ptr noundef %137, ptr noundef %138) #5
  br label %140

140:                                              ; preds = %136, %128
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = call i32 @fclose(ptr noundef %141)
  %143 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %143, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %144

144:                                              ; preds = %140, %112, %90, %45, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4096, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 133, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 133, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %145 = load i32, ptr %4, align 4
  ret i32 %145
}

declare void @apnd_stat_cw(ptr noundef, i32 noundef, ptr noundef) #3

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

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

declare i32 @fclose(ptr noundef) #3

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

; Function Attrs: nounwind
declare ptr @strcat(ptr noundef, ptr noundef) #1

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

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


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

@prs_cmdfil.rname = external hidden global [16 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [35 x i8], align 1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @prs_cmdfil(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca [133 x i8], align 16
  %5 = alloca [133 x i8], align 16
  %6 = alloca [4096 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 133, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 133, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %6) #6
  %7 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str.2)
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %.preheader

9:                                                ; preds = %3
  %10 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %0) #6
  tail call void @apnd_stat_cw(ptr noundef %2, i32 noundef 1, ptr noundef nonnull @prs_cmdfil.rname) #6
  br label %53

.preheader:                                       ; preds = %3, %12
  %11 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 132, ptr noundef nonnull %7)
  %cond = icmp eq ptr %11, null
  br i1 %cond, label %15, label %12

12:                                               ; preds = %.preheader
  %13 = load i8, ptr %11, align 1, !tbaa !5
  %14 = icmp eq i8 %13, 47
  br i1 %14, label %18, label %.preheader, !llvm.loop !8

15:                                               ; preds = %.preheader
  %16 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %0) #6
  %17 = call i32 @fclose(ptr noundef nonnull %7)
  call void @apnd_stat_cw(ptr noundef %2, i32 noundef 1, ptr noundef nonnull @prs_cmdfil.rname) #6
  br label %53

18:                                               ; preds = %12
  %19 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) %11) #6
  %20 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %11) #7
  %21 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 132, ptr noundef nonnull %7)
  %.not566465 = icmp eq ptr %21, null
  br i1 %.not566465, label %.outer._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %18
  %22 = trunc i64 %20 to i32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.outer
  %23 = phi ptr [ %41, %.outer ], [ %21, %.lr.ph.preheader ]
  %.049.ph66 = phi i32 [ %38, %.outer ], [ %22, %.lr.ph.preheader ]
  br label %24

24:                                               ; preds = %.lr.ph, %27
  %25 = phi ptr [ %23, %.lr.ph ], [ %28, %27 ]
  %26 = load i8, ptr %25, align 1, !tbaa !5
  switch i8 %26, label %.loopexit [
    i8 46, label %27
    i8 40, label %27
    i8 47, label %29
  ]

27:                                               ; preds = %24, %24
  %28 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 132, ptr noundef nonnull %7)
  %.not56 = icmp eq ptr %28, null
  br i1 %.not56, label %.outer._crit_edge, label %24, !llvm.loop !10

29:                                               ; preds = %24
  %30 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.5) #6
  %31 = call i32 @srv_cmdprs(ptr noundef %1, ptr noundef nonnull %6) #6
  %.not58 = icmp eq i32 %31, 0
  br i1 %.not58, label %35, label %32

32:                                               ; preds = %29
  %33 = call i32 @fclose(ptr noundef nonnull %7)
  %34 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %6) #6
  br label %53

35:                                               ; preds = %29
  store i8 0, ptr %1, align 1, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %24, %35
  %.1 = phi i32 [ 0, %35 ], [ %.049.ph66, %24 ]
  %36 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %25) #7
  %37 = trunc i64 %36 to i32
  %38 = add i32 %.1, %37
  %39 = icmp slt i32 %38, 3990
  br i1 %39, label %.outer, label %42

.outer:                                           ; preds = %.loopexit
  %40 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) %25) #6
  %41 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 132, ptr noundef nonnull %7)
  %.not5664 = icmp eq ptr %41, null
  br i1 %.not5664, label %.outer._crit_edge, label %.lr.ph, !llvm.loop !10

42:                                               ; preds = %.loopexit
  %43 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %0) #6
  %44 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull %25) #6
  %45 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %5) #6
  %46 = call i32 @fclose(ptr noundef nonnull %7)
  call void @apnd_stat_cw(ptr noundef %2, i32 noundef 1, ptr noundef nonnull @prs_cmdfil.rname) #6
  br label %53

.outer._crit_edge:                                ; preds = %.outer, %27, %18
  %47 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.5) #6
  %48 = call i32 @srv_cmdprs(ptr noundef %1, ptr noundef nonnull %6) #6
  %.not57 = icmp eq i32 %48, 0
  br i1 %.not57, label %51, label %49

49:                                               ; preds = %.outer._crit_edge
  %50 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %6) #6
  br label %51

51:                                               ; preds = %49, %.outer._crit_edge
  %52 = call i32 @fclose(ptr noundef nonnull %7)
  br label %53

53:                                               ; preds = %51, %42, %32, %15, %9
  %.0 = phi i32 [ 1, %9 ], [ 1, %15 ], [ %31, %32 ], [ 1, %42 ], [ %48, %51 ]
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 133, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 133, ptr nonnull %4) #6
  ret i32 %.0
}

declare void @apnd_stat_cw(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #1

declare i32 @srv_cmdprs(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { "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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}


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