; 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._State = type { ptr, i32, ptr, ptr }
%struct._EhcNode = type { %struct._State, i32, i32, ptr, ptr }
%struct._OpConn = type { ptr, i8, ptr, i32, i8, i8, i32, i8, float }

@gnum_ft_conn = external global i32, align 4
@gnum_fl_conn = external global i32, align 4
@lehc_space_head = external dso_local global ptr, align 8
@lH = external dso_local global i8, align 1
@gcmd_line = external global %struct._command_line, align 4
@search_for_better_state.fc = external hidden global i8, align 1
@search_for_better_state.S__ = external hidden global %struct._State, align 8
@lehc_current_end = external dso_local global ptr, align 8
@gnum_H = external global i32, align 4
@gop_conn = external global ptr, align 8
@gH = 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
@lehc_current_start = external dso_local global ptr, align 8
@gmax_search_depth = external global i32, align 4
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@stdout = external global ptr, align 8

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

declare void @make_state(ptr noundef, i32 noundef, i32 noundef) #1

declare ptr @new_EhcNode() #1

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

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

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

17:                                               ; preds = %4
  %18 = load i32, ptr @gnum_ft_conn, align 4, !tbaa !9
  %19 = load i32, ptr @gnum_fl_conn, align 4, !tbaa !9
  call void @make_state(ptr noundef @search_for_better_state.S__, i32 noundef %18, i32 noundef %19)
  store i8 0, ptr @search_for_better_state.fc, align 1, !tbaa !11
  br label %20

20:                                               ; preds = %17, %4
  %21 = call ptr @new_EhcNode()
  store ptr %21, ptr %13, align 8, !tbaa !5
  %22 = load ptr, ptr %13, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._EhcNode, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  call void @source_to_dest(ptr noundef %23, ptr noundef %24)
  %25 = load ptr, ptr %13, align 8, !tbaa !5
  call void @hash_ehc_node(ptr noundef %25)
  %26 = load ptr, ptr @lehc_space_head, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._EhcNode, ptr %26, i32 0, i32 4
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  store ptr %28, ptr @lehc_current_end, align 8, !tbaa !5
  %29 = load i8, ptr @lH, align 1, !tbaa !11
  %30 = icmp ne i8 %29, 0
  br i1 %30, label %31, label %75

31:                                               ; preds = %20
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %71, %31
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = load i32, ptr @gnum_H, align 4, !tbaa !9
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %74

36:                                               ; preds = %32
  %37 = load ptr, ptr @gop_conn, align 8, !tbaa !5
  %38 = load ptr, ptr @gH, align 8, !tbaa !5
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %38, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct._OpConn, ptr %37, i64 %43
  %45 = getelementptr inbounds %struct._OpConn, ptr %44, i32 0, i32 1
  %46 = load i8, ptr %45, align 8, !tbaa !15
  %47 = icmp ne i8 %46, 0
  br i1 %47, label %48, label %55

48:                                               ; preds = %36
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %50 = load ptr, ptr @gH, align 8, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %50, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  call void @print_op_name(i32 noundef %54)
  call void @exit(i32 noundef 1) #6
  unreachable

55:                                               ; preds = %36
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load ptr, ptr @gH, align 8, !tbaa !5
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %57, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = call zeroext i8 @result_to_dest(ptr noundef @search_for_better_state.S__, ptr noundef %56, i32 noundef %61)
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %64, label %70

64:                                               ; preds = %55
  %65 = load ptr, ptr @gH, align 8, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %65, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  call void @add_to_ehc_space(ptr noundef @search_for_better_state.S__, i32 noundef %69, ptr noundef null)
  br label %70

70:                                               ; preds = %64, %55
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %10, align 4, !tbaa !9
  br label %32, !llvm.loop !18

74:                                               ; preds = %32
  br label %119

75:                                               ; preds = %20
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %115, %75
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = load i32, ptr @gnum_A, align 4, !tbaa !9
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %118

80:                                               ; preds = %76
  %81 = load ptr, ptr @gop_conn, align 8, !tbaa !5
  %82 = load ptr, ptr @gA, align 8, !tbaa !5
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct._OpConn, ptr %81, i64 %87
  %89 = getelementptr inbounds %struct._OpConn, ptr %88, i32 0, i32 1
  %90 = load i8, ptr %89, align 8, !tbaa !15
  %91 = icmp ne i8 %90, 0
  br i1 %91, label %92, label %99

92:                                               ; preds = %80
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %94 = load ptr, ptr @gA, align 8, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !9
  call void @print_op_name(i32 noundef %98)
  call void @exit(i32 noundef 1) #6
  unreachable

99:                                               ; preds = %80
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load ptr, ptr @gA, align 8, !tbaa !5
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %101, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = call zeroext i8 @result_to_dest(ptr noundef @search_for_better_state.S__, ptr noundef %100, i32 noundef %105)
  %107 = icmp ne i8 %106, 0
  br i1 %107, label %108, label %114

108:                                              ; preds = %99
  %109 = load ptr, ptr @gA, align 8, !tbaa !5
  %110 = load i32, ptr %10, 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
  call void @add_to_ehc_space(ptr noundef @search_for_better_state.S__, i32 noundef %113, ptr noundef null)
  br label %114

114:                                              ; preds = %108, %99
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %10, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %10, align 4, !tbaa !9
  br label %76, !llvm.loop !20

118:                                              ; preds = %76
  br label %119

119:                                              ; preds = %118, %74
  %120 = load ptr, ptr @lehc_space_head, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._EhcNode, ptr %120, i32 0, i32 4
  %122 = load ptr, ptr %121, align 8, !tbaa !12
  store ptr %122, ptr @lehc_current_start, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %162, %119
  br label %124

124:                                              ; preds = %123
  %125 = load ptr, ptr @lehc_current_start, align 8, !tbaa !5
  %126 = load ptr, ptr @lehc_current_end, align 8, !tbaa !5
  %127 = icmp eq ptr %125, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %124
  call void @reset_ehc_hash_entrys()
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %129) #5
  store i8 0, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %171

130:                                              ; preds = %124
  %131 = load ptr, ptr @lehc_current_start, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._EhcNode, ptr %131, i32 0, i32 2
  %133 = load i32, ptr %132, align 4, !tbaa !21
  %134 = load i32, ptr %12, align 4, !tbaa !9
  %135 = icmp sgt i32 %133, %134
  br i1 %135, label %136, label %154

136:                                              ; preds = %130
  %137 = load ptr, ptr @lehc_current_start, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._EhcNode, ptr %137, i32 0, i32 2
  %139 = load i32, ptr %138, align 4, !tbaa !21
  store i32 %139, ptr %12, align 4, !tbaa !9
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = load i32, ptr @gmax_search_depth, align 4, !tbaa !9
  %142 = icmp sgt i32 %140, %141
  br i1 %142, label %143, label %145

143:                                              ; preds = %136
  %144 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %144, ptr @gmax_search_depth, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %143, %136
  %146 = load i32, ptr getelementptr inbounds (%struct._command_line, ptr @gcmd_line, i32 0, i32 3), align 4, !tbaa !22
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %153

148:                                              ; preds = %145
  %149 = load i32, ptr %12, align 4, !tbaa !9
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %149)
  %151 = load ptr, ptr @stdout, align 8, !tbaa !5
  %152 = call i32 @fflush(ptr noundef %151)
  br label %153

153:                                              ; preds = %148, %145
  br label %154

154:                                              ; preds = %153, %130
  %155 = load i32, ptr %7, align 4, !tbaa !9
  %156 = call i32 @expand_first_node(i32 noundef %155)
  store i32 %156, ptr %11, align 4, !tbaa !9
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = load i32, ptr %7, align 4, !tbaa !9
  %159 = call zeroext i8 @LESS(i32 noundef %157, i32 noundef %158)
  %160 = icmp ne i8 %159, 0
  br i1 %160, label %161, label %162

161:                                              ; preds = %154
  br label %163

162:                                              ; preds = %154
  br label %123

163:                                              ; preds = %161
  call void @reset_ehc_hash_entrys()
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %164) #5
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  call void @extract_plan_fragment(ptr noundef %165)
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = load ptr, ptr @lehc_current_start, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct._EhcNode, ptr %167, i32 0, i32 0
  call void @source_to_dest(ptr noundef %166, ptr noundef %168)
  %169 = load i32, ptr %11, align 4, !tbaa !9
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %169, ptr %170, align 4, !tbaa !9
  store i8 1, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %171

171:                                              ; preds = %163, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %172 = load i8, ptr %5, align 1
  ret i8 %172
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @hash_ehc_node(ptr noundef) #2

declare void @print_op_name(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @result_to_dest(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @add_to_ehc_space(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @reset_ehc_hash_entrys() #2

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

declare i32 @fflush(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @expand_first_node(i32 noundef) #2

declare zeroext i8 @LESS(i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @extract_plan_fragment(ptr noundef) #2

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 48}
!13 = !{!"_EhcNode", !14, i64 0, !10, i64 32, !10, i64 36, !6, i64 40, !6, i64 48}
!14 = !{!"_State", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!16, !7, i64 8}
!16 = !{!"_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, !17, i64 40}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!13, !10, i64 36}
!22 = !{!23, !10, i64 768}
!23 = !{!"_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, !17, i64 788}


; 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._State = type { ptr, i32, ptr, ptr }
%struct._OpConn = type { ptr, i8, ptr, i32, i8, i8, i32, i8, float }

@gnum_ft_conn = external local_unnamed_addr global i32, align 4
@gnum_fl_conn = external local_unnamed_addr global i32, align 4
@lehc_space_head = external dso_local local_unnamed_addr global ptr, align 8
@lH = external dso_local local_unnamed_addr global i8, align 1
@gcmd_line = external local_unnamed_addr global %struct._command_line, align 4
@search_for_better_state.fc = external hidden local_unnamed_addr global i8, align 1
@search_for_better_state.S__ = external hidden global %struct._State, align 8
@lehc_current_end = external dso_local local_unnamed_addr global ptr, align 8
@gnum_H = external local_unnamed_addr global i32, align 4
@gop_conn = external local_unnamed_addr global ptr, align 8
@gH = 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
@lehc_current_start = external dso_local local_unnamed_addr global ptr, align 8
@gmax_search_depth = external local_unnamed_addr global i32, align 4
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

declare void @make_state(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare ptr @new_EhcNode() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @search_for_better_state(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 {
  %5 = load i8, ptr @search_for_better_state.fc, align 1, !tbaa !5
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %9, label %6

6:                                                ; preds = %4
  %7 = load i32, ptr @gnum_ft_conn, align 4, !tbaa !8
  %8 = load i32, ptr @gnum_fl_conn, align 4, !tbaa !8
  tail call void @make_state(ptr noundef nonnull @search_for_better_state.S__, i32 noundef %7, i32 noundef %8) #5
  store i8 0, ptr @search_for_better_state.fc, align 1, !tbaa !5
  br label %9

9:                                                ; preds = %6, %4
  %10 = tail call ptr @new_EhcNode() #5
  tail call void @source_to_dest(ptr noundef %10, ptr noundef %0)
  tail call void @hash_ehc_node(ptr noundef %10)
  %11 = load ptr, ptr @lehc_space_head, align 8, !tbaa !10
  %12 = getelementptr inbounds i8, ptr %11, i64 48
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  store ptr %13, ptr @lehc_current_end, align 8, !tbaa !10
  %14 = load i8, ptr @lH, align 1, !tbaa !5
  %.not35 = icmp eq i8 %14, 0
  br i1 %.not35, label %.preheader, label %.preheader42

.preheader42:                                     ; preds = %9
  %15 = load i32, ptr @gnum_H, align 4, !tbaa !8
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %.loopexit

.preheader:                                       ; preds = %9
  %17 = load i32, ptr @gnum_A, align 4, !tbaa !8
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph48, label %.loopexit

.lr.ph:                                           ; preds = %.preheader42, %37
  %indvars.iv = phi i64 [ %indvars.iv.next, %37 ], [ 0, %.preheader42 ]
  %19 = load ptr, ptr @gop_conn, align 8, !tbaa !10
  %20 = load ptr, ptr @gH, align 8, !tbaa !10
  %21 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
  %22 = load i32, ptr %21, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds %struct._OpConn, ptr %19, i64 %23, i32 1
  %25 = load i8, ptr %24, align 8, !tbaa !15
  %.not40 = icmp eq i8 %25, 0
  br i1 %.not40, label %31, label %26

26:                                               ; preds = %.lr.ph
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %28 = load ptr, ptr @gH, align 8, !tbaa !10
  %29 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv
  %30 = load i32, ptr %29, align 4, !tbaa !8
  tail call void @print_op_name(i32 noundef %30) #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

31:                                               ; preds = %.lr.ph
  %32 = tail call zeroext i8 @result_to_dest(ptr noundef nonnull @search_for_better_state.S__, ptr noundef %0, i32 noundef %22)
  %.not41 = icmp eq i8 %32, 0
  br i1 %.not41, label %37, label %33

33:                                               ; preds = %31
  %34 = load ptr, ptr @gH, align 8, !tbaa !10
  %35 = getelementptr inbounds i32, ptr %34, i64 %indvars.iv
  %36 = load i32, ptr %35, align 4, !tbaa !8
  tail call void @add_to_ehc_space(ptr noundef nonnull @search_for_better_state.S__, i32 noundef %36, ptr noundef null)
  br label %37

37:                                               ; preds = %31, %33
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %38 = load i32, ptr @gnum_H, align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next, %39
  br i1 %40, label %.lr.ph, label %.loopexit, !llvm.loop !18

.lr.ph48:                                         ; preds = %.preheader, %59
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %59 ], [ 0, %.preheader ]
  %41 = load ptr, ptr @gop_conn, align 8, !tbaa !10
  %42 = load ptr, ptr @gA, align 8, !tbaa !10
  %43 = getelementptr inbounds i32, ptr %42, i64 %indvars.iv55
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct._OpConn, ptr %41, i64 %45, i32 1
  %47 = load i8, ptr %46, align 8, !tbaa !15
  %.not36 = icmp eq i8 %47, 0
  br i1 %.not36, label %53, label %48

48:                                               ; preds = %.lr.ph48
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %50 = load ptr, ptr @gA, align 8, !tbaa !10
  %51 = getelementptr inbounds i32, ptr %50, i64 %indvars.iv55
  %52 = load i32, ptr %51, align 4, !tbaa !8
  tail call void @print_op_name(i32 noundef %52) #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

53:                                               ; preds = %.lr.ph48
  %54 = tail call zeroext i8 @result_to_dest(ptr noundef nonnull @search_for_better_state.S__, ptr noundef %0, i32 noundef %44)
  %.not37 = icmp eq i8 %54, 0
  br i1 %.not37, label %59, label %55

55:                                               ; preds = %53
  %56 = load ptr, ptr @gA, align 8, !tbaa !10
  %57 = getelementptr inbounds i32, ptr %56, i64 %indvars.iv55
  %58 = load i32, ptr %57, align 4, !tbaa !8
  tail call void @add_to_ehc_space(ptr noundef nonnull @search_for_better_state.S__, i32 noundef %58, ptr noundef null)
  br label %59

59:                                               ; preds = %53, %55
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %60 = load i32, ptr @gnum_A, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next56, %61
  br i1 %62, label %.lr.ph48, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %37, %59, %.preheader42, %.preheader
  %63 = load ptr, ptr @lehc_space_head, align 8, !tbaa !10
  %64 = getelementptr inbounds i8, ptr %63, i64 48
  %65 = load ptr, ptr %64, align 8, !tbaa !12
  store ptr %65, ptr @lehc_current_start, align 8, !tbaa !10
  br label %66

66:                                               ; preds = %85, %.loopexit
  %.030 = phi i32 [ 0, %.loopexit ], [ %.1, %85 ]
  %67 = load ptr, ptr @lehc_current_start, align 8, !tbaa !10
  %68 = load ptr, ptr @lehc_current_end, align 8, !tbaa !10
  %69 = icmp eq ptr %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %66
  tail call void @reset_ehc_hash_entrys()
  tail call void @free(ptr noundef %10) #5
  br label %90

71:                                               ; preds = %66
  %72 = getelementptr inbounds i8, ptr %67, i64 36
  %73 = load i32, ptr %72, align 4, !tbaa !21
  %74 = icmp sgt i32 %73, %.030
  br i1 %74, label %75, label %85

75:                                               ; preds = %71
  %76 = load i32, ptr @gmax_search_depth, align 4, !tbaa !8
  %77 = icmp sgt i32 %73, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  store i32 %73, ptr @gmax_search_depth, align 4, !tbaa !8
  br label %79

79:                                               ; preds = %78, %75
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @gcmd_line, i64 768), align 4, !tbaa !22
  %.not38 = icmp eq i32 %80, 0
  br i1 %.not38, label %85, label %81

81:                                               ; preds = %79
  %82 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %73)
  %83 = load ptr, ptr @stdout, align 8, !tbaa !10
  %84 = tail call i32 @fflush(ptr noundef %83)
  br label %85

85:                                               ; preds = %79, %81, %71
  %.1 = phi i32 [ %73, %81 ], [ %73, %79 ], [ %.030, %71 ]
  %86 = tail call i32 @expand_first_node(i32 noundef %1)
  %87 = tail call zeroext i8 @LESS(i32 noundef %86, i32 noundef %1) #5
  %.not39 = icmp eq i8 %87, 0
  br i1 %.not39, label %66, label %88

88:                                               ; preds = %85
  tail call void @reset_ehc_hash_entrys()
  tail call void @free(ptr noundef %10) #5
  tail call void @extract_plan_fragment(ptr noundef %0)
  %89 = load ptr, ptr @lehc_current_start, align 8, !tbaa !10
  tail call void @source_to_dest(ptr noundef %2, ptr noundef %89)
  store i32 %86, ptr %3, align 4, !tbaa !8
  br label %90

90:                                               ; preds = %88, %70
  %.0 = phi i8 [ 0, %70 ], [ 1, %88 ]
  ret i8 %.0
}

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

declare void @print_op_name(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @result_to_dest(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @add_to_ehc_space(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @reset_ehc_hash_entrys() local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @expand_first_node(i32 noundef) local_unnamed_addr #1

declare zeroext i8 @LESS(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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 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 #2 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!13, !11, i64 48}
!13 = !{!"_EhcNode", !14, i64 0, !9, i64 32, !9, i64 36, !11, i64 40, !11, i64 48}
!14 = !{!"_State", !11, i64 0, !9, i64 8, !11, i64 16, !11, i64 24}
!15 = !{!16, !6, i64 8}
!16 = !{!"_OpConn", !11, i64 0, !6, i64 8, !11, i64 16, !9, i64 24, !6, i64 28, !6, i64 29, !9, i64 32, !6, i64 36, !17, i64 40}
!17 = !{!"float", !6, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!13, !9, i64 36}
!22 = !{!23, !9, i64 768}
!23 = !{!"_command_line", !6, i64 0, !6, i64 256, !6, i64 512, !9, i64 768, !9, i64 772, !9, i64 776, !6, i64 780, !9, i64 784, !17, i64 788}


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