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

; 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.vldoor_t = type { %struct.thinker_s, i32, ptr, i32, i32, i32, i32, i32 }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%union.actionf_t = type { ptr }
%struct.sector_t = type { i32, i32, i16, i16, i16, i16, i16, i32, ptr, [4 x i32], %struct.degenmobj_t, i32, ptr, ptr, i32, ptr }
%struct.degenmobj_t = type { %struct.thinker_s, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local void @T_VerticalDoor(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.vldoor_t, ptr %4, i32 0, i32 5
  %6 = load i32, ptr %5, align 8, !tbaa !9
  switch i32 %6, label %166 [
    i32 0, label %7
    i32 2, label %41
    i32 -1, label %63
    i32 1, label %128
  ]

7:                                                ; preds = %1
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.vldoor_t, ptr %8, i32 0, i32 7
  %10 = load i32, ptr %9, align 8, !tbaa !13
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr %9, align 8, !tbaa !13
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %40, label %13

13:                                               ; preds = %7
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.vldoor_t, ptr %14, i32 0, i32 1
  %16 = load i32, ptr %15, align 8, !tbaa !14
  switch i32 %16, label %38 [
    i32 5, label %17
    i32 0, label %24
    i32 1, label %31
  ]

17:                                               ; preds = %13
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.vldoor_t, ptr %18, i32 0, i32 5
  store i32 -1, ptr %19, align 8, !tbaa !9
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.vldoor_t, ptr %20, i32 0, i32 2
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = getelementptr inbounds %struct.sector_t, ptr %22, i32 0, i32 10
  call void @S_StartSound(ptr noundef %23, i32 noundef 89)
  br label %39

24:                                               ; preds = %13
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.vldoor_t, ptr %25, i32 0, i32 5
  store i32 -1, ptr %26, align 8, !tbaa !9
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.vldoor_t, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !15
  %30 = getelementptr inbounds %struct.sector_t, ptr %29, i32 0, i32 10
  call void @S_StartSound(ptr noundef %30, i32 noundef 21)
  br label %39

31:                                               ; preds = %13
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.vldoor_t, ptr %32, i32 0, i32 5
  store i32 1, ptr %33, align 8, !tbaa !9
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.vldoor_t, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = getelementptr inbounds %struct.sector_t, ptr %36, i32 0, i32 10
  call void @S_StartSound(ptr noundef %37, i32 noundef 20)
  br label %39

38:                                               ; preds = %13
  br label %39

39:                                               ; preds = %38, %31, %24, %17
  br label %40

40:                                               ; preds = %39, %7
  br label %166

41:                                               ; preds = %1
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.vldoor_t, ptr %42, i32 0, i32 7
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr %43, align 8, !tbaa !13
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %62, label %47

47:                                               ; preds = %41
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.vldoor_t, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 8, !tbaa !14
  switch i32 %50, label %60 [
    i32 4, label %51
  ]

51:                                               ; preds = %47
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.vldoor_t, ptr %52, i32 0, i32 5
  store i32 1, ptr %53, align 8, !tbaa !9
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.vldoor_t, ptr %54, i32 0, i32 1
  store i32 0, ptr %55, align 8, !tbaa !14
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.vldoor_t, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !15
  %59 = getelementptr inbounds %struct.sector_t, ptr %58, i32 0, i32 10
  call void @S_StartSound(ptr noundef %59, i32 noundef 20)
  br label %61

60:                                               ; preds = %47
  br label %61

61:                                               ; preds = %60, %51
  br label %62

62:                                               ; preds = %61, %41
  br label %166

63:                                               ; preds = %1
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.vldoor_t, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.vldoor_t, ptr %67, i32 0, i32 4
  %69 = load i32, ptr %68, align 4, !tbaa !16
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.vldoor_t, ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !15
  %73 = getelementptr inbounds %struct.sector_t, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !17
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.vldoor_t, ptr %75, i32 0, i32 5
  %77 = load i32, ptr %76, align 8, !tbaa !9
  %78 = call i32 @T_MovePlane(ptr noundef %66, i32 noundef %69, i32 noundef %74, i32 noundef 0, i32 noundef 1, i32 noundef %77)
  store i32 %78, ptr %3, align 4, !tbaa !21
  %79 = load i32, ptr %3, align 4, !tbaa !21
  %80 = icmp eq i32 %79, 2
  br i1 %80, label %81, label %110

81:                                               ; preds = %63
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.vldoor_t, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 8, !tbaa !14
  switch i32 %84, label %108 [
    i32 5, label %85
    i32 7, label %85
    i32 0, label %96
    i32 2, label %96
    i32 1, label %103
  ]

85:                                               ; preds = %81, %81
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.vldoor_t, ptr %86, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !15
  %89 = getelementptr inbounds %struct.sector_t, ptr %88, i32 0, i32 13
  store ptr null, ptr %89, align 8, !tbaa !22
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.vldoor_t, ptr %90, i32 0, i32 0
  call void @P_RemoveThinker(ptr noundef %91)
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.vldoor_t, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = getelementptr inbounds %struct.sector_t, ptr %94, i32 0, i32 10
  call void @S_StartSound(ptr noundef %95, i32 noundef 89)
  br label %109

96:                                               ; preds = %81, %81
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.vldoor_t, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !15
  %100 = getelementptr inbounds %struct.sector_t, ptr %99, i32 0, i32 13
  store ptr null, ptr %100, align 8, !tbaa !22
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.vldoor_t, ptr %101, i32 0, i32 0
  call void @P_RemoveThinker(ptr noundef %102)
  br label %109

103:                                              ; preds = %81
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.vldoor_t, ptr %104, i32 0, i32 5
  store i32 0, ptr %105, align 8, !tbaa !9
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.vldoor_t, ptr %106, i32 0, i32 7
  store i32 1050, ptr %107, align 8, !tbaa !13
  br label %109

108:                                              ; preds = %81
  br label %109

109:                                              ; preds = %108, %103, %96, %85
  br label %127

110:                                              ; preds = %63
  %111 = load i32, ptr %3, align 4, !tbaa !21
  %112 = icmp eq i32 %111, 1
  br i1 %112, label %113, label %126

113:                                              ; preds = %110
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.vldoor_t, ptr %114, i32 0, i32 1
  %116 = load i32, ptr %115, align 8, !tbaa !14
  switch i32 %116, label %118 [
    i32 7, label %117
    i32 2, label %117
  ]

117:                                              ; preds = %113, %113
  br label %125

118:                                              ; preds = %113
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.vldoor_t, ptr %119, i32 0, i32 5
  store i32 1, ptr %120, align 8, !tbaa !9
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.vldoor_t, ptr %121, i32 0, i32 2
  %123 = load ptr, ptr %122, align 8, !tbaa !15
  %124 = getelementptr inbounds %struct.sector_t, ptr %123, i32 0, i32 10
  call void @S_StartSound(ptr noundef %124, i32 noundef 20)
  br label %125

125:                                              ; preds = %118, %117
  br label %126

126:                                              ; preds = %125, %110
  br label %127

127:                                              ; preds = %126, %109
  br label %166

128:                                              ; preds = %1
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.vldoor_t, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.vldoor_t, ptr %132, i32 0, i32 4
  %134 = load i32, ptr %133, align 4, !tbaa !16
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.vldoor_t, ptr %135, i32 0, i32 3
  %137 = load i32, ptr %136, align 8, !tbaa !23
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.vldoor_t, ptr %138, i32 0, i32 5
  %140 = load i32, ptr %139, align 8, !tbaa !9
  %141 = call i32 @T_MovePlane(ptr noundef %131, i32 noundef %134, i32 noundef %137, i32 noundef 0, i32 noundef 1, i32 noundef %140)
  store i32 %141, ptr %3, align 4, !tbaa !21
  %142 = load i32, ptr %3, align 4, !tbaa !21
  %143 = icmp eq i32 %142, 2
  br i1 %143, label %144, label %165

144:                                              ; preds = %128
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.vldoor_t, ptr %145, i32 0, i32 1
  %147 = load i32, ptr %146, align 8, !tbaa !14
  switch i32 %147, label %163 [
    i32 5, label %148
    i32 0, label %148
    i32 1, label %156
    i32 6, label %156
    i32 3, label %156
  ]

148:                                              ; preds = %144, %144
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.vldoor_t, ptr %149, i32 0, i32 5
  store i32 0, ptr %150, align 8, !tbaa !9
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.vldoor_t, ptr %151, i32 0, i32 6
  %153 = load i32, ptr %152, align 4, !tbaa !24
  %154 = load ptr, ptr %2, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.vldoor_t, ptr %154, i32 0, i32 7
  store i32 %153, ptr %155, align 8, !tbaa !13
  br label %164

156:                                              ; preds = %144, %144, %144
  %157 = load ptr, ptr %2, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.vldoor_t, ptr %157, i32 0, i32 2
  %159 = load ptr, ptr %158, align 8, !tbaa !15
  %160 = getelementptr inbounds %struct.sector_t, ptr %159, i32 0, i32 13
  store ptr null, ptr %160, align 8, !tbaa !22
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.vldoor_t, ptr %161, i32 0, i32 0
  call void @P_RemoveThinker(ptr noundef %162)
  br label %164

163:                                              ; preds = %144
  br label %164

164:                                              ; preds = %163, %156, %148
  br label %165

165:                                              ; preds = %164, %128
  br label %166

166:                                              ; preds = %165, %127, %62, %40, %1
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

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

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

declare i32 @T_MovePlane(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @P_RemoveThinker(ptr noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 48}
!10 = !{!"", !11, i64 0, !12, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56}
!11 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !12, i64 56}
!14 = !{!10, !12, i64 24}
!15 = !{!10, !6, i64 32}
!16 = !{!10, !12, i64 44}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !12, i64 4, !19, i64 8, !19, i64 10, !19, i64 12, !19, i64 14, !19, i64 16, !12, i64 20, !6, i64 24, !7, i64 32, !20, i64 48, !12, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !6, i64 120}
!19 = !{!"short", !7, i64 0}
!20 = !{!"", !11, i64 0, !12, i64 24, !12, i64 28, !12, i64 32}
!21 = !{!12, !12, i64 0}
!22 = !{!18, !6, i64 104}
!23 = !{!10, !12, i64 40}
!24 = !{!10, !12, i64 52}


; 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: nounwind uwtable
define dso_local void @T_VerticalDoor(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 48
  %3 = load i32, ptr %2, align 8, !tbaa !5
  switch i32 %3, label %79 [
    i32 0, label %4
    i32 2, label %23
    i32 -1, label %34
    i32 1, label %60
  ]

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = load i32, ptr %5, align 8, !tbaa !12
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr %5, align 8, !tbaa !12
  %.not42 = icmp eq i32 %7, 0
  br i1 %.not42, label %8, label %79

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  %10 = load i32, ptr %9, align 8, !tbaa !13
  switch i32 %10, label %79 [
    i32 5, label %11
    i32 0, label %15
    i32 1, label %19
  ]

11:                                               ; preds = %8
  store i32 -1, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %13, i64 48
  tail call void @S_StartSound(ptr noundef nonnull %14, i32 noundef 89) #2
  br label %79

15:                                               ; preds = %8
  store i32 -1, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %17, i64 48
  tail call void @S_StartSound(ptr noundef nonnull %18, i32 noundef 21) #2
  br label %79

19:                                               ; preds = %8
  store i32 1, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %21, i64 48
  tail call void @S_StartSound(ptr noundef nonnull %22, i32 noundef 20) #2
  br label %79

23:                                               ; preds = %1
  %24 = getelementptr inbounds i8, ptr %0, i64 56
  %25 = load i32, ptr %24, align 8, !tbaa !12
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %24, align 8, !tbaa !12
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %27, label %79

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %0, i64 24
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %cond = icmp eq i32 %29, 4
  br i1 %cond, label %30, label %79

30:                                               ; preds = %27
  store i32 1, ptr %2, align 8, !tbaa !5
  store i32 0, ptr %28, align 8, !tbaa !13
  %31 = getelementptr inbounds i8, ptr %0, i64 32
  %32 = load ptr, ptr %31, align 8, !tbaa !14
  %33 = getelementptr inbounds i8, ptr %32, i64 48
  tail call void @S_StartSound(ptr noundef nonnull %33, i32 noundef 20) #2
  br label %79

34:                                               ; preds = %1
  %35 = getelementptr inbounds i8, ptr %0, i64 32
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = getelementptr inbounds i8, ptr %0, i64 44
  %38 = load i32, ptr %37, align 4, !tbaa !15
  %39 = load i32, ptr %36, align 8, !tbaa !16
  %40 = tail call i32 @T_MovePlane(ptr noundef nonnull %36, i32 noundef %38, i32 noundef %39, i32 noundef 0, i32 noundef 1, i32 noundef -1) #2
  switch i32 %40, label %79 [
    i32 2, label %41
    i32 1, label %54
  ]

41:                                               ; preds = %34
  %42 = getelementptr inbounds i8, ptr %0, i64 24
  %43 = load i32, ptr %42, align 8, !tbaa !13
  switch i32 %43, label %79 [
    i32 5, label %44
    i32 7, label %44
    i32 0, label %49
    i32 2, label %49
    i32 1, label %52
  ]

44:                                               ; preds = %41, %41
  %45 = load ptr, ptr %35, align 8, !tbaa !14
  %46 = getelementptr inbounds i8, ptr %45, i64 104
  store ptr null, ptr %46, align 8, !tbaa !20
  tail call void @P_RemoveThinker(ptr noundef nonnull %0) #2
  %47 = load ptr, ptr %35, align 8, !tbaa !14
  %48 = getelementptr inbounds i8, ptr %47, i64 48
  tail call void @S_StartSound(ptr noundef nonnull %48, i32 noundef 89) #2
  br label %79

49:                                               ; preds = %41, %41
  %50 = load ptr, ptr %35, align 8, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %50, i64 104
  store ptr null, ptr %51, align 8, !tbaa !20
  tail call void @P_RemoveThinker(ptr noundef nonnull %0) #2
  br label %79

52:                                               ; preds = %41
  store i32 0, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 1050, ptr %53, align 8, !tbaa !12
  br label %79

54:                                               ; preds = %34
  %55 = getelementptr inbounds i8, ptr %0, i64 24
  %56 = load i32, ptr %55, align 8, !tbaa !13
  switch i32 %56, label %57 [
    i32 7, label %79
    i32 2, label %79
  ]

57:                                               ; preds = %54
  store i32 1, ptr %2, align 8, !tbaa !5
  %58 = load ptr, ptr %35, align 8, !tbaa !14
  %59 = getelementptr inbounds i8, ptr %58, i64 48
  tail call void @S_StartSound(ptr noundef nonnull %59, i32 noundef 20) #2
  br label %79

60:                                               ; preds = %1
  %61 = getelementptr inbounds i8, ptr %0, i64 32
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  %63 = getelementptr inbounds i8, ptr %0, i64 44
  %64 = load i32, ptr %63, align 4, !tbaa !15
  %65 = getelementptr inbounds i8, ptr %0, i64 40
  %66 = load i32, ptr %65, align 8, !tbaa !21
  %67 = tail call i32 @T_MovePlane(ptr noundef %62, i32 noundef %64, i32 noundef %66, i32 noundef 0, i32 noundef 1, i32 noundef 1) #2
  %68 = icmp eq i32 %67, 2
  br i1 %68, label %69, label %79

69:                                               ; preds = %60
  %70 = getelementptr inbounds i8, ptr %0, i64 24
  %71 = load i32, ptr %70, align 8, !tbaa !13
  switch i32 %71, label %79 [
    i32 5, label %72
    i32 0, label %72
    i32 1, label %76
    i32 6, label %76
    i32 3, label %76
  ]

72:                                               ; preds = %69, %69
  store i32 0, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %0, i64 52
  %74 = load i32, ptr %73, align 4, !tbaa !22
  %75 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 %74, ptr %75, align 8, !tbaa !12
  br label %79

76:                                               ; preds = %69, %69, %69
  %77 = load ptr, ptr %61, align 8, !tbaa !14
  %78 = getelementptr inbounds i8, ptr %77, i64 104
  store ptr null, ptr %78, align 8, !tbaa !20
  tail call void @P_RemoveThinker(ptr noundef nonnull %0) #2
  br label %79

79:                                               ; preds = %34, %60, %69, %76, %72, %41, %52, %49, %44, %57, %54, %54, %23, %27, %30, %4, %8, %19, %15, %11, %1
  ret void
}

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

declare i32 @T_MovePlane(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @P_RemoveThinker(ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 48}
!6 = !{!"", !7, i64 0, !11, i64 24, !8, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56}
!7 = !{!"thinker_s", !8, i64 0, !8, i64 8, !9, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!6, !11, i64 56}
!13 = !{!6, !11, i64 24}
!14 = !{!6, !8, i64 32}
!15 = !{!6, !11, i64 44}
!16 = !{!17, !11, i64 0}
!17 = !{!"", !11, i64 0, !11, i64 4, !18, i64 8, !18, i64 10, !18, i64 12, !18, i64 14, !18, i64 16, !11, i64 20, !8, i64 24, !9, i64 32, !19, i64 48, !11, i64 88, !8, i64 96, !8, i64 104, !11, i64 112, !8, i64 120}
!18 = !{!"short", !9, i64 0}
!19 = !{!"", !7, i64 0, !11, i64 24, !11, i64 28, !11, i64 32}
!20 = !{!17, !8, i64 104}
!21 = !{!6, !11, i64 40}
!22 = !{!6, !11, i64 52}


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