; LLVM IR from txus/libsweeper :: tests (array_tests)

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

@array = external hidden global ptr, align 8
@assertions = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@val1 = external hidden global ptr, align 8
@val2 = external hidden global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @test_remove() #4 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %4 = load ptr, ptr @array, align 8, !tbaa !5
  %5 = call ptr @SWPArray_remove(ptr noundef %4, i32 noundef 0)
  store ptr %5, ptr %2, align 8, !tbaa !5
  %6 = load i32, ptr @assertions, align 4, !tbaa !9
  %7 = add nsw i32 %6, 1
  store i32 %7, ptr @assertions, align 4, !tbaa !9
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = icmp ne ptr %8, null
  br i1 %9, label %24, label %10

10:                                               ; preds = %0
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %12 = load ptr, ptr @stderr, align 8, !tbaa !5
  %13 = call ptr @__errno_location() #7
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %10
  br label %21

17:                                               ; preds = %10
  %18 = call ptr @__errno_location() #7
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = call ptr @strerror(i32 noundef %19) #6
  br label %21

21:                                               ; preds = %17, %16
  %22 = phi ptr [ @.str.3, %16 ], [ %20, %17 ]
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef @.str.20, ptr noundef @.str.2, i32 noundef 57, ptr noundef %22) #6
  store ptr @.str.21, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %144

24:                                               ; preds = %0
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %26

26:                                               ; preds = %24
  %27 = load i32, ptr @assertions, align 4, !tbaa !9
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @assertions, align 4, !tbaa !9
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = load ptr, ptr @val1, align 8, !tbaa !5
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = icmp eq i32 %30, %32
  br i1 %33, label %48, label %34

34:                                               ; preds = %26
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = call ptr @__errno_location() #7
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %34
  br label %45

41:                                               ; preds = %34
  %42 = call ptr @__errno_location() #7
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = call ptr @strerror(i32 noundef %43) #6
  br label %45

45:                                               ; preds = %41, %40
  %46 = phi ptr [ @.str.3, %40 ], [ %44, %41 ]
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.22, ptr noundef @.str.2, i32 noundef 58, ptr noundef %46) #6
  store ptr @.str.23, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %144

48:                                               ; preds = %26
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %50

50:                                               ; preds = %48
  %51 = load i32, ptr @assertions, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr @assertions, align 4, !tbaa !9
  %53 = load ptr, ptr @array, align 8, !tbaa !5
  %54 = call ptr @SWPArray_get(ptr noundef %53, i32 noundef 0)
  %55 = icmp eq ptr %54, null
  br i1 %55, label %70, label %56

56:                                               ; preds = %50
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call ptr @__errno_location() #7
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %56
  br label %67

63:                                               ; preds = %56
  %64 = call ptr @__errno_location() #7
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = call ptr @strerror(i32 noundef %65) #6
  br label %67

67:                                               ; preds = %63, %62
  %68 = phi ptr [ @.str.3, %62 ], [ %66, %63 ]
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.24, ptr noundef @.str.2, i32 noundef 59, ptr noundef %68) #6
  store ptr @.str.25, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %144

70:                                               ; preds = %50
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %72

72:                                               ; preds = %70
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %73) #6
  %74 = load ptr, ptr @array, align 8, !tbaa !5
  %75 = call ptr @SWPArray_remove(ptr noundef %74, i32 noundef 1)
  store ptr %75, ptr %2, align 8, !tbaa !5
  %76 = load i32, ptr @assertions, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr @assertions, align 4, !tbaa !9
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %94, label %80

80:                                               ; preds = %72
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %82 = load ptr, ptr @stderr, align 8, !tbaa !5
  %83 = call ptr @__errno_location() #7
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %80
  br label %91

87:                                               ; preds = %80
  %88 = call ptr @__errno_location() #7
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %90 = call ptr @strerror(i32 noundef %89) #6
  br label %91

91:                                               ; preds = %87, %86
  %92 = phi ptr [ @.str.3, %86 ], [ %90, %87 ]
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.20, ptr noundef @.str.2, i32 noundef 63, ptr noundef %92) #6
  store ptr @.str.21, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %144

94:                                               ; preds = %72
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %96

96:                                               ; preds = %94
  %97 = load i32, ptr @assertions, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr @assertions, align 4, !tbaa !9
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = load ptr, ptr @val2, align 8, !tbaa !5
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = icmp eq i32 %100, %102
  br i1 %103, label %118, label %104

104:                                              ; preds = %96
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %106 = load ptr, ptr @stderr, align 8, !tbaa !5
  %107 = call ptr @__errno_location() #7
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %104
  br label %115

111:                                              ; preds = %104
  %112 = call ptr @__errno_location() #7
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = call ptr @strerror(i32 noundef %113) #6
  br label %115

115:                                              ; preds = %111, %110
  %116 = phi ptr [ @.str.3, %110 ], [ %114, %111 ]
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.22, ptr noundef @.str.2, i32 noundef 64, ptr noundef %116) #6
  store ptr @.str.23, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %144

118:                                              ; preds = %96
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %120

120:                                              ; preds = %118
  %121 = load i32, ptr @assertions, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr @assertions, align 4, !tbaa !9
  %123 = load ptr, ptr @array, align 8, !tbaa !5
  %124 = call ptr @SWPArray_get(ptr noundef %123, i32 noundef 1)
  %125 = icmp eq ptr %124, null
  br i1 %125, label %140, label %126

126:                                              ; preds = %120
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %128 = load ptr, ptr @stderr, align 8, !tbaa !5
  %129 = call ptr @__errno_location() #7
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %133

132:                                              ; preds = %126
  br label %137

133:                                              ; preds = %126
  %134 = call ptr @__errno_location() #7
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = call ptr @strerror(i32 noundef %135) #6
  br label %137

137:                                              ; preds = %133, %132
  %138 = phi ptr [ @.str.3, %132 ], [ %136, %133 ]
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef @.str.24, ptr noundef @.str.2, i32 noundef 65, ptr noundef %138) #6
  store ptr @.str.25, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %144

140:                                              ; preds = %120
  %141 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %142

142:                                              ; preds = %140
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %143) #6
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %144

144:                                              ; preds = %142, %137, %115, %91, %67, %45, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %145 = load ptr, ptr %1, align 8
  ret ptr %145
}

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

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

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

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

attributes #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 = { 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 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 #3 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!"int", !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"

@array = external hidden local_unnamed_addr global ptr, align 8
@assertions = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@val1 = external hidden local_unnamed_addr global ptr, align 8
@val2 = external hidden local_unnamed_addr global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @SWPArray_get(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @test_remove() local_unnamed_addr #4 {
  %1 = load ptr, ptr @array, align 8, !tbaa !5
  %2 = tail call ptr @SWPArray_remove(ptr noundef %1, i32 noundef 0)
  %3 = load i32, ptr @assertions, align 4, !tbaa !9
  %4 = add nsw i32 %3, 1
  store i32 %4, ptr @assertions, align 4, !tbaa !9
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %5, label %16

5:                                                ; preds = %0
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %7 = load ptr, ptr @stderr, align 8, !tbaa !5
  %8 = tail call ptr @__errno_location() #6
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %13, label %11

11:                                               ; preds = %5
  %12 = tail call ptr @strerror(i32 noundef %9) #7
  br label %13

13:                                               ; preds = %5, %11
  %14 = phi ptr [ %12, %11 ], [ @.str.3, %5 ]
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.2, i32 noundef 57, ptr noundef %14) #8
  br label %109

16:                                               ; preds = %0
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %18 = load i32, ptr @assertions, align 4, !tbaa !9
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr @assertions, align 4, !tbaa !9
  %20 = load i32, ptr %2, align 4, !tbaa !9
  %21 = load ptr, ptr @val1, align 8, !tbaa !5
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = icmp eq i32 %20, %22
  br i1 %23, label %35, label %24

24:                                               ; preds = %16
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = tail call ptr @__errno_location() #6
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %32, label %30

30:                                               ; preds = %24
  %31 = tail call ptr @strerror(i32 noundef %28) #7
  br label %32

32:                                               ; preds = %24, %30
  %33 = phi ptr [ %31, %30 ], [ @.str.3, %24 ]
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.2, i32 noundef 58, ptr noundef %33) #8
  br label %109

35:                                               ; preds = %16
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %37 = load i32, ptr @assertions, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr @assertions, align 4, !tbaa !9
  %39 = load ptr, ptr @array, align 8, !tbaa !5
  %40 = tail call ptr @SWPArray_get(ptr noundef %39, i32 noundef 0)
  %41 = icmp eq ptr %40, null
  br i1 %41, label %53, label %42

42:                                               ; preds = %35
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = tail call ptr @__errno_location() #6
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %50, label %48

48:                                               ; preds = %42
  %49 = tail call ptr @strerror(i32 noundef %46) #7
  br label %50

50:                                               ; preds = %42, %48
  %51 = phi ptr [ %49, %48 ], [ @.str.3, %42 ]
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.2, i32 noundef 59, ptr noundef %51) #8
  br label %109

53:                                               ; preds = %35
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  tail call void @free(ptr noundef nonnull %2) #7
  %55 = load ptr, ptr @array, align 8, !tbaa !5
  %56 = tail call ptr @SWPArray_remove(ptr noundef %55, i32 noundef 1)
  %57 = load i32, ptr @assertions, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @assertions, align 4, !tbaa !9
  %.not15 = icmp eq ptr %56, null
  br i1 %.not15, label %59, label %70

59:                                               ; preds = %53
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = tail call ptr @__errno_location() #6
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %67, label %65

65:                                               ; preds = %59
  %66 = tail call ptr @strerror(i32 noundef %63) #7
  br label %67

67:                                               ; preds = %59, %65
  %68 = phi ptr [ %66, %65 ], [ @.str.3, %59 ]
  %69 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.2, i32 noundef 63, ptr noundef %68) #8
  br label %109

70:                                               ; preds = %53
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %72 = load i32, ptr @assertions, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @assertions, align 4, !tbaa !9
  %74 = load i32, ptr %56, align 4, !tbaa !9
  %75 = load ptr, ptr @val2, align 8, !tbaa !5
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = icmp eq i32 %74, %76
  br i1 %77, label %89, label %78

78:                                               ; preds = %70
  %79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %80 = load ptr, ptr @stderr, align 8, !tbaa !5
  %81 = tail call ptr @__errno_location() #6
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %86, label %84

84:                                               ; preds = %78
  %85 = tail call ptr @strerror(i32 noundef %82) #7
  br label %86

86:                                               ; preds = %78, %84
  %87 = phi ptr [ %85, %84 ], [ @.str.3, %78 ]
  %88 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.2, i32 noundef 64, ptr noundef %87) #8
  br label %109

89:                                               ; preds = %70
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %91 = load i32, ptr @assertions, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr @assertions, align 4, !tbaa !9
  %93 = load ptr, ptr @array, align 8, !tbaa !5
  %94 = tail call ptr @SWPArray_get(ptr noundef %93, i32 noundef 1)
  %95 = icmp eq ptr %94, null
  br i1 %95, label %107, label %96

96:                                               ; preds = %89
  %97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = tail call ptr @__errno_location() #6
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %104, label %102

102:                                              ; preds = %96
  %103 = tail call ptr @strerror(i32 noundef %100) #7
  br label %104

104:                                              ; preds = %96, %102
  %105 = phi ptr [ %103, %102 ], [ @.str.3, %96 ]
  %106 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.2, i32 noundef 65, ptr noundef %105) #8
  br label %109

107:                                              ; preds = %89
  %108 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  tail call void @free(ptr noundef nonnull %56) #7
  br label %109

109:                                              ; preds = %107, %104, %86, %67, %50, %32, %13
  %.0 = phi ptr [ null, %107 ], [ @.str.25, %104 ], [ @.str.23, %86 ], [ @.str.21, %67 ], [ @.str.25, %50 ], [ @.str.23, %32 ], [ @.str.21, %13 ]
  ret ptr %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @SWPArray_remove(ptr noundef, i32 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 #5

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 #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 willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass