; 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_UnArchiveWorld() #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 = %57, %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 %62

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

57:                                               ; preds = %13
  %58 = load i32, ptr %1, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %1, align 4, !tbaa !9
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.sector_t, ptr %60, i32 1
  store ptr %61, ptr %3, align 8, !tbaa !5
  br label %9, !llvm.loop !25

62:                                               ; preds = %9
  store i32 0, ptr %1, align 4, !tbaa !9
  %63 = load ptr, ptr @lines, align 8, !tbaa !5
  store ptr %63, ptr %4, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %140, %62
  %65 = load i32, ptr %1, align 4, !tbaa !9
  %66 = load i32, ptr @numlines, align 4, !tbaa !9
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %145

68:                                               ; preds = %64
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds i16, ptr %69, i32 1
  store ptr %70, ptr %6, align 8, !tbaa !5
  %71 = load i16, ptr %69, align 2, !tbaa !11
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.line_s, ptr %72, i32 0, i32 4
  store i16 %71, ptr %73, align 8, !tbaa !27
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds i16, ptr %74, i32 1
  store ptr %75, ptr %6, align 8, !tbaa !5
  %76 = load i16, ptr %74, align 2, !tbaa !11
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.line_s, ptr %77, i32 0, i32 5
  store i16 %76, ptr %78, align 2, !tbaa !29
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds i16, ptr %79, i32 1
  store ptr %80, ptr %6, align 8, !tbaa !5
  %81 = load i16, ptr %79, align 2, !tbaa !11
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.line_s, ptr %82, i32 0, i32 6
  store i16 %81, ptr %83, align 4, !tbaa !30
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %136, %68
  %85 = load i32, ptr %2, align 4, !tbaa !9
  %86 = icmp slt i32 %85, 2
  br i1 %86, label %87, label %139

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

96:                                               ; preds = %87
  br label %136

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

136:                                              ; preds = %97, %96
  %137 = load i32, ptr %2, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %2, align 4, !tbaa !9
  br label %84, !llvm.loop !37

139:                                              ; preds = %84
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %1, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %1, align 4, !tbaa !9
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.line_s, ptr %143, i32 1
  store ptr %144, ptr %4, align 8, !tbaa !5
  br label %64, !llvm.loop !38

145:                                              ; preds = %64
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %146, 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, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !10, i64 0}
!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, !10, i64 4}
!18 = !{!14, !12, i64 8}
!19 = !{!14, !12, i64 10}
!20 = !{!14, !12, i64 12}
!21 = !{!14, !12, i64 14}
!22 = !{!14, !12, i64 16}
!23 = !{!14, !6, i64 104}
!24 = !{!14, !6, i64 24}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !12, i64 24}
!28 = !{!"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}
!29 = !{!28, !12, i64 26}
!30 = !{!28, !12, i64 28}
!31 = !{!32, !10, i64 0}
!32 = !{!"", !10, i64 0, !10, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !6, i64 16}
!33 = !{!32, !10, i64 4}
!34 = !{!32, !12, i64 8}
!35 = !{!32, !12, i64 10}
!36 = !{!32, !12, i64 12}
!37 = distinct !{!37, !26}
!38 = distinct !{!38, !26}


; 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_UnArchiveWorld() 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
  %.051 = phi ptr [ %21, %.lr.ph ], [ %1, %.lr.ph.preheader ]
  %.04450 = phi i32 [ %26, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %.04749 = phi ptr [ %27, %.lr.ph ], [ %4, %.lr.ph.preheader ]
  %5 = getelementptr inbounds i8, ptr %.051, i64 4
  %6 = load <2 x i16>, ptr %.051, align 2, !tbaa !11
  %7 = sext <2 x i16> %6 to <2 x i32>
  %8 = shl nsw <2 x i32> %7, <i32 16, i32 16>
  store <2 x i32> %8, ptr %.04749, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %.051, i64 6
  %10 = load i16, ptr %5, align 2, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %.04749, i64 8
  store i16 %10, ptr %11, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %.051, i64 8
  %13 = load i16, ptr %9, align 2, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %.04749, i64 10
  store i16 %13, ptr %14, align 2, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %.051, i64 10
  %16 = load i16, ptr %12, align 2, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %.04749, i64 12
  store i16 %16, ptr %17, align 4, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %.051, i64 12
  %19 = load i16, ptr %15, align 2, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %.04749, i64 14
  store i16 %19, ptr %20, align 2, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %.051, i64 14
  %22 = load i16, ptr %18, align 2, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %.04749, i64 16
  store i16 %22, ptr %23, align 8, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %.04749, i64 104
  store ptr null, ptr %24, align 8, !tbaa !21
  %25 = getelementptr inbounds i8, ptr %.04749, i64 24
  store ptr null, ptr %25, align 8, !tbaa !22
  %26 = add nuw nsw i32 %.04450, 1
  %27 = getelementptr inbounds i8, ptr %.04749, i64 128
  %28 = load i32, ptr @numsectors, align 4, !tbaa !9
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.0.lcssa = phi ptr [ %1, %0 ], [ %21, %.lr.ph ]
  %30 = load i32, ptr @numlines, align 4, !tbaa !9
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph58.preheader, label %._crit_edge59

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

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %82
  %.156 = phi ptr [ %.3.1, %82 ], [ %.0.lcssa, %.lr.ph58.preheader ]
  %.14555 = phi i32 [ %83, %82 ], [ 0, %.lr.ph58.preheader ]
  %.04654 = phi ptr [ %84, %82 ], [ %32, %.lr.ph58.preheader ]
  %33 = getelementptr inbounds i8, ptr %.156, i64 2
  %34 = load i16, ptr %.156, align 2, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %.04654, i64 24
  store i16 %34, ptr %35, align 8, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %.156, i64 4
  %37 = load i16, ptr %33, align 2, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %.04654, i64 26
  store i16 %37, ptr %38, align 2, !tbaa !27
  %39 = getelementptr inbounds i8, ptr %.156, i64 6
  %40 = load i16, ptr %36, align 2, !tbaa !11
  %41 = getelementptr inbounds i8, ptr %.04654, i64 28
  store i16 %40, ptr %41, align 4, !tbaa !28
  %42 = getelementptr inbounds i8, ptr %.04654, i64 30
  %43 = load ptr, ptr @sides, align 8
  %44 = load i16, ptr %42, align 2, !tbaa !11
  %45 = icmp eq i16 %44, -1
  br i1 %45, label %62, label %46

46:                                               ; preds = %.lr.ph58
  %47 = sext i16 %44 to i64
  %48 = getelementptr inbounds %struct.side_t, ptr %43, i64 %47
  %49 = getelementptr inbounds i8, ptr %.156, i64 10
  %50 = load <2 x i16>, ptr %39, align 2, !tbaa !11
  %51 = sext <2 x i16> %50 to <2 x i32>
  %52 = shl nsw <2 x i32> %51, <i32 16, i32 16>
  store <2 x i32> %52, ptr %48, align 8, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %.156, i64 12
  %54 = load i16, ptr %49, align 2, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %48, i64 8
  store i16 %54, ptr %55, align 8, !tbaa !29
  %56 = getelementptr inbounds i8, ptr %.156, i64 14
  %57 = load i16, ptr %53, align 2, !tbaa !11
  %58 = getelementptr inbounds i8, ptr %48, i64 10
  store i16 %57, ptr %58, align 2, !tbaa !31
  %59 = getelementptr inbounds i8, ptr %.156, i64 16
  %60 = load i16, ptr %56, align 2, !tbaa !11
  %61 = getelementptr inbounds i8, ptr %48, i64 12
  store i16 %60, ptr %61, align 4, !tbaa !32
  br label %62

62:                                               ; preds = %.lr.ph58, %46
  %.3 = phi ptr [ %39, %.lr.ph58 ], [ %59, %46 ]
  %63 = getelementptr inbounds i8, ptr %.04654, i64 32
  %64 = load i16, ptr %63, align 2, !tbaa !11
  %65 = icmp eq i16 %64, -1
  br i1 %65, label %82, label %66

66:                                               ; preds = %62
  %67 = sext i16 %64 to i64
  %68 = getelementptr inbounds %struct.side_t, ptr %43, i64 %67
  %69 = getelementptr inbounds i8, ptr %.3, i64 4
  %70 = load <2 x i16>, ptr %.3, align 2, !tbaa !11
  %71 = sext <2 x i16> %70 to <2 x i32>
  %72 = shl nsw <2 x i32> %71, <i32 16, i32 16>
  store <2 x i32> %72, ptr %68, align 8, !tbaa !9
  %73 = getelementptr inbounds i8, ptr %.3, i64 6
  %74 = load i16, ptr %69, align 2, !tbaa !11
  %75 = getelementptr inbounds i8, ptr %68, i64 8
  store i16 %74, ptr %75, align 8, !tbaa !29
  %76 = getelementptr inbounds i8, ptr %.3, i64 8
  %77 = load i16, ptr %73, align 2, !tbaa !11
  %78 = getelementptr inbounds i8, ptr %68, i64 10
  store i16 %77, ptr %78, align 2, !tbaa !31
  %79 = getelementptr inbounds i8, ptr %.3, i64 10
  %80 = load i16, ptr %76, align 2, !tbaa !11
  %81 = getelementptr inbounds i8, ptr %68, i64 12
  store i16 %80, ptr %81, align 4, !tbaa !32
  br label %82

82:                                               ; preds = %66, %62
  %.3.1 = phi ptr [ %.3, %62 ], [ %79, %66 ]
  %83 = add nuw nsw i32 %.14555, 1
  %84 = getelementptr inbounds i8, ptr %.04654, i64 88
  %85 = load i32, ptr @numlines, align 4, !tbaa !9
  %86 = icmp slt i32 %83, %85
  br i1 %86, label %.lr.ph58, label %._crit_edge59, !llvm.loop !33

._crit_edge59:                                    ; preds = %82, %._crit_edge
  %.1.lcssa = phi ptr [ %.0.lcssa, %._crit_edge ], [ %.3.1, %82 ]
  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 = !{!14, !6, i64 104}
!22 = !{!14, !6, i64 24}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !12, i64 24}
!26 = !{!"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}
!27 = !{!26, !12, i64 26}
!28 = !{!26, !12, i64 28}
!29 = !{!30, !12, i64 8}
!30 = !{!"", !10, i64 0, !10, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !6, i64 16}
!31 = !{!30, !12, i64 10}
!32 = !{!30, !12, i64 12}
!33 = distinct !{!33, !24}


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