; LLVM IR from PyojinKim/LPVO :: LPVO_core/addon/lsd_1.6 (lsd_cmd)

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

@.str = external hidden unnamed_addr constant [2200 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  %21 = call ptr @process_arguments(ptr noundef @.str, i32 noundef %19, ptr noundef %20)
  store ptr %21, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, 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
  store i32 7, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %22 = load ptr, ptr %6, align 8, !tbaa !9
  %23 = call ptr @get_str(ptr noundef %22, ptr noundef @.str.1)
  %24 = call ptr @read_pgm_image_double(ptr noundef %9, ptr noundef %10, ptr noundef %23)
  store ptr %24, ptr %8, align 8, !tbaa !9
  %25 = load ptr, ptr %8, align 8, !tbaa !9
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = load i32, ptr %10, align 4, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !9
  %29 = call double @get_double(ptr noundef %28, ptr noundef @.str.2)
  %30 = load ptr, ptr %6, align 8, !tbaa !9
  %31 = call double @get_double(ptr noundef %30, ptr noundef @.str.3)
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = call double @get_double(ptr noundef %32, ptr noundef @.str.4)
  %34 = load ptr, ptr %6, align 8, !tbaa !9
  %35 = call double @get_double(ptr noundef %34, ptr noundef @.str.5)
  %36 = load ptr, ptr %6, align 8, !tbaa !9
  %37 = call double @get_double(ptr noundef %36, ptr noundef @.str.6)
  %38 = load ptr, ptr %6, align 8, !tbaa !9
  %39 = call double @get_double(ptr noundef %38, ptr noundef @.str.7)
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  %41 = call i32 @get_int(ptr noundef %40, ptr noundef @.str.8)
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = call i32 @is_assigned(ptr noundef %42, ptr noundef @.str.9)
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %2
  br label %47

46:                                               ; preds = %2
  br label %47

47:                                               ; preds = %46, %45
  %48 = phi ptr [ %14, %45 ], [ null, %46 ]
  %49 = call ptr @LineSegmentDetection(ptr noundef %12, ptr noundef %25, i32 noundef %26, i32 noundef %27, double noundef %29, double noundef %31, double noundef %33, double noundef %35, double noundef %37, double noundef %39, i32 noundef %41, ptr noundef %48, ptr noundef %15, ptr noundef %16)
  store ptr %49, ptr %11, align 8, !tbaa !9
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = call ptr @get_str(ptr noundef %50, ptr noundef @.str.10)
  %52 = call i32 @strcmp(ptr noundef %51, ptr noundef @.str.11) #6
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %56

54:                                               ; preds = %47
  %55 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %55, ptr %7, align 8, !tbaa !9
  br label %60

56:                                               ; preds = %47
  %57 = load ptr, ptr %6, align 8, !tbaa !9
  %58 = call ptr @get_str(ptr noundef %57, ptr noundef @.str.10)
  %59 = call noalias ptr @fopen(ptr noundef %58, ptr noundef @.str.12)
  store ptr %59, ptr %7, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %56, %54
  %61 = load ptr, ptr %7, align 8, !tbaa !9
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  call void @error(ptr noundef @.str.13)
  br label %64

64:                                               ; preds = %63, %60
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %92, %64
  %66 = load i32, ptr %17, align 4, !tbaa !5
  %67 = load i32, ptr %12, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %69, label %95

69:                                               ; preds = %65
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %86, %69
  %71 = load i32, ptr %18, align 4, !tbaa !5
  %72 = load i32, ptr %13, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %89

74:                                               ; preds = %70
  %75 = load ptr, ptr %7, align 8, !tbaa !9
  %76 = load ptr, ptr %11, align 8, !tbaa !9
  %77 = load i32, ptr %17, align 4, !tbaa !5
  %78 = load i32, ptr %13, align 4, !tbaa !5
  %79 = mul nsw i32 %77, %78
  %80 = load i32, ptr %18, align 4, !tbaa !5
  %81 = add nsw i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %76, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !11
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.14, double noundef %84) #5
  br label %86

86:                                               ; preds = %74
  %87 = load i32, ptr %18, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %18, align 4, !tbaa !5
  br label %70, !llvm.loop !13

89:                                               ; preds = %70
  %90 = load ptr, ptr %7, align 8, !tbaa !9
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.15) #5
  br label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %17, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %17, align 4, !tbaa !5
  br label %65, !llvm.loop !15

95:                                               ; preds = %65
  %96 = load ptr, ptr %7, align 8, !tbaa !9
  %97 = load ptr, ptr @stdout, align 8, !tbaa !9
  %98 = icmp ne ptr %96, %97
  br i1 %98, label %99, label %104

99:                                               ; preds = %95
  %100 = load ptr, ptr %7, align 8, !tbaa !9
  %101 = call i32 @fclose(ptr noundef %100)
  %102 = icmp eq i32 %101, -1
  br i1 %102, label %103, label %104

103:                                              ; preds = %99
  call void @error(ptr noundef @.str.16)
  br label %104

104:                                              ; preds = %103, %99, %95
  %105 = load ptr, ptr %6, align 8, !tbaa !9
  %106 = call i32 @is_assigned(ptr noundef %105, ptr noundef @.str.9)
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %115

108:                                              ; preds = %104
  %109 = load ptr, ptr %14, align 8, !tbaa !9
  %110 = load i32, ptr %15, align 4, !tbaa !5
  %111 = load i32, ptr %16, align 4, !tbaa !5
  %112 = load ptr, ptr %6, align 8, !tbaa !9
  %113 = call ptr @get_str(ptr noundef %112, ptr noundef @.str.9)
  call void @write_pgm_image_int(ptr noundef %109, i32 noundef %110, i32 noundef %111, ptr noundef %113)
  %114 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %114) #5
  br label %115

115:                                              ; preds = %108, %104
  %116 = load ptr, ptr %6, align 8, !tbaa !9
  %117 = call i32 @is_assigned(ptr noundef %116, ptr noundef @.str.17)
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %129

119:                                              ; preds = %115
  %120 = load ptr, ptr %11, align 8, !tbaa !9
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = load ptr, ptr %6, align 8, !tbaa !9
  %124 = call ptr @get_str(ptr noundef %123, ptr noundef @.str.17)
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = load ptr, ptr %6, align 8, !tbaa !9
  %128 = call double @get_double(ptr noundef %127, ptr noundef @.str.18)
  call void @write_eps(ptr noundef %120, i32 noundef %121, i32 noundef %122, ptr noundef %124, i32 noundef %125, i32 noundef %126, double noundef %128)
  br label %129

129:                                              ; preds = %119, %115
  %130 = load ptr, ptr %6, align 8, !tbaa !9
  %131 = call i32 @is_assigned(ptr noundef %130, ptr noundef @.str.19)
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %143

133:                                              ; preds = %129
  %134 = load ptr, ptr %11, align 8, !tbaa !9
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = load i32, ptr %13, align 4, !tbaa !5
  %137 = load ptr, ptr %6, align 8, !tbaa !9
  %138 = call ptr @get_str(ptr noundef %137, ptr noundef @.str.19)
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = load ptr, ptr %6, align 8, !tbaa !9
  %142 = call double @get_double(ptr noundef %141, ptr noundef @.str.18)
  call void @write_svg(ptr noundef %134, i32 noundef %135, i32 noundef %136, ptr noundef %138, i32 noundef %139, i32 noundef %140, double noundef %142)
  br label %143

143:                                              ; preds = %133, %129
  %144 = load ptr, ptr %8, align 8, !tbaa !9
  call void @free(ptr noundef %144) #5
  %145 = load ptr, ptr %11, align 8, !tbaa !9
  call void @free(ptr noundef %145) #5
  %146 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free_arguments(ptr noundef %146)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  ret i32 0
}

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

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

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

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

declare ptr @LineSegmentDetection(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @error(ptr noundef) #0

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

declare i32 @fclose(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden void @write_eps(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, double noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @write_svg(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, double noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @free_arguments(ptr noundef) #0

; 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 = { "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 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 #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 }
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 = !{!"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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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

@.str = external hidden unnamed_addr constant [2200 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = tail call ptr @process_arguments(ptr noundef nonnull @.str, i32 noundef %0, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %10 = tail call ptr @get_str(ptr noundef %9, ptr noundef nonnull @.str.1)
  %11 = call ptr @read_pgm_image_double(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef %10)
  %12 = load i32, ptr %3, align 4, !tbaa !5
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.2)
  %15 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.3)
  %16 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.4)
  %17 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.5)
  %18 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.6)
  %19 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.7)
  %20 = call i32 @get_int(ptr noundef %9, ptr noundef nonnull @.str.8)
  %21 = call i32 @is_assigned(ptr noundef %9, ptr noundef nonnull @.str.9)
  %.not = icmp eq i32 %21, 0
  %. = select i1 %.not, ptr null, ptr %6
  %22 = call ptr @LineSegmentDetection(ptr noundef nonnull %5, ptr noundef %11, i32 noundef %12, i32 noundef %13, double noundef %14, double noundef %15, double noundef %16, double noundef %17, double noundef %18, double noundef %19, i32 noundef %20, ptr noundef %., ptr noundef nonnull %7, ptr noundef nonnull %8) #6
  %23 = call ptr @get_str(ptr noundef %9, ptr noundef nonnull @.str.10)
  %24 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) @.str.11) #7
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %2
  %27 = load ptr, ptr @stdout, align 8, !tbaa !9
  br label %31

28:                                               ; preds = %2
  %29 = call ptr @get_str(ptr noundef %9, ptr noundef nonnull @.str.10)
  %30 = call noalias ptr @fopen(ptr noundef %29, ptr noundef nonnull @.str.12)
  br label %31

31:                                               ; preds = %28, %26
  %.043 = phi ptr [ %27, %26 ], [ %30, %28 ]
  %32 = icmp eq ptr %.043, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %31
  call void @error(ptr noundef nonnull @.str.13)
  br label %34

34:                                               ; preds = %33, %31
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.preheader.preheader, label %._crit_edge

.preheader.preheader:                             ; preds = %34
  %invariant.gep = getelementptr inbounds i8, ptr %22, i64 8
  %invariant.gep52 = getelementptr inbounds i8, ptr %22, i64 16
  %invariant.gep54 = getelementptr inbounds i8, ptr %22, i64 24
  %invariant.gep56 = getelementptr inbounds i8, ptr %22, i64 32
  %invariant.gep58 = getelementptr inbounds i8, ptr %22, i64 40
  %invariant.gep60 = getelementptr inbounds i8, ptr %22, i64 48
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %.preheader ]
  %37 = mul nuw nsw i64 %indvars.iv, 7
  %38 = getelementptr inbounds double, ptr %22, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !11
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.14, double noundef %39) #6
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %37
  %41 = load double, ptr %gep, align 8, !tbaa !11
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.14, double noundef %41) #6
  %gep53 = getelementptr inbounds double, ptr %invariant.gep52, i64 %37
  %43 = load double, ptr %gep53, align 8, !tbaa !11
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.14, double noundef %43) #6
  %gep55 = getelementptr inbounds double, ptr %invariant.gep54, i64 %37
  %45 = load double, ptr %gep55, align 8, !tbaa !11
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.14, double noundef %45) #6
  %gep57 = getelementptr inbounds double, ptr %invariant.gep56, i64 %37
  %47 = load double, ptr %gep57, align 8, !tbaa !11
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.14, double noundef %47) #6
  %gep59 = getelementptr inbounds double, ptr %invariant.gep58, i64 %37
  %49 = load double, ptr %gep59, align 8, !tbaa !11
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.14, double noundef %49) #6
  %gep61 = getelementptr inbounds double, ptr %invariant.gep60, i64 %37
  %51 = load double, ptr %gep61, align 8, !tbaa !11
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.14, double noundef %51) #6
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.043, ptr noundef nonnull @.str.15) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next, %55
  br i1 %56, label %.preheader, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.preheader, %34
  %57 = load ptr, ptr @stdout, align 8, !tbaa !9
  %.not44 = icmp eq ptr %.043, %57
  br i1 %.not44, label %62, label %58

58:                                               ; preds = %._crit_edge
  %59 = call i32 @fclose(ptr noundef %.043)
  %60 = icmp eq i32 %59, -1
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  call void @error(ptr noundef nonnull @.str.16)
  br label %62

62:                                               ; preds = %61, %58, %._crit_edge
  %63 = call i32 @is_assigned(ptr noundef %9, ptr noundef nonnull @.str.9)
  %.not45 = icmp eq i32 %63, 0
  br i1 %.not45, label %70, label %64

64:                                               ; preds = %62
  %65 = load ptr, ptr %6, align 8, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = call ptr @get_str(ptr noundef %9, ptr noundef nonnull @.str.9)
  call void @write_pgm_image_int(ptr noundef %65, i32 noundef %66, i32 noundef %67, ptr noundef %68)
  %69 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %69) #6
  br label %70

70:                                               ; preds = %64, %62
  %71 = call i32 @is_assigned(ptr noundef %9, ptr noundef nonnull @.str.17)
  %.not46 = icmp eq i32 %71, 0
  br i1 %.not46, label %78, label %72

72:                                               ; preds = %70
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = call ptr @get_str(ptr noundef %9, ptr noundef nonnull @.str.17)
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.18)
  call void @write_eps(ptr noundef %22, i32 noundef %73, i32 noundef 7, ptr noundef %74, i32 noundef %75, i32 noundef %76, double noundef %77)
  br label %78

78:                                               ; preds = %72, %70
  %79 = call i32 @is_assigned(ptr noundef %9, ptr noundef nonnull @.str.19)
  %.not47 = icmp eq i32 %79, 0
  br i1 %.not47, label %86, label %80

80:                                               ; preds = %78
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = call ptr @get_str(ptr noundef %9, ptr noundef nonnull @.str.19)
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = call double @get_double(ptr noundef %9, ptr noundef nonnull @.str.18)
  call void @write_svg(ptr noundef %22, i32 noundef %81, i32 noundef 7, ptr noundef %82, i32 noundef %83, i32 noundef %84, double noundef %85)
  br label %86

86:                                               ; preds = %80, %78
  call void @free(ptr noundef %11) #6
  call void @free(ptr noundef %22) #6
  call void @free_arguments(ptr noundef %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret i32 0
}

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

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

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

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

declare ptr @LineSegmentDetection(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture 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: nounwind uwtable
declare hidden void @error(ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @write_eps(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @write_svg(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @free_arguments(ptr noundef) local_unnamed_addr #0

; 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 = { "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 = { 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 #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 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 #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 = !{!"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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass