; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2013-14/Dec 2013/13 Dec G2.ll (Z3updiiiii)

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

@seg = external dso_local global [131072 x [2 x [2 x i64]]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3updiiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !5
  %17 = load i32, ptr %8, align 4, !tbaa !5
  %18 = load i32, ptr %9, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %24, label %20

20:                                               ; preds = %5
  %21 = load i32, ptr %9, align 4, !tbaa !5
  %22 = load i32, ptr %7, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %25

24:                                               ; preds = %20, %5
  br label %165

25:                                               ; preds = %20
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = icmp eq i32 %26, %27
  br i1 %28, label %29, label %37

29:                                               ; preds = %25
  %30 = load i32, ptr %10, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %33
  %35 = getelementptr inbounds [2 x [2 x i64]], ptr %34, i64 0, i64 1
  %36 = getelementptr inbounds [2 x i64], ptr %35, i64 0, i64 1
  store i64 %31, ptr %36, align 8, !tbaa !9
  br label %165

37:                                               ; preds = %25
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = mul nsw i32 2, %38
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = add nsw i32 %41, %42
  %44 = sdiv i32 %43, 2
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = load i32, ptr %10, align 4, !tbaa !5
  call void @_Z3updiiiii(i32 noundef %39, i32 noundef %40, i32 noundef %44, i32 noundef %45, i32 noundef %46)
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = mul nsw i32 2, %47
  %49 = add nsw i32 %48, 1
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = add nsw i32 %50, %51
  %53 = sdiv i32 %52, 2
  %54 = add nsw i32 %53, 1
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !5
  call void @_Z3updiiiii(i32 noundef %49, i32 noundef %54, i32 noundef %55, i32 noundef %56, i32 noundef %57)
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %59
  %61 = getelementptr inbounds [2 x [2 x i64]], ptr %60, i64 0, i64 1
  %62 = getelementptr inbounds [2 x i64], ptr %61, i64 0, i64 1
  store i64 0, ptr %62, align 8, !tbaa !9
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %64
  %66 = getelementptr inbounds [2 x [2 x i64]], ptr %65, i64 0, i64 0
  %67 = getelementptr inbounds [2 x i64], ptr %66, i64 0, i64 1
  store i64 0, ptr %67, align 8, !tbaa !9
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %69
  %71 = getelementptr inbounds [2 x [2 x i64]], ptr %70, i64 0, i64 1
  %72 = getelementptr inbounds [2 x i64], ptr %71, i64 0, i64 0
  store i64 0, ptr %72, align 16, !tbaa !9
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %74
  %76 = getelementptr inbounds [2 x [2 x i64]], ptr %75, i64 0, i64 0
  %77 = getelementptr inbounds [2 x i64], ptr %76, i64 0, i64 0
  store i64 0, ptr %77, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %161, %37
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = icmp slt i32 %79, 2
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %164

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %157, %82
  %84 = load i32, ptr %13, align 4, !tbaa !5
  %85 = icmp slt i32 %84, 2
  br i1 %85, label %87, label %86

86:                                               ; preds = %83
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %160

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %153, %87
  %89 = load i32, ptr %14, align 4, !tbaa !5
  %90 = icmp slt i32 %89, 2
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %156

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %149, %92
  %94 = load i32, ptr %15, align 4, !tbaa !5
  %95 = icmp slt i32 %94, 2
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %152

97:                                               ; preds = %93
  %98 = load i32, ptr %13, align 4, !tbaa !5
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %103, label %100

100:                                              ; preds = %97
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %148

103:                                              ; preds = %100, %97
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [2 x [2 x i64]], ptr %106, i64 0, i64 %108
  %110 = load i32, ptr %15, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [2 x i64], ptr %109, i64 0, i64 %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = mul nsw i32 2, %113
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %115
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2 x [2 x i64]], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [2 x i64], ptr %119, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = mul nsw i32 2, %124
  %126 = add nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %127
  %129 = load i32, ptr %14, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2 x [2 x i64]], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %15, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [2 x i64], ptr %131, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !9
  %136 = add nsw i64 %123, %135
  store i64 %136, ptr %16, align 8, !tbaa !9
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %138 = load i64, ptr %137, align 8, !tbaa !9
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %140
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [2 x [2 x i64]], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %15, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [2 x i64], ptr %144, i64 0, i64 %146
  store i64 %138, ptr %147, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %148

148:                                              ; preds = %103, %100
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %15, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %15, align 4, !tbaa !5
  br label %93, !llvm.loop !11

152:                                              ; preds = %96
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %14, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %14, align 4, !tbaa !5
  br label %88, !llvm.loop !13

156:                                              ; preds = %91
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %13, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %13, align 4, !tbaa !5
  br label %83, !llvm.loop !14

160:                                              ; preds = %86
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %11, align 4, !tbaa !5
  br label %78, !llvm.loop !15

164:                                              ; preds = %81
  br label %165

165:                                              ; preds = %164, %29, %24
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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

@seg = external dso_local global [131072 x [2 x [2 x i64]]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3updiiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca i64, align 8
  %7 = icmp slt i32 %2, %3
  %8 = icmp slt i32 %3, %1
  %or.cond53 = or i1 %7, %8
  br i1 %or.cond53, label %.loopexit, label %9

9:                                                ; preds = %5
  %10 = icmp eq i32 %1, %2
  br i1 %10, label %11, label %.split59.us.1

11:                                               ; preds = %9
  %12 = sext i32 %4 to i64
  %13 = sext i32 %0 to i64
  %14 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %13, i64 1, i64 1
  store i64 %12, ptr %14, align 8, !tbaa !5
  br label %.loopexit

.split59.us.1:                                    ; preds = %9
  %15 = shl nsw i32 %0, 1
  %16 = add nsw i32 %2, %1
  %17 = sdiv i32 %16, 2
  tail call void @_Z3updiiiii(i32 noundef %15, i32 noundef %1, i32 noundef %17, i32 noundef %3, i32 noundef %4)
  %18 = or disjoint i32 %15, 1
  %19 = add nsw i32 %17, 1
  tail call void @_Z3updiiiii(i32 noundef %18, i32 noundef %19, i32 noundef %2, i32 noundef %3, i32 noundef %4)
  %20 = sext i32 %0 to i64
  %21 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %21, i8 0, i64 32, i1 false)
  %22 = sext i32 %18 to i64
  %23 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %22, i64 0, i64 1
  %24 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %22, i64 0, i64 0
  %25 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %22, i64 1, i64 1
  %26 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %22, i64 1, i64 0
  %27 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %22, i64 0, i64 1
  %28 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %22, i64 0, i64 0
  %29 = sext i32 %15 to i64
  %30 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %29, i64 0, i64 0
  %31 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %32 = load i64, ptr %30, align 16, !tbaa !5
  %33 = load i64, ptr %28, align 16, !tbaa !5
  %34 = add nsw i64 %33, %32
  store i64 %34, ptr %6, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %36 = load i64, ptr %35, align 8, !tbaa !5
  store i64 %36, ptr %31, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %37 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %38 = load i64, ptr %30, align 16, !tbaa !5
  %39 = load i64, ptr %27, align 8, !tbaa !5
  %40 = add nsw i64 %39, %38
  store i64 %40, ptr %6, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %42 = load i64, ptr %41, align 8, !tbaa !5
  store i64 %42, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %43 = load i64, ptr %30, align 16, !tbaa !5
  %44 = load i64, ptr %26, align 16, !tbaa !5
  %45 = add nsw i64 %44, %43
  store i64 %45, ptr %6, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %47 = load i64, ptr %46, align 8, !tbaa !5
  store i64 %47, ptr %31, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %48 = load i64, ptr %30, align 16, !tbaa !5
  %49 = load i64, ptr %25, align 8, !tbaa !5
  %50 = add nsw i64 %49, %48
  store i64 %50, ptr %6, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %52 = load i64, ptr %51, align 8, !tbaa !5
  store i64 %52, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %53 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %29, i64 0, i64 1
  %54 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %55 = load i64, ptr %53, align 8, !tbaa !5
  %56 = load i64, ptr %24, align 16, !tbaa !5
  %57 = add nsw i64 %56, %55
  store i64 %57, ptr %6, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %59 = load i64, ptr %58, align 8, !tbaa !5
  store i64 %59, ptr %54, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %60 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %61 = load i64, ptr %53, align 8, !tbaa !5
  %62 = load i64, ptr %23, align 8, !tbaa !5
  %63 = add nsw i64 %62, %61
  store i64 %63, ptr %6, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %65 = load i64, ptr %64, align 8, !tbaa !5
  store i64 %65, ptr %60, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %66 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %29, i64 1, i64 0
  %67 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 1, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %68 = load i64, ptr %66, align 16, !tbaa !5
  %69 = load i64, ptr %28, align 16, !tbaa !5
  %70 = add nsw i64 %69, %68
  store i64 %70, ptr %6, align 8, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %72 = load i64, ptr %71, align 8, !tbaa !5
  store i64 %72, ptr %67, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %73 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 1, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %74 = load i64, ptr %66, align 16, !tbaa !5
  %75 = load i64, ptr %27, align 8, !tbaa !5
  %76 = add nsw i64 %75, %74
  store i64 %76, ptr %6, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %78 = load i64, ptr %77, align 8, !tbaa !5
  store i64 %78, ptr %73, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %79 = load i64, ptr %66, align 16, !tbaa !5
  %80 = load i64, ptr %26, align 16, !tbaa !5
  %81 = add nsw i64 %80, %79
  store i64 %81, ptr %6, align 8, !tbaa !5
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %83 = load i64, ptr %82, align 8, !tbaa !5
  store i64 %83, ptr %67, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %84 = load i64, ptr %66, align 16, !tbaa !5
  %85 = load i64, ptr %25, align 8, !tbaa !5
  %86 = add nsw i64 %85, %84
  store i64 %86, ptr %6, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %88 = load i64, ptr %87, align 8, !tbaa !5
  store i64 %88, ptr %73, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %89 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %29, i64 1, i64 1
  %90 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 1, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %91 = load i64, ptr %89, align 8, !tbaa !5
  %92 = load i64, ptr %24, align 16, !tbaa !5
  %93 = add nsw i64 %92, %91
  store i64 %93, ptr %6, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %95 = load i64, ptr %94, align 8, !tbaa !5
  store i64 %95, ptr %90, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %96 = getelementptr inbounds [131072 x [2 x [2 x i64]]], ptr @seg, i64 0, i64 %20, i64 1, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %97 = load i64, ptr %89, align 8, !tbaa !5
  %98 = load i64, ptr %23, align 8, !tbaa !5
  %99 = add nsw i64 %98, %97
  store i64 %99, ptr %6, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %101 = load i64, ptr %100, align 8, !tbaa !5
  store i64 %101, ptr %96, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.split59.us.1, %5, %11
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass