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

; 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.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.thinker_s = type { ptr, ptr, %union.actionf_t }
%union.actionf_t = type { 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 }

@save_p = external dso_local global ptr, align 8
@sectors = external global ptr, align 8
@numsectors = external global i32, align 4
@lines = external global ptr, align 8
@numlines = external global i32, align 4
@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
define dso_local void @P_ArchiveWorld() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %7 = load ptr, ptr @save_p, align 8, !tbaa !5
  store ptr %7, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !9
  %8 = load ptr, ptr @sectors, align 8, !tbaa !5
  store ptr %8, ptr %3, align 8, !tbaa !5
  br label %9

9:                                                ; preds = %53, %0
  %10 = load i32, ptr %1, align 4, !tbaa !9
  %11 = load i32, ptr @numsectors, align 4, !tbaa !9
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %13, label %58

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

53:                                               ; preds = %13
  %54 = load i32, ptr %1, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %1, align 4, !tbaa !9
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.sector_t, ptr %56, i32 1
  store ptr %57, ptr %3, align 8, !tbaa !5
  br label %9, !llvm.loop !23

58:                                               ; preds = %9
  store i32 0, ptr %1, align 4, !tbaa !9
  %59 = load ptr, ptr @lines, align 8, !tbaa !5
  store ptr %59, ptr %4, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %136, %58
  %61 = load i32, ptr %1, align 4, !tbaa !9
  %62 = load i32, ptr @numlines, align 4, !tbaa !9
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %141

64:                                               ; preds = %60
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.line_s, ptr %65, i32 0, i32 4
  %67 = load i16, ptr %66, align 8, !tbaa !25
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds i16, ptr %68, i32 1
  store ptr %69, ptr %6, align 8, !tbaa !5
  store i16 %67, ptr %68, align 2, !tbaa !16
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.line_s, ptr %70, i32 0, i32 5
  %72 = load i16, ptr %71, align 2, !tbaa !27
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds i16, ptr %73, i32 1
  store ptr %74, ptr %6, align 8, !tbaa !5
  store i16 %72, ptr %73, align 2, !tbaa !16
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.line_s, ptr %75, i32 0, i32 6
  %77 = load i16, ptr %76, align 4, !tbaa !28
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds i16, ptr %78, i32 1
  store ptr %79, ptr %6, align 8, !tbaa !5
  store i16 %77, ptr %78, align 2, !tbaa !16
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %132, %64
  %81 = load i32, ptr %2, align 4, !tbaa !9
  %82 = icmp slt i32 %81, 2
  br i1 %82, label %83, label %135

83:                                               ; preds = %80
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.line_s, ptr %84, i32 0, i32 7
  %86 = load i32, ptr %2, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2 x i16], ptr %85, i64 0, i64 %87
  %89 = load i16, ptr %88, align 2, !tbaa !16
  %90 = sext i16 %89 to i32
  %91 = icmp eq i32 %90, -1
  br i1 %91, label %92, label %93

92:                                               ; preds = %83
  br label %132

93:                                               ; preds = %83
  %94 = load ptr, ptr @sides, align 8, !tbaa !5
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.line_s, ptr %95, i32 0, i32 7
  %97 = load i32, ptr %2, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [2 x i16], ptr %96, i64 0, i64 %98
  %100 = load i16, ptr %99, align 2, !tbaa !16
  %101 = sext i16 %100 to i64
  %102 = getelementptr inbounds %struct.side_t, ptr %94, i64 %101
  store ptr %102, ptr %5, align 8, !tbaa !5
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.side_t, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !29
  %106 = ashr i32 %105, 16
  %107 = trunc i32 %106 to i16
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds i16, ptr %108, i32 1
  store ptr %109, ptr %6, align 8, !tbaa !5
  store i16 %107, ptr %108, align 2, !tbaa !16
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.side_t, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !31
  %113 = ashr i32 %112, 16
  %114 = trunc i32 %113 to i16
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds i16, ptr %115, i32 1
  store ptr %116, ptr %6, align 8, !tbaa !5
  store i16 %114, ptr %115, align 2, !tbaa !16
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.side_t, ptr %117, i32 0, i32 2
  %119 = load i16, ptr %118, align 8, !tbaa !32
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds i16, ptr %120, i32 1
  store ptr %121, ptr %6, align 8, !tbaa !5
  store i16 %119, ptr %120, align 2, !tbaa !16
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.side_t, ptr %122, i32 0, i32 3
  %124 = load i16, ptr %123, align 2, !tbaa !33
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds i16, ptr %125, i32 1
  store ptr %126, ptr %6, align 8, !tbaa !5
  store i16 %124, ptr %125, align 2, !tbaa !16
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.side_t, ptr %127, i32 0, i32 4
  %129 = load i16, ptr %128, align 4, !tbaa !34
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds i16, ptr %130, i32 1
  store ptr %131, ptr %6, align 8, !tbaa !5
  store i16 %129, ptr %130, align 2, !tbaa !16
  br label %132

132:                                              ; preds = %93, %92
  %133 = load i32, ptr %2, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %2, align 4, !tbaa !9
  br label %80, !llvm.loop !35

135:                                              ; preds = %80
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %1, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %1, align 4, !tbaa !9
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.line_s, ptr %139, i32 1
  store ptr %140, ptr %4, align 8, !tbaa !5
  br label %60, !llvm.loop !36

141:                                              ; preds = %60
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %142, ptr @save_p, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #2
  ret void
}

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 = { 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, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 10, !13, i64 12, !13, i64 14, !13, i64 16, !10, i64 20, !6, i64 24, !7, i64 32, !14, i64 48, !10, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !6, i64 120}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !15, i64 0, !10, i64 24, !10, i64 28, !10, i64 32}
!15 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!16 = !{!13, !13, i64 0}
!17 = !{!12, !10, i64 4}
!18 = !{!12, !13, i64 8}
!19 = !{!12, !13, i64 10}
!20 = !{!12, !13, i64 12}
!21 = !{!12, !13, i64 14}
!22 = !{!12, !13, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !13, i64 24}
!26 = !{!"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}
!27 = !{!26, !13, i64 26}
!28 = !{!26, !13, i64 28}
!29 = !{!30, !10, i64 0}
!30 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 10, !13, i64 12, !6, i64 16}
!31 = !{!30, !10, i64 4}
!32 = !{!30, !13, i64 8}
!33 = !{!30, !13, i64 10}
!34 = !{!30, !13, i64 12}
!35 = distinct !{!35, !24}
!36 = distinct !{!36, !24}


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

@save_p = external dso_local local_unnamed_addr global ptr, align 8
@sectors = external local_unnamed_addr global ptr, align 8
@numsectors = external local_unnamed_addr global i32, align 4
@lines = external local_unnamed_addr global ptr, align 8
@numlines = external local_unnamed_addr global i32, align 4
@sides = external local_unnamed_addr global ptr, align 8

; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @P_ArchiveWorld() local_unnamed_addr #0 {
  %1 = load ptr, ptr @save_p, align 8, !tbaa !5
  %2 = load i32, ptr @numsectors, align 4, !tbaa !9
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %4 = load ptr, ptr @sectors, align 8, !tbaa !5
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.049 = phi ptr [ %23, %.lr.ph ], [ %1, %.lr.ph.preheader ]
  %.04248 = phi i32 [ %24, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %.04547 = phi ptr [ %25, %.lr.ph ], [ %4, %.lr.ph.preheader ]
  %5 = getelementptr inbounds i8, ptr %.049, i64 4
  %6 = load <2 x i32>, ptr %.04547, align 8, !tbaa !9
  %7 = lshr <2 x i32> %6, <i32 16, i32 16>
  %8 = trunc nuw <2 x i32> %7 to <2 x i16>
  store <2 x i16> %8, ptr %.049, align 2, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %.04547, i64 8
  %10 = load i16, ptr %9, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %.049, i64 6
  store i16 %10, ptr %5, align 2, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %.04547, i64 10
  %13 = load i16, ptr %12, align 2, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %.049, i64 8
  store i16 %13, ptr %11, align 2, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %.04547, i64 12
  %16 = load i16, ptr %15, align 4, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %.049, i64 10
  store i16 %16, ptr %14, align 2, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %.04547, i64 14
  %19 = load i16, ptr %18, align 2, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %.049, i64 12
  store i16 %19, ptr %17, align 2, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %.04547, i64 16
  %22 = load i16, ptr %21, align 8, !tbaa !20
  %23 = getelementptr inbounds i8, ptr %.049, i64 14
  store i16 %22, ptr %20, align 2, !tbaa !11
  %24 = add nuw nsw i32 %.04248, 1
  %25 = getelementptr inbounds i8, ptr %.04547, i64 128
  %exitcond.not = icmp eq i32 %24, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.0.lcssa = phi ptr [ %1, %0 ], [ %23, %.lr.ph ]
  %26 = load i32, ptr @numlines, align 4, !tbaa !9
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph56.preheader, label %._crit_edge57

.lr.ph56.preheader:                               ; preds = %._crit_edge
  %28 = load ptr, ptr @lines, align 8, !tbaa !5
  br label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %78
  %.154 = phi ptr [ %.3.1, %78 ], [ %.0.lcssa, %.lr.ph56.preheader ]
  %.14353 = phi i32 [ %79, %78 ], [ 0, %.lr.ph56.preheader ]
  %.04452 = phi ptr [ %80, %78 ], [ %28, %.lr.ph56.preheader ]
  %29 = getelementptr inbounds i8, ptr %.04452, i64 24
  %30 = load i16, ptr %29, align 8, !tbaa !23
  %31 = getelementptr inbounds i8, ptr %.154, i64 2
  store i16 %30, ptr %.154, align 2, !tbaa !11
  %32 = getelementptr inbounds i8, ptr %.04452, i64 26
  %33 = load i16, ptr %32, align 2, !tbaa !25
  %34 = getelementptr inbounds i8, ptr %.154, i64 4
  store i16 %33, ptr %31, align 2, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %.04452, i64 28
  %36 = load i16, ptr %35, align 4, !tbaa !26
  %37 = getelementptr inbounds i8, ptr %.154, i64 6
  store i16 %36, ptr %34, align 2, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %.04452, i64 30
  %39 = load ptr, ptr @sides, align 8
  %40 = load i16, ptr %38, align 2, !tbaa !11
  %41 = icmp eq i16 %40, -1
  br i1 %41, label %58, label %42

42:                                               ; preds = %.lr.ph56
  %43 = sext i16 %40 to i64
  %44 = getelementptr inbounds %struct.side_t, ptr %39, i64 %43
  %45 = getelementptr inbounds i8, ptr %.154, i64 10
  %46 = load <2 x i32>, ptr %44, align 8, !tbaa !9
  %47 = lshr <2 x i32> %46, <i32 16, i32 16>
  %48 = trunc nuw <2 x i32> %47 to <2 x i16>
  store <2 x i16> %48, ptr %37, align 2, !tbaa !11
  %49 = getelementptr inbounds i8, ptr %44, i64 8
  %50 = load i16, ptr %49, align 8, !tbaa !27
  %51 = getelementptr inbounds i8, ptr %.154, i64 12
  store i16 %50, ptr %45, align 2, !tbaa !11
  %52 = getelementptr inbounds i8, ptr %44, i64 10
  %53 = load i16, ptr %52, align 2, !tbaa !29
  %54 = getelementptr inbounds i8, ptr %.154, i64 14
  store i16 %53, ptr %51, align 2, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %44, i64 12
  %56 = load i16, ptr %55, align 4, !tbaa !30
  %57 = getelementptr inbounds i8, ptr %.154, i64 16
  store i16 %56, ptr %54, align 2, !tbaa !11
  br label %58

58:                                               ; preds = %.lr.ph56, %42
  %.3 = phi ptr [ %37, %.lr.ph56 ], [ %57, %42 ]
  %59 = getelementptr inbounds i8, ptr %.04452, i64 32
  %60 = load i16, ptr %59, align 2, !tbaa !11
  %61 = icmp eq i16 %60, -1
  br i1 %61, label %78, label %62

62:                                               ; preds = %58
  %63 = sext i16 %60 to i64
  %64 = getelementptr inbounds %struct.side_t, ptr %39, i64 %63
  %65 = getelementptr inbounds i8, ptr %.3, i64 4
  %66 = load <2 x i32>, ptr %64, align 8, !tbaa !9
  %67 = lshr <2 x i32> %66, <i32 16, i32 16>
  %68 = trunc nuw <2 x i32> %67 to <2 x i16>
  store <2 x i16> %68, ptr %.3, align 2, !tbaa !11
  %69 = getelementptr inbounds i8, ptr %64, i64 8
  %70 = load i16, ptr %69, align 8, !tbaa !27
  %71 = getelementptr inbounds i8, ptr %.3, i64 6
  store i16 %70, ptr %65, align 2, !tbaa !11
  %72 = getelementptr inbounds i8, ptr %64, i64 10
  %73 = load i16, ptr %72, align 2, !tbaa !29
  %74 = getelementptr inbounds i8, ptr %.3, i64 8
  store i16 %73, ptr %71, align 2, !tbaa !11
  %75 = getelementptr inbounds i8, ptr %64, i64 12
  %76 = load i16, ptr %75, align 4, !tbaa !30
  %77 = getelementptr inbounds i8, ptr %.3, i64 10
  store i16 %76, ptr %74, align 2, !tbaa !11
  br label %78

78:                                               ; preds = %62, %58
  %.3.1 = phi ptr [ %.3, %58 ], [ %77, %62 ]
  %79 = add nuw nsw i32 %.14353, 1
  %80 = getelementptr inbounds i8, ptr %.04452, i64 88
  %exitcond60.not = icmp eq i32 %79, %26
  br i1 %exitcond60.not, label %._crit_edge57, label %.lr.ph56, !llvm.loop !31

._crit_edge57:                                    ; preds = %78, %._crit_edge
  %.1.lcssa = phi ptr [ %.0.lcssa, %._crit_edge ], [ %.3.1, %78 ]
  store ptr %.1.lcssa, ptr @save_p, align 8, !tbaa !5
  ret void
}

attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) 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" }

!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, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"", !10, i64 0, !10, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !12, i64 14, !12, i64 16, !10, i64 20, !6, i64 24, !7, i64 32, !15, i64 48, !10, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !6, i64 120}
!15 = !{!"", !16, i64 0, !10, i64 24, !10, i64 28, !10, i64 32}
!16 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!17 = !{!14, !12, i64 10}
!18 = !{!14, !12, i64 12}
!19 = !{!14, !12, i64 14}
!20 = !{!14, !12, i64 16}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !12, i64 24}
!24 = !{!"line_s", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !12, i64 24, !12, i64 26, !12, i64 28, !7, i64 30, !7, i64 36, !10, i64 52, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80}
!25 = !{!24, !12, i64 26}
!26 = !{!24, !12, i64 28}
!27 = !{!28, !12, i64 8}
!28 = !{!"", !10, i64 0, !10, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !6, i64 16}
!29 = !{!28, !12, i64 10}
!30 = !{!28, !12, i64 12}
!31 = distinct !{!31, !22}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass