; 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.mobj_s = type { %struct.thinker_s, i32, i32, i32, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, %struct.mapthing_t, ptr }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%union.actionf_t = type { ptr }
%struct.mapthing_t = type { i16, i16, i16, i16, i16 }
%struct.line_s = type { ptr, ptr, i32, i32, i16, i16, i16, [2 x i16], [4 x i32], i32, ptr, ptr, i32, ptr }
%struct.player_s = type { ptr, i32, %struct.ticcmd_t, i32, i32, i32, i32, i32, i32, i32, [6 x i32], [6 x i32], i32, [4 x i32], i32, i32, [9 x i32], [4 x i32], [4 x i32], i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, [2 x %struct.pspdef_t], i32 }
%struct.ticcmd_t = type { i8, i8, i16, i16, i8, i8 }
%struct.pspdef_t = type { ptr, i32, i32, i32 }
%struct.side_t = type { i32, i32, i16, i16, i16, 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 }
%struct.vldoor_t = type { %struct.thinker_s, i32, ptr, i32, i32, i32, i32, i32 }

@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@sides = external global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local void @T_VerticalDoor(ptr noundef) #0

; 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

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

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

declare void @P_AddThinker(ptr noundef) #2

declare i32 @P_FindLowestCeilingSurrounding(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @EV_VerticalDoor(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.mobj_s, ptr %10, i32 0, i32 31
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  store ptr %12, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.line_s, ptr %13, i32 0, i32 5
  %15 = load i16, ptr %14, align 2, !tbaa !16
  %16 = sext i16 %15 to i32
  switch i32 %16, label %77 [
    i32 26, label %17
    i32 32, label %17
    i32 27, label %37
    i32 34, label %37
    i32 28, label %57
    i32 33, label %57
  ]

17:                                               ; preds = %2, %2
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  store i32 1, ptr %9, align 4
  br label %187

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.player_s, ptr %22, i32 0, i32 11
  %24 = getelementptr inbounds [6 x i32], ptr %23, i64 0, i64 0
  %25 = load i32, ptr %24, align 8, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %36, label %27

27:                                               ; preds = %21
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.player_s, ptr %28, i32 0, i32 11
  %30 = getelementptr inbounds [6 x i32], ptr %29, i64 0, i64 3
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %36, label %33

33:                                               ; preds = %27
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.player_s, ptr %34, i32 0, i32 26
  store ptr @.str.3, ptr %35, align 8, !tbaa !18
  call void @S_StartSound(ptr noundef null, i32 noundef 34)
  store i32 1, ptr %9, align 4
  br label %187

36:                                               ; preds = %27, %21
  br label %77

37:                                               ; preds = %2, %2
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  store i32 1, ptr %9, align 4
  br label %187

41:                                               ; preds = %37
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.player_s, ptr %42, i32 0, i32 11
  %44 = getelementptr inbounds [6 x i32], ptr %43, i64 0, i64 1
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %56, label %47

47:                                               ; preds = %41
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.player_s, ptr %48, i32 0, i32 11
  %50 = getelementptr inbounds [6 x i32], ptr %49, i64 0, i64 4
  %51 = load i32, ptr %50, align 8, !tbaa !9
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %56, label %53

53:                                               ; preds = %47
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.player_s, ptr %54, i32 0, i32 26
  store ptr @.str.4, ptr %55, align 8, !tbaa !18
  call void @S_StartSound(ptr noundef null, i32 noundef 34)
  store i32 1, ptr %9, align 4
  br label %187

56:                                               ; preds = %47, %41
  br label %77

57:                                               ; preds = %2, %2
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = icmp ne ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  store i32 1, ptr %9, align 4
  br label %187

61:                                               ; preds = %57
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.player_s, ptr %62, i32 0, i32 11
  %64 = getelementptr inbounds [6 x i32], ptr %63, i64 0, i64 2
  %65 = load i32, ptr %64, align 8, !tbaa !9
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %76, label %67

67:                                               ; preds = %61
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.player_s, ptr %68, i32 0, i32 11
  %70 = getelementptr inbounds [6 x i32], ptr %69, i64 0, i64 5
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %76, label %73

73:                                               ; preds = %67
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.player_s, ptr %74, i32 0, i32 26
  store ptr @.str.5, ptr %75, align 8, !tbaa !18
  call void @S_StartSound(ptr noundef null, i32 noundef 34)
  store i32 1, ptr %9, align 4
  br label %187

76:                                               ; preds = %67, %61
  br label %77

77:                                               ; preds = %76, %56, %36, %2
  %78 = load ptr, ptr @sides, align 8, !tbaa !5
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.line_s, ptr %79, i32 0, i32 7
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = xor i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [2 x i16], ptr %80, i64 0, i64 %83
  %85 = load i16, ptr %84, align 2, !tbaa !21
  %86 = sext i16 %85 to i64
  %87 = getelementptr inbounds %struct.side_t, ptr %78, i64 %86
  %88 = getelementptr inbounds %struct.side_t, ptr %87, i32 0, i32 5
  %89 = load ptr, ptr %88, align 8, !tbaa !22
  store ptr %89, ptr %6, align 8, !tbaa !5
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.sector_t, ptr %90, i32 0, i32 13
  %92 = load ptr, ptr %91, align 8, !tbaa !24
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %121

94:                                               ; preds = %77
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.sector_t, ptr %95, i32 0, i32 13
  %97 = load ptr, ptr %96, align 8, !tbaa !24
  store ptr %97, ptr %7, align 8, !tbaa !5
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.line_s, ptr %98, i32 0, i32 5
  %100 = load i16, ptr %99, align 2, !tbaa !16
  %101 = sext i16 %100 to i32
  switch i32 %101, label %120 [
    i32 1, label %102
    i32 26, label %102
    i32 27, label %102
    i32 28, label %102
    i32 117, label %102
  ]

102:                                              ; preds = %94, %94, %94, %94, %94
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.vldoor_t, ptr %103, i32 0, i32 5
  %105 = load i32, ptr %104, align 8, !tbaa !27
  %106 = icmp eq i32 %105, -1
  br i1 %106, label %107, label %110

107:                                              ; preds = %102
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.vldoor_t, ptr %108, i32 0, i32 5
  store i32 1, ptr %109, align 8, !tbaa !27
  br label %119

110:                                              ; preds = %102
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.mobj_s, ptr %111, i32 0, i32 31
  %113 = load ptr, ptr %112, align 8, !tbaa !11
  %114 = icmp ne ptr %113, null
  br i1 %114, label %116, label %115

115:                                              ; preds = %110
  store i32 1, ptr %9, align 4
  br label %187

116:                                              ; preds = %110
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.vldoor_t, ptr %117, i32 0, i32 5
  store i32 -1, ptr %118, align 8, !tbaa !27
  br label %119

119:                                              ; preds = %116, %107
  store i32 1, ptr %9, align 4
  br label %187

120:                                              ; preds = %94
  br label %121

121:                                              ; preds = %120, %77
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.line_s, ptr %122, i32 0, i32 5
  %124 = load i16, ptr %123, align 2, !tbaa !16
  %125 = sext i16 %124 to i32
  switch i32 %125, label %132 [
    i32 117, label %126
    i32 118, label %126
    i32 1, label %129
    i32 31, label %129
  ]

126:                                              ; preds = %121, %121
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.sector_t, ptr %127, i32 0, i32 10
  call void @S_StartSound(ptr noundef %128, i32 noundef 88)
  br label %135

129:                                              ; preds = %121, %121
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.sector_t, ptr %130, i32 0, i32 10
  call void @S_StartSound(ptr noundef %131, i32 noundef 20)
  br label %135

132:                                              ; preds = %121
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.sector_t, ptr %133, i32 0, i32 10
  call void @S_StartSound(ptr noundef %134, i32 noundef 20)
  br label %135

135:                                              ; preds = %132, %129, %126
  %136 = call ptr @Z_Malloc(i32 noundef 64, i32 noundef 51, ptr noundef null)
  store ptr %136, ptr %7, align 8, !tbaa !5
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.vldoor_t, ptr %137, i32 0, i32 0
  call void @P_AddThinker(ptr noundef %138)
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.sector_t, ptr %140, i32 0, i32 13
  store ptr %139, ptr %141, align 8, !tbaa !24
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.vldoor_t, ptr %142, i32 0, i32 0
  %144 = getelementptr inbounds %struct.thinker_s, ptr %143, i32 0, i32 2
  store ptr @T_VerticalDoor, ptr %144, align 8, !tbaa !29
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.vldoor_t, ptr %146, i32 0, i32 2
  store ptr %145, ptr %147, align 8, !tbaa !30
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.vldoor_t, ptr %148, i32 0, i32 5
  store i32 1, ptr %149, align 8, !tbaa !27
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.vldoor_t, ptr %150, i32 0, i32 4
  store i32 131072, ptr %151, align 4, !tbaa !31
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.vldoor_t, ptr %152, i32 0, i32 6
  store i32 150, ptr %153, align 4, !tbaa !32
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.line_s, ptr %154, i32 0, i32 5
  %156 = load i16, ptr %155, align 2, !tbaa !16
  %157 = sext i16 %156 to i32
  switch i32 %157, label %178 [
    i32 1, label %158
    i32 26, label %158
    i32 27, label %158
    i32 28, label %158
    i32 31, label %161
    i32 32, label %161
    i32 33, label %161
    i32 34, label %161
    i32 117, label %166
    i32 118, label %171
  ]

158:                                              ; preds = %135, %135, %135, %135
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.vldoor_t, ptr %159, i32 0, i32 1
  store i32 0, ptr %160, align 8, !tbaa !33
  br label %178

161:                                              ; preds = %135, %135, %135, %135
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.vldoor_t, ptr %162, i32 0, i32 1
  store i32 3, ptr %163, align 8, !tbaa !33
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.line_s, ptr %164, i32 0, i32 5
  store i16 0, ptr %165, align 2, !tbaa !16
  br label %178

166:                                              ; preds = %135
  %167 = load ptr, ptr %7, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.vldoor_t, ptr %167, i32 0, i32 1
  store i32 5, ptr %168, align 8, !tbaa !33
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.vldoor_t, ptr %169, i32 0, i32 4
  store i32 524288, ptr %170, align 4, !tbaa !31
  br label %178

171:                                              ; preds = %135
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.vldoor_t, ptr %172, i32 0, i32 1
  store i32 6, ptr %173, align 8, !tbaa !33
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.line_s, ptr %174, i32 0, i32 5
  store i16 0, ptr %175, align 2, !tbaa !16
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.vldoor_t, ptr %176, i32 0, i32 4
  store i32 524288, ptr %177, align 4, !tbaa !31
  br label %178

178:                                              ; preds = %171, %166, %161, %158, %135
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = call i32 @P_FindLowestCeilingSurrounding(ptr noundef %179)
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.vldoor_t, ptr %181, i32 0, i32 3
  store i32 %180, ptr %182, align 8, !tbaa !34
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.vldoor_t, ptr %183, i32 0, i32 3
  %185 = load i32, ptr %184, align 8, !tbaa !34
  %186 = sub nsw i32 %185, 262144
  store i32 %186, ptr %184, align 8, !tbaa !34
  store i32 0, ptr %9, align 4
  br label %187

187:                                              ; preds = %178, %119, %115, %73, %60, %53, %40, %33, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %188 = load i32, ptr %9, align 4
  switch i32 %188, label %190 [
    i32 0, label %189
    i32 1, label %189
  ]

189:                                              ; preds = %187, %187
  ret void

190:                                              ; preds = %187
  unreachable
}

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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 192}
!12 = !{!"mobj_s", !13, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !6, i64 136, !10, i64 144, !6, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !6, i64 176, !10, i64 184, !10, i64 188, !6, i64 192, !10, i64 200, !14, i64 204, !6, i64 216}
!13 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!14 = !{!"", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !15, i64 26}
!17 = !{!"line_s", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !15, i64 24, !15, i64 26, !15, i64 28, !7, i64 30, !7, i64 36, !10, i64 52, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80}
!18 = !{!19, !6, i64 224}
!19 = !{!"player_s", !6, i64 0, !10, i64 8, !20, i64 12, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !7, i64 72, !10, i64 96, !7, i64 100, !10, i64 116, !10, i64 120, !7, i64 124, !7, i64 160, !7, i64 176, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !6, i64 224, !10, i64 232, !10, i64 236, !6, i64 240, !10, i64 248, !10, i64 252, !10, i64 256, !7, i64 264, !10, i64 312}
!20 = !{!"", !7, i64 0, !7, i64 1, !15, i64 2, !15, i64 4, !7, i64 6, !7, i64 7}
!21 = !{!15, !15, i64 0}
!22 = !{!23, !6, i64 16}
!23 = !{!"", !10, i64 0, !10, i64 4, !15, i64 8, !15, i64 10, !15, i64 12, !6, i64 16}
!24 = !{!25, !6, i64 104}
!25 = !{!"", !10, i64 0, !10, i64 4, !15, i64 8, !15, i64 10, !15, i64 12, !15, i64 14, !15, i64 16, !10, i64 20, !6, i64 24, !7, i64 32, !26, i64 48, !10, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !6, i64 120}
!26 = !{!"", !13, i64 0, !10, i64 24, !10, i64 28, !10, i64 32}
!27 = !{!28, !10, i64 48}
!28 = !{!"", !13, i64 0, !10, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!29 = !{!7, !7, i64 0}
!30 = !{!28, !6, i64 32}
!31 = !{!28, !10, i64 44}
!32 = !{!28, !10, i64 52}
!33 = !{!28, !10, i64 24}
!34 = !{!28, !10, i64 40}


; 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.side_t = type { i32, i32, i16, i16, i16, ptr }

@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@sides = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local void @T_VerticalDoor(ptr noundef) #0

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

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

declare void @P_AddThinker(ptr noundef) local_unnamed_addr #1

declare i32 @P_FindLowestCeilingSurrounding(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @EV_VerticalDoor(ptr nocapture noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 192
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 26
  %6 = load i16, ptr %5, align 2, !tbaa !14
  switch i16 %6, label %34 [
    i16 26, label %7
    i16 32, label %7
    i16 27, label %16
    i16 34, label %16
    i16 28, label %25
    i16 33, label %25
  ]

7:                                                ; preds = %2, %2
  %.not53 = icmp eq ptr %4, null
  br i1 %.not53, label %74, label %8

8:                                                ; preds = %7
  %9 = getelementptr inbounds i8, ptr %4, i64 72
  %10 = load i32, ptr %9, align 8, !tbaa !16
  %.not54 = icmp eq i32 %10, 0
  br i1 %.not54, label %11, label %34

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %4, i64 84
  %13 = load i32, ptr %12, align 4, !tbaa !16
  %.not55 = icmp eq i32 %13, 0
  br i1 %.not55, label %14, label %34

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %4, i64 224
  store ptr @.str.3, ptr %15, align 8, !tbaa !17
  tail call void @S_StartSound(ptr noundef null, i32 noundef 34) #2
  br label %74

16:                                               ; preds = %2, %2
  %.not50 = icmp eq ptr %4, null
  br i1 %.not50, label %74, label %17

17:                                               ; preds = %16
  %18 = getelementptr inbounds i8, ptr %4, i64 76
  %19 = load i32, ptr %18, align 4, !tbaa !16
  %.not51 = icmp eq i32 %19, 0
  br i1 %.not51, label %20, label %34

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %4, i64 88
  %22 = load i32, ptr %21, align 8, !tbaa !16
  %.not52 = icmp eq i32 %22, 0
  br i1 %.not52, label %23, label %34

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %4, i64 224
  store ptr @.str.4, ptr %24, align 8, !tbaa !17
  tail call void @S_StartSound(ptr noundef null, i32 noundef 34) #2
  br label %74

25:                                               ; preds = %2, %2
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %74, label %26

26:                                               ; preds = %25
  %27 = getelementptr inbounds i8, ptr %4, i64 80
  %28 = load i32, ptr %27, align 8, !tbaa !16
  %.not48 = icmp eq i32 %28, 0
  br i1 %.not48, label %29, label %34

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %4, i64 92
  %31 = load i32, ptr %30, align 4, !tbaa !16
  %.not49 = icmp eq i32 %31, 0
  br i1 %.not49, label %32, label %34

32:                                               ; preds = %29
  %33 = getelementptr inbounds i8, ptr %4, i64 224
  store ptr @.str.5, ptr %33, align 8, !tbaa !17
  tail call void @S_StartSound(ptr noundef null, i32 noundef 34) #2
  br label %74

34:                                               ; preds = %26, %29, %17, %20, %8, %11, %2
  %35 = load ptr, ptr @sides, align 8, !tbaa !20
  %36 = getelementptr inbounds i8, ptr %0, i64 32
  %37 = load i16, ptr %36, align 2, !tbaa !21
  %38 = sext i16 %37 to i64
  %39 = getelementptr inbounds %struct.side_t, ptr %35, i64 %38, i32 5
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %40, i64 104
  %42 = load ptr, ptr %41, align 8, !tbaa !24
  %.not56 = icmp eq ptr %42, null
  br i1 %.not56, label %50, label %43

43:                                               ; preds = %34
  switch i16 %6, label %52 [
    i16 1, label %44
    i16 26, label %44
    i16 27, label %44
    i16 28, label %44
    i16 117, label %44
    i16 118, label %53
    i16 31, label %51
  ]

44:                                               ; preds = %43, %43, %43, %43, %43
  %45 = getelementptr inbounds i8, ptr %42, i64 48
  %46 = load i32, ptr %45, align 8, !tbaa !27
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  %.not57 = icmp eq ptr %4, null
  br i1 %.not57, label %74, label %49

49:                                               ; preds = %48, %44
  %storemerge = phi i32 [ 1, %44 ], [ -1, %48 ]
  store i32 %storemerge, ptr %45, align 8, !tbaa !27
  br label %74

50:                                               ; preds = %34
  switch i16 %6, label %52 [
    i16 117, label %53
    i16 118, label %53
    i16 1, label %51
    i16 31, label %51
  ]

51:                                               ; preds = %43, %50, %50
  br label %53

52:                                               ; preds = %43, %50
  br label %53

53:                                               ; preds = %50, %50, %43, %52, %51
  %.sink58 = phi i32 [ 20, %52 ], [ 20, %51 ], [ 88, %43 ], [ 88, %50 ], [ 88, %50 ]
  %54 = getelementptr inbounds i8, ptr %40, i64 48
  tail call void @S_StartSound(ptr noundef nonnull %54, i32 noundef %.sink58) #2
  %55 = tail call ptr @Z_Malloc(i32 noundef 64, i32 noundef 51, ptr noundef null) #2
  tail call void @P_AddThinker(ptr noundef %55) #2
  store ptr %55, ptr %41, align 8, !tbaa !24
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  store ptr @T_VerticalDoor, ptr %56, align 8, !tbaa !29
  %57 = getelementptr inbounds i8, ptr %55, i64 32
  store ptr %40, ptr %57, align 8, !tbaa !30
  %58 = getelementptr inbounds i8, ptr %55, i64 48
  store i32 1, ptr %58, align 8, !tbaa !27
  %59 = getelementptr inbounds i8, ptr %55, i64 44
  store i32 131072, ptr %59, align 4, !tbaa !31
  %60 = getelementptr inbounds i8, ptr %55, i64 52
  store i32 150, ptr %60, align 4, !tbaa !32
  %61 = load i16, ptr %5, align 2, !tbaa !14
  switch i16 %61, label %70 [
    i16 1, label %62
    i16 26, label %62
    i16 27, label %62
    i16 28, label %62
    i16 31, label %64
    i16 32, label %64
    i16 33, label %64
    i16 34, label %64
    i16 117, label %66
    i16 118, label %68
  ]

62:                                               ; preds = %53, %53, %53, %53
  %63 = getelementptr inbounds i8, ptr %55, i64 24
  store i32 0, ptr %63, align 8, !tbaa !33
  br label %70

64:                                               ; preds = %53, %53, %53, %53
  %65 = getelementptr inbounds i8, ptr %55, i64 24
  store i32 3, ptr %65, align 8, !tbaa !33
  store i16 0, ptr %5, align 2, !tbaa !14
  br label %70

66:                                               ; preds = %53
  %67 = getelementptr inbounds i8, ptr %55, i64 24
  store i32 5, ptr %67, align 8, !tbaa !33
  store i32 524288, ptr %59, align 4, !tbaa !31
  br label %70

68:                                               ; preds = %53
  %69 = getelementptr inbounds i8, ptr %55, i64 24
  store i32 6, ptr %69, align 8, !tbaa !33
  store i16 0, ptr %5, align 2, !tbaa !14
  store i32 524288, ptr %59, align 4, !tbaa !31
  br label %70

70:                                               ; preds = %68, %66, %64, %62, %53
  %71 = tail call i32 @P_FindLowestCeilingSurrounding(ptr noundef nonnull %40) #2
  %72 = getelementptr inbounds i8, ptr %55, i64 40
  %73 = add nsw i32 %71, -262144
  store i32 %73, ptr %72, align 8, !tbaa !34
  br label %74

74:                                               ; preds = %48, %25, %16, %7, %70, %49, %32, %23, %14
  ret void
}

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, !8, i64 192}
!6 = !{!"mobj_s", !7, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !8, i64 40, !8, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !8, i64 136, !11, i64 144, !8, i64 152, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !8, i64 176, !11, i64 184, !11, i64 188, !8, i64 192, !11, i64 200, !12, i64 204, !8, i64 216}
!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 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!13 = !{!"short", !9, i64 0}
!14 = !{!15, !13, i64 26}
!15 = !{!"line_s", !8, i64 0, !8, i64 8, !11, i64 16, !11, i64 20, !13, i64 24, !13, i64 26, !13, i64 28, !9, i64 30, !9, i64 36, !11, i64 52, !8, i64 56, !8, i64 64, !11, i64 72, !8, i64 80}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !8, i64 224}
!18 = !{!"player_s", !8, i64 0, !11, i64 8, !19, i64 12, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !9, i64 48, !9, i64 72, !11, i64 96, !9, i64 100, !11, i64 116, !11, i64 120, !9, i64 124, !9, i64 160, !9, i64 176, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !11, i64 212, !11, i64 216, !8, i64 224, !11, i64 232, !11, i64 236, !8, i64 240, !11, i64 248, !11, i64 252, !11, i64 256, !9, i64 264, !11, i64 312}
!19 = !{!"", !9, i64 0, !9, i64 1, !13, i64 2, !13, i64 4, !9, i64 6, !9, i64 7}
!20 = !{!8, !8, i64 0}
!21 = !{!13, !13, i64 0}
!22 = !{!23, !8, i64 16}
!23 = !{!"", !11, i64 0, !11, i64 4, !13, i64 8, !13, i64 10, !13, i64 12, !8, i64 16}
!24 = !{!25, !8, i64 104}
!25 = !{!"", !11, i64 0, !11, i64 4, !13, i64 8, !13, i64 10, !13, i64 12, !13, i64 14, !13, i64 16, !11, i64 20, !8, i64 24, !9, i64 32, !26, i64 48, !11, i64 88, !8, i64 96, !8, i64 104, !11, i64 112, !8, i64 120}
!26 = !{!"", !7, i64 0, !11, i64 24, !11, i64 28, !11, i64 32}
!27 = !{!28, !11, i64 48}
!28 = !{!"", !7, i64 0, !11, i64 24, !8, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56}
!29 = !{!9, !9, i64 0}
!30 = !{!28, !8, i64 32}
!31 = !{!28, !11, i64 44}
!32 = !{!28, !11, i64 52}
!33 = !{!28, !11, i64 24}
!34 = !{!28, !11, i64 40}


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