; LLVM IR from xtaci/algorithms :: src (astar_demo)

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

%"class.alg::Array2D" = type { i32, i32, ptr }
%"class.alg::AStar" = type { ptr, %"class.alg::Heap", %"class.alg::Array2D.0", %"class.alg::Array2D.0", %"class.alg::Array2D.1", %"class.alg::Array2D.1" }
%"class.alg::Heap" = type { i32, i32, ptr }
%"class.alg::Array2D.0" = type { i32, i32, ptr }
%"class.alg::Array2D.1" = type { i32, i32, ptr }
%"struct.alg::AStar::AStarResult" = type <{ ptr, i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.alg::Array2D", align 8
  %3 = alloca i8, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.alg::AStar", align 8
  %9 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #7
  call void @_ZN3alg7Array2DIhEC2Ejj(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 128, i32 noundef 128)
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  store i8 0, ptr %3, align 1, !tbaa !5
  invoke void @_ZN3alg7Array2DIhE5clearERKh(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %10 unwind label %26

10:                                               ; preds = %0
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  %11 = call i64 @time(ptr noundef null) #7
  %12 = trunc i64 %11 to i32
  call void @srand(i32 noundef %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 32, ptr %6, align 4, !tbaa !8
  br label %13

13:                                               ; preds = %23, %10
  %14 = load i32, ptr %6, align 4, !tbaa !8
  %15 = icmp sle i32 %14, 96
  br i1 %15, label %16, label %34

16:                                               ; preds = %13
  %17 = load i32, ptr %6, align 4, !tbaa !8
  %18 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 96, i32 noundef %17)
          to label %19 unwind label %30

19:                                               ; preds = %16
  store i8 -1, ptr %18, align 1, !tbaa !5
  %20 = load i32, ptr %6, align 4, !tbaa !8
  %21 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %20, i32 noundef 96)
          to label %22 unwind label %30

22:                                               ; preds = %19
  store i8 -1, ptr %21, align 1, !tbaa !5
  br label %23

23:                                               ; preds = %22
  %24 = load i32, ptr %6, align 4, !tbaa !8
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %6, align 4, !tbaa !8
  br label %13, !llvm.loop !10

26:                                               ; preds = %0
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %4, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %186

30:                                               ; preds = %72, %66, %59, %56, %48, %38, %36, %34, %19, %16
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %4, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %5, align 4
  br label %185

34:                                               ; preds = %13
  %35 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 0, i32 noundef 0)
          to label %36 unwind label %30

36:                                               ; preds = %34
  store i8 0, ptr %35, align 1, !tbaa !5
  %37 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 127, i32 noundef 127)
          to label %38 unwind label %30

38:                                               ; preds = %36
  store i8 0, ptr %37, align 1, !tbaa !5
  %39 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef 127, i32 noundef 127)
          to label %40 unwind label %30

40:                                               ; preds = %38
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %41

41:                                               ; preds = %69, %40
  %42 = load i32, ptr %6, align 4, !tbaa !8
  %43 = icmp slt i32 %42, 128
  br i1 %43, label %44, label %72

44:                                               ; preds = %41
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %45

45:                                               ; preds = %63, %44
  %46 = load i32, ptr %7, align 4, !tbaa !8
  %47 = icmp slt i32 %46, 128
  br i1 %47, label %48, label %66

48:                                               ; preds = %45
  %49 = load i32, ptr %6, align 4, !tbaa !8
  %50 = load i32, ptr %7, align 4, !tbaa !8
  %51 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %49, i32 noundef %50)
          to label %52 unwind label %30

52:                                               ; preds = %48
  %53 = load i8, ptr %51, align 1, !tbaa !5
  %54 = zext i8 %53 to i32
  %55 = icmp eq i32 %54, 255
  br i1 %55, label %56, label %59

56:                                               ; preds = %52
  %57 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1)
          to label %58 unwind label %30

58:                                               ; preds = %56
  br label %62

59:                                               ; preds = %52
  %60 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2)
          to label %61 unwind label %30

61:                                               ; preds = %59
  br label %62

62:                                               ; preds = %61, %58
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %7, align 4, !tbaa !8
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %7, align 4, !tbaa !8
  br label %45, !llvm.loop !12

66:                                               ; preds = %45
  %67 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %68 unwind label %30

68:                                               ; preds = %66
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %6, align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %6, align 4, !tbaa !8
  br label %41, !llvm.loop !13

72:                                               ; preds = %41
  %73 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4)
          to label %74 unwind label %30

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 88, ptr %8) #7
  invoke void @_ZN3alg5AStarC2ERKNS_7Array2DIhEE(ptr noundef nonnull align 8 dereferenceable(88) %8, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %75 unwind label %126

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %76 = invoke noundef ptr @_ZN3alg5AStar3runEjjjj(ptr noundef nonnull align 8 dereferenceable(88) %8, i32 noundef 0, i32 noundef 0, i32 noundef 127, i32 noundef 127)
          to label %77 unwind label %130

77:                                               ; preds = %75
  store ptr %76, ptr %9, align 8, !tbaa !14
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %123, %77
  %79 = load i32, ptr %6, align 4, !tbaa !8
  %80 = load ptr, ptr %9, align 8, !tbaa !14
  %81 = getelementptr inbounds %"struct.alg::AStar::AStarResult", ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 8, !tbaa !16
  %83 = icmp slt i32 %79, %82
  br i1 %83, label %84, label %134

84:                                               ; preds = %78
  %85 = load ptr, ptr %9, align 8, !tbaa !14
  %86 = getelementptr inbounds %"struct.alg::AStar::AStarResult", ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !18
  %88 = load i32, ptr %6, align 4, !tbaa !8
  %89 = mul nsw i32 %88, 2
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %87, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !8
  %93 = load ptr, ptr %9, align 8, !tbaa !14
  %94 = getelementptr inbounds %"struct.alg::AStar::AStarResult", ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !18
  %96 = load i32, ptr %6, align 4, !tbaa !8
  %97 = mul nsw i32 %96, 2
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %95, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !8
  %102 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %92, i32 noundef %101)
          to label %103 unwind label %130

103:                                              ; preds = %84
  %104 = load ptr, ptr %9, align 8, !tbaa !14
  %105 = getelementptr inbounds %"struct.alg::AStar::AStarResult", ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !18
  %107 = load i32, ptr %6, align 4, !tbaa !8
  %108 = mul nsw i32 %107, 2
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %106, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !8
  %112 = load ptr, ptr %9, align 8, !tbaa !14
  %113 = getelementptr inbounds %"struct.alg::AStar::AStarResult", ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !18
  %115 = load i32, ptr %6, align 4, !tbaa !8
  %116 = mul nsw i32 %115, 2
  %117 = add nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %114, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %121 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %111, i32 noundef %120)
          to label %122 unwind label %130

122:                                              ; preds = %103
  store i8 -18, ptr %121, align 1, !tbaa !5
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %6, align 4, !tbaa !8
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !8
  br label %78, !llvm.loop !19

126:                                              ; preds = %74
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %4, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %5, align 4
  br label %184

130:                                              ; preds = %180, %174, %166, %163, %155, %152, %144, %134, %103, %84, %75
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %4, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZN3alg5AStarD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %8) #7
  br label %184

134:                                              ; preds = %78
  %135 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %136 unwind label %130

136:                                              ; preds = %134
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %137

137:                                              ; preds = %177, %136
  %138 = load i32, ptr %6, align 4, !tbaa !8
  %139 = icmp slt i32 %138, 128
  br i1 %139, label %140, label %180

140:                                              ; preds = %137
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %141

141:                                              ; preds = %171, %140
  %142 = load i32, ptr %7, align 4, !tbaa !8
  %143 = icmp slt i32 %142, 128
  br i1 %143, label %144, label %174

144:                                              ; preds = %141
  %145 = load i32, ptr %6, align 4, !tbaa !8
  %146 = load i32, ptr %7, align 4, !tbaa !8
  %147 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %145, i32 noundef %146)
          to label %148 unwind label %130

148:                                              ; preds = %144
  %149 = load i8, ptr %147, align 1, !tbaa !5
  %150 = zext i8 %149 to i32
  %151 = icmp eq i32 %150, 255
  br i1 %151, label %152, label %155

152:                                              ; preds = %148
  %153 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1)
          to label %154 unwind label %130

154:                                              ; preds = %152
  br label %170

155:                                              ; preds = %148
  %156 = load i32, ptr %6, align 4, !tbaa !8
  %157 = load i32, ptr %7, align 4, !tbaa !8
  %158 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %156, i32 noundef %157)
          to label %159 unwind label %130

159:                                              ; preds = %155
  %160 = load i8, ptr %158, align 1, !tbaa !5
  %161 = zext i8 %160 to i32
  %162 = icmp eq i32 %161, 238
  br i1 %162, label %163, label %166

163:                                              ; preds = %159
  %164 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6)
          to label %165 unwind label %130

165:                                              ; preds = %163
  br label %169

166:                                              ; preds = %159
  %167 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2)
          to label %168 unwind label %130

168:                                              ; preds = %166
  br label %169

169:                                              ; preds = %168, %165
  br label %170

170:                                              ; preds = %169, %154
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %7, align 4, !tbaa !8
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %7, align 4, !tbaa !8
  br label %141, !llvm.loop !20

174:                                              ; preds = %141
  %175 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %176 unwind label %130

176:                                              ; preds = %174
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %6, align 4, !tbaa !8
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %6, align 4, !tbaa !8
  br label %137, !llvm.loop !21

180:                                              ; preds = %137
  %181 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %182 unwind label %130

182:                                              ; preds = %180
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZN3alg5AStarD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %8) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @_ZN3alg7Array2DIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #7
  %183 = load i32, ptr %1, align 4
  ret i32 %183

184:                                              ; preds = %130, %126
  call void @llvm.lifetime.end.p0(i64 88, ptr %8) #7
  br label %185

185:                                              ; preds = %184, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %186

186:                                              ; preds = %185, %26
  call void @_ZN3alg7Array2DIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #7
  br label %187

187:                                              ; preds = %186
  %188 = load ptr, ptr %4, align 8
  %189 = load i32, ptr %5, align 4
  %190 = insertvalue { ptr, i32 } poison, ptr %188, 0
  %191 = insertvalue { ptr, i32 } %190, i32 %189, 1
  resume { ptr, i32 } %191
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg7Array2DIhEC2Ejj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3alg7Array2DIhE5clearERKh(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #4

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg5AStarC2ERKNS_7Array2DIhEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3alg5AStar3runEjjjj(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3alg5AStarD2Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3alg7Array2DIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse 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 = { mustprogress 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 = { mustprogress 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 "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 = { inlinehint mustprogress 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 #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 }

!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++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !6, i64 0}
!16 = !{!17, !9, i64 8}
!17 = !{!"_ZTSN3alg5AStar11AStarResultE", !15, i64 0, !9, i64 8}
!18 = !{!17, !15, i64 0}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}


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

%"class.alg::Array2D" = type { i32, i32, ptr }
%"class.alg::AStar" = type { ptr, %"class.alg::Heap", %"class.alg::Array2D.0", %"class.alg::Array2D.0", %"class.alg::Array2D.1", %"class.alg::Array2D.1" }
%"class.alg::Heap" = type { i32, i32, ptr }
%"class.alg::Array2D.0" = type { i32, i32, ptr }
%"class.alg::Array2D.1" = type { i32, i32, ptr }

@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.alg::Array2D", align 8
  %2 = alloca i8, align 1
  %3 = alloca %"class.alg::AStar", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #7
  call void @_ZN3alg7Array2DIhEC2Ejj(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 128, i32 noundef 128)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  store i8 0, ptr %2, align 1, !tbaa !5
  call void @_ZN3alg7Array2DIhE5clearERKh(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  %4 = call i64 @time(ptr noundef null) #7
  %5 = trunc i64 %4 to i32
  call void @srand(i32 noundef %5) #7
  br label %6

6:                                                ; preds = %0, %6
  %.03138 = phi i32 [ 32, %0 ], [ %9, %6 ]
  %7 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 96, i32 noundef %.03138)
  store i8 -1, ptr %7, align 1, !tbaa !5
  %8 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.03138, i32 noundef 96)
  store i8 -1, ptr %8, align 1, !tbaa !5
  %9 = add nuw nsw i32 %.03138, 1
  %exitcond.not = icmp eq i32 %9, 97
  br i1 %exitcond.not, label %10, label %6, !llvm.loop !8

10:                                               ; preds = %6
  %11 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 0, i32 noundef 0)
  store i8 0, ptr %11, align 1, !tbaa !5
  %12 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 127, i32 noundef 127)
  store i8 0, ptr %12, align 1, !tbaa !5
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 127, i32 noundef 127)
  br label %.preheader37

.preheader37:                                     ; preds = %10, %20
  %.13240 = phi i32 [ 0, %10 ], [ %22, %20 ]
  br label %14

14:                                               ; preds = %.preheader37, %14
  %.039 = phi i32 [ 0, %.preheader37 ], [ %19, %14 ]
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.13240, i32 noundef %.039)
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = icmp eq i8 %16, -1
  %.str.1..str.2 = select i1 %17, ptr @.str.1, ptr @.str.2
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
  %19 = add nuw nsw i32 %.039, 1
  %exitcond44.not = icmp eq i32 %19, 128
  br i1 %exitcond44.not, label %20, label %14, !llvm.loop !10

20:                                               ; preds = %14
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %22 = add nuw nsw i32 %.13240, 1
  %exitcond45.not = icmp eq i32 %22, 128
  br i1 %exitcond45.not, label %23, label %.preheader37, !llvm.loop !11

23:                                               ; preds = %20
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #7
  invoke void @_ZN3alg5AStarC2ERKNS_7Array2DIhEE(ptr noundef nonnull align 8 dereferenceable(88) %3, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %25 unwind label %47

25:                                               ; preds = %23
  %26 = invoke noundef ptr @_ZN3alg5AStar3runEjjjj(ptr noundef nonnull align 8 dereferenceable(88) %3, i32 noundef 0, i32 noundef 0, i32 noundef 127, i32 noundef 127)
          to label %.preheader36 unwind label %49

.preheader36:                                     ; preds = %25
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !12
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader36, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader36 ]
  %30 = load ptr, ptr %26, align 8, !tbaa !16
  %31 = shl nuw nsw i64 %indvars.iv, 1
  %32 = getelementptr inbounds i32, ptr %30, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = or disjoint i64 %31, 1
  %35 = getelementptr inbounds i32, ptr %30, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !17
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %33, i32 noundef %36)
  %38 = load ptr, ptr %26, align 8, !tbaa !16
  %39 = getelementptr inbounds i32, ptr %38, i64 %31
  %40 = load i32, ptr %39, align 4, !tbaa !17
  %41 = getelementptr inbounds i32, ptr %38, i64 %34
  %42 = load i32, ptr %41, align 4, !tbaa !17
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %40, i32 noundef %42)
  store i8 -18, ptr %43, align 1, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr %27, align 8, !tbaa !12
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph, label %._crit_edge, !llvm.loop !18

47:                                               ; preds = %23
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %68

49:                                               ; preds = %25
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3alg5AStarD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %3) #7
  br label %68

._crit_edge:                                      ; preds = %.lr.ph, %.preheader36
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.preheader

.preheader:                                       ; preds = %._crit_edge, %63
  %.343 = phi i32 [ 0, %._crit_edge ], [ %65, %63 ]
  br label %52

52:                                               ; preds = %.preheader, %60
  %.142 = phi i32 [ 0, %.preheader ], [ %62, %60 ]
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.343, i32 noundef %.142)
  %54 = load i8, ptr %53, align 1, !tbaa !5
  %55 = icmp eq i8 %54, -1
  br i1 %55, label %60, label %56

56:                                               ; preds = %52
  %57 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.343, i32 noundef %.142)
  %58 = load i8, ptr %57, align 1, !tbaa !5
  %59 = icmp eq i8 %58, -18
  %.str.6..str.2 = select i1 %59, ptr @.str.6, ptr @.str.2
  br label %60

60:                                               ; preds = %56, %52
  %.str.1.sink49 = phi ptr [ @.str.1, %52 ], [ %.str.6..str.2, %56 ]
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink49)
  %62 = add nuw nsw i32 %.142, 1
  %exitcond47.not = icmp eq i32 %62, 128
  br i1 %exitcond47.not, label %63, label %52, !llvm.loop !19

63:                                               ; preds = %60
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %65 = add nuw nsw i32 %.343, 1
  %exitcond48.not = icmp eq i32 %65, 128
  br i1 %exitcond48.not, label %66, label %.preheader, !llvm.loop !20

66:                                               ; preds = %63
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @_ZN3alg5AStarD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %3) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #7
  call void @_ZN3alg7Array2DIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  ret i32 0

68:                                               ; preds = %49, %47
  %.pn = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #7
  call void @_ZN3alg7Array2DIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn
}

; 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 uwtable
declare dso_local void @_ZN3alg7Array2DIhEC2Ejj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3alg7Array2DIhE5clearERKh(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN3alg7Array2DIhEclEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg5AStarC2ERKNS_7Array2DIhEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3alg5AStar3runEjjjj(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3alg5AStarD2Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3alg7Array2DIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse 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 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 = { mustprogress 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 "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 = { inlinehint mustprogress 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 #6 = { 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 #7 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = !{!13, !15, i64 8}
!13 = !{!"_ZTSN3alg5AStar11AStarResultE", !14, i64 0, !15, i64 8}
!14 = !{!"any pointer", !6, i64 0}
!15 = !{!"int", !6, i64 0}
!16 = !{!13, !14, i64 0}
!17 = !{!15, !15, i64 0}
!18 = distinct !{!18, !9}
!19 = distinct !{!19, !9}
!20 = distinct !{!20, !9}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass