; LLVM IR from totte174/minesolve :: src (solver)

; 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.Board = type { i32, i32, i32, i32, [1024 x i32], [1024 x i8], [1024 x i8], i8 }
%struct.Edge = type { [192 x i32], i32, [192 x i32], [192 x i32], i32, i32, [192 x i32], i32 }
%struct.ProbabilityMap = type { double, [192 x double], [192 x double], double }
%struct.SearchResult = type { double, double, i32, i32 }
%struct.SolverSearchState = type { i32, [8 x i32], [8 x i32] }

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @tree_search(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [192 x i32], align 16
  %14 = alloca [192 x double], align 16
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.Board, align 4
  %19 = alloca %struct.Edge, align 4
  %20 = alloca %struct.ProbabilityMap, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca i8, align 1
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %struct.SearchResult, align 8
  %30 = alloca %struct.SolverSearchState, align 4
  %31 = alloca double, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.SolverSearchState, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = icmp sge i32 %34, %35
  br i1 %36, label %37, label %42

37:                                               ; preds = %6
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.SearchResult, ptr %38, i32 0, i32 1
  store double 1.000000e+00, ptr %39, align 8, !tbaa !13
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.SearchResult, ptr %40, i32 0, i32 0
  store double 0.000000e+00, ptr %41, align 8, !tbaa !16
  br label %256

42:                                               ; preds = %6
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = call i32 @get_pmap(ptr noundef %43, ptr noundef %44, ptr noundef %45)
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.SearchResult, ptr %47, i32 0, i32 3
  store i32 %46, ptr %48, align 4, !tbaa !17
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ProbabilityMap, ptr %49, i32 0, i32 0
  %51 = load double, ptr %50, align 8, !tbaa !18
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.SearchResult, ptr %52, i32 0, i32 1
  store double %51, ptr %53, align 8, !tbaa !13
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.SearchResult, ptr %54, i32 0, i32 3
  %56 = load i32, ptr %55, align 4, !tbaa !17
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %42
  br label %256

59:                                               ; preds = %42
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SolverSearchState, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = sub nsw i32 %60, %63
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %66, label %74

66:                                               ; preds = %59
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.SearchResult, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.SearchResult, ptr %72, i32 0, i32 2
  call void @get_lowest_probability(ptr noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %71, ptr noundef %73)
  br label %256

74:                                               ; preds = %59
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.SearchResult, ptr %75, i32 0, i32 0
  store double 1.000000e+00, ptr %76, align 8, !tbaa !16
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.SearchResult, ptr %77, i32 0, i32 2
  store i32 -1, ptr %78, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 768, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 1536, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds [192 x i32], ptr %13, i64 0, i64 0
  %83 = getelementptr inbounds [192 x double], ptr %14, i64 0, i64 0
  %84 = call i32 @get_best_evaluations(ptr noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82, ptr noundef %83)
  store i32 %84, ptr %15, align 4, !tbaa !9
  %85 = getelementptr inbounds [192 x double], ptr %14, i64 0, i64 0
  %86 = load double, ptr %85, align 16, !tbaa !21
  %87 = fcmp oeq double %86, 0.000000e+00
  br i1 %87, label %88, label %135

88:                                               ; preds = %74
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.SolverSearchState, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 4, !tbaa !11
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %100

93:                                               ; preds = %88
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.SearchResult, ptr %94, i32 0, i32 0
  store double 0.000000e+00, ptr %95, align 8, !tbaa !16
  %96 = getelementptr inbounds [192 x i32], ptr %13, i64 0, i64 0
  %97 = load i32, ptr %96, align 16, !tbaa !9
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.SearchResult, ptr %98, i32 0, i32 2
  store i32 %97, ptr %99, align 8, !tbaa !20
  store i32 1, ptr %16, align 4
  br label %254

100:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %112, %100
  %102 = load i32, ptr %17, align 4, !tbaa !9
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %115

105:                                              ; preds = %101
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [192 x double], ptr %14, i64 0, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !21
  %110 = fcmp une double %109, 0.000000e+00
  br i1 %110, label %111, label %112

111:                                              ; preds = %105
  br label %115

112:                                              ; preds = %105
  %113 = load i32, ptr %17, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %17, align 4, !tbaa !9
  br label %101, !llvm.loop !22

115:                                              ; preds = %111, %101
  %116 = load i32, ptr %17, align 4, !tbaa !9
  %117 = load i32, ptr %9, align 4, !tbaa !9
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.SolverSearchState, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 4, !tbaa !11
  %121 = sub nsw i32 %117, %120
  %122 = icmp eq i32 %116, %121
  br i1 %122, label %123, label %130

123:                                              ; preds = %115
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.SearchResult, ptr %124, i32 0, i32 0
  store double 0.000000e+00, ptr %125, align 8, !tbaa !16
  %126 = getelementptr inbounds [192 x i32], ptr %13, i64 0, i64 0
  %127 = load i32, ptr %126, align 16, !tbaa !9
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.SearchResult, ptr %128, i32 0, i32 2
  store i32 %127, ptr %129, align 8, !tbaa !20
  store i32 1, ptr %16, align 4
  br label %131

130:                                              ; preds = %115
  store i32 0, ptr %16, align 4
  br label %131

131:                                              ; preds = %130, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  %132 = load i32, ptr %16, align 4
  switch i32 %132, label %254 [
    i32 0, label %133
  ]

133:                                              ; preds = %131
  br label %134

134:                                              ; preds = %133
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %135

135:                                              ; preds = %134, %74
  call void @llvm.lifetime.start.p0(i64 6164, ptr %18) #5
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %136, i64 6164, i1 false), !tbaa.struct !24
  %137 = getelementptr inbounds %struct.Board, ptr %18, i32 0, i32 3
  %138 = load i32, ptr %137, align 4, !tbaa !28
  %139 = add nsw i32 %138, -1
  store i32 %139, ptr %137, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 3088, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 3088, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %249, %135
  %141 = load i32, ptr %21, align 4, !tbaa !9
  %142 = load i32, ptr %15, align 4, !tbaa !9
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 4, ptr %16, align 4
  br label %252

145:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %146 = load i32, ptr %21, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [192 x i32], ptr %13, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !9
  store i32 %149, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %150 = load i32, ptr %21, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [192 x double], ptr %14, i64 0, i64 %151
  %153 = load double, ptr %152, align 8, !tbaa !21
  store double %153, ptr %23, align 8, !tbaa !21
  %154 = load double, ptr %23, align 8, !tbaa !21
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.SearchResult, ptr %155, i32 0, i32 0
  %157 = load double, ptr %156, align 8, !tbaa !16
  %158 = fcmp oge double %154, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %145
  store i32 4, ptr %16, align 4
  br label %246

160:                                              ; preds = %145
  %161 = getelementptr inbounds %struct.Board, ptr %18, i32 0, i32 5
  %162 = load i32, ptr %22, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1024 x i8], ptr %161, i64 0, i64 %163
  store i8 1, ptr %164, align 1, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store double 0.000000e+00, ptr %24, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store double 0.000000e+00, ptr %25, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #5
  store i8 0, ptr %26, align 1, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %165 = load i32, ptr %22, align 4, !tbaa !9
  %166 = call i32 @get_adjacent_unknown_c(ptr noundef %18, i32 noundef %165)
  store i32 %166, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %202, %160
  %168 = load i32, ptr %28, align 4, !tbaa !9
  %169 = load i32, ptr %27, align 4, !tbaa !9
  %170 = icmp sle i32 %168, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %167
  store i32 7, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %205

172:                                              ; preds = %167
  %173 = load i32, ptr %28, align 4, !tbaa !9
  %174 = getelementptr inbounds %struct.Board, ptr %18, i32 0, i32 4
  %175 = load i32, ptr %22, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [1024 x i32], ptr %174, i64 0, i64 %176
  store i32 %173, ptr %177, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 68, ptr %30) #5
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %178, i64 68, i1 false), !tbaa.struct !30
  %179 = load i32, ptr %22, align 4, !tbaa !9
  %180 = load i32, ptr %28, align 4, !tbaa !9
  call void @state_add_position(ptr noundef %30, i32 noundef %179, i32 noundef %180)
  %181 = load i32, ptr %9, align 4, !tbaa !9
  call void @tree_search(ptr noundef %18, ptr noundef %30, i32 noundef %181, ptr noundef %29, ptr noundef %19, ptr noundef %20)
  %182 = getelementptr inbounds %struct.SearchResult, ptr %29, i32 0, i32 3
  %183 = load i32, ptr %182, align 4, !tbaa !17
  %184 = icmp eq i32 %183, 1
  br i1 %184, label %185, label %186

185:                                              ; preds = %172
  store i8 1, ptr %26, align 1, !tbaa !26
  br label %186

186:                                              ; preds = %185, %172
  %187 = getelementptr inbounds %struct.SearchResult, ptr %29, i32 0, i32 3
  %188 = load i32, ptr %187, align 4, !tbaa !17
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %201, label %190

190:                                              ; preds = %186
  %191 = getelementptr inbounds %struct.SearchResult, ptr %29, i32 0, i32 0
  %192 = load double, ptr %191, align 8, !tbaa !16
  %193 = getelementptr inbounds %struct.SearchResult, ptr %29, i32 0, i32 1
  %194 = load double, ptr %193, align 8, !tbaa !13
  %195 = load double, ptr %25, align 8, !tbaa !21
  %196 = call double @llvm.fmuladd.f64(double %192, double %194, double %195)
  store double %196, ptr %25, align 8, !tbaa !21
  %197 = getelementptr inbounds %struct.SearchResult, ptr %29, i32 0, i32 1
  %198 = load double, ptr %197, align 8, !tbaa !13
  %199 = load double, ptr %24, align 8, !tbaa !21
  %200 = fadd double %199, %198
  store double %200, ptr %24, align 8, !tbaa !21
  br label %201

201:                                              ; preds = %190, %186
  call void @llvm.lifetime.end.p0(i64 68, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #5
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %28, align 4, !tbaa !9
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %28, align 4, !tbaa !9
  br label %167, !llvm.loop !31

205:                                              ; preds = %171
  %206 = load double, ptr %24, align 8, !tbaa !21
  %207 = fcmp oeq double %206, 0.000000e+00
  br i1 %207, label %208, label %218

208:                                              ; preds = %205
  %209 = load i8, ptr %26, align 1, !tbaa !26, !range !32, !noundef !33
  %210 = trunc i8 %209 to i1
  br i1 %210, label %211, label %214

211:                                              ; preds = %208
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.SearchResult, ptr %212, i32 0, i32 3
  store i32 1, ptr %213, align 4, !tbaa !17
  br label %217

214:                                              ; preds = %208
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.SearchResult, ptr %215, i32 0, i32 3
  store i32 3, ptr %216, align 4, !tbaa !17
  br label %217

217:                                              ; preds = %214, %211
  store i32 4, ptr %16, align 4
  br label %245

218:                                              ; preds = %205
  %219 = load double, ptr %24, align 8, !tbaa !21
  %220 = load double, ptr %25, align 8, !tbaa !21
  %221 = fdiv double %220, %219
  store double %221, ptr %25, align 8, !tbaa !21
  %222 = getelementptr inbounds %struct.Board, ptr %18, i32 0, i32 5
  %223 = load i32, ptr %22, align 4, !tbaa !9
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [1024 x i8], ptr %222, i64 0, i64 %224
  store i8 0, ptr %225, align 1, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %226 = load double, ptr %23, align 8, !tbaa !21
  %227 = fsub double 1.000000e+00, %226
  %228 = load double, ptr %25, align 8, !tbaa !21
  %229 = fsub double 1.000000e+00, %228
  %230 = fneg double %227
  %231 = call double @llvm.fmuladd.f64(double %230, double %229, double 1.000000e+00)
  store double %231, ptr %31, align 8, !tbaa !21
  %232 = load double, ptr %31, align 8, !tbaa !21
  %233 = load ptr, ptr %10, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.SearchResult, ptr %233, i32 0, i32 0
  %235 = load double, ptr %234, align 8, !tbaa !16
  %236 = fcmp olt double %232, %235
  br i1 %236, label %237, label %244

237:                                              ; preds = %218
  %238 = load double, ptr %31, align 8, !tbaa !21
  %239 = load ptr, ptr %10, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.SearchResult, ptr %239, i32 0, i32 0
  store double %238, ptr %240, align 8, !tbaa !16
  %241 = load i32, ptr %22, align 4, !tbaa !9
  %242 = load ptr, ptr %10, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.SearchResult, ptr %242, i32 0, i32 2
  store i32 %241, ptr %243, align 8, !tbaa !20
  br label %244

244:                                              ; preds = %237, %218
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  store i32 0, ptr %16, align 4
  br label %245

245:                                              ; preds = %244, %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %246

246:                                              ; preds = %245, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %247 = load i32, ptr %16, align 4
  switch i32 %247, label %252 [
    i32 0, label %248
  ]

248:                                              ; preds = %246
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %21, align 4, !tbaa !9
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %21, align 4, !tbaa !9
  br label %140, !llvm.loop !34

252:                                              ; preds = %246, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %253

253:                                              ; preds = %252
  call void @llvm.lifetime.end.p0(i64 3088, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 3088, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 6164, ptr %18) #5
  store i32 0, ptr %16, align 4
  br label %254

254:                                              ; preds = %253, %131, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 1536, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 768, ptr %13) #5
  %255 = load i32, ptr %16, align 4
  switch i32 %255, label %257 [
    i32 0, label %256
    i32 1, label %256
  ]

256:                                              ; preds = %254, %254, %66, %58, %37
  ret void

257:                                              ; preds = %254
  unreachable
}

declare i32 @get_pmap(ptr noundef, ptr noundef, ptr noundef) #2

declare void @get_lowest_probability(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @get_best_evaluations(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i32 @get_adjacent_unknown_c(ptr noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 0}
!12 = !{!"SolverSearchState", !10, i64 0, !7, i64 4, !7, i64 36}
!13 = !{!14, !15, i64 8}
!14 = !{!"SearchResult", !15, i64 0, !15, i64 8, !10, i64 16, !10, i64 20}
!15 = !{!"double", !7, i64 0}
!16 = !{!14, !15, i64 0}
!17 = !{!14, !10, i64 20}
!18 = !{!19, !15, i64 0}
!19 = !{!"ProbabilityMap", !15, i64 0, !7, i64 8, !7, i64 1544, !15, i64 3080}
!20 = !{!14, !10, i64 16}
!21 = !{!15, !15, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4096, !25, i64 4112, i64 1024, !25, i64 5136, i64 1024, !25, i64 6160, i64 1, !26}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"_Bool", !7, i64 0}
!28 = !{!29, !10, i64 12}
!29 = !{!"Board", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !7, i64 16, !7, i64 4112, !7, i64 5136, !27, i64 6160}
!30 = !{i64 0, i64 4, !9, i64 4, i64 32, !25, i64 36, i64 32, !25}
!31 = distinct !{!31, !23}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = distinct !{!34, !23}


; 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.Board = type { i32, i32, i32, i32, [1024 x i32], [1024 x i8], [1024 x i8], i8 }
%struct.Edge = type { [192 x i32], i32, [192 x i32], [192 x i32], i32, i32, [192 x i32], i32 }
%struct.ProbabilityMap = type { double, [192 x double], [192 x double], double }
%struct.SearchResult = type { double, double, i32, i32 }
%struct.SolverSearchState = type { i32, [8 x i32], [8 x i32] }

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @tree_search(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  %7 = alloca [192 x i32], align 16
  %8 = alloca [192 x double], align 16
  %9 = alloca %struct.Board, align 4
  %10 = alloca %struct.Edge, align 4
  %11 = alloca %struct.ProbabilityMap, align 8
  %12 = alloca %struct.SearchResult, align 8
  %13 = alloca %struct.SolverSearchState, align 4
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %.not = icmp slt i32 %14, %2
  br i1 %.not, label %16, label %15

15:                                               ; preds = %6
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %3, align 8, !tbaa !10
  br label %94

16:                                               ; preds = %6
  %17 = tail call i32 @get_pmap(ptr noundef %0, ptr noundef %4, ptr noundef %5) #5
  %18 = getelementptr inbounds i8, ptr %3, i64 20
  store i32 %17, ptr %18, align 4, !tbaa !12
  %19 = load double, ptr %5, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  store double %19, ptr %20, align 8, !tbaa !16
  %.not86 = icmp eq i32 %17, 0
  br i1 %.not86, label %21, label %94

21:                                               ; preds = %16
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = sub nsw i32 %2, %22
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %27

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %3, i64 16
  tail call void @get_lowest_probability(ptr noundef %0, ptr noundef %4, ptr noundef nonnull %5, ptr noundef nonnull %3, ptr noundef nonnull %26) #5
  br label %94

27:                                               ; preds = %21
  store double 1.000000e+00, ptr %3, align 8, !tbaa !17
  %28 = getelementptr inbounds i8, ptr %3, i64 16
  store i32 -1, ptr %28, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 768, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 1536, ptr nonnull %8) #5
  %29 = call i32 @get_best_evaluations(ptr noundef %0, ptr noundef %4, ptr noundef nonnull %5, ptr noundef nonnull %7, ptr noundef nonnull %8) #5
  %30 = load double, ptr %8, align 16, !tbaa !10
  %31 = fcmp oeq double %30, 0.000000e+00
  br i1 %31, label %32, label %.critedge

32:                                               ; preds = %27
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %36, label %.preheader

.preheader:                                       ; preds = %32
  %35 = icmp sgt i32 %29, 0
  br i1 %35, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %29 to i64
  br label %.lr.ph

36:                                               ; preds = %32
  store double 0.000000e+00, ptr %3, align 8, !tbaa !17
  %37 = load i32, ptr %7, align 16, !tbaa !19
  store i32 %37, ptr %28, align 8, !tbaa !18
  br label %93

.lr.ph:                                           ; preds = %.lr.ph.preheader, %41
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %41 ]
  %38 = getelementptr inbounds [192 x double], ptr %8, i64 0, i64 %indvars.iv
  %39 = load double, ptr %38, align 8, !tbaa !10
  %40 = fcmp une double %39, 0.000000e+00
  br i1 %40, label %._crit_edge.loopexit.split.loop.exit, label %41

41:                                               ; preds = %.lr.ph
  %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 %.lr.ph, !llvm.loop !20

._crit_edge.loopexit.split.loop.exit:             ; preds = %.lr.ph
  %42 = trunc nuw nsw i64 %indvars.iv to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %41, %._crit_edge.loopexit.split.loop.exit, %.preheader
  %.081.lcssa = phi i32 [ 0, %.preheader ], [ %42, %._crit_edge.loopexit.split.loop.exit ], [ %29, %41 ]
  %43 = sub nsw i32 %2, %33
  %.not87 = icmp eq i32 %.081.lcssa, %43
  br i1 %.not87, label %47, label %.critedge.thread

.critedge.thread:                                 ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 6164, ptr nonnull %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(6164) %9, ptr noundef nonnull align 4 dereferenceable(6164) %0, i64 6164, i1 false), !tbaa.struct !22
  %44 = getelementptr inbounds i8, ptr %9, i64 12
  %45 = load i32, ptr %44, align 4, !tbaa !26
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %44, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 3088, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 3088, ptr nonnull %11) #5
  br label %.lr.ph107

47:                                               ; preds = %._crit_edge
  store double 0.000000e+00, ptr %3, align 8, !tbaa !17
  %48 = load i32, ptr %7, align 16, !tbaa !19
  store i32 %48, ptr %28, align 8, !tbaa !18
  br label %93

.critedge:                                        ; preds = %27
  call void @llvm.lifetime.start.p0(i64 6164, ptr nonnull %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(6164) %9, ptr noundef nonnull align 4 dereferenceable(6164) %0, i64 6164, i1 false), !tbaa.struct !22
  %49 = getelementptr inbounds i8, ptr %9, i64 12
  %50 = load i32, ptr %49, align 4, !tbaa !26
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %49, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 3088, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 3088, ptr nonnull %11) #5
  %52 = icmp sgt i32 %29, 0
  br i1 %52, label %.lr.ph107, label %.loopexit

.lr.ph107:                                        ; preds = %.critedge.thread, %.critedge
  %.0117 = phi i32 [ 1, %.critedge.thread ], [ %29, %.critedge ]
  %53 = getelementptr inbounds i8, ptr %9, i64 4112
  %54 = getelementptr inbounds i8, ptr %9, i64 16
  %55 = getelementptr inbounds i8, ptr %12, i64 20
  %56 = getelementptr inbounds i8, ptr %12, i64 8
  %wide.trip.count114 = zext nneg i32 %.0117 to i64
  %.pre = load double, ptr %3, align 8, !tbaa !17
  br label %57

57:                                               ; preds = %.lr.ph107, %91
  %58 = phi double [ %.pre, %.lr.ph107 ], [ %92, %91 ]
  %indvars.iv111 = phi i64 [ 0, %.lr.ph107 ], [ %indvars.iv.next112, %91 ]
  %59 = getelementptr inbounds [192 x i32], ptr %7, i64 0, i64 %indvars.iv111
  %60 = load i32, ptr %59, align 4, !tbaa !19
  %61 = getelementptr inbounds [192 x double], ptr %8, i64 0, i64 %indvars.iv111
  %62 = load double, ptr %61, align 8, !tbaa !10
  %63 = fcmp ult double %62, %58
  br i1 %63, label %64, label %.loopexit

64:                                               ; preds = %57
  %65 = sext i32 %60 to i64
  %66 = getelementptr inbounds [1024 x i8], ptr %53, i64 0, i64 %65
  store i8 1, ptr %66, align 1, !tbaa !24
  %67 = call i32 @get_adjacent_unknown_c(ptr noundef nonnull %9, i32 noundef %60) #5
  %.not8895 = icmp slt i32 %67, 0
  br i1 %.not8895, label %.thread, label %.lr.ph101

.lr.ph101:                                        ; preds = %64
  %68 = getelementptr inbounds [1024 x i32], ptr %54, i64 0, i64 %65
  br label %70

._crit_edge102:                                   ; preds = %78
  %69 = fcmp oeq double %.180, 0.000000e+00
  br i1 %69, label %80, label %82

70:                                               ; preds = %.lr.ph101, %78
  %.07399 = phi i32 [ 0, %.lr.ph101 ], [ %79, %78 ]
  %.07598 = phi i1 [ false, %.lr.ph101 ], [ %spec.select, %78 ]
  %.07797 = phi double [ 0.000000e+00, %.lr.ph101 ], [ %.178, %78 ]
  %.07996 = phi double [ 0.000000e+00, %.lr.ph101 ], [ %.180, %78 ]
  store i32 %.07399, ptr %68, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 68, ptr nonnull %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(68) %13, ptr noundef nonnull align 4 dereferenceable(68) %1, i64 68, i1 false), !tbaa.struct !28
  call void @state_add_position(ptr noundef nonnull %13, i32 noundef %60, i32 noundef %.07399)
  call void @tree_search(ptr noundef nonnull %9, ptr noundef nonnull %13, i32 noundef %2, ptr noundef nonnull %12, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %71 = load i32, ptr %55, align 4, !tbaa !12
  %.fr127 = freeze i32 %71
  %72 = icmp eq i32 %.fr127, 1
  %spec.select = select i1 %72, i1 true, i1 %.07598
  %.not89 = icmp eq i32 %.fr127, 0
  br i1 %.not89, label %73, label %78

73:                                               ; preds = %70
  %74 = load double, ptr %12, align 8, !tbaa !17
  %75 = load double, ptr %56, align 8, !tbaa !16
  %76 = call double @llvm.fmuladd.f64(double %74, double %75, double %.07797)
  %77 = fadd double %.07996, %75
  br label %78

78:                                               ; preds = %73, %70
  %.180 = phi double [ %.07996, %70 ], [ %77, %73 ]
  %.178 = phi double [ %.07797, %70 ], [ %76, %73 ]
  call void @llvm.lifetime.end.p0(i64 68, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  %79 = add nuw i32 %.07399, 1
  %exitcond110.not = icmp eq i32 %.07399, %67
  br i1 %exitcond110.not, label %._crit_edge102, label %70, !llvm.loop !29

80:                                               ; preds = %._crit_edge102
  %spec.select126 = select i1 %spec.select, i32 1, i32 3
  br label %.thread

.thread:                                          ; preds = %64, %80
  %81 = phi i32 [ %spec.select126, %80 ], [ 3, %64 ]
  store i32 %81, ptr %18, align 4, !tbaa !12
  br label %.loopexit

82:                                               ; preds = %._crit_edge102
  %83 = fdiv double %.178, %.180
  store i8 0, ptr %66, align 1, !tbaa !24
  %84 = fsub double 1.000000e+00, %62
  %85 = fsub double 1.000000e+00, %83
  %86 = fneg double %84
  %87 = call double @llvm.fmuladd.f64(double %86, double %85, double 1.000000e+00)
  %88 = load double, ptr %3, align 8, !tbaa !17
  %89 = fcmp olt double %87, %88
  br i1 %89, label %90, label %91

90:                                               ; preds = %82
  store double %87, ptr %3, align 8, !tbaa !17
  store i32 %60, ptr %28, align 8, !tbaa !18
  br label %91

91:                                               ; preds = %90, %82
  %92 = phi double [ %87, %90 ], [ %88, %82 ]
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
  br i1 %exitcond115.not, label %.loopexit, label %57, !llvm.loop !30

.loopexit:                                        ; preds = %91, %57, %.critedge, %.thread
  call void @llvm.lifetime.end.p0(i64 3088, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 3088, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 6164, ptr nonnull %9) #5
  br label %93

93:                                               ; preds = %47, %.loopexit, %36
  call void @llvm.lifetime.end.p0(i64 1536, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 768, ptr nonnull %7) #5
  br label %94

94:                                               ; preds = %16, %93, %25, %15
  ret void
}

declare i32 @get_pmap(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @get_lowest_probability(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @get_best_evaluations(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i32 @get_adjacent_unknown_c(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"SolverSearchState", !7, i64 0, !8, i64 4, !8, i64 36}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!13, !7, i64 20}
!13 = !{!"SearchResult", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 20}
!14 = !{!15, !11, i64 0}
!15 = !{!"ProbabilityMap", !11, i64 0, !8, i64 8, !8, i64 1544, !11, i64 3080}
!16 = !{!13, !11, i64 8}
!17 = !{!13, !11, i64 0}
!18 = !{!13, !7, i64 16}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{i64 0, i64 4, !19, i64 4, i64 4, !19, i64 8, i64 4, !19, i64 12, i64 4, !19, i64 16, i64 4096, !23, i64 4112, i64 1024, !23, i64 5136, i64 1024, !23, i64 6160, i64 1, !24}
!23 = !{!8, !8, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"_Bool", !8, i64 0}
!26 = !{!27, !7, i64 12}
!27 = !{!"Board", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !8, i64 16, !8, i64 4112, !8, i64 5136, !25, i64 6160}
!28 = !{i64 0, i64 4, !19, i64 4, i64 32, !23, i64 36, i64 32, !23}
!29 = distinct !{!29, !21}
!30 = distinct !{!30, !21}


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