; LLVM IR from ARM-software/Arm-2D :: examples/common/controls (dynamic_nebula)

; 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.dynamic_nebula_cfg_t = type { i16, i16, i16, i16, i16, i16, float, ptr, %struct.dynamic_nebula_on_draw_particle_evt_t }
%struct.dynamic_nebula_on_draw_particle_evt_t = type { ptr, ptr }
%struct.dynamic_nebula_t = type { %struct.anon, ptr }
%struct.anon = type { %struct.dynamic_nebula_cfg_t, [1 x i64], float, float }
%struct.dynamic_nebula_particle_t = type { %struct.anon.0 }
%struct.anon.0 = type { float, float, float }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__.dynamic_nebula_init = external hidden unnamed_addr constant [69 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @dynamic_nebula_init(ptr noundef nonnull %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = icmp ne ptr null, %8
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %12

11:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 74, ptr noundef @__PRETTY_FUNCTION__.dynamic_nebula_init) #7
  unreachable

12:                                               ; preds = %10
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = icmp ne ptr null, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  br label %17

16:                                               ; preds = %12
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 75, ptr noundef @__PRETTY_FUNCTION__.dynamic_nebula_init) #7
  unreachable

17:                                               ; preds = %15
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %18, i32 0, i32 7
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = icmp ne ptr null, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %17
  br label %24

23:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 76, ptr noundef @__PRETTY_FUNCTION__.dynamic_nebula_init) #7
  unreachable

24:                                               ; preds = %22
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %25, i32 0, i32 2
  %27 = load i16, ptr %26, align 4, !tbaa !14
  %28 = zext i16 %27 to i32
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %24
  br label %32

31:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 77, ptr noundef @__PRETTY_FUNCTION__.dynamic_nebula_init) #7
  unreachable

32:                                               ; preds = %30
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %33, i8 0, i64 64, i1 false)
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds %struct.anon, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %37, i64 40, i1 false), !tbaa.struct !15
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds %struct.anon, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %40, i32 0, i32 0
  %42 = load i16, ptr %41, align 8, !tbaa !19
  %43 = sext i16 %42 to i32
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %44, i32 0, i32 0
  %46 = getelementptr inbounds %struct.anon, ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %46, i32 0, i32 1
  %48 = load i16, ptr %47, align 2, !tbaa !22
  %49 = sext i16 %48 to i32
  %50 = icmp slt i32 %43, %49
  br i1 %50, label %51, label %58

51:                                               ; preds = %32
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds %struct.anon, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %54, i32 0, i32 0
  %56 = load i16, ptr %55, align 8, !tbaa !19
  %57 = sext i16 %56 to i32
  br label %65

58:                                               ; preds = %32
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %struct.anon, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %61, i32 0, i32 1
  %63 = load i16, ptr %62, align 2, !tbaa !22
  %64 = sext i16 %63 to i32
  br label %65

65:                                               ; preds = %58, %51
  %66 = phi i32 [ %57, %51 ], [ %64, %58 ]
  %67 = trunc i32 %66 to i16
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %struct.anon, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %70, i32 0, i32 1
  store i16 %67, ptr %71, align 2, !tbaa !22
  %72 = call i64 @arm_2d_helper_get_system_timestamp()
  %73 = trunc i64 %72 to i32
  call void @srand(i32 noundef %73) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %74, i32 0, i32 0
  %76 = getelementptr inbounds %struct.anon, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %76, i32 0, i32 2
  %78 = load i16, ptr %77, align 4, !tbaa !23
  %79 = zext i16 %78 to i32
  store i32 %79, ptr %5, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %struct.anon, ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %82, i32 0, i32 7
  %84 = load ptr, ptr %83, align 8, !tbaa !26
  store ptr %84, ptr %6, align 8, !tbaa !5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %85, i32 0, i32 0
  %87 = getelementptr inbounds %struct.anon, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %87, i32 0, i32 5
  %89 = load i16, ptr %88, align 2, !tbaa !27
  %90 = zext i16 %89 to i32
  %91 = icmp eq i32 0, %90
  br i1 %91, label %92, label %97

92:                                               ; preds = %65
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %95, i32 0, i32 5
  store i16 12, ptr %96, align 2, !tbaa !27
  br label %97

97:                                               ; preds = %92, %65
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds %struct.anon, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %100, i32 0, i32 1
  %102 = load i16, ptr %101, align 2, !tbaa !22
  %103 = sext i16 %102 to i32
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds %struct.anon, ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %106, i32 0, i32 3
  %108 = load i16, ptr %107, align 2
  %109 = lshr i16 %108, 8
  %110 = zext i16 %109 to i32
  %111 = sub nsw i32 %103, %110
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds %struct.anon, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %114, i32 0, i32 4
  %116 = load i16, ptr %115, align 8, !tbaa !28
  %117 = sext i16 %116 to i32
  %118 = sub nsw i32 %111, %117
  %119 = sitofp i32 %118 to float
  %120 = fdiv float 2.550000e+02, %119
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %struct.anon, ptr %122, i32 0, i32 2
  store float %120, ptr %123, align 8, !tbaa !29
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds %struct.anon, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %126, i32 0, i32 3
  %128 = load i16, ptr %127, align 2
  %129 = lshr i16 %128, 8
  %130 = uitofp i16 %129 to float
  %131 = fdiv float 2.550000e+02, %130
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %struct.anon, ptr %133, i32 0, i32 3
  store float %131, ptr %134, align 4, !tbaa !30
  br label %135

135:                                              ; preds = %174, %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %136 = call i32 @rand() #8
  %137 = srem i32 %136, 3600
  %138 = sitofp i32 %137 to float
  %139 = fdiv float %138, 1.000000e+01
  %140 = fmul float %139, 0x400921FB40000000
  %141 = fdiv float %140, 1.800000e+02
  store float %141, ptr %7, align 4, !tbaa !18
  %142 = load float, ptr %7, align 4, !tbaa !18
  %143 = call float @arm_sin_f32(float noundef %142)
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.dynamic_nebula_particle_t, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.anon.0, ptr %145, i32 0, i32 0
  store float %143, ptr %146, align 4, !tbaa !31
  %147 = load float, ptr %7, align 4, !tbaa !18
  %148 = call float @arm_cos_f32(float noundef %147)
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.dynamic_nebula_particle_t, ptr %149, i32 0, i32 0
  %151 = getelementptr inbounds %struct.anon.0, ptr %150, i32 0, i32 1
  store float %148, ptr %151, align 4, !tbaa !34
  %152 = call i32 @rand() #8
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %153, i32 0, i32 0
  %155 = getelementptr inbounds %struct.anon, ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %155, i32 0, i32 1
  %157 = load i16, ptr %156, align 2, !tbaa !22
  %158 = sext i16 %157 to i32
  %159 = srem i32 %152, %158
  %160 = sitofp i32 %159 to float
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.dynamic_nebula_particle_t, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %struct.anon.0, ptr %162, i32 0, i32 2
  store float %160, ptr %163, align 4, !tbaa !35
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = ptrtoint ptr %164 to i64
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.dynamic_nebula_t, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds %struct.anon, ptr %167, i32 0, i32 0
  %169 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %168, i32 0, i32 5
  %170 = load i16, ptr %169, align 2, !tbaa !27
  %171 = zext i16 %170 to i64
  %172 = add i64 %165, %171
  %173 = inttoptr i64 %172 to ptr
  store ptr %173, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %174

174:                                              ; preds = %135
  %175 = load i32, ptr %5, align 4, !tbaa !24
  %176 = add nsw i32 %175, -1
  store i32 %176, ptr %5, align 4, !tbaa !24
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %135, label %178, !llvm.loop !36

178:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #4

declare i64 @arm_2d_helper_get_system_timestamp() #5

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

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

declare float @arm_sin_f32(float noundef) #5

declare float @arm_cos_f32(float noundef) #5

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

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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, !6, i64 16}
!10 = !{!"dynamic_nebula_cfg_t", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !11, i64 7, !11, i64 8, !11, i64 10, !12, i64 12, !6, i64 16, !13, i64 24}
!11 = !{!"short", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"dynamic_nebula_on_draw_particle_evt_t", !6, i64 0, !6, i64 8}
!14 = !{!10, !11, i64 4}
!15 = !{i64 0, i64 2, !16, i64 2, i64 2, !16, i64 4, i64 2, !16, i64 6, i64 2, !17, i64 8, i64 2, !16, i64 10, i64 2, !16, i64 12, i64 4, !18, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 8, !5}
!16 = !{!11, !11, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!12, !12, i64 0}
!19 = !{!20, !11, i64 0}
!20 = !{!"dynamic_nebula_t", !21, i64 0, !6, i64 56}
!21 = !{!"", !10, i64 0, !7, i64 40, !12, i64 48, !12, i64 52}
!22 = !{!20, !11, i64 2}
!23 = !{!20, !11, i64 4}
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !7, i64 0}
!26 = !{!20, !6, i64 16}
!27 = !{!20, !11, i64 10}
!28 = !{!20, !11, i64 8}
!29 = !{!20, !12, i64 48}
!30 = !{!20, !12, i64 52}
!31 = !{!32, !12, i64 0}
!32 = !{!"dynamic_nebula_particle_t", !33, i64 0}
!33 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!34 = !{!32, !12, i64 4}
!35 = !{!32, !12, i64 8}
!36 = distinct !{!36, !37}
!37 = !{!"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"

@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__.dynamic_nebula_init = external hidden unnamed_addr constant [69 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @dynamic_nebula_init(ptr nocapture noundef nonnull %0, ptr noundef readonly %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 75, ptr noundef nonnull @__PRETTY_FUNCTION__.dynamic_nebula_init) #7
  unreachable

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 16
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not34 = icmp eq ptr %6, null
  br i1 %.not34, label %7, label %8

7:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 76, ptr noundef nonnull @__PRETTY_FUNCTION__.dynamic_nebula_init) #7
  unreachable

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %1, i64 4
  %10 = load i16, ptr %9, align 4, !tbaa !13
  %.not35 = icmp eq i16 %10, 0
  br i1 %.not35, label %11, label %12

11:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 77, ptr noundef nonnull @__PRETTY_FUNCTION__.dynamic_nebula_init) #7
  unreachable

12:                                               ; preds = %8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %0, i8 0, i64 64, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, i64 40, i1 false), !tbaa.struct !14
  %13 = load i16, ptr %0, align 8, !tbaa !19
  %14 = getelementptr inbounds i8, ptr %0, i64 2
  %15 = load i16, ptr %14, align 2, !tbaa !22
  %. = tail call i16 @llvm.smin.i16(i16 %13, i16 %15)
  store i16 %., ptr %14, align 2, !tbaa !22
  %16 = tail call i64 @arm_2d_helper_get_system_timestamp() #8
  %17 = trunc i64 %16 to i32
  tail call void @srand(i32 noundef %17) #8
  %18 = getelementptr inbounds i8, ptr %0, i64 4
  %19 = load i16, ptr %18, align 4, !tbaa !23
  %20 = zext i16 %19 to i32
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !24
  %23 = getelementptr inbounds i8, ptr %0, i64 10
  %24 = load i16, ptr %23, align 2, !tbaa !25
  %25 = icmp eq i16 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %12
  store i16 12, ptr %23, align 2, !tbaa !25
  br label %27

27:                                               ; preds = %26, %12
  %28 = load i16, ptr %14, align 2, !tbaa !22
  %29 = sext i16 %28 to i32
  %30 = getelementptr inbounds i8, ptr %0, i64 6
  %31 = load i16, ptr %30, align 2
  %32 = lshr i16 %31, 8
  %33 = zext nneg i16 %32 to i32
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  %35 = load i16, ptr %34, align 8, !tbaa !26
  %36 = sext i16 %35 to i32
  %37 = add nsw i32 %36, %33
  %38 = sub nsw i32 %29, %37
  %39 = sitofp i32 %38 to float
  %40 = getelementptr inbounds i8, ptr %0, i64 48
  %41 = uitofp nneg i16 %32 to float
  %42 = insertelement <2 x float> poison, float %39, i64 0
  %43 = insertelement <2 x float> %42, float %41, i64 1
  %44 = fdiv <2 x float> <float 2.550000e+02, float 2.550000e+02>, %43
  store <2 x float> %44, ptr %40, align 8, !tbaa !17
  br label %45

45:                                               ; preds = %45, %27
  %.030 = phi ptr [ %22, %27 ], [ %65, %45 ]
  %.0 = phi i32 [ %20, %27 ], [ %66, %45 ]
  %46 = tail call i32 @rand() #8
  %47 = srem i32 %46, 3600
  %48 = sitofp i32 %47 to float
  %49 = fdiv float %48, 1.000000e+01
  %50 = fmul float %49, 0x400921FB40000000
  %51 = fdiv float %50, 1.800000e+02
  %52 = tail call float @arm_sin_f32(float noundef %51) #8
  store float %52, ptr %.030, align 4, !tbaa !27
  %53 = tail call float @arm_cos_f32(float noundef %51) #8
  %54 = getelementptr inbounds i8, ptr %.030, i64 4
  store float %53, ptr %54, align 4, !tbaa !30
  %55 = tail call i32 @rand() #8
  %56 = load i16, ptr %14, align 2, !tbaa !22
  %57 = sext i16 %56 to i32
  %58 = srem i32 %55, %57
  %59 = sitofp i32 %58 to float
  %60 = getelementptr inbounds i8, ptr %.030, i64 8
  store float %59, ptr %60, align 4, !tbaa !31
  %61 = ptrtoint ptr %.030 to i64
  %62 = load i16, ptr %23, align 2, !tbaa !25
  %63 = zext i16 %62 to i64
  %64 = add i64 %63, %61
  %65 = inttoptr i64 %64 to ptr
  %66 = add nsw i32 %.0, -1
  %.not36 = icmp eq i32 %66, 0
  br i1 %.not36, label %67, label %45, !llvm.loop !32

67:                                               ; preds = %45
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #4

declare i64 @arm_2d_helper_get_system_timestamp() local_unnamed_addr #5

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

declare float @arm_sin_f32(float noundef) local_unnamed_addr #5

declare float @arm_cos_f32(float noundef) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.smin.i16(i16, i16) #6

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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, !11, i64 16}
!6 = !{!"dynamic_nebula_cfg_t", !7, i64 0, !7, i64 2, !7, i64 4, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 10, !10, i64 12, !11, i64 16, !12, i64 24}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"dynamic_nebula_on_draw_particle_evt_t", !11, i64 0, !11, i64 8}
!13 = !{!6, !7, i64 4}
!14 = !{i64 0, i64 2, !15, i64 2, i64 2, !15, i64 4, i64 2, !15, i64 6, i64 2, !16, i64 8, i64 2, !15, i64 10, i64 2, !15, i64 12, i64 4, !17, i64 16, i64 8, !18, i64 24, i64 8, !18, i64 32, i64 8, !18}
!15 = !{!7, !7, i64 0}
!16 = !{!8, !8, i64 0}
!17 = !{!10, !10, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !7, i64 0}
!20 = !{!"dynamic_nebula_t", !21, i64 0, !11, i64 56}
!21 = !{!"", !6, i64 0, !8, i64 40, !10, i64 48, !10, i64 52}
!22 = !{!20, !7, i64 2}
!23 = !{!20, !7, i64 4}
!24 = !{!20, !11, i64 16}
!25 = !{!20, !7, i64 10}
!26 = !{!20, !7, i64 8}
!27 = !{!28, !10, i64 0}
!28 = !{!"dynamic_nebula_particle_t", !29, i64 0}
!29 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!30 = !{!28, !10, i64 4}
!31 = !{!28, !10, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass