; LLVM IR from csviragh/robotsim :: src/utilities (arenas)

; 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.phase_t = type { ptr, ptr, ptr, ptr, i32, i32 }
%struct.arena_t = type { i32, [32 x i8], [128 x [3 x double]], i32 }

@Shill_Wall.GoalPositionVect = external hidden global [3 x double], align 16
@Shill_Wall.FromGoal = external hidden global [3 x double], align 16
@Shill_Wall.ToArena = external hidden global [3 x double], align 16
@Shill_Wall.ToArenaLength = external hidden global double, align 8

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

; 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 i32 @NearestArenaPoint(ptr noundef, ptr noundef, ptr noundef, double noundef, double noundef, double noundef) #1

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

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

declare void @MultiplicateWithScalar(ptr noundef, ptr noundef, double noundef, i32 noundef) #2

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

declare double @VectAbsXY(ptr noundef) #2

declare void @FillVect(ptr noundef, double noundef, double noundef, double noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @Shill_Wall(ptr noundef %0, ptr noundef %1, double noundef %2, double noundef %3, double noundef %4, ptr noundef %5, double noundef %6, double noundef %7, double noundef %8, double noundef %9, i32 noundef %10, i32 noundef %11) #1 {
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store double %2, ptr %15, align 8, !tbaa !9
  store double %3, ptr %16, align 8, !tbaa !9
  store double %4, ptr %17, align 8, !tbaa !9
  store ptr %5, ptr %18, align 8, !tbaa !5
  store double %6, ptr %19, align 8, !tbaa !9
  store double %7, ptr %20, align 8, !tbaa !9
  store double %8, ptr %21, align 8, !tbaa !9
  store double %9, ptr %22, align 8, !tbaa !9
  store i32 %10, ptr %23, align 4, !tbaa !11
  store i32 %11, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store double 1.000000e-02, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %29 = load ptr, ptr %14, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.phase_t, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = load i32, ptr %23, align 4, !tbaa !11
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds ptr, ptr %31, i64 %33
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  store ptr %35, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.phase_t, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = load i32, ptr %23, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %38, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  store ptr %42, ptr %27, align 8, !tbaa !5
  %43 = load double, ptr %15, align 8, !tbaa !9
  %44 = load double, ptr %16, align 8, !tbaa !9
  call void @FillVect(ptr noundef @Shill_Wall.GoalPositionVect, double noundef %43, double noundef %44, double noundef 0.000000e+00)
  %45 = load ptr, ptr %26, align 8, !tbaa !5
  call void @VectDifference(ptr noundef @Shill_Wall.FromGoal, ptr noundef @Shill_Wall.GoalPositionVect, ptr noundef %45)
  %46 = load i32, ptr %24, align 4, !tbaa !11
  %47 = sitofp i32 %46 to double
  %48 = fcmp oeq double 2.000000e+00, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %12
  store double 0.000000e+00, ptr getelementptr inbounds ([3 x double], ptr @Shill_Wall.FromGoal, i64 0, i64 2), align 16, !tbaa !9
  br label %50

50:                                               ; preds = %49, %12
  %51 = load ptr, ptr %18, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.arena_t, ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !16
  %54 = icmp eq i32 %53, 1
  br i1 %54, label %55, label %111

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %56

56:                                               ; preds = %107, %55
  %57 = load i32, ptr %28, align 4, !tbaa !11
  %58 = load i32, ptr %24, align 4, !tbaa !11
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %110

60:                                               ; preds = %56
  call void @NullVect(ptr noundef @Shill_Wall.ToArena, i32 noundef 3)
  %61 = load i32, ptr %28, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [3 x double], ptr @Shill_Wall.FromGoal, i64 0, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !9
  %65 = load i32, ptr %28, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [3 x double], ptr @Shill_Wall.ToArena, i64 0, i64 %66
  store double %64, ptr %67, align 8, !tbaa !9
  call void @UnitVect(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena)
  %68 = load double, ptr %20, align 8, !tbaa !9
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %68, i32 noundef 3)
  %69 = load ptr, ptr %27, align 8, !tbaa !5
  call void @VectDifference(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, ptr noundef %69)
  %70 = load double, ptr %21, align 8, !tbaa !9
  %71 = call double @llvm.fabs.f64(double %70)
  %72 = fcmp ogt double %71, 0x3D719799812DEA11
  br i1 %72, label %73, label %91

73:                                               ; preds = %60
  %74 = load i32, ptr %24, align 4, !tbaa !11
  %75 = sitofp i32 %74 to double
  %76 = fcmp oeq double 2.000000e+00, %75
  br i1 %76, label %77, label %79

77:                                               ; preds = %73
  %78 = call double @VectAbsXY(ptr noundef @Shill_Wall.ToArena)
  store double %78, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  br label %81

79:                                               ; preds = %73
  %80 = call double @VectAbs(ptr noundef @Shill_Wall.ToArena)
  store double %80, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %79, %77
  %82 = load double, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  %83 = fcmp ogt double %82, 0.000000e+00
  br i1 %83, label %84, label %90

84:                                               ; preds = %81
  %85 = load double, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  %86 = fmul double 1.000000e-02, %85
  %87 = load double, ptr %21, align 8, !tbaa !9
  %88 = call double @pow(double noundef %86, double noundef %87) #5
  %89 = load i32, ptr %24, align 4, !tbaa !11
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %88, i32 noundef %89)
  br label %90

90:                                               ; preds = %84, %81
  br label %91

91:                                               ; preds = %90, %60
  %92 = load double, ptr %19, align 8, !tbaa !9
  %93 = load i32, ptr %28, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3 x double], ptr @Shill_Wall.FromGoal, i64 0, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = call double @llvm.fabs.f64(double %96)
  %98 = load double, ptr %22, align 8, !tbaa !9
  %99 = fdiv double 1.000000e+00, %98
  %100 = load double, ptr %17, align 8, !tbaa !9
  %101 = call double @SigmoidLin(double noundef %97, double noundef %99, double noundef 1.000000e+00, double noundef %100)
  %102 = fsub double 1.000000e+00, %101
  %103 = fmul double %92, %102
  %104 = load i32, ptr %24, align 4, !tbaa !11
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %103, i32 noundef %104)
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  call void @VectSum(ptr noundef %105, ptr noundef @Shill_Wall.ToArena, ptr noundef %106)
  br label %107

107:                                              ; preds = %91
  %108 = load i32, ptr %28, align 4, !tbaa !11
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %28, align 4, !tbaa !11
  br label %56, !llvm.loop !18

110:                                              ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %189

111:                                              ; preds = %50
  %112 = load ptr, ptr %18, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.arena_t, ptr %112, i32 0, i32 0
  %114 = load i32, ptr %113, align 8, !tbaa !16
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %152

116:                                              ; preds = %111
  call void @UnitVect(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.FromGoal)
  %117 = load double, ptr %20, align 8, !tbaa !9
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %117, i32 noundef 3)
  %118 = load ptr, ptr %27, align 8, !tbaa !5
  call void @VectDifference(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, ptr noundef %118)
  %119 = load double, ptr %21, align 8, !tbaa !9
  %120 = call double @llvm.fabs.f64(double %119)
  %121 = fcmp ogt double %120, 0x3D719799812DEA11
  br i1 %121, label %122, label %140

122:                                              ; preds = %116
  %123 = load i32, ptr %24, align 4, !tbaa !11
  %124 = sitofp i32 %123 to double
  %125 = fcmp oeq double 2.000000e+00, %124
  br i1 %125, label %126, label %128

126:                                              ; preds = %122
  %127 = call double @VectAbsXY(ptr noundef @Shill_Wall.ToArena)
  store double %127, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  br label %130

128:                                              ; preds = %122
  %129 = call double @VectAbs(ptr noundef @Shill_Wall.ToArena)
  store double %129, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  br label %130

130:                                              ; preds = %128, %126
  %131 = load double, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  %132 = fcmp ogt double %131, 0.000000e+00
  br i1 %132, label %133, label %139

133:                                              ; preds = %130
  %134 = load double, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  %135 = fmul double 1.000000e-02, %134
  %136 = load double, ptr %21, align 8, !tbaa !9
  %137 = call double @pow(double noundef %135, double noundef %136) #5
  %138 = load i32, ptr %24, align 4, !tbaa !11
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %137, i32 noundef %138)
  br label %139

139:                                              ; preds = %133, %130
  br label %140

140:                                              ; preds = %139, %116
  %141 = load double, ptr %19, align 8, !tbaa !9
  %142 = call double @VectAbs(ptr noundef @Shill_Wall.FromGoal)
  %143 = load double, ptr %22, align 8, !tbaa !9
  %144 = fdiv double 1.000000e+00, %143
  %145 = load double, ptr %17, align 8, !tbaa !9
  %146 = call double @SigmoidLin(double noundef %142, double noundef %144, double noundef 1.000000e+00, double noundef %145)
  %147 = fsub double 1.000000e+00, %146
  %148 = fmul double %141, %147
  %149 = load i32, ptr %24, align 4, !tbaa !11
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %148, i32 noundef %149)
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  call void @VectSum(ptr noundef %150, ptr noundef @Shill_Wall.ToArena, ptr noundef %151)
  br label %188

152:                                              ; preds = %111
  %153 = load ptr, ptr %26, align 8, !tbaa !5
  %154 = load ptr, ptr %18, align 8, !tbaa !5
  %155 = load double, ptr %17, align 8, !tbaa !9
  %156 = load double, ptr %15, align 8, !tbaa !9
  %157 = load double, ptr %16, align 8, !tbaa !9
  %158 = call i32 @NearestArenaPoint(ptr noundef @Shill_Wall.ToArena, ptr noundef %153, ptr noundef %154, double noundef %155, double noundef %156, double noundef %157)
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %160, label %185

160:                                              ; preds = %152
  %161 = load ptr, ptr %26, align 8, !tbaa !5
  call void @VectDifference(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, ptr noundef %161)
  %162 = call double @VectAbsXY(ptr noundef @Shill_Wall.ToArena)
  store double %162, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  call void @UnitVect(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena)
  %163 = load double, ptr %20, align 8, !tbaa !9
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %163, i32 noundef 2)
  %164 = load ptr, ptr %27, align 8, !tbaa !5
  call void @VectDifference(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, ptr noundef %164)
  %165 = load double, ptr %21, align 8, !tbaa !9
  %166 = call double @llvm.fabs.f64(double %165)
  %167 = fcmp ogt double %166, 0x3D719799812DEA11
  br i1 %167, label %168, label %173

168:                                              ; preds = %160
  %169 = call double @VectAbsXY(ptr noundef @Shill_Wall.ToArena)
  %170 = fmul double 1.000000e-02, %169
  %171 = load double, ptr %21, align 8, !tbaa !9
  %172 = call double @pow(double noundef %170, double noundef %171) #5
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %172, i32 noundef 2)
  br label %173

173:                                              ; preds = %168, %160
  %174 = load double, ptr %19, align 8, !tbaa !9
  %175 = load double, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !9
  %176 = load double, ptr %22, align 8, !tbaa !9
  %177 = fdiv double 1.000000e+00, %176
  %178 = call double @SigmoidLin(double noundef %175, double noundef %177, double noundef 1.000000e+00, double noundef 0.000000e+00)
  %179 = fsub double 1.000000e+00, %178
  %180 = fmul double %174, %179
  call void @MultiplicateWithScalar(ptr noundef @Shill_Wall.ToArena, ptr noundef @Shill_Wall.ToArena, double noundef %180, i32 noundef 2)
  %181 = load ptr, ptr %13, align 8, !tbaa !5
  %182 = load ptr, ptr %13, align 8, !tbaa !5
  call void @VectSum(ptr noundef %181, ptr noundef @Shill_Wall.ToArena, ptr noundef %182)
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  %184 = getelementptr inbounds double, ptr %183, i64 2
  store double 0.000000e+00, ptr %184, align 8, !tbaa !9
  br label %187

185:                                              ; preds = %152
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  call void @NullVect(ptr noundef %186, i32 noundef 3)
  br label %187

187:                                              ; preds = %185, %173
  br label %188

188:                                              ; preds = %187, %140
  br label %189

189:                                              ; preds = %188, %110
  %190 = load i32, ptr %24, align 4, !tbaa !11
  %191 = sitofp i32 %190 to double
  %192 = fcmp oeq double 2.000000e+00, %191
  br i1 %192, label %193, label %196

193:                                              ; preds = %189
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  %195 = getelementptr inbounds double, ptr %194, i64 2
  store double 0.000000e+00, ptr %195, align 8, !tbaa !9
  br label %196

196:                                              ; preds = %193, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  ret void
}

declare void @NullVect(ptr noundef, i32 noundef) #2

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

declare double @VectAbs(ptr noundef) #2

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #4

declare double @SigmoidLin(double noundef, double noundef, double noundef, double noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 nosync nounwind speculatable willreturn memory(none) }
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 }

!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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !12, i64 36}
!15 = !{!14, !6, i64 8}
!16 = !{!17, !12, i64 0}
!17 = !{!"", !12, i64 0, !7, i64 4, !7, i64 40, !12, i64 3112}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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

@Shill_Wall.GoalPositionVect = external hidden global [3 x double], align 16
@Shill_Wall.FromGoal = external hidden global [3 x double], align 16
@Shill_Wall.ToArena = external hidden global [3 x double], align 16
@Shill_Wall.ToArenaLength = external hidden local_unnamed_addr global double, align 8

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

declare void @VectDifference(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @UnitVect(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @MultiplicateWithScalar(ptr noundef, ptr noundef, double noundef, i32 noundef) local_unnamed_addr #1

declare void @VectSum(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare double @VectAbsXY(ptr noundef) local_unnamed_addr #1

declare void @FillVect(ptr noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @Shill_Wall(ptr noundef %0, ptr nocapture noundef readonly %1, double noundef %2, double noundef %3, double noundef %4, ptr noundef %5, double noundef %6, double noundef %7, double noundef %8, double noundef %9, i32 noundef %10, i32 noundef %11) local_unnamed_addr #0 {
  %13 = load ptr, ptr %1, align 8, !tbaa !5
  %14 = sext i32 %10 to i64
  %15 = getelementptr inbounds ptr, ptr %13, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %1, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %19 = getelementptr inbounds ptr, ptr %18, i64 %14
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  tail call void @FillVect(ptr noundef nonnull @Shill_Wall.GoalPositionVect, double noundef %2, double noundef %3, double noundef 0.000000e+00) #4
  tail call void @VectDifference(ptr noundef nonnull @Shill_Wall.FromGoal, ptr noundef nonnull @Shill_Wall.GoalPositionVect, ptr noundef %16) #4
  %21 = icmp eq i32 %11, 2
  br i1 %21, label %22, label %23

22:                                               ; preds = %12
  store double 0.000000e+00, ptr getelementptr inbounds (i8, ptr @Shill_Wall.FromGoal, i64 16), align 16, !tbaa !13
  br label %23

23:                                               ; preds = %22, %12
  %24 = load i32, ptr %5, align 8, !tbaa !15
  switch i32 %24, label %74 [
    i32 1, label %.preheader
    i32 0, label %55
  ]

.preheader:                                       ; preds = %23
  %25 = icmp sgt i32 %11, 0
  br i1 %25, label %.lr.ph, label %.loopexit.thread

.lr.ph:                                           ; preds = %.preheader
  %26 = tail call double @llvm.fabs.f64(double %8)
  %27 = fcmp ogt double %26, 0x3D719799812DEA11
  %28 = fdiv double 1.000000e+00, %9
  %wide.trip.count68 = zext nneg i32 %11 to i64
  br i1 %27, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %41
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %41 ], [ 0, %.lr.ph ]
  tail call void @NullVect(ptr noundef nonnull @Shill_Wall.ToArena, i32 noundef 3) #4
  %29 = getelementptr inbounds [3 x double], ptr @Shill_Wall.FromGoal, i64 0, i64 %indvars.iv65
  %30 = load double, ptr %29, align 8, !tbaa !13
  %31 = getelementptr inbounds [3 x double], ptr @Shill_Wall.ToArena, i64 0, i64 %indvars.iv65
  store double %30, ptr %31, align 8, !tbaa !13
  tail call void @UnitVect(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena) #4
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %7, i32 noundef 3) #4
  tail call void @VectDifference(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %20) #4
  br i1 %21, label %34, label %32

32:                                               ; preds = %.lr.ph.split.us
  %33 = tail call double @VectAbs(ptr noundef nonnull @Shill_Wall.ToArena) #4
  br label %36

34:                                               ; preds = %.lr.ph.split.us
  %35 = tail call double @VectAbsXY(ptr noundef nonnull @Shill_Wall.ToArena) #4
  br label %36

36:                                               ; preds = %34, %32
  %storemerge61.us = phi double [ %33, %32 ], [ %35, %34 ]
  store double %storemerge61.us, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !13
  %37 = fcmp ogt double %storemerge61.us, 0.000000e+00
  br i1 %37, label %38, label %41

38:                                               ; preds = %36
  %39 = fmul double %storemerge61.us, 1.000000e-02
  %40 = tail call double @pow(double noundef %39, double noundef %8) #4
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %40, i32 noundef %11) #4
  br label %41

41:                                               ; preds = %38, %36
  %42 = load double, ptr %29, align 8, !tbaa !13
  %43 = tail call double @llvm.fabs.f64(double %42)
  %44 = tail call double @SigmoidLin(double noundef %43, double noundef %28, double noundef 1.000000e+00, double noundef %4) #4
  %45 = fsub double 1.000000e+00, %44
  %46 = fmul double %45, %6
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %46, i32 noundef %11) #4
  tail call void @VectSum(ptr noundef %0, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %0) #4
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count68
  br i1 %exitcond69.not, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !17

.lr.ph.split:                                     ; preds = %.lr.ph, %.lr.ph.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.split ], [ 0, %.lr.ph ]
  tail call void @NullVect(ptr noundef nonnull @Shill_Wall.ToArena, i32 noundef 3) #4
  %47 = getelementptr inbounds [3 x double], ptr @Shill_Wall.FromGoal, i64 0, i64 %indvars.iv
  %48 = load double, ptr %47, align 8, !tbaa !13
  %49 = getelementptr inbounds [3 x double], ptr @Shill_Wall.ToArena, i64 0, i64 %indvars.iv
  store double %48, ptr %49, align 8, !tbaa !13
  tail call void @UnitVect(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena) #4
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %7, i32 noundef 3) #4
  tail call void @VectDifference(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %20) #4
  %50 = load double, ptr %47, align 8, !tbaa !13
  %51 = tail call double @llvm.fabs.f64(double %50)
  %52 = tail call double @SigmoidLin(double noundef %51, double noundef %28, double noundef 1.000000e+00, double noundef %4) #4
  %53 = fsub double 1.000000e+00, %52
  %54 = fmul double %53, %6
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %54, i32 noundef %11) #4
  tail call void @VectSum(ptr noundef %0, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %0) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count68
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph.split, !llvm.loop !17

55:                                               ; preds = %23
  tail call void @UnitVect(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.FromGoal) #4
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %7, i32 noundef 3) #4
  tail call void @VectDifference(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %20) #4
  %56 = tail call double @llvm.fabs.f64(double %8)
  %57 = fcmp ogt double %56, 0x3D719799812DEA11
  br i1 %57, label %58, label %68

58:                                               ; preds = %55
  br i1 %21, label %59, label %61

59:                                               ; preds = %58
  %60 = tail call double @VectAbsXY(ptr noundef nonnull @Shill_Wall.ToArena) #4
  br label %63

61:                                               ; preds = %58
  %62 = tail call double @VectAbs(ptr noundef nonnull @Shill_Wall.ToArena) #4
  br label %63

63:                                               ; preds = %61, %59
  %storemerge = phi double [ %62, %61 ], [ %60, %59 ]
  store double %storemerge, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !13
  %64 = fcmp ogt double %storemerge, 0.000000e+00
  br i1 %64, label %65, label %68

65:                                               ; preds = %63
  %66 = fmul double %storemerge, 1.000000e-02
  %67 = tail call double @pow(double noundef %66, double noundef %8) #4
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %67, i32 noundef %11) #4
  br label %68

68:                                               ; preds = %63, %65, %55
  %69 = tail call double @VectAbs(ptr noundef nonnull @Shill_Wall.FromGoal) #4
  %70 = fdiv double 1.000000e+00, %9
  %71 = tail call double @SigmoidLin(double noundef %69, double noundef %70, double noundef 1.000000e+00, double noundef %4) #4
  %72 = fsub double 1.000000e+00, %71
  %73 = fmul double %72, %6
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %73, i32 noundef %11) #4
  tail call void @VectSum(ptr noundef %0, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %0) #4
  br label %.loopexit

74:                                               ; preds = %23
  %75 = tail call i32 @NearestArenaPoint(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %16, ptr noundef nonnull %5, double noundef %4, double noundef %2, double noundef %3)
  %.not = icmp eq i32 %75, 0
  br i1 %.not, label %91, label %76

76:                                               ; preds = %74
  tail call void @VectDifference(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %16) #4
  %77 = tail call double @VectAbsXY(ptr noundef nonnull @Shill_Wall.ToArena) #4
  store double %77, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !13
  tail call void @UnitVect(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena) #4
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %7, i32 noundef 2) #4
  tail call void @VectDifference(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %20) #4
  %78 = tail call double @llvm.fabs.f64(double %8)
  %79 = fcmp ogt double %78, 0x3D719799812DEA11
  br i1 %79, label %80, label %84

80:                                               ; preds = %76
  %81 = tail call double @VectAbsXY(ptr noundef nonnull @Shill_Wall.ToArena) #4
  %82 = fmul double %81, 1.000000e-02
  %83 = tail call double @pow(double noundef %82, double noundef %8) #4
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %83, i32 noundef 2) #4
  br label %84

84:                                               ; preds = %80, %76
  %85 = load double, ptr @Shill_Wall.ToArenaLength, align 8, !tbaa !13
  %86 = fdiv double 1.000000e+00, %9
  %87 = tail call double @SigmoidLin(double noundef %85, double noundef %86, double noundef 1.000000e+00, double noundef 0.000000e+00) #4
  %88 = fsub double 1.000000e+00, %87
  %89 = fmul double %88, %6
  tail call void @MultiplicateWithScalar(ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef nonnull @Shill_Wall.ToArena, double noundef %89, i32 noundef 2) #4
  tail call void @VectSum(ptr noundef %0, ptr noundef nonnull @Shill_Wall.ToArena, ptr noundef %0) #4
  %90 = getelementptr inbounds i8, ptr %0, i64 16
  store double 0.000000e+00, ptr %90, align 8, !tbaa !13
  br label %.loopexit

91:                                               ; preds = %74
  tail call void @NullVect(ptr noundef %0, i32 noundef 3) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.split, %41, %68, %91, %84
  br i1 %21, label %92, label %.loopexit.thread

92:                                               ; preds = %.loopexit
  %93 = getelementptr inbounds i8, ptr %0, i64 16
  store double 0.000000e+00, ptr %93, align 8, !tbaa !13
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %.preheader, %92, %.loopexit
  ret void
}

declare void @NullVect(ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare double @VectAbs(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3

declare double @SigmoidLin(double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

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 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "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 }

!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 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"", !10, i64 0, !8, i64 4, !8, i64 40, !10, i64 3112}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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