; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/101 Hacks/101 Hack 2015/101 Hack Oct/Problem D/D.ll (Z2goi)

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

@dp = external dso_local global [65536 x [2 x i64]], align 16
@a = external dso_local global [16 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_Z2goi(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca [16 x i32], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %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
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %34, %1
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = icmp slt i32 %17, 16
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %37

20:                                               ; preds = %16
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp ne i32 %21, %22
  br i1 %23, label %24, label %33

24:                                               ; preds = %20
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [16 x i32], ptr @a, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %29 to i64
  %32 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %31
  store i32 %28, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %24, %20
  br label %34

34:                                               ; preds = %33
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %5, align 4, !tbaa !5
  br label %16, !llvm.loop !9

37:                                               ; preds = %19
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 0, i64 1048576, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 32767, ptr %6, align 4, !tbaa !5
  store i64 1, ptr @dp, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %133, %37
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %136

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %129, %43
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 2
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %132

48:                                               ; preds = %44
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %50
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2 x i64], ptr %51, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %48
  br label %129

58:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = call i32 @llvm.ctpop.i32(i32 %59)
  store i32 %60, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %125, %58
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = icmp slt i32 %62, 16
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %128

65:                                               ; preds = %61
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = sub nsw i32 %67, 1
  %69 = shl i32 1, %68
  %70 = and i32 %66, %69
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %124

72:                                               ; preds = %65
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = load i32, ptr %11, align 4, !tbaa !5
  %78 = shl i32 1, %77
  %79 = and i32 %76, %78
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %81, label %124

81:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = shl i32 1, %84
  %86 = or i32 %82, %85
  store i32 %86, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %87 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %87, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %14, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %105, %81
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = icmp slt i32 %91, 16
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %108

94:                                               ; preds = %90
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = load i32, ptr %14, align 4, !tbaa !5
  %97 = sub nsw i32 %96, 1
  %98 = shl i32 1, %97
  %99 = and i32 %95, %98
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %101, label %104

101:                                              ; preds = %94
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = xor i32 %102, 1
  store i32 %103, ptr %13, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %101, %94
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %14, align 4, !tbaa !5
  br label %90, !llvm.loop !13

108:                                              ; preds = %93
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %110
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [2 x i64], ptr %111, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !11
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %117
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [2 x i64], ptr %118, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !11
  %123 = add nsw i64 %122, %115
  store i64 %123, ptr %121, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %124

124:                                              ; preds = %108, %72, %65
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %11, align 4, !tbaa !5
  br label %61, !llvm.loop !14

128:                                              ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %129

129:                                              ; preds = %128, %57
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %9, align 4, !tbaa !5
  br label %44, !llvm.loop !15

132:                                              ; preds = %47
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %7, align 4, !tbaa !5
  br label %38, !llvm.loop !16

136:                                              ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %137 = load i32, ptr %2, align 4, !tbaa !5
  %138 = sdiv i32 %137, 4
  %139 = add nsw i32 %138, 1
  %140 = srem i32 %139, 2
  store i32 %140, ptr %15, align 4, !tbaa !5
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %142
  %144 = load i32, ptr %15, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [2 x i64], ptr %143, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !11
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %3) #4
  ret i64 %147
}

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

; Function Attrs: 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) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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

@dp = external dso_local local_unnamed_addr global [65536 x [2 x i64]], align 16
@a = external dso_local local_unnamed_addr global [16 x i32], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local noundef i64 @_Z2goi(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca [16 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #5
  %.not44 = icmp eq i32 %0, 0
  %.1.14167.sroa.gep = getelementptr inbounds i8, ptr %2, i64 60
  %.1.14167.sroa.gep206 = getelementptr inbounds i8, ptr %2, i64 56
  %.1.14167.sroa.gep207 = getelementptr inbounds i8, ptr %2, i64 56
  br i1 %.not44, label %.thread66, label %4

.thread66:                                        ; preds = %1
  %3 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  store i32 %3, ptr %2, align 16, !tbaa !5
  br label %.thread73

4:                                                ; preds = %1
  %5 = load i32, ptr @a, align 16, !tbaa !5
  store i32 %5, ptr %2, align 16, !tbaa !5
  %.not44.1 = icmp eq i32 %0, 1
  br i1 %.not44.1, label %.thread73, label %6

6:                                                ; preds = %4
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %7, ptr %8, align 4, !tbaa !5
  %.not44.2 = icmp eq i32 %0, 2
  br i1 %.not44.2, label %.thread81, label %11

.thread73:                                        ; preds = %.thread66, %4
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %9, ptr %10, align 4, !tbaa !5
  br label %.thread81

11:                                               ; preds = %6
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %12, ptr %13, align 8, !tbaa !5
  %.not44.3 = icmp eq i32 %0, 3
  br i1 %.not44.3, label %.thread89, label %16

.thread81:                                        ; preds = %.thread73, %6
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 12), align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %14, ptr %15, align 8, !tbaa !5
  br label %.thread89

16:                                               ; preds = %11
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 12), align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %2, i64 12
  store i32 %17, ptr %18, align 4, !tbaa !5
  %.not44.4 = icmp eq i32 %0, 4
  br i1 %.not44.4, label %.thread97, label %21

.thread89:                                        ; preds = %.thread81, %11
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 16), align 16, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %2, i64 12
  store i32 %19, ptr %20, align 4, !tbaa !5
  br label %.thread97

21:                                               ; preds = %16
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 16), align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 %22, ptr %23, align 16, !tbaa !5
  %.not44.5 = icmp eq i32 %0, 5
  br i1 %.not44.5, label %.thread105, label %26

.thread97:                                        ; preds = %.thread89, %16
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 20), align 4, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 %24, ptr %25, align 16, !tbaa !5
  br label %.thread105

26:                                               ; preds = %21
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 20), align 4, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %2, i64 20
  store i32 %27, ptr %28, align 4, !tbaa !5
  %.not44.6 = icmp eq i32 %0, 6
  br i1 %.not44.6, label %.thread113, label %31

.thread105:                                       ; preds = %.thread97, %21
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 24), align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %2, i64 20
  store i32 %29, ptr %30, align 4, !tbaa !5
  br label %.thread113

31:                                               ; preds = %26
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 24), align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %2, i64 24
  store i32 %32, ptr %33, align 8, !tbaa !5
  %.not44.7 = icmp eq i32 %0, 7
  br i1 %.not44.7, label %.thread121, label %36

.thread113:                                       ; preds = %.thread105, %26
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 28), align 4, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %2, i64 24
  store i32 %34, ptr %35, align 8, !tbaa !5
  br label %.thread121

36:                                               ; preds = %31
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 28), align 4, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %2, i64 28
  store i32 %37, ptr %38, align 4, !tbaa !5
  %.not44.8 = icmp eq i32 %0, 8
  br i1 %.not44.8, label %.thread129, label %41

.thread121:                                       ; preds = %.thread113, %31
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 32), align 16, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %2, i64 28
  store i32 %39, ptr %40, align 4, !tbaa !5
  br label %.thread129

41:                                               ; preds = %36
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 32), align 16, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %2, i64 32
  store i32 %42, ptr %43, align 16, !tbaa !5
  %.not44.9 = icmp eq i32 %0, 9
  br i1 %.not44.9, label %.thread137, label %46

.thread129:                                       ; preds = %.thread121, %36
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 36), align 4, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %2, i64 32
  store i32 %44, ptr %45, align 16, !tbaa !5
  br label %.thread137

46:                                               ; preds = %41
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 36), align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %2, i64 36
  store i32 %47, ptr %48, align 4, !tbaa !5
  %.not44.10 = icmp eq i32 %0, 10
  br i1 %.not44.10, label %.thread145, label %51

.thread137:                                       ; preds = %.thread129, %41
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 40), align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %2, i64 36
  store i32 %49, ptr %50, align 4, !tbaa !5
  br label %.thread145

51:                                               ; preds = %46
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 40), align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %2, i64 40
  store i32 %52, ptr %53, align 8, !tbaa !5
  %.not44.11 = icmp eq i32 %0, 11
  br i1 %.not44.11, label %.thread153, label %56

.thread145:                                       ; preds = %.thread137, %46
  %54 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 44), align 4, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %2, i64 40
  store i32 %54, ptr %55, align 8, !tbaa !5
  br label %.thread153

56:                                               ; preds = %51
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 44), align 4, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %2, i64 44
  store i32 %57, ptr %58, align 4, !tbaa !5
  %.not44.12 = icmp eq i32 %0, 12
  br i1 %.not44.12, label %.thread161, label %61

.thread153:                                       ; preds = %.thread145, %51
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 48), align 16, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %2, i64 44
  store i32 %59, ptr %60, align 4, !tbaa !5
  br label %.thread161

61:                                               ; preds = %56
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 48), align 16, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %2, i64 48
  store i32 %62, ptr %63, align 16, !tbaa !5
  %.not44.13 = icmp eq i32 %0, 13
  br i1 %.not44.13, label %.thread169, label %66

.thread161:                                       ; preds = %.thread153, %56
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 52), align 4, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %2, i64 48
  store i32 %64, ptr %65, align 16, !tbaa !5
  br label %.thread169

66:                                               ; preds = %61
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 52), align 4, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %2, i64 52
  store i32 %67, ptr %68, align 4, !tbaa !5
  %.not44.14 = icmp eq i32 %0, 14
  br i1 %.not44.14, label %.thread164, label %71

.thread169:                                       ; preds = %.thread161, %61
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 56), align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %2, i64 52
  store i32 %69, ptr %70, align 4, !tbaa !5
  br label %.thread164

71:                                               ; preds = %66
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 56), align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %2, i64 56
  store i32 %72, ptr %73, align 8, !tbaa !5
  %.not44.15 = icmp eq i32 %0, 15
  br i1 %.not44.15, label %75, label %.thread164

.thread164:                                       ; preds = %66, %.thread169, %71
  %.1.14167.sroa.phi = phi ptr [ %.1.14167.sroa.gep, %71 ], [ %.1.14167.sroa.gep206, %.thread169 ], [ %.1.14167.sroa.gep207, %66 ]
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 60), align 4, !tbaa !5
  store i32 %74, ptr %.1.14167.sroa.phi, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %.thread164, %71
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1048576) @dp, i8 0, i64 1048576, i1 false)
  store i64 1, ptr @dp, align 16, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %75, %.loopexit.1
  %indvars.iv = phi i64 [ 0, %75 ], [ %indvars.iv.next, %.loopexit.1 ]
  %76 = trunc nuw nsw i64 %indvars.iv to i32
  %77 = tail call range(i32 0, 16) i32 @llvm.ctpop.i32(i32 %76)
  %78 = zext nneg i32 %77 to i64
  %79 = getelementptr inbounds [16 x i32], ptr %2, i64 0, i64 %78
  %80 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %indvars.iv, i64 0
  %81 = load i64, ptr %80, align 16, !tbaa !9
  %82 = icmp eq i64 %81, 0
  br i1 %82, label %.loopexit, label %.preheader53.preheader

.preheader53.preheader:                           ; preds = %.preheader
  %broadcast.splatinsert195 = insertelement <4 x i32> poison, i32 %76, i64 0
  %broadcast.splat196 = shufflevector <4 x i32> %broadcast.splatinsert195, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %.preheader53

83:                                               ; preds = %.loopexit.1
  %84 = sdiv i32 %0, 4
  %85 = add nsw i32 %84, 1
  %86 = srem i32 %85, 2
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2 x i64], ptr getelementptr inbounds (i8, ptr @dp, i64 524272), i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #5
  ret i64 %89

.preheader53:                                     ; preds = %.preheader53.preheader, %118
  %indvar174 = phi i32 [ %indvar.next175, %118 ], [ 0, %.preheader53.preheader ]
  %.04049 = phi i32 [ %119, %118 ], [ 1, %.preheader53.preheader ]
  %90 = sub i32 14, %indvar174
  %91 = add nsw i32 %.04049, -1
  %92 = shl nuw nsw i32 1, %91
  %93 = and i32 %92, %76
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %118

95:                                               ; preds = %.preheader53
  %96 = load i32, ptr %79, align 4, !tbaa !5
  %97 = shl nuw nsw i32 1, %.04049
  %98 = and i32 %96, %97
  %.not = icmp eq i32 %98, 0
  br i1 %.not, label %118, label %99

99:                                               ; preds = %95
  %100 = or i32 %92, %76
  %101 = icmp ult i32 %.04049, 15
  br i1 %101, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %99
  %min.iters.check178 = icmp ult i32 %90, 8
  br i1 %min.iters.check178, label %.lr.ph.preheader202, label %vector.ph179

.lr.ph.preheader202:                              ; preds = %middle.block176, %.lr.ph.preheader
  %.036.in48.ph = phi i32 [ %.04049, %.lr.ph.preheader ], [ %ind.end182, %middle.block176 ]
  %.03747.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %109, %middle.block176 ]
  br label %.lr.ph

vector.ph179:                                     ; preds = %.lr.ph.preheader
  %n.vec181 = and i32 %90, -8
  %ind.end182 = add i32 %.04049, %n.vec181
  %.splatinsert186 = insertelement <4 x i32> poison, i32 %.04049, i64 0
  %.splat187 = shufflevector <4 x i32> %.splatinsert186, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction188 = add nuw nsw <4 x i32> %.splat187, <i32 0, i32 1, i32 2, i32 3>
  br label %vector.body184

vector.body184:                                   ; preds = %vector.body184, %vector.ph179
  %index185 = phi i32 [ 0, %vector.ph179 ], [ %index.next197, %vector.body184 ]
  %vec.ind189 = phi <4 x i32> [ %induction188, %vector.ph179 ], [ %vec.ind.next192, %vector.body184 ]
  %vec.phi193 = phi <4 x i32> [ zeroinitializer, %vector.ph179 ], [ %106, %vector.body184 ]
  %vec.phi194 = phi <4 x i32> [ zeroinitializer, %vector.ph179 ], [ %107, %vector.body184 ]
  %step.add190 = add <4 x i32> %vec.ind189, <i32 4, i32 4, i32 4, i32 4>
  %102 = lshr <4 x i32> %broadcast.splat196, %vec.ind189
  %103 = lshr <4 x i32> %broadcast.splat196, %step.add190
  %104 = and <4 x i32> %102, <i32 1, i32 1, i32 1, i32 1>
  %105 = and <4 x i32> %103, <i32 1, i32 1, i32 1, i32 1>
  %106 = xor <4 x i32> %104, %vec.phi193
  %107 = xor <4 x i32> %105, %vec.phi194
  %index.next197 = add nuw i32 %index185, 8
  %vec.ind.next192 = add <4 x i32> %vec.ind189, <i32 8, i32 8, i32 8, i32 8>
  %108 = icmp eq i32 %index.next197, %n.vec181
  br i1 %108, label %middle.block176, label %vector.body184, !llvm.loop !11

middle.block176:                                  ; preds = %vector.body184
  %bin.rdx198 = xor <4 x i32> %107, %106
  %109 = tail call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %bin.rdx198)
  %cmp.n199 = icmp eq i32 %90, %n.vec181
  br i1 %cmp.n199, label %._crit_edge, label %.lr.ph.preheader202

._crit_edge:                                      ; preds = %.lr.ph, %middle.block176, %99
  %.037.lcssa = phi i32 [ 0, %99 ], [ %109, %middle.block176 ], [ %spec.select, %.lr.ph ]
  %110 = load i64, ptr %80, align 16, !tbaa !9
  %111 = zext nneg i32 %100 to i64
  %112 = zext nneg i32 %.037.lcssa to i64
  %113 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %111, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !9
  %115 = add nsw i64 %114, %110
  store i64 %115, ptr %113, align 8, !tbaa !9
  br label %118

.lr.ph:                                           ; preds = %.lr.ph.preheader202, %.lr.ph
  %.036.in48 = phi i32 [ %.036, %.lr.ph ], [ %.036.in48.ph, %.lr.ph.preheader202 ]
  %.03747 = phi i32 [ %spec.select, %.lr.ph ], [ %.03747.ph, %.lr.ph.preheader202 ]
  %.036 = add nuw nsw i32 %.036.in48, 1
  %116 = lshr i32 %76, %.036.in48
  %117 = and i32 %116, 1
  %spec.select = xor i32 %117, %.03747
  %exitcond.not = icmp eq i32 %.036, 15
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

118:                                              ; preds = %.preheader53, %95, %._crit_edge
  %119 = add nuw nsw i32 %.04049, 1
  %exitcond55.not = icmp eq i32 %119, 16
  %indvar.next175 = add i32 %indvar174, 1
  br i1 %exitcond55.not, label %.loopexit, label %.preheader53, !llvm.loop !16

.loopexit:                                        ; preds = %118, %.preheader
  %120 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %indvars.iv, i64 1
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = icmp eq i64 %121, 0
  br i1 %122, label %.loopexit.1, label %.preheader53.1.preheader

.preheader53.1.preheader:                         ; preds = %.loopexit
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %76, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %.preheader53.1

.preheader53.1:                                   ; preds = %.preheader53.1.preheader, %151
  %indvar = phi i32 [ %indvar.next, %151 ], [ 0, %.preheader53.1.preheader ]
  %.04049.1 = phi i32 [ %152, %151 ], [ 1, %.preheader53.1.preheader ]
  %123 = sub i32 14, %indvar
  %124 = add nsw i32 %.04049.1, -1
  %125 = shl nuw nsw i32 1, %124
  %126 = and i32 %125, %76
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %151

128:                                              ; preds = %.preheader53.1
  %129 = load i32, ptr %79, align 4, !tbaa !5
  %130 = shl nuw nsw i32 1, %.04049.1
  %131 = and i32 %129, %130
  %.not.1 = icmp eq i32 %131, 0
  br i1 %.not.1, label %151, label %132

132:                                              ; preds = %128
  %133 = or i32 %125, %76
  %134 = icmp ult i32 %.04049.1, 15
  br i1 %134, label %.lr.ph.1.preheader, label %._crit_edge.1

.lr.ph.1.preheader:                               ; preds = %132
  %min.iters.check = icmp ult i32 %123, 8
  br i1 %min.iters.check, label %.lr.ph.1.preheader201, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.1.preheader
  %n.vec = and i32 %123, -8
  %ind.end = add i32 %.04049.1, %n.vec
  %.splatinsert = insertelement <4 x i32> poison, i32 %.04049.1, i64 0
  %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction = add nuw nsw <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 1, i32 0, i32 0, i32 0>, %vector.ph ], [ %139, %vector.body ]
  %vec.phi173 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %140, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %135 = lshr <4 x i32> %broadcast.splat, %vec.ind
  %136 = lshr <4 x i32> %broadcast.splat, %step.add
  %137 = and <4 x i32> %135, <i32 1, i32 1, i32 1, i32 1>
  %138 = and <4 x i32> %136, <i32 1, i32 1, i32 1, i32 1>
  %139 = xor <4 x i32> %137, %vec.phi
  %140 = xor <4 x i32> %138, %vec.phi173
  %index.next = add nuw i32 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %141 = icmp eq i32 %index.next, %n.vec
  br i1 %141, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = xor <4 x i32> %140, %139
  %142 = tail call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i32 %123, %n.vec
  br i1 %cmp.n, label %._crit_edge.1, label %.lr.ph.1.preheader201

.lr.ph.1.preheader201:                            ; preds = %middle.block, %.lr.ph.1.preheader
  %.036.in48.1.ph = phi i32 [ %.04049.1, %.lr.ph.1.preheader ], [ %ind.end, %middle.block ]
  %.03747.1.ph = phi i32 [ 1, %.lr.ph.1.preheader ], [ %142, %middle.block ]
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph.1.preheader201, %.lr.ph.1
  %.036.in48.1 = phi i32 [ %.036.1, %.lr.ph.1 ], [ %.036.in48.1.ph, %.lr.ph.1.preheader201 ]
  %.03747.1 = phi i32 [ %spec.select.1, %.lr.ph.1 ], [ %.03747.1.ph, %.lr.ph.1.preheader201 ]
  %.036.1 = add nuw nsw i32 %.036.in48.1, 1
  %143 = lshr i32 %76, %.036.in48.1
  %144 = and i32 %143, 1
  %spec.select.1 = xor i32 %144, %.03747.1
  %exitcond.1.not = icmp eq i32 %.036.1, 15
  br i1 %exitcond.1.not, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !18

._crit_edge.1:                                    ; preds = %.lr.ph.1, %middle.block, %132
  %.037.lcssa.1 = phi i32 [ 1, %132 ], [ %142, %middle.block ], [ %spec.select.1, %.lr.ph.1 ]
  %145 = load i64, ptr %120, align 8, !tbaa !9
  %146 = zext nneg i32 %133 to i64
  %147 = zext nneg i32 %.037.lcssa.1 to i64
  %148 = getelementptr inbounds [65536 x [2 x i64]], ptr @dp, i64 0, i64 %146, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = add nsw i64 %149, %145
  store i64 %150, ptr %148, align 8, !tbaa !9
  br label %151

151:                                              ; preds = %._crit_edge.1, %128, %.preheader53.1
  %152 = add nuw nsw i32 %.04049.1, 1
  %exitcond55.1.not = icmp eq i32 %152, 16
  %indvar.next = add i32 %indvar, 1
  br i1 %exitcond55.1.not, label %.loopexit.1, label %.preheader53.1, !llvm.loop !16

.loopexit.1:                                      ; preds = %151, %.loopexit
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next, 32767
  br i1 %exitcond58.not, label %83, label %.preheader, !llvm.loop !19
}

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.xor.v4i32(<4 x i32>) #4

attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(readwrite, argmem: none, 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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !13, !14}
!18 = distinct !{!18, !12, !14, !13}
!19 = distinct !{!19, !12}


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