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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @pomdp_perseus_uninitialize_cpu(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %5, i32 0, i32 1
  store i32 0, ptr %6, align 8, !tbaa !9
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %7, i32 0, i32 6
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %18

11:                                               ; preds = %2
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %12, i32 0, i32 6
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = icmp eq ptr %14, null
  br i1 %15, label %17, label %16

16:                                               ; preds = %11
  call void @_ZdaPv(ptr noundef %14) #2
  br label %17

17:                                               ; preds = %16, %11
  br label %18

18:                                               ; preds = %17, %2
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %19, i32 0, i32 6
  store ptr null, ptr %20, align 8, !tbaa !12
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %21, i32 0, i32 2
  store i32 0, ptr %22, align 4, !tbaa !13
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %23, i32 0, i32 7
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %34

27:                                               ; preds = %18
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %28, i32 0, i32 7
  %30 = load ptr, ptr %29, align 8, !tbaa !14
  %31 = icmp eq ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @_ZdaPv(ptr noundef %30) #2
  br label %33

33:                                               ; preds = %32, %27
  br label %34

34:                                               ; preds = %33, %18
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %35, i32 0, i32 7
  store ptr null, ptr %36, align 8, !tbaa !14
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %37, i32 0, i32 3
  store i32 0, ptr %38, align 8, !tbaa !15
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %39, i32 0, i32 8
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %50

43:                                               ; preds = %34
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %44, i32 0, i32 8
  %46 = load ptr, ptr %45, align 8, !tbaa !16
  %47 = icmp eq ptr %46, null
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  call void @_ZdaPv(ptr noundef %46) #2
  br label %49

49:                                               ; preds = %48, %43
  br label %50

50:                                               ; preds = %49, %34
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %51, i32 0, i32 8
  store ptr null, ptr %52, align 8, !tbaa !16
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %53, i32 0, i32 9
  %55 = load ptr, ptr %54, align 8, !tbaa !17
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %64

57:                                               ; preds = %50
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %58, i32 0, i32 9
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = icmp eq ptr %60, null
  br i1 %61, label %63, label %62

62:                                               ; preds = %57
  call void @_ZdaPv(ptr noundef %60) #2
  br label %63

63:                                               ; preds = %62, %57
  br label %64

64:                                               ; preds = %63, %50
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %65, i32 0, i32 9
  store ptr null, ptr %66, align 8, !tbaa !17
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %67, i32 0, i32 5
  %69 = load ptr, ptr %68, align 8, !tbaa !18
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %78

71:                                               ; preds = %64
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %72, i32 0, i32 5
  %74 = load ptr, ptr %73, align 8, !tbaa !18
  %75 = icmp eq ptr %74, null
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  call void @_ZdaPv(ptr noundef %74) #2
  br label %77

77:                                               ; preds = %76, %71
  br label %78

78:                                               ; preds = %77, %64
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %79, i32 0, i32 5
  store ptr null, ptr %80, align 8, !tbaa !18
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.nova::NovaPOMDPPerseusCPU", ptr %81, i32 0, i32 4
  store i32 0, ptr %82, align 4, !tbaa !19
  ret i32 0
}

attributes #0 = { 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 #1 = { 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 #2 = { 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, !11, i64 12}
!14 = !{!10, !6, i64 40}
!15 = !{!10, !11, i64 16}
!16 = !{!10, !6, i64 48}
!17 = !{!10, !6, i64 56}
!18 = !{!10, !6, i64 24}
!19 = !{!10, !11, i64 20}


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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @pomdp_perseus_uninitialize_cpu(ptr nocapture noundef readnone %0, ptr nocapture noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 0, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !11
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %7, label %6

6:                                                ; preds = %2
  tail call void @_ZdaPv(ptr noundef nonnull %5) #2
  br label %7

7:                                                ; preds = %6, %2
  store ptr null, ptr %4, align 8, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %1, i64 12
  store i32 0, ptr %8, align 4, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %1, i64 40
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %.not23 = icmp eq ptr %10, null
  br i1 %.not23, label %12, label %11

11:                                               ; preds = %7
  tail call void @_ZdaPv(ptr noundef nonnull %10) #2
  br label %12

12:                                               ; preds = %11, %7
  store ptr null, ptr %9, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  store i32 0, ptr %13, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %1, i64 48
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %.not24 = icmp eq ptr %15, null
  br i1 %.not24, label %17, label %16

16:                                               ; preds = %12
  tail call void @_ZdaPv(ptr noundef nonnull %15) #2
  br label %17

17:                                               ; preds = %16, %12
  store ptr null, ptr %14, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %1, i64 56
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %.not25 = icmp eq ptr %19, null
  br i1 %.not25, label %21, label %20

20:                                               ; preds = %17
  tail call void @_ZdaPv(ptr noundef nonnull %19) #2
  br label %21

21:                                               ; preds = %20, %17
  store ptr null, ptr %18, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %1, i64 24
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %.not26 = icmp eq ptr %23, null
  br i1 %.not26, label %25, label %24

24:                                               ; preds = %21
  tail call void @_ZdaPv(ptr noundef nonnull %23) #2
  br label %25

25:                                               ; preds = %24, %21
  store ptr null, ptr %22, align 8, !tbaa !17
  %26 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 0, ptr %26, align 4, !tbaa !18
  ret i32 0
}

attributes #0 = { 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 #1 = { 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 #2 = { 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, !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 = !{!6, !7, i64 32}
!12 = !{!6, !10, i64 12}
!13 = !{!6, !7, i64 40}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !7, i64 48}
!16 = !{!6, !7, i64 56}
!17 = !{!6, !7, i64 24}
!18 = !{!6, !10, i64 20}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass