; LLVM IR from kylewray/nova :: src/pomdp/algorithms (pomdp_perseus_cpu)

; 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.nova::NovaPOMDPPerseusCPU" = type { ptr, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }
%"struct.nova::NovaPOMDP" = type { i32, i32, i32, i32, i32, i32, float, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4nova37pomdp_perseus_compute_b_dot_alpha_cpuEjPKiPKfjS3_Pf(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr 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: mustprogress nounwind uwtable
declare dso_local void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4nova29pomdp_perseus_update_step_cpuEjjjjjjfPKiPKfS3_S3_S1_S3_S3_jjPfPj(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

; 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) #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #7

; Function Attrs: mustprogress uwtable
define dso_local i32 @pomdp_perseus_update_cpu(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store ptr null, ptr %11, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = urem i32 %26, 2
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %46

29:                                               ; preds = %2
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %30, i32 0, i32 6
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  store ptr %32, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %33, i32 0, i32 7
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  store ptr %35, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %36, i32 0, i32 2
  store ptr %37, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %38, i32 0, i32 3
  store ptr %39, ptr %9, align 8, !tbaa !5
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %40, i32 0, i32 8
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  store ptr %42, ptr %10, align 8, !tbaa !5
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %43, i32 0, i32 9
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  store ptr %45, ptr %11, align 8, !tbaa !5
  br label %63

46:                                               ; preds = %2
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %47, i32 0, i32 7
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  store ptr %49, ptr %6, align 8, !tbaa !5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %50, i32 0, i32 6
  %52 = load ptr, ptr %51, align 8, !tbaa !12
  store ptr %52, ptr %7, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %53, i32 0, i32 3
  store ptr %54, ptr %8, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %55, i32 0, i32 2
  store ptr %56, ptr %9, align 8, !tbaa !5
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %57, i32 0, i32 9
  %59 = load ptr, ptr %58, align 8, !tbaa !15
  store ptr %59, ptr %10, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %60, i32 0, i32 8
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  store ptr %62, ptr %11, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %46, %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %64 = call i32 @rand() #8
  %65 = sitofp i32 %64 to float
  %66 = fdiv float %65, 0x41E0000000000000
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %67, i32 0, i32 4
  %69 = load i32, ptr %68, align 4, !tbaa !16
  %70 = uitofp i32 %69 to float
  %71 = fmul float %66, %70
  %72 = fptoui float %71 to i32
  store i32 %72, ptr %12, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %73, i32 0, i32 5
  %75 = load ptr, ptr %74, align 8, !tbaa !18
  %76 = load i32, ptr %12, align 4, !tbaa !17
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !17
  store i32 %79, ptr %13, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !19
  %83 = zext i32 %82 to i64
  %84 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %83, i64 4)
  %85 = extractvalue { i64, i1 } %84, 1
  %86 = extractvalue { i64, i1 } %84, 0
  %87 = select i1 %85, i64 -1, i64 %86
  %88 = call noalias noundef nonnull ptr @_Znam(i64 noundef %87) #9
  store ptr %88, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !17
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !19
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !22
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %95, i32 0, i32 2
  %97 = load i32, ptr %96, align 8, !tbaa !23
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %98, i32 0, i32 3
  %100 = load i32, ptr %99, align 4, !tbaa !24
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %101, i32 0, i32 4
  %103 = load i32, ptr %102, align 8, !tbaa !25
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %104, i32 0, i32 5
  %106 = load i32, ptr %105, align 4, !tbaa !26
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %107, i32 0, i32 6
  %109 = load float, ptr %108, align 8, !tbaa !27
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %110, i32 0, i32 8
  %112 = load ptr, ptr %111, align 8, !tbaa !28
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %113, i32 0, i32 9
  %115 = load ptr, ptr %114, align 8, !tbaa !29
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %116, i32 0, i32 10
  %118 = load ptr, ptr %117, align 8, !tbaa !30
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %119, i32 0, i32 11
  %121 = load ptr, ptr %120, align 8, !tbaa !31
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %122, i32 0, i32 12
  %124 = load ptr, ptr %123, align 8, !tbaa !32
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %125, i32 0, i32 13
  %127 = load ptr, ptr %126, align 8, !tbaa !33
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = load i32, ptr %129, align 4, !tbaa !17
  %131 = load i32, ptr %13, align 4, !tbaa !17
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN4nova29pomdp_perseus_update_step_cpuEjjjjjjfPKiPKfS3_S3_S1_S3_S3_jjPfPj(i32 noundef %91, i32 noundef %94, i32 noundef %97, i32 noundef %100, i32 noundef %103, i32 noundef %106, float noundef %109, ptr noundef %112, ptr noundef %115, ptr noundef %118, ptr noundef %121, ptr noundef %124, ptr noundef %127, ptr noundef %128, i32 noundef %130, i32 noundef %131, ptr noundef %132, ptr noundef %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store float 0.000000e+00, ptr %16, align 4, !tbaa !34
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %133, i32 0, i32 5
  %135 = load i32, ptr %134, align 4, !tbaa !26
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %136, i32 0, i32 12
  %138 = load ptr, ptr %137, align 8, !tbaa !32
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %139, i32 0, i32 13
  %141 = load ptr, ptr %140, align 8, !tbaa !33
  %142 = load i32, ptr %13, align 4, !tbaa !17
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN4nova37pomdp_perseus_compute_b_dot_alpha_cpuEjPKiPKfjS3_Pf(i32 noundef %135, ptr noundef %138, ptr noundef %141, i32 noundef %142, ptr noundef %143, ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store float 0.000000e+00, ptr %17, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !17
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 8, !tbaa !19
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %147, i32 0, i32 5
  %149 = load i32, ptr %148, align 4, !tbaa !26
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %150, i32 0, i32 12
  %152 = load ptr, ptr %151, align 8, !tbaa !32
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %153, i32 0, i32 13
  %155 = load ptr, ptr %154, align 8, !tbaa !33
  %156 = load i32, ptr %13, align 4, !tbaa !17
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = load i32, ptr %158, align 4, !tbaa !17
  call void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef %146, i32 noundef %149, ptr noundef %152, ptr noundef %155, i32 noundef %156, ptr noundef %157, i32 noundef %159, ptr noundef %17, ptr noundef %18)
  %160 = load float, ptr %16, align 4, !tbaa !34
  %161 = load float, ptr %17, align 4, !tbaa !34
  %162 = fcmp oge float %160, %161
  br i1 %162, label %163, label %185

163:                                              ; preds = %63
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = load i32, ptr %165, align 4, !tbaa !17
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %167, i32 0, i32 0
  %169 = load i32, ptr %168, align 8, !tbaa !19
  %170 = mul i32 %166, %169
  %171 = zext i32 %170 to i64
  %172 = getelementptr inbounds float, ptr %164, i64 %171
  %173 = load ptr, ptr %14, align 8, !tbaa !5
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 8, !tbaa !19
  %177 = zext i32 %176 to i64
  %178 = mul i64 %177, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %172, ptr align 4 %173, i64 %178, i1 false)
  %179 = load i32, ptr %15, align 4, !tbaa !17
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = load i32, ptr %181, align 4, !tbaa !17
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds i32, ptr %180, i64 %183
  store i32 %179, ptr %184, align 4, !tbaa !17
  br label %218

185:                                              ; preds = %63
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = load i32, ptr %187, align 4, !tbaa !17
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %189, i32 0, i32 0
  %191 = load i32, ptr %190, align 8, !tbaa !19
  %192 = mul i32 %188, %191
  %193 = zext i32 %192 to i64
  %194 = getelementptr inbounds float, ptr %186, i64 %193
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = load i32, ptr %18, align 4, !tbaa !17
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %197, i32 0, i32 0
  %199 = load i32, ptr %198, align 8, !tbaa !19
  %200 = mul i32 %196, %199
  %201 = zext i32 %200 to i64
  %202 = getelementptr inbounds float, ptr %195, i64 %201
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %203, i32 0, i32 0
  %205 = load i32, ptr %204, align 8, !tbaa !19
  %206 = zext i32 %205 to i64
  %207 = mul i64 %206, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %194, ptr align 4 %202, i64 %207, i1 false)
  %208 = load ptr, ptr %10, align 8, !tbaa !5
  %209 = load i32, ptr %18, align 4, !tbaa !17
  %210 = zext i32 %209 to i64
  %211 = getelementptr inbounds i32, ptr %208, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !17
  %213 = load ptr, ptr %11, align 8, !tbaa !5
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = load i32, ptr %214, align 4, !tbaa !17
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds i32, ptr %213, i64 %216
  store i32 %212, ptr %217, align 4, !tbaa !17
  br label %218

218:                                              ; preds = %185, %163
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = load i32, ptr %219, align 4, !tbaa !17
  %221 = add i32 %220, 1
  store i32 %221, ptr %219, align 4, !tbaa !17
  %222 = load ptr, ptr %14, align 8, !tbaa !5
  %223 = icmp eq ptr %222, null
  br i1 %223, label %225, label %224

224:                                              ; preds = %218
  call void @_ZdaPv(ptr noundef %222) #10
  br label %225

225:                                              ; preds = %224, %218
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = load i32, ptr %226, align 4, !tbaa !17
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %228, i32 0, i32 4
  %230 = load i32, ptr %229, align 8, !tbaa !25
  %231 = icmp ugt i32 %227, %230
  br i1 %231, label %232, label %235

232:                                              ; preds = %225
  %233 = load ptr, ptr @stderr, align 8, !tbaa !5
  %234 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %233, ptr noundef @.str.2, ptr noundef @.str.3) #8
  store i32 11, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %335

235:                                              ; preds = %225
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  %237 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %236, i32 0, i32 4
  store i32 0, ptr %237, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !17
  br label %238

238:                                              ; preds = %296, %235
  %239 = load i32, ptr %20, align 4, !tbaa !17
  %240 = load ptr, ptr %4, align 8, !tbaa !5
  %241 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %240, i32 0, i32 4
  %242 = load i32, ptr %241, align 8, !tbaa !25
  %243 = icmp ult i32 %239, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %238
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %299

245:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !17
  store float 0.000000e+00, ptr %17, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store float 0.000000e+00, ptr %22, align 4, !tbaa !34
  %246 = load ptr, ptr %4, align 8, !tbaa !5
  %247 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %246, i32 0, i32 0
  %248 = load i32, ptr %247, align 8, !tbaa !19
  %249 = load ptr, ptr %4, align 8, !tbaa !5
  %250 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %249, i32 0, i32 5
  %251 = load i32, ptr %250, align 4, !tbaa !26
  %252 = load ptr, ptr %4, align 8, !tbaa !5
  %253 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %252, i32 0, i32 12
  %254 = load ptr, ptr %253, align 8, !tbaa !32
  %255 = load ptr, ptr %4, align 8, !tbaa !5
  %256 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %255, i32 0, i32 13
  %257 = load ptr, ptr %256, align 8, !tbaa !33
  %258 = load i32, ptr %20, align 4, !tbaa !17
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  %261 = load i32, ptr %260, align 4, !tbaa !17
  call void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef %248, i32 noundef %251, ptr noundef %254, ptr noundef %257, i32 noundef %258, ptr noundef %259, i32 noundef %261, ptr noundef %17, ptr noundef %21)
  %262 = load ptr, ptr %4, align 8, !tbaa !5
  %263 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %262, i32 0, i32 0
  %264 = load i32, ptr %263, align 8, !tbaa !19
  %265 = load ptr, ptr %4, align 8, !tbaa !5
  %266 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %265, i32 0, i32 5
  %267 = load i32, ptr %266, align 4, !tbaa !26
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %268, i32 0, i32 12
  %270 = load ptr, ptr %269, align 8, !tbaa !32
  %271 = load ptr, ptr %4, align 8, !tbaa !5
  %272 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %271, i32 0, i32 13
  %273 = load ptr, ptr %272, align 8, !tbaa !33
  %274 = load i32, ptr %20, align 4, !tbaa !17
  %275 = load ptr, ptr %7, align 8, !tbaa !5
  %276 = load ptr, ptr %9, align 8, !tbaa !5
  %277 = load i32, ptr %276, align 4, !tbaa !17
  call void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef %264, i32 noundef %267, ptr noundef %270, ptr noundef %273, i32 noundef %274, ptr noundef %275, i32 noundef %277, ptr noundef %22, ptr noundef %21)
  %278 = load float, ptr %22, align 4, !tbaa !34
  %279 = load float, ptr %17, align 4, !tbaa !34
  %280 = fcmp olt float %278, %279
  br i1 %280, label %281, label %295

281:                                              ; preds = %245
  %282 = load i32, ptr %20, align 4, !tbaa !17
  %283 = load ptr, ptr %5, align 8, !tbaa !5
  %284 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %283, i32 0, i32 5
  %285 = load ptr, ptr %284, align 8, !tbaa !18
  %286 = load ptr, ptr %5, align 8, !tbaa !5
  %287 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %286, i32 0, i32 4
  %288 = load i32, ptr %287, align 4, !tbaa !16
  %289 = zext i32 %288 to i64
  %290 = getelementptr inbounds i32, ptr %285, i64 %289
  store i32 %282, ptr %290, align 4, !tbaa !17
  %291 = load ptr, ptr %5, align 8, !tbaa !5
  %292 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %291, i32 0, i32 4
  %293 = load i32, ptr %292, align 4, !tbaa !16
  %294 = add i32 %293, 1
  store i32 %294, ptr %292, align 4, !tbaa !16
  br label %295

295:                                              ; preds = %281, %245
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %296

296:                                              ; preds = %295
  %297 = load i32, ptr %20, align 4, !tbaa !17
  %298 = add i32 %297, 1
  store i32 %298, ptr %20, align 4, !tbaa !17
  br label %238, !llvm.loop !35

299:                                              ; preds = %244
  %300 = load ptr, ptr %5, align 8, !tbaa !5
  %301 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %300, i32 0, i32 4
  %302 = load i32, ptr %301, align 4, !tbaa !16
  %303 = icmp eq i32 %302, 0
  br i1 %303, label %304, label %334

304:                                              ; preds = %299
  %305 = load ptr, ptr %5, align 8, !tbaa !5
  %306 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %305, i32 0, i32 1
  %307 = load i32, ptr %306, align 8, !tbaa !9
  %308 = add i32 %307, 1
  store i32 %308, ptr %306, align 8, !tbaa !9
  %309 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %309, align 4, !tbaa !17
  %310 = load ptr, ptr %4, align 8, !tbaa !5
  %311 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %310, i32 0, i32 4
  %312 = load i32, ptr %311, align 8, !tbaa !25
  %313 = load ptr, ptr %5, align 8, !tbaa !5
  %314 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %313, i32 0, i32 4
  store i32 %312, ptr %314, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !17
  br label %315

315:                                              ; preds = %330, %304
  %316 = load i32, ptr %23, align 4, !tbaa !17
  %317 = load ptr, ptr %4, align 8, !tbaa !5
  %318 = getelementptr inbounds %"struct.nova::NovaPOMDP", ptr %317, i32 0, i32 4
  %319 = load i32, ptr %318, align 8, !tbaa !25
  %320 = icmp ult i32 %316, %319
  br i1 %320, label %322, label %321

321:                                              ; preds = %315
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %333

322:                                              ; preds = %315
  %323 = load i32, ptr %23, align 4, !tbaa !17
  %324 = load ptr, ptr %5, align 8, !tbaa !5
  %325 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %324, i32 0, i32 5
  %326 = load ptr, ptr %325, align 8, !tbaa !18
  %327 = load i32, ptr %23, align 4, !tbaa !17
  %328 = zext i32 %327 to i64
  %329 = getelementptr inbounds i32, ptr %326, i64 %328
  store i32 %323, ptr %329, align 4, !tbaa !17
  br label %330

330:                                              ; preds = %322
  %331 = load i32, ptr %23, align 4, !tbaa !17
  %332 = add i32 %331, 1
  store i32 %332, ptr %23, align 4, !tbaa !17
  br label %315, !llvm.loop !37

333:                                              ; preds = %321
  store i32 9, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %335

334:                                              ; preds = %299
  store i32 0, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %335

335:                                              ; preds = %334, %333, %232
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %336 = load i32, ptr %3, align 4
  ret i32 %336
}

; Function Attrs: nounwind
declare i32 @rand() #7

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind "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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN4nova19NovaPOMDPPerseusCPUE", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 32}
!13 = !{!10, !6, i64 40}
!14 = !{!10, !6, i64 48}
!15 = !{!10, !6, i64 56}
!16 = !{!10, !11, i64 20}
!17 = !{!11, !11, i64 0}
!18 = !{!10, !6, i64 24}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTSN4nova9NovaPOMDPE", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !21, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!21 = !{!"float", !7, i64 0}
!22 = !{!20, !11, i64 4}
!23 = !{!20, !11, i64 8}
!24 = !{!20, !11, i64 12}
!25 = !{!20, !11, i64 16}
!26 = !{!20, !11, i64 20}
!27 = !{!20, !21, i64 24}
!28 = !{!20, !6, i64 32}
!29 = !{!20, !6, i64 40}
!30 = !{!20, !6, i64 48}
!31 = !{!20, !6, i64 56}
!32 = !{!20, !6, i64 64}
!33 = !{!20, !6, i64 72}
!34 = !{!21, !21, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4nova37pomdp_perseus_compute_b_dot_alpha_cpuEjPKiPKfjS3_Pf(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr 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: mustprogress nounwind uwtable
declare dso_local void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4nova29pomdp_perseus_update_step_cpuEjjjjjjfPKiPKfS3_S3_S1_S3_S3_jjPfPj(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

; 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) #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
define dso_local range(i32 0, 12) i32 @pomdp_perseus_update_cpu(ptr nocapture noundef readonly %0, ptr nocapture noundef %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = and i32 %10, 1
  %12 = icmp eq i32 %11, 0
  %. = select i1 %12, i64 32, i64 40
  %.122 = select i1 %12, i64 40, i64 32
  %.123 = select i1 %12, i64 12, i64 16
  %.124 = select i1 %12, i64 16, i64 12
  %.125 = select i1 %12, i64 48, i64 56
  %.126 = select i1 %12, i64 56, i64 48
  %13 = getelementptr inbounds i8, ptr %1, i64 %.
  %14 = getelementptr inbounds i8, ptr %1, i64 %.122
  %15 = getelementptr inbounds i8, ptr %1, i64 %.123
  %16 = getelementptr inbounds i8, ptr %1, i64 %.124
  %17 = getelementptr inbounds i8, ptr %1, i64 %.125
  %18 = getelementptr inbounds i8, ptr %1, i64 %.126
  %.0101 = load ptr, ptr %13, align 8, !tbaa !11
  %.0102 = load ptr, ptr %14, align 8, !tbaa !11
  %.0103 = load ptr, ptr %18, align 8, !tbaa !11
  %.0104 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = tail call i32 @rand() #8
  %20 = sitofp i32 %19 to float
  %21 = fmul float %20, 0x3E00000000000000
  %22 = getelementptr inbounds i8, ptr %1, i64 20
  %23 = load i32, ptr %22, align 4, !tbaa !12
  %24 = uitofp i32 %23 to float
  %25 = fmul float %21, %24
  %26 = fptoui float %25 to i32
  %27 = getelementptr inbounds i8, ptr %1, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = zext i32 %26 to i64
  %30 = getelementptr inbounds i32, ptr %28, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !14
  %32 = load i32, ptr %0, align 8, !tbaa !15
  %33 = zext i32 %32 to i64
  %34 = shl nuw nsw i64 %33, 2
  %35 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %34) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 0, ptr %3, align 4, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %0, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !18
  %38 = getelementptr inbounds i8, ptr %0, i64 8
  %39 = load i32, ptr %38, align 8, !tbaa !19
  %40 = getelementptr inbounds i8, ptr %0, i64 12
  %41 = load i32, ptr %40, align 4, !tbaa !20
  %42 = getelementptr inbounds i8, ptr %0, i64 16
  %43 = load i32, ptr %42, align 8, !tbaa !21
  %44 = getelementptr inbounds i8, ptr %0, i64 20
  %45 = load i32, ptr %44, align 4, !tbaa !22
  %46 = getelementptr inbounds i8, ptr %0, i64 24
  %47 = load float, ptr %46, align 8, !tbaa !23
  %48 = getelementptr inbounds i8, ptr %0, i64 32
  %49 = load ptr, ptr %48, align 8, !tbaa !24
  %50 = getelementptr inbounds i8, ptr %0, i64 40
  %51 = load ptr, ptr %50, align 8, !tbaa !25
  %52 = getelementptr inbounds i8, ptr %0, i64 48
  %53 = load ptr, ptr %52, align 8, !tbaa !26
  %54 = getelementptr inbounds i8, ptr %0, i64 56
  %55 = load ptr, ptr %54, align 8, !tbaa !27
  %56 = getelementptr inbounds i8, ptr %0, i64 64
  %57 = load ptr, ptr %56, align 8, !tbaa !28
  %58 = getelementptr inbounds i8, ptr %0, i64 72
  %59 = load ptr, ptr %58, align 8, !tbaa !29
  %60 = load i32, ptr %15, align 4, !tbaa !14
  call void @_ZN4nova29pomdp_perseus_update_step_cpuEjjjjjjfPKiPKfS3_S3_S1_S3_S3_jjPfPj(i32 noundef %32, i32 noundef %37, i32 noundef %39, i32 noundef %41, i32 noundef %43, i32 noundef %45, float noundef %47, ptr noundef %49, ptr noundef %51, ptr noundef %53, ptr noundef %55, ptr noundef %57, ptr noundef %59, ptr noundef %.0101, i32 noundef %60, i32 noundef %31, ptr noundef nonnull %35, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store float 0.000000e+00, ptr %4, align 4, !tbaa !30
  %61 = load i32, ptr %44, align 4, !tbaa !22
  %62 = load ptr, ptr %56, align 8, !tbaa !28
  %63 = load ptr, ptr %58, align 8, !tbaa !29
  call void @_ZN4nova37pomdp_perseus_compute_b_dot_alpha_cpuEjPKiPKfjS3_Pf(i32 noundef %61, ptr noundef %62, ptr noundef %63, i32 noundef %31, ptr noundef nonnull %35, ptr noundef nonnull %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store float 0.000000e+00, ptr %5, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !14
  %64 = load i32, ptr %0, align 8, !tbaa !15
  %65 = load i32, ptr %44, align 4, !tbaa !22
  %66 = load ptr, ptr %56, align 8, !tbaa !28
  %67 = load ptr, ptr %58, align 8, !tbaa !29
  %68 = load i32, ptr %15, align 4, !tbaa !14
  call void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef %64, i32 noundef %65, ptr noundef %66, ptr noundef %67, i32 noundef %31, ptr noundef %.0101, i32 noundef %68, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %69 = load float, ptr %4, align 4, !tbaa !30
  %70 = load float, ptr %5, align 4, !tbaa !30
  %71 = fcmp ult float %69, %70
  %72 = load i32, ptr %16, align 4, !tbaa !14
  %73 = load i32, ptr %0, align 8, !tbaa !15
  %74 = mul i32 %73, %72
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds float, ptr %.0102, i64 %75
  br i1 %71, label %80, label %77

77:                                               ; preds = %2
  %78 = zext i32 %73 to i64
  %79 = shl nuw nsw i64 %78, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %76, ptr nonnull align 4 %35, i64 %79, i1 false)
  br label %89

80:                                               ; preds = %2
  %81 = load i32, ptr %6, align 4, !tbaa !14
  %82 = mul i32 %81, %73
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds float, ptr %.0101, i64 %83
  %85 = zext i32 %73 to i64
  %86 = shl nuw nsw i64 %85, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %76, ptr align 4 %84, i64 %86, i1 false)
  %87 = zext i32 %81 to i64
  %88 = getelementptr inbounds i32, ptr %.0104, i64 %87
  br label %89

89:                                               ; preds = %80, %77
  %.sink118.in = phi ptr [ %88, %80 ], [ %3, %77 ]
  %.sink118 = load i32, ptr %.sink118.in, align 4, !tbaa !14
  %90 = load i32, ptr %16, align 4, !tbaa !14
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr %.0103, i64 %91
  store i32 %.sink118, ptr %92, align 4, !tbaa !14
  %93 = load i32, ptr %16, align 4, !tbaa !14
  %94 = add i32 %93, 1
  store i32 %94, ptr %16, align 4, !tbaa !14
  call void @_ZdaPv(ptr noundef nonnull %35) #10
  %95 = load i32, ptr %16, align 4, !tbaa !14
  %96 = load i32, ptr %42, align 8, !tbaa !21
  %97 = icmp ugt i32 %95, %96
  br i1 %97, label %98, label %101

98:                                               ; preds = %89
  %99 = load ptr, ptr @stderr, align 8, !tbaa !11
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3) #11
  br label %.loopexit

101:                                              ; preds = %89
  store i32 0, ptr %22, align 4, !tbaa !12
  %.not = icmp eq i32 %96, 0
  br i1 %.not, label %._crit_edge.thread, label %.lr.ph

._crit_edge:                                      ; preds = %123
  %.pre = load i32, ptr %22, align 4, !tbaa !12
  %102 = icmp eq i32 %.pre, 0
  br i1 %102, label %._crit_edge.thread, label %.loopexit

.lr.ph:                                           ; preds = %101, %123
  %.099107 = phi i32 [ %124, %123 ], [ 0, %101 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !14
  store float 0.000000e+00, ptr %5, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store float 0.000000e+00, ptr %8, align 4, !tbaa !30
  %103 = load i32, ptr %0, align 8, !tbaa !15
  %104 = load i32, ptr %44, align 4, !tbaa !22
  %105 = load ptr, ptr %56, align 8, !tbaa !28
  %106 = load ptr, ptr %58, align 8, !tbaa !29
  %107 = load i32, ptr %15, align 4, !tbaa !14
  call void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef %103, i32 noundef %104, ptr noundef %105, ptr noundef %106, i32 noundef %.099107, ptr noundef %.0101, i32 noundef %107, ptr noundef nonnull %5, ptr noundef nonnull %7)
  %108 = load i32, ptr %0, align 8, !tbaa !15
  %109 = load i32, ptr %44, align 4, !tbaa !22
  %110 = load ptr, ptr %56, align 8, !tbaa !28
  %111 = load ptr, ptr %58, align 8, !tbaa !29
  %112 = load i32, ptr %16, align 4, !tbaa !14
  call void @_ZN4nova28pomdp_perseus_compute_Vb_cpuEjjPKiPKfjS3_jPfPj(i32 noundef %108, i32 noundef %109, ptr noundef %110, ptr noundef %111, i32 noundef %.099107, ptr noundef %.0102, i32 noundef %112, ptr noundef nonnull %8, ptr noundef nonnull %7)
  %113 = load float, ptr %8, align 4, !tbaa !30
  %114 = load float, ptr %5, align 4, !tbaa !30
  %115 = fcmp olt float %113, %114
  br i1 %115, label %116, label %123

116:                                              ; preds = %.lr.ph
  %117 = load ptr, ptr %27, align 8, !tbaa !13
  %118 = load i32, ptr %22, align 4, !tbaa !12
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  store i32 %.099107, ptr %120, align 4, !tbaa !14
  %121 = load i32, ptr %22, align 4, !tbaa !12
  %122 = add i32 %121, 1
  store i32 %122, ptr %22, align 4, !tbaa !12
  br label %123

123:                                              ; preds = %116, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %124 = add nuw i32 %.099107, 1
  %125 = load i32, ptr %42, align 8, !tbaa !21
  %126 = icmp ult i32 %124, %125
  br i1 %126, label %.lr.ph, label %._crit_edge, !llvm.loop !31

._crit_edge.thread:                               ; preds = %101, %._crit_edge
  %127 = load i32, ptr %9, align 8, !tbaa !5
  %128 = add i32 %127, 1
  store i32 %128, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %15, align 4, !tbaa !14
  %129 = load i32, ptr %42, align 8, !tbaa !21
  store i32 %129, ptr %22, align 4, !tbaa !12
  %.not111 = icmp eq i32 %129, 0
  br i1 %.not111, label %.loopexit, label %.lr.ph110

.lr.ph110:                                        ; preds = %._crit_edge.thread
  %130 = load ptr, ptr %27, align 8, !tbaa !13
  br label %131

131:                                              ; preds = %.lr.ph110, %131
  %indvars.iv = phi i64 [ 0, %.lr.ph110 ], [ %indvars.iv.next, %131 ]
  %132 = getelementptr inbounds i32, ptr %130, i64 %indvars.iv
  %133 = trunc nuw i64 %indvars.iv to i32
  store i32 %133, ptr %132, align 4, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %134 = load i32, ptr %42, align 8, !tbaa !21
  %135 = zext i32 %134 to i64
  %136 = icmp ult i64 %indvars.iv.next, %135
  br i1 %136, label %131, label %.loopexit, !llvm.loop !33

.loopexit:                                        ; preds = %131, %._crit_edge.thread, %._crit_edge, %98
  %.0100 = phi i32 [ 11, %98 ], [ 0, %._crit_edge ], [ 9, %._crit_edge.thread ], [ 9, %131 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  ret i32 %.0100
}

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #7

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nobuiltin 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 #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind "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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }
attributes #11 = { cold 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, !10, i64 8}
!6 = !{!"_ZTSN4nova19NovaPOMDPPerseusCPUE", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !10, i64 20}
!13 = !{!6, !7, i64 24}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTSN4nova9NovaPOMDPE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !17, i64 24, !10, i64 28, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!17 = !{!"float", !8, i64 0}
!18 = !{!16, !10, i64 4}
!19 = !{!16, !10, i64 8}
!20 = !{!16, !10, i64 12}
!21 = !{!16, !10, i64 16}
!22 = !{!16, !10, i64 20}
!23 = !{!16, !17, i64 24}
!24 = !{!16, !7, i64 32}
!25 = !{!16, !7, i64 40}
!26 = !{!16, !7, i64 48}
!27 = !{!16, !7, i64 56}
!28 = !{!16, !7, i64 64}
!29 = !{!16, !7, i64 72}
!30 = !{!17, !17, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}


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