; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-10-11/upsolved (H - The Sightseeing Tour - dby)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@l = external dso_local global [100 x i32], align 16
@r = external dso_local global [100 x i32], align 16
@c = external dso_local global [100 x i32], align 16
@ord = external dso_local global [100 x i32], align 16
@sum = external dso_local global [330 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; 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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %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 i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %134, %0
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %137

20:                                               ; preds = %15
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %21)
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %50, %20
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %53

29:                                               ; preds = %24
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100 x i32], ptr @l, i64 0, i64 %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100 x i32], ptr @r, i64 0, i64 %34
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %37
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %32, ptr noundef %35, ptr noundef %38)
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100 x i32], ptr @ord, i64 0, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = add nsw i32 %48, %47
  store i32 %49, ptr %5, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %29
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %6, align 4, !tbaa !5
  br label %24, !llvm.loop !9

53:                                               ; preds = %28
  %54 = load i32, ptr @m, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr @ord, i64 %55
  call void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef @ord, ptr noundef %56, ptr noundef @_Z3cmpii)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %66, %53
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %69

62:                                               ; preds = %57
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %64
  store i32 -1, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %62
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %7, align 4, !tbaa !5
  br label %57, !llvm.loop !11

69:                                               ; preds = %61
  call void @_Z3dfsiiii(i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %105, %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = icmp sle i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %108

75:                                               ; preds = %70
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp ne i32 %79, -1
  br i1 %80, label %81, label %93

81:                                               ; preds = %75
  %82 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %82, ptr %8, align 4, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, %87
  store i32 %92, ptr %90, align 4, !tbaa !5
  br label %104

93:                                               ; preds = %75
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = add nsw i32 %98, %99
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %102
  store i32 %100, ptr %103, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %93, %81
  br label %105

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

108:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %128, %108
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = load i32, ptr @k, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %131

114:                                              ; preds = %109
  %115 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %11, ptr noundef %12)
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = call noundef i64 @_Z4calciii(i32 noundef %116, i32 noundef %117, i32 noundef %118)
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = call noundef i64 @_Z4calciii(i32 noundef %121, i32 noundef %122, i32 noundef %123)
  %125 = sub nsw i64 %119, %124
  %126 = load i64, ptr %10, align 8, !tbaa !13
  %127 = add nsw i64 %126, %125
  store i64 %127, ptr %10, align 8, !tbaa !13
  br label %128

128:                                              ; preds = %114
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %13, align 4, !tbaa !5
  br label %109, !llvm.loop !15

131:                                              ; preds = %113
  %132 = load i64, ptr %10, align 8, !tbaa !13
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %132)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %134

134:                                              ; preds = %131
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %3, align 4, !tbaa !5
  br label %15, !llvm.loop !16

137:                                              ; preds = %19
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %138 = load i32, ptr %1, align 4
  ret i32 %138
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpii(i32 noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4calciii(i32 noundef, i32 noundef, i32 noundef) #5

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 = { mustprogress norecurse 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 = { "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 #4 = { inlinehint 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 #5 = { 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 #6 = { 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!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"

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@l = external dso_local global [100 x i32], align 16
@r = external dso_local global [100 x i32], align 16
@c = external dso_local global [100 x i32], align 16
@ord = external dso_local global [100 x i32], align 16
@sum = external dso_local local_unnamed_addr global [330 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %.not68 = icmp slt i32 %5, 1
  br i1 %.not68, label %._crit_edge72, label %.lr.ph71

._crit_edge72:                                    ; preds = %._crit_edge66, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph71:                                         ; preds = %0, %._crit_edge66
  %.04169 = phi i32 [ %40, %._crit_edge66 ], [ 1, %0 ]
  %6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.04169)
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph71
  %.pre = sext i32 %8 to i64
  %10 = getelementptr inbounds i32, ptr @ord, i64 %.pre
  call void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %10, ptr noundef nonnull @_Z3cmpii)
  br label %._crit_edge54

._crit_edge:                                      ; preds = %.lr.ph
  %11 = getelementptr inbounds i32, ptr @ord, i64 %21
  call void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %11, ptr noundef nonnull @_Z3cmpii)
  %.not4450 = icmp slt i32 %19, 0
  br i1 %.not4450, label %._crit_edge54.thread, label %._crit_edge54

._crit_edge54.thread:                             ; preds = %._crit_edge
  call void @_Z3dfsiiii(i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  br label %._crit_edge60

.lr.ph:                                           ; preds = %.lr.ph71, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph71 ]
  %.04047 = phi i32 [ %19, %.lr.ph ], [ 0, %.lr.ph71 ]
  %12 = getelementptr inbounds [100 x i32], ptr @l, i64 0, i64 %indvars.iv
  %13 = getelementptr inbounds [100 x i32], ptr @r, i64 0, i64 %indvars.iv
  %14 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14)
  %16 = getelementptr inbounds [100 x i32], ptr @ord, i64 0, i64 %indvars.iv
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %16, align 4, !tbaa !5
  %18 = load i32, ptr %14, align 4, !tbaa !5
  %19 = add nsw i32 %18, %.04047
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge54:                                    ; preds = %._crit_edge, %._crit_edge.thread
  %.040.lcssa86 = phi i32 [ 0, %._crit_edge.thread ], [ %19, %._crit_edge ]
  %23 = add nuw i32 %.040.lcssa86, 1
  %24 = zext i32 %23 to i64
  %25 = shl nuw nsw i64 %24, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @sum, i8 -1, i64 %25, i1 false), !tbaa !5
  call void @_Z3dfsiiii(i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %.not4555 = icmp eq i32 %.040.lcssa86, 0
  br i1 %.not4555, label %._crit_edge60, label %.lr.ph59.preheader

.lr.ph59.preheader:                               ; preds = %._crit_edge54
  %load_initial = load i32, ptr @sum, align 16
  %26 = zext nneg i32 %.040.lcssa86 to i64
  %xtraiter = and i64 %26, 1
  %27 = icmp eq i32 %.040.lcssa86, 1
  br i1 %27, label %._crit_edge60.loopexit.unr-lcssa, label %.lr.ph59.preheader.new

.lr.ph59.preheader.new:                           ; preds = %.lr.ph59.preheader
  %unroll_iter = and i64 %26, 2147483646
  br label %.lr.ph59

._crit_edge60.loopexit.unr-lcssa:                 ; preds = %.lr.ph59, %.lr.ph59.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph59.preheader ], [ %.1.1, %.lr.ph59 ]
  %store_forwarded.unr = phi i32 [ %load_initial, %.lr.ph59.preheader ], [ %storemerge.1, %.lr.ph59 ]
  %indvars.iv80.unr = phi i64 [ 1, %.lr.ph59.preheader ], [ %indvars.iv.next81.1, %.lr.ph59 ]
  %.03756.unr = phi i32 [ 0, %.lr.ph59.preheader ], [ %.1.1, %.lr.ph59 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge60, label %.lr.ph59.epil

.lr.ph59.epil:                                    ; preds = %._crit_edge60.loopexit.unr-lcssa
  %28 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %indvars.iv80.unr
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %.not46.epil = icmp eq i32 %29, -1
  %30 = trunc nuw nsw i64 %indvars.iv80.unr to i32
  %storemerge.v.epil = select i1 %.not46.epil, i32 %.03756.unr, i32 %29
  %storemerge.epil = add nsw i32 %store_forwarded.unr, %storemerge.v.epil
  %.1.epil = select i1 %.not46.epil, i32 %.03756.unr, i32 %30
  store i32 %storemerge.epil, ptr %28, align 4, !tbaa !5
  br label %._crit_edge60

._crit_edge60:                                    ; preds = %.lr.ph59.epil, %._crit_edge60.loopexit.unr-lcssa, %._crit_edge54.thread, %._crit_edge54
  %.040.lcssa8790 = phi i32 [ 0, %._crit_edge54 ], [ %19, %._crit_edge54.thread ], [ %.040.lcssa86, %._crit_edge60.loopexit.unr-lcssa ], [ %.040.lcssa86, %.lr.ph59.epil ]
  %.037.lcssa = phi i32 [ 0, %._crit_edge54 ], [ 0, %._crit_edge54.thread ], [ %.1.lcssa.ph, %._crit_edge60.loopexit.unr-lcssa ], [ %.1.epil, %.lr.ph59.epil ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %31 = load i32, ptr @k, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph65, label %._crit_edge66

.lr.ph59:                                         ; preds = %.lr.ph59, %.lr.ph59.preheader.new
  %store_forwarded = phi i32 [ %load_initial, %.lr.ph59.preheader.new ], [ %storemerge.1, %.lr.ph59 ]
  %indvars.iv80 = phi i64 [ 1, %.lr.ph59.preheader.new ], [ %indvars.iv.next81.1, %.lr.ph59 ]
  %.03756 = phi i32 [ 0, %.lr.ph59.preheader.new ], [ %.1.1, %.lr.ph59 ]
  %niter = phi i64 [ 0, %.lr.ph59.preheader.new ], [ %niter.next.1, %.lr.ph59 ]
  %33 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %indvars.iv80
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %.not46 = icmp eq i32 %34, -1
  %35 = trunc nuw nsw i64 %indvars.iv80 to i32
  %storemerge.v = select i1 %.not46, i32 %.03756, i32 %34
  %storemerge = add nsw i32 %store_forwarded, %storemerge.v
  %.1 = select i1 %.not46, i32 %.03756, i32 %35
  store i32 %storemerge, ptr %33, align 4, !tbaa !5
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %36 = getelementptr inbounds [330 x i32], ptr @sum, i64 0, i64 %indvars.iv.next81
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %.not46.1 = icmp eq i32 %37, -1
  %38 = trunc nuw nsw i64 %indvars.iv.next81 to i32
  %storemerge.v.1 = select i1 %.not46.1, i32 %.1, i32 %37
  %storemerge.1 = add nsw i32 %storemerge, %storemerge.v.1
  %.1.1 = select i1 %.not46.1, i32 %.1, i32 %38
  store i32 %storemerge.1, ptr %36, align 4, !tbaa !5
  %indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge60.loopexit.unr-lcssa, label %.lr.ph59, !llvm.loop !11

._crit_edge66:                                    ; preds = %.lr.ph65, %._crit_edge60
  %.035.lcssa = phi i64 [ 0, %._crit_edge60 ], [ %49, %.lr.ph65 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %.035.lcssa)
  %40 = add nuw nsw i32 %.04169, 1
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.04169, %41
  br i1 %.not.not, label %.lr.ph71, label %._crit_edge72, !llvm.loop !12

.lr.ph65:                                         ; preds = %._crit_edge60, %.lr.ph65
  %.063 = phi i32 [ %50, %.lr.ph65 ], [ 0, %._crit_edge60 ]
  %.03562 = phi i64 [ %49, %.lr.ph65 ], [ 0, %._crit_edge60 ]
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = call noundef i64 @_Z4calciii(i32 noundef %43, i32 noundef %.040.lcssa8790, i32 noundef %.037.lcssa)
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  %47 = call noundef i64 @_Z4calciii(i32 noundef %46, i32 noundef %.040.lcssa8790, i32 noundef %.037.lcssa)
  %48 = add i64 %44, %.03562
  %49 = sub i64 %48, %47
  %50 = add nuw nsw i32 %.063, 1
  %51 = load i32, ptr @k, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph65, label %._crit_edge66, !llvm.loop !13
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpii(i32 noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4calciii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 = { nofree nounwind "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 #4 = { inlinehint 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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass