; LLVM IR from BrunoLevy/learn-fpga :: LiteX/software/Doom/mc1-doom/src (p_switch)

; 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.button_t = type { ptr, i32, i32, i32, ptr }
%struct.line_s = type { ptr, ptr, i32, i32, i16, i16, i16, [2 x i16], [4 x i32], i32, ptr, ptr, i32, ptr }
%struct.side_t = type { i32, i32, i16, i16, i16, ptr }

@numswitches = external dso_local global i32, align 4
@switchlist = external dso_local global [100 x i32], align 16
@buttonlist = external dso_local global [16 x %struct.button_t], align 16
@sides = external global ptr, 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 void @P_StartButton(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @P_ChangeSwitchTexture(ptr noundef %0, i32 noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %11 = load i32, ptr %4, align 4, !tbaa !9
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %16, label %13

13:                                               ; preds = %2
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.line_s, ptr %14, i32 0, i32 5
  store i16 0, ptr %15, align 2, !tbaa !11
  br label %16

16:                                               ; preds = %13, %2
  %17 = load ptr, ptr @sides, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.line_s, ptr %18, i32 0, i32 7
  %20 = getelementptr inbounds [2 x i16], ptr %19, i64 0, i64 0
  %21 = load i16, ptr %20, align 2, !tbaa !14
  %22 = sext i16 %21 to i64
  %23 = getelementptr inbounds %struct.side_t, ptr %17, i64 %22
  %24 = getelementptr inbounds %struct.side_t, ptr %23, i32 0, i32 2
  %25 = load i16, ptr %24, align 8, !tbaa !15
  %26 = sext i16 %25 to i32
  store i32 %26, ptr %5, align 4, !tbaa !9
  %27 = load ptr, ptr @sides, align 8, !tbaa !5
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.line_s, ptr %28, i32 0, i32 7
  %30 = getelementptr inbounds [2 x i16], ptr %29, i64 0, i64 0
  %31 = load i16, ptr %30, align 2, !tbaa !14
  %32 = sext i16 %31 to i64
  %33 = getelementptr inbounds %struct.side_t, ptr %27, i64 %32
  %34 = getelementptr inbounds %struct.side_t, ptr %33, i32 0, i32 4
  %35 = load i16, ptr %34, align 4, !tbaa !17
  %36 = sext i16 %35 to i32
  store i32 %36, ptr %6, align 4, !tbaa !9
  %37 = load ptr, ptr @sides, align 8, !tbaa !5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.line_s, ptr %38, i32 0, i32 7
  %40 = getelementptr inbounds [2 x i16], ptr %39, i64 0, i64 0
  %41 = load i16, ptr %40, align 2, !tbaa !14
  %42 = sext i16 %41 to i64
  %43 = getelementptr inbounds %struct.side_t, ptr %37, i64 %42
  %44 = getelementptr inbounds %struct.side_t, ptr %43, i32 0, i32 3
  %45 = load i16, ptr %44, align 2, !tbaa !18
  %46 = sext i16 %45 to i32
  store i32 %46, ptr %7, align 4, !tbaa !9
  store i32 23, ptr %9, align 4, !tbaa !9
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.line_s, ptr %47, i32 0, i32 5
  %49 = load i16, ptr %48, align 2, !tbaa !11
  %50 = sext i16 %49 to i32
  %51 = icmp eq i32 %50, 11
  br i1 %51, label %52, label %53

52:                                               ; preds = %16
  store i32 24, ptr %9, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %52, %16
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %161, %53
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr @numswitches, align 4, !tbaa !9
  %57 = mul nsw i32 %56, 2
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %59, label %164

59:                                               ; preds = %54
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = icmp eq i32 %63, %64
  br i1 %65, label %66, label %92

66:                                               ; preds = %59
  %67 = load ptr, ptr getelementptr inbounds (%struct.button_t, ptr @buttonlist, i32 0, i32 4), align 8, !tbaa !19
  %68 = load i32, ptr %9, align 4, !tbaa !9
  call void @S_StartSound(ptr noundef %67, i32 noundef %68)
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = xor i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = trunc i32 %73 to i16
  %75 = load ptr, ptr @sides, align 8, !tbaa !5
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.line_s, ptr %76, i32 0, i32 7
  %78 = getelementptr inbounds [2 x i16], ptr %77, i64 0, i64 0
  %79 = load i16, ptr %78, align 2, !tbaa !14
  %80 = sext i16 %79 to i64
  %81 = getelementptr inbounds %struct.side_t, ptr %75, i64 %80
  %82 = getelementptr inbounds %struct.side_t, ptr %81, i32 0, i32 2
  store i16 %74, ptr %82, align 8, !tbaa !15
  %83 = load i32, ptr %4, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %91

85:                                               ; preds = %66
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  call void @P_StartButton(ptr noundef %86, i32 noundef 0, i32 noundef %90, i32 noundef 35)
  br label %91

91:                                               ; preds = %85, %66
  store i32 1, ptr %10, align 4
  br label %165

92:                                               ; preds = %59
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = icmp eq i32 %96, %97
  br i1 %98, label %99, label %125

99:                                               ; preds = %92
  %100 = load ptr, ptr getelementptr inbounds (%struct.button_t, ptr @buttonlist, i32 0, i32 4), align 8, !tbaa !19
  %101 = load i32, ptr %9, align 4, !tbaa !9
  call void @S_StartSound(ptr noundef %100, i32 noundef %101)
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = xor i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = trunc i32 %106 to i16
  %108 = load ptr, ptr @sides, align 8, !tbaa !5
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.line_s, ptr %109, i32 0, i32 7
  %111 = getelementptr inbounds [2 x i16], ptr %110, i64 0, i64 0
  %112 = load i16, ptr %111, align 2, !tbaa !14
  %113 = sext i16 %112 to i64
  %114 = getelementptr inbounds %struct.side_t, ptr %108, i64 %113
  %115 = getelementptr inbounds %struct.side_t, ptr %114, i32 0, i32 4
  store i16 %107, ptr %115, align 4, !tbaa !17
  %116 = load i32, ptr %4, align 4, !tbaa !9
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %124

118:                                              ; preds = %99
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = load i32, ptr %8, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !9
  call void @P_StartButton(ptr noundef %119, i32 noundef 1, i32 noundef %123, i32 noundef 35)
  br label %124

124:                                              ; preds = %118, %99
  store i32 1, ptr %10, align 4
  br label %165

125:                                              ; preds = %92
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !9
  %130 = load i32, ptr %7, align 4, !tbaa !9
  %131 = icmp eq i32 %129, %130
  br i1 %131, label %132, label %158

132:                                              ; preds = %125
  %133 = load ptr, ptr getelementptr inbounds (%struct.button_t, ptr @buttonlist, i32 0, i32 4), align 8, !tbaa !19
  %134 = load i32, ptr %9, align 4, !tbaa !9
  call void @S_StartSound(ptr noundef %133, i32 noundef %134)
  %135 = load i32, ptr %8, align 4, !tbaa !9
  %136 = xor i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = trunc i32 %139 to i16
  %141 = load ptr, ptr @sides, align 8, !tbaa !5
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.line_s, ptr %142, i32 0, i32 7
  %144 = getelementptr inbounds [2 x i16], ptr %143, i64 0, i64 0
  %145 = load i16, ptr %144, align 2, !tbaa !14
  %146 = sext i16 %145 to i64
  %147 = getelementptr inbounds %struct.side_t, ptr %141, i64 %146
  %148 = getelementptr inbounds %struct.side_t, ptr %147, i32 0, i32 3
  store i16 %140, ptr %148, align 2, !tbaa !18
  %149 = load i32, ptr %4, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %157

151:                                              ; preds = %132
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = load i32, ptr %8, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !9
  call void @P_StartButton(ptr noundef %152, i32 noundef 2, i32 noundef %156, i32 noundef 35)
  br label %157

157:                                              ; preds = %151, %132
  store i32 1, ptr %10, align 4
  br label %165

158:                                              ; preds = %125
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %8, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %8, align 4, !tbaa !9
  br label %54, !llvm.loop !21

164:                                              ; preds = %54
  store i32 0, ptr %10, align 4
  br label %165

165:                                              ; preds = %164, %157, %124, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  %166 = load i32, ptr %10, align 4
  switch i32 %166, label %168 [
    i32 0, label %167
    i32 1, label %167
  ]

167:                                              ; preds = %165, %165
  ret void

168:                                              ; preds = %165
  unreachable
}

declare void @S_StartSound(ptr noundef, i32 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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 26}
!12 = !{!"line_s", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !13, i64 24, !13, i64 26, !13, i64 28, !7, i64 30, !7, i64 36, !10, i64 52, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80}
!13 = !{!"short", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !13, i64 8}
!16 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 10, !13, i64 12, !6, i64 16}
!17 = !{!16, !13, i64 12}
!18 = !{!16, !13, i64 10}
!19 = !{!20, !6, i64 24}
!20 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24}
!21 = distinct !{!21, !22}
!22 = !{!"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"

%struct.button_t = type { ptr, i32, i32, i32, ptr }
%struct.side_t = type { i32, i32, i16, i16, i16, ptr }

@numswitches = external dso_local local_unnamed_addr global i32, align 4
@switchlist = external dso_local local_unnamed_addr global [100 x i32], align 16
@buttonlist = external dso_local local_unnamed_addr global [16 x %struct.button_t], align 16
@sides = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: nounwind uwtable
define dso_local void @P_ChangeSwitchTexture(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %.not = icmp eq i32 %1, 0
  %3 = getelementptr inbounds i8, ptr %0, i64 26
  br i1 %.not, label %6, label %._crit_edge

._crit_edge:                                      ; preds = %2
  %.pre = load i16, ptr %3, align 2, !tbaa !5
  %4 = icmp eq i16 %.pre, 11
  %5 = select i1 %4, i32 24, i32 23
  br label %7

6:                                                ; preds = %2
  store i16 0, ptr %3, align 2, !tbaa !5
  br label %7

7:                                                ; preds = %._crit_edge, %6
  %spec.store.select = phi i32 [ %5, %._crit_edge ], [ 23, %6 ]
  %8 = load ptr, ptr @sides, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %0, i64 30
  %10 = load i16, ptr %9, align 2, !tbaa !13
  %11 = sext i16 %10 to i64
  %12 = getelementptr inbounds %struct.side_t, ptr %8, i64 %11
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load i16, ptr %13, align 8, !tbaa !14
  %15 = sext i16 %14 to i32
  %16 = getelementptr inbounds i8, ptr %12, i64 12
  %17 = load i16, ptr %16, align 4, !tbaa !16
  %18 = sext i16 %17 to i32
  %19 = getelementptr inbounds i8, ptr %12, i64 10
  %20 = load i16, ptr %19, align 2, !tbaa !17
  %21 = sext i16 %20 to i32
  %22 = load i32, ptr @numswitches, align 4, !tbaa !18
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %7
  %24 = shl nuw i32 %22, 1
  %smax = tail call i32 @llvm.smax.i32(i32 %24, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %65
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %65 ]
  %25 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %indvars.iv
  %26 = load i32, ptr %25, align 4, !tbaa !18
  %27 = icmp eq i32 %26, %15
  br i1 %27, label %28, label %39

28:                                               ; preds = %.lr.ph
  %29 = load ptr, ptr getelementptr inbounds (i8, ptr @buttonlist, i64 24), align 8, !tbaa !19
  tail call void @S_StartSound(ptr noundef %29, i32 noundef %spec.store.select) #3
  %30 = and i64 %indvars.iv, 4294967295
  %31 = xor i64 %30, 1
  %32 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !18
  %34 = trunc i32 %33 to i16
  %35 = load ptr, ptr @sides, align 8, !tbaa !12
  %36 = load i16, ptr %9, align 2, !tbaa !13
  %37 = sext i16 %36 to i64
  %38 = getelementptr inbounds %struct.side_t, ptr %35, i64 %37, i32 2
  store i16 %34, ptr %38, align 8, !tbaa !14
  br i1 %.not, label %.loopexit, label %.loopexit.sink.split

39:                                               ; preds = %.lr.ph
  %40 = icmp eq i32 %26, %18
  br i1 %40, label %41, label %52

41:                                               ; preds = %39
  %42 = load ptr, ptr getelementptr inbounds (i8, ptr @buttonlist, i64 24), align 8, !tbaa !19
  tail call void @S_StartSound(ptr noundef %42, i32 noundef %spec.store.select) #3
  %43 = and i64 %indvars.iv, 4294967295
  %44 = xor i64 %43, 1
  %45 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !18
  %47 = trunc i32 %46 to i16
  %48 = load ptr, ptr @sides, align 8, !tbaa !12
  %49 = load i16, ptr %9, align 2, !tbaa !13
  %50 = sext i16 %49 to i64
  %51 = getelementptr inbounds %struct.side_t, ptr %48, i64 %50, i32 4
  store i16 %47, ptr %51, align 4, !tbaa !16
  br i1 %.not, label %.loopexit, label %.loopexit.sink.split

52:                                               ; preds = %39
  %53 = icmp eq i32 %26, %21
  br i1 %53, label %54, label %65

54:                                               ; preds = %52
  %55 = load ptr, ptr getelementptr inbounds (i8, ptr @buttonlist, i64 24), align 8, !tbaa !19
  tail call void @S_StartSound(ptr noundef %55, i32 noundef %spec.store.select) #3
  %56 = and i64 %indvars.iv, 4294967295
  %57 = xor i64 %56, 1
  %58 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !18
  %60 = trunc i32 %59 to i16
  %61 = load ptr, ptr @sides, align 8, !tbaa !12
  %62 = load i16, ptr %9, align 2, !tbaa !13
  %63 = sext i16 %62 to i64
  %64 = getelementptr inbounds %struct.side_t, ptr %61, i64 %63, i32 3
  store i16 %60, ptr %64, align 2, !tbaa !17
  br i1 %.not, label %.loopexit, label %.loopexit.sink.split

65:                                               ; preds = %52
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !21

.loopexit.sink.split:                             ; preds = %54, %41, %28
  %.sink = phi i32 [ 0, %28 ], [ 1, %41 ], [ 2, %54 ]
  %.sink58 = getelementptr inbounds [100 x i32], ptr @switchlist, i64 0, i64 %indvars.iv
  %66 = load i32, ptr %.sink58, align 4, !tbaa !18
  tail call void @P_StartButton(ptr noundef nonnull %0, i32 noundef %.sink, i32 noundef %66, i32 noundef 35)
  br label %.loopexit

.loopexit:                                        ; preds = %65, %.loopexit.sink.split, %7, %54, %41, %28
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 26}
!6 = !{!"line_s", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !11, i64 24, !11, i64 26, !11, i64 28, !8, i64 30, !8, i64 36, !10, i64 52, !7, i64 56, !7, i64 64, !10, i64 72, !7, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 8}
!15 = !{!"", !10, i64 0, !10, i64 4, !11, i64 8, !11, i64 10, !11, i64 12, !7, i64 16}
!16 = !{!15, !11, i64 12}
!17 = !{!15, !11, i64 10}
!18 = !{!10, !10, i64 0}
!19 = !{!20, !7, i64 24}
!20 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass