; LLVM IR from askforalfred/alfred :: gen/ff_planner (search)

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

%struct._command_line = type { [256 x i8], [256 x i8], [256 x i8], i32, i32, i32, i8, i32, float }
%struct._BfsNode = type { %struct._State, i32, i32, i32, float, float, float, ptr, i32, ptr, ptr, ptr }
%struct._State = type { ptr, i32, ptr, ptr }
%struct._OpConn = type { ptr, i8, ptr, i32, i8, i8, i32, i8, float }

@gcmd_line = external global %struct._command_line, align 4
@gop_conn = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@gnum_A = external global i32, align 4
@gA = external global ptr, align 8
@lbfs_space_head = external dso_local global ptr, align 8
@ghmax = external global float, align 4
@gh_cost = external global float, align 4
@gw = external global float, align 4

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

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

declare i32 @get_1P_and_A(ptr noundef) #1

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

declare void @print_op_name(i32 noundef) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @copy_source_to_dest(ptr noundef, ptr noundef) #4

declare ptr @new_BfsNode() #1

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @hash_bfs_node(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @add_to_weighted_Astar_space(ptr noundef %0, i32 noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %33

18:                                               ; preds = %3
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._BfsNode, ptr %19, i32 0, i32 2
  %21 = load i32, ptr %20, align 4, !tbaa !11
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %9, align 4, !tbaa !9
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._BfsNode, ptr %23, i32 0, i32 4
  %25 = load float, ptr %24, align 4, !tbaa !15
  %26 = load ptr, ptr @gop_conn, align 8, !tbaa !5
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct._OpConn, ptr %26, i64 %28
  %30 = getelementptr inbounds %struct._OpConn, ptr %29, i32 0, i32 8
  %31 = load float, ptr %30, align 8, !tbaa !16
  %32 = fadd float %25, %31
  store float %32, ptr %11, align 4, !tbaa !18
  br label %34

33:                                               ; preds = %3
  store i32 0, ptr %9, align 4, !tbaa !9
  store float 0.000000e+00, ptr %11, align 4, !tbaa !18
  br label %34

34:                                               ; preds = %33, %18
  %35 = load float, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 8), align 4, !tbaa !19
  %36 = fcmp une float %35, -1.000000e+00
  br i1 %36, label %37, label %42

37:                                               ; preds = %34
  %38 = load float, ptr %11, align 4, !tbaa !18
  %39 = load float, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 8), align 4, !tbaa !19
  %40 = fcmp ogt float %38, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  store i32 1, ptr %15, align 4
  br label %189

42:                                               ; preds = %37, %34
  %43 = call ptr @new_BfsNode()
  store ptr %43, ptr %7, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._BfsNode, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  call void @copy_source_to_dest(ptr noundef %45, ptr noundef %46)
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._BfsNode, ptr %48, i32 0, i32 1
  store i32 %47, ptr %49, align 8, !tbaa !21
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._BfsNode, ptr %51, i32 0, i32 9
  store ptr %50, ptr %52, align 8, !tbaa !22
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load float, ptr %11, align 4, !tbaa !18
  %55 = call zeroext i8 @Astar_better_state_hashed(ptr noundef %53, float noundef %54)
  %56 = icmp ne i8 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %42
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %58) #7
  store i32 1, ptr %15, align 4
  br label %189

59:                                               ; preds = %42
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = call i32 @get_1P_and_A(ptr noundef %60)
  store i32 %61, ptr %10, align 4, !tbaa !9
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = icmp eq i32 %62, -1
  br i1 %63, label %64, label %66

64:                                               ; preds = %59
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %65) #7
  store i32 1, ptr %15, align 4
  br label %189

66:                                               ; preds = %59
  %67 = load float, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 8), align 4, !tbaa !19
  %68 = fcmp une float %67, -1.000000e+00
  br i1 %68, label %69, label %77

69:                                               ; preds = %66
  %70 = load float, ptr %11, align 4, !tbaa !18
  %71 = load float, ptr @ghmax, align 4, !tbaa !18
  %72 = fadd float %70, %71
  %73 = load float, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 8), align 4, !tbaa !19
  %74 = fcmp ogt float %72, %73
  br i1 %74, label %75, label %77

75:                                               ; preds = %69
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %76) #7
  store i32 1, ptr %15, align 4
  br label %189

77:                                               ; preds = %69, %66
  %78 = load float, ptr @gh_cost, align 4, !tbaa !18
  store float %78, ptr %12, align 4, !tbaa !18
  %79 = load float, ptr %11, align 4, !tbaa !18
  %80 = load float, ptr @gw, align 4, !tbaa !18
  %81 = load float, ptr %12, align 4, !tbaa !18
  %82 = call float @llvm.fmuladd.f32(float %80, float %81, float %79)
  store float %82, ptr %13, align 4, !tbaa !18
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._BfsNode, ptr %84, i32 0, i32 3
  store i32 %83, ptr %85, align 8, !tbaa !23
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._BfsNode, ptr %87, i32 0, i32 2
  store i32 %86, ptr %88, align 4, !tbaa !11
  %89 = load float, ptr %11, align 4, !tbaa !18
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._BfsNode, ptr %90, i32 0, i32 4
  store float %89, ptr %91, align 4, !tbaa !15
  %92 = load float, ptr %12, align 4, !tbaa !18
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._BfsNode, ptr %93, i32 0, i32 5
  store float %92, ptr %94, align 8, !tbaa !24
  %95 = load float, ptr %13, align 4, !tbaa !18
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._BfsNode, ptr %96, i32 0, i32 6
  store float %95, ptr %97, align 4, !tbaa !25
  %98 = load i32, ptr @gnum_A, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = call noalias ptr @calloc(i64 noundef %99, i64 noundef 4) #8
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._BfsNode, ptr %101, i32 0, i32 7
  store ptr %100, ptr %102, align 8, !tbaa !26
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %138, %77
  %104 = load i32, ptr %14, align 4, !tbaa !9
  %105 = load i32, ptr @gnum_A, align 4, !tbaa !9
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %141

107:                                              ; preds = %103
  %108 = load ptr, ptr @gop_conn, align 8, !tbaa !5
  %109 = load ptr, ptr @gA, align 8, !tbaa !5
  %110 = load i32, ptr %14, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %109, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %struct._OpConn, ptr %108, i64 %114
  %116 = getelementptr inbounds %struct._OpConn, ptr %115, i32 0, i32 1
  %117 = load i8, ptr %116, align 8, !tbaa !27
  %118 = icmp ne i8 %117, 0
  br i1 %118, label %119, label %126

119:                                              ; preds = %107
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %121 = load ptr, ptr @gA, align 8, !tbaa !5
  %122 = load i32, ptr %14, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %121, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  call void @print_op_name(i32 noundef %125)
  call void @exit(i32 noundef 1) #9
  unreachable

126:                                              ; preds = %107
  %127 = load ptr, ptr @gA, align 8, !tbaa !5
  %128 = load i32, ptr %14, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %127, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._BfsNode, ptr %132, i32 0, i32 7
  %134 = load ptr, ptr %133, align 8, !tbaa !26
  %135 = load i32, ptr %14, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  store i32 %131, ptr %137, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %126
  %139 = load i32, ptr %14, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %14, align 4, !tbaa !9
  br label %103, !llvm.loop !28

141:                                              ; preds = %103
  %142 = load i32, ptr @gnum_A, align 4, !tbaa !9
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._BfsNode, ptr %143, i32 0, i32 8
  store i32 %142, ptr %144, align 8, !tbaa !30
  %145 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !5
  store ptr %145, ptr %8, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %161, %141
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._BfsNode, ptr %147, i32 0, i32 10
  %149 = load ptr, ptr %148, align 8, !tbaa !31
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %165

151:                                              ; preds = %146
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._BfsNode, ptr %152, i32 0, i32 10
  %154 = load ptr, ptr %153, align 8, !tbaa !31
  %155 = getelementptr inbounds %struct._BfsNode, ptr %154, i32 0, i32 6
  %156 = load float, ptr %155, align 4, !tbaa !25
  %157 = load float, ptr %13, align 4, !tbaa !18
  %158 = fcmp oge float %156, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %151
  br label %165

160:                                              ; preds = %151
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._BfsNode, ptr %162, i32 0, i32 10
  %164 = load ptr, ptr %163, align 8, !tbaa !31
  store ptr %164, ptr %8, align 8, !tbaa !5
  br label %146, !llvm.loop !32

165:                                              ; preds = %159, %146
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._BfsNode, ptr %166, i32 0, i32 10
  %168 = load ptr, ptr %167, align 8, !tbaa !31
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct._BfsNode, ptr %169, i32 0, i32 10
  store ptr %168, ptr %170, align 8, !tbaa !31
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._BfsNode, ptr %172, i32 0, i32 11
  store ptr %171, ptr %173, align 8, !tbaa !33
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._BfsNode, ptr %175, i32 0, i32 10
  store ptr %174, ptr %176, align 8, !tbaa !31
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._BfsNode, ptr %177, i32 0, i32 10
  %179 = load ptr, ptr %178, align 8, !tbaa !31
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %187

181:                                              ; preds = %165
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._BfsNode, ptr %183, i32 0, i32 10
  %185 = load ptr, ptr %184, align 8, !tbaa !31
  %186 = getelementptr inbounds %struct._BfsNode, ptr %185, i32 0, i32 11
  store ptr %182, ptr %186, align 8, !tbaa !33
  br label %187

187:                                              ; preds = %181, %165
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  call void @hash_bfs_node(ptr noundef %188)
  store i32 0, ptr %15, align 4
  br label %189

189:                                              ; preds = %187, %75, %64, %57, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  %190 = load i32, ptr %15, align 4
  switch i32 %190, label %192 [
    i32 0, label %191
    i32 1, label %191
  ]

191:                                              ; preds = %189, %189
  ret void

192:                                              ; preds = %189
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Astar_better_state_hashed(ptr noundef, float noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { noreturn 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 = { nounwind allocsize(0,1) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 36}
!12 = !{!"_BfsNode", !13, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !6, i64 56, !10, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!13 = !{!"_State", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!"float", !7, i64 0}
!15 = !{!12, !14, i64 44}
!16 = !{!17, !14, i64 40}
!17 = !{!"_OpConn", !6, i64 0, !7, i64 8, !6, i64 16, !10, i64 24, !7, i64 28, !7, i64 29, !10, i64 32, !7, i64 36, !14, i64 40}
!18 = !{!14, !14, i64 0}
!19 = !{!20, !14, i64 788}
!20 = !{!"_command_line", !7, i64 0, !7, i64 256, !7, i64 512, !10, i64 768, !10, i64 772, !10, i64 776, !7, i64 780, !10, i64 784, !14, i64 788}
!21 = !{!12, !10, i64 32}
!22 = !{!12, !6, i64 72}
!23 = !{!12, !10, i64 40}
!24 = !{!12, !14, i64 48}
!25 = !{!12, !14, i64 52}
!26 = !{!12, !6, i64 56}
!27 = !{!17, !7, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!12, !10, i64 64}
!31 = !{!12, !6, i64 80}
!32 = distinct !{!32, !29}
!33 = !{!12, !6, i64 88}


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

%struct._command_line = type { [256 x i8], [256 x i8], [256 x i8], i32, i32, i32, i8, i32, float }
%struct._OpConn = type { ptr, i8, ptr, i32, i8, i8, i32, i8, float }

@gcmd_line = external local_unnamed_addr global %struct._command_line, align 4
@gop_conn = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@gnum_A = external local_unnamed_addr global i32, align 4
@gA = external local_unnamed_addr global ptr, align 8
@lbfs_space_head = external dso_local local_unnamed_addr global ptr, align 8
@ghmax = external local_unnamed_addr global float, align 4
@gh_cost = external local_unnamed_addr global float, align 4
@gw = external local_unnamed_addr global float, align 4

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

declare i32 @get_1P_and_A(ptr noundef) local_unnamed_addr #1

declare void @print_op_name(i32 noundef) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @copy_source_to_dest(ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @new_BfsNode() local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local void @hash_bfs_node(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @add_to_weighted_Astar_space(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #4 {
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %15, label %4

4:                                                ; preds = %3
  %5 = getelementptr inbounds i8, ptr %2, i64 36
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = add nsw i32 %6, 1
  %8 = getelementptr inbounds i8, ptr %2, i64 44
  %9 = load float, ptr %8, align 4, !tbaa !13
  %10 = load ptr, ptr @gop_conn, align 8, !tbaa !14
  %11 = sext i32 %1 to i64
  %12 = getelementptr inbounds %struct._OpConn, ptr %10, i64 %11, i32 8
  %13 = load float, ptr %12, align 8, !tbaa !15
  %14 = fadd float %9, %13
  br label %15

15:                                               ; preds = %3, %4
  %.055 = phi float [ %14, %4 ], [ 0.000000e+00, %3 ]
  %.054 = phi i32 [ %7, %4 ], [ 0, %3 ]
  %16 = load float, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 788), align 4, !tbaa !17
  %17 = fcmp une float %16, -1.000000e+00
  %18 = fcmp ogt float %.055, %16
  %or.cond = select i1 %17, i1 %18, i1 false
  br i1 %or.cond, label %83, label %19

19:                                               ; preds = %15
  %20 = tail call ptr @new_BfsNode() #7
  tail call void @copy_source_to_dest(ptr noundef %20, ptr noundef %0)
  %21 = getelementptr inbounds i8, ptr %20, i64 32
  store i32 %1, ptr %21, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %20, i64 72
  store ptr %2, ptr %22, align 8, !tbaa !20
  %23 = tail call zeroext i8 @Astar_better_state_hashed(ptr noundef %20, float noundef %.055)
  %.not63 = icmp eq i8 %23, 0
  br i1 %.not63, label %25, label %24

24:                                               ; preds = %19
  tail call void @free(ptr noundef nonnull %20) #7
  br label %83

25:                                               ; preds = %19
  %26 = tail call i32 @get_1P_and_A(ptr noundef %0) #7
  %27 = icmp eq i32 %26, -1
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  tail call void @free(ptr noundef nonnull %20) #7
  br label %83

29:                                               ; preds = %25
  %30 = load float, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 788), align 4, !tbaa !17
  %31 = fcmp une float %30, -1.000000e+00
  br i1 %31, label %32, label %37

32:                                               ; preds = %29
  %33 = load float, ptr @ghmax, align 4, !tbaa !21
  %34 = fadd float %.055, %33
  %35 = fcmp ogt float %34, %30
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  tail call void @free(ptr noundef nonnull %20) #7
  br label %83

37:                                               ; preds = %32, %29
  %38 = load float, ptr @gh_cost, align 4, !tbaa !21
  %39 = load float, ptr @gw, align 4, !tbaa !21
  %40 = tail call float @llvm.fmuladd.f32(float %39, float %38, float %.055)
  %41 = getelementptr inbounds i8, ptr %20, i64 40
  store i32 %26, ptr %41, align 8, !tbaa !22
  %42 = getelementptr inbounds i8, ptr %20, i64 36
  store i32 %.054, ptr %42, align 4, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %20, i64 44
  store float %.055, ptr %43, align 4, !tbaa !13
  %44 = getelementptr inbounds i8, ptr %20, i64 48
  store float %38, ptr %44, align 8, !tbaa !23
  %45 = getelementptr inbounds i8, ptr %20, i64 52
  store float %40, ptr %45, align 4, !tbaa !24
  %46 = load i32, ptr @gnum_A, align 4, !tbaa !25
  %47 = sext i32 %46 to i64
  %48 = tail call noalias ptr @calloc(i64 noundef %47, i64 noundef 4) #8
  %49 = getelementptr inbounds i8, ptr %20, i64 56
  store ptr %48, ptr %49, align 8, !tbaa !26
  %50 = icmp sgt i32 %46, 0
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %37
  %51 = load ptr, ptr @gop_conn, align 8, !tbaa !14
  %52 = load ptr, ptr @gA, align 8, !tbaa !14
  %wide.trip.count = zext nneg i32 %46 to i64
  br label %53

53:                                               ; preds = %.lr.ph, %64
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %64 ]
  %54 = getelementptr inbounds i32, ptr %52, i64 %indvars.iv
  %55 = load i32, ptr %54, align 4, !tbaa !25
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %struct._OpConn, ptr %51, i64 %56, i32 1
  %58 = load i8, ptr %57, align 8, !tbaa !27
  %.not66 = icmp eq i8 %58, 0
  br i1 %.not66, label %64, label %59

59:                                               ; preds = %53
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %61 = load ptr, ptr @gA, align 8, !tbaa !14
  %62 = getelementptr inbounds i32, ptr %61, i64 %indvars.iv
  %63 = load i32, ptr %62, align 4, !tbaa !25
  tail call void @print_op_name(i32 noundef %63) #7
  tail call void @exit(i32 noundef 1) #9
  unreachable

64:                                               ; preds = %53
  %65 = getelementptr inbounds i32, ptr %48, i64 %indvars.iv
  store i32 %55, ptr %65, align 4, !tbaa !25
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %53, !llvm.loop !28

._crit_edge:                                      ; preds = %64, %37
  %66 = getelementptr inbounds i8, ptr %20, i64 64
  store i32 %46, ptr %66, align 8, !tbaa !30
  %67 = load ptr, ptr @lbfs_space_head, align 8, !tbaa !14
  br label %68

68:                                               ; preds = %71, %._crit_edge
  %.053 = phi ptr [ %67, %._crit_edge ], [ %70, %71 ]
  %69 = getelementptr inbounds i8, ptr %.053, i64 80
  %70 = load ptr, ptr %69, align 8, !tbaa !31
  %.not64 = icmp eq ptr %70, null
  br i1 %.not64, label %75, label %71

71:                                               ; preds = %68
  %72 = getelementptr inbounds i8, ptr %70, i64 52
  %73 = load float, ptr %72, align 4, !tbaa !24
  %74 = fcmp ult float %73, %40
  br i1 %74, label %68, label %75, !llvm.loop !32

75:                                               ; preds = %71, %68
  %76 = getelementptr inbounds i8, ptr %.053, i64 80
  %77 = getelementptr inbounds i8, ptr %20, i64 80
  store ptr %70, ptr %77, align 8, !tbaa !31
  %78 = getelementptr inbounds i8, ptr %20, i64 88
  store ptr %.053, ptr %78, align 8, !tbaa !33
  store ptr %20, ptr %76, align 8, !tbaa !31
  %79 = load ptr, ptr %77, align 8, !tbaa !31
  %.not65 = icmp eq ptr %79, null
  br i1 %.not65, label %82, label %80

80:                                               ; preds = %75
  %81 = getelementptr inbounds i8, ptr %79, i64 88
  store ptr %20, ptr %81, align 8, !tbaa !33
  br label %82

82:                                               ; preds = %80, %75
  tail call void @hash_bfs_node(ptr noundef nonnull %20)
  br label %83

83:                                               ; preds = %15, %82, %36, %28, %24
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Astar_better_state_hashed(ptr noundef, float noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

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 = { "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 = { noreturn 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 = { 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 #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 nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { noreturn 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, !11, i64 36}
!6 = !{!"_BfsNode", !7, i64 0, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !8, i64 56, !11, i64 64, !8, i64 72, !8, i64 80, !8, i64 88}
!7 = !{!"_State", !8, i64 0, !11, i64 8, !8, i64 16, !8, i64 24}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = !{!6, !12, i64 44}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !12, i64 40}
!16 = !{!"_OpConn", !8, i64 0, !9, i64 8, !8, i64 16, !11, i64 24, !9, i64 28, !9, i64 29, !11, i64 32, !9, i64 36, !12, i64 40}
!17 = !{!18, !12, i64 788}
!18 = !{!"_command_line", !9, i64 0, !9, i64 256, !9, i64 512, !11, i64 768, !11, i64 772, !11, i64 776, !9, i64 780, !11, i64 784, !12, i64 788}
!19 = !{!6, !11, i64 32}
!20 = !{!6, !8, i64 72}
!21 = !{!12, !12, i64 0}
!22 = !{!6, !11, i64 40}
!23 = !{!6, !12, i64 48}
!24 = !{!6, !12, i64 52}
!25 = !{!11, !11, i64 0}
!26 = !{!6, !8, i64 56}
!27 = !{!16, !9, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!6, !11, i64 64}
!31 = !{!6, !8, i64 80}
!32 = distinct !{!32, !29}
!33 = !{!6, !8, i64 88}


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