; LLVM IR from tangjz/acm-icpc :: lydsy (1003)

; 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.Line = type { i32, i32, i32 }

@line = external dso_local global [801 x %struct.Line], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@e = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@head = external dso_local global [21 x i32], align 16
@f = external dso_local global [101 x i32], align 16
@flag = external dso_local global [21 x [101 x i8]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8shortestii(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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @k, ptr noundef @e)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %63, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @e, align 4, !tbaa !5
  %12 = mul nsw i32 2, %11
  %13 = icmp slt i32 %10, %12
  br i1 %13, label %14, label %66

14:                                               ; preds = %9
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %18
  %20 = getelementptr inbounds %struct.Line, ptr %19, i32 0, i32 0
  store i32 %16, ptr %20, align 4, !tbaa !9
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [21 x i32], ptr @head, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.Line, ptr %27, i32 0, i32 2
  store i32 %24, ptr %28, align 4, !tbaa !11
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [21 x i32], ptr @head, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.Line, ptr %37, i32 0, i32 0
  store i32 %33, ptr %38, align 4, !tbaa !9
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [21 x i32], ptr @head, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.Line, ptr %46, i32 0, i32 2
  store i32 %42, ptr %47, align 4, !tbaa !11
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [21 x i32], ptr @head, i64 0, i64 %51
  store i32 %49, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %56
  %58 = getelementptr inbounds %struct.Line, ptr %57, i32 0, i32 1
  store i32 %53, ptr %58, align 4, !tbaa !12
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %60
  %62 = getelementptr inbounds %struct.Line, ptr %61, i32 0, i32 1
  store i32 %53, ptr %62, align 4, !tbaa !12
  br label %63

63:                                               ; preds = %14
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = add nsw i32 %64, 2
  store i32 %65, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !13

66:                                               ; preds = %9
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @d)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %87, %66
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = load i32, ptr @d, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %90

72:                                               ; preds = %68
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  br label %74

74:                                               ; preds = %78, %72
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %78, label %86

78:                                               ; preds = %74
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [21 x [101 x i8]], ptr @flag, i64 0, i64 %80
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %5, align 4, !tbaa !5
  %84 = sext i32 %82 to i64
  %85 = getelementptr inbounds [101 x i8], ptr %81, i64 0, i64 %84
  store i8 1, ptr %85, align 1, !tbaa !15
  br label %74, !llvm.loop !17

86:                                               ; preds = %74
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %2, align 4, !tbaa !5
  br label %68, !llvm.loop !18

90:                                               ; preds = %68
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %129, %90
  %92 = load i32, ptr %2, align 4, !tbaa !5
  %93 = load i32, ptr @n, align 4, !tbaa !5
  %94 = icmp sle i32 %92, %93
  br i1 %94, label %95, label %132

95:                                               ; preds = %91
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = call noundef i32 @_Z8shortestii(i32 noundef 1, i32 noundef %96)
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %99
  store i32 %97, ptr %100, align 4, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %125, %95
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = load i32, ptr %2, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %128

105:                                              ; preds = %101
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %109 = load i32, ptr %3, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = call noundef i32 @_Z8shortestii(i32 noundef %114, i32 noundef %115)
  %117 = add nsw i32 %112, %116
  %118 = load i32, ptr @k, align 4, !tbaa !5
  %119 = add nsw i32 %117, %118
  store i32 %119, ptr %7, align 4, !tbaa !5
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %108, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %123
  store i32 %121, ptr %124, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %125

125:                                              ; preds = %105
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %3, align 4, !tbaa !5
  br label %101, !llvm.loop !19

128:                                              ; preds = %101
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %2, align 4, !tbaa !5
  br label %91, !llvm.loop !20

132:                                              ; preds = %91
  %133 = load i32, ptr @n, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %136)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

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

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 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 #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, !6, i64 0}
!10 = !{!"_ZTS4Line", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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.Line = type { i32, i32, i32 }

@line = external dso_local local_unnamed_addr global [801 x %struct.Line], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@e = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@head = external dso_local local_unnamed_addr global [21 x i32], align 16
@f = external dso_local global [101 x i32], align 16
@flag = external dso_local local_unnamed_addr global [21 x [101 x i8]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8shortestii(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
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k, ptr noundef nonnull @e)
  %6 = load i32, ptr @e, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %indvars.iv
  store i32 %9, ptr %10, align 4, !tbaa !9
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [21 x i32], ptr @head, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 %14, ptr %15, align 4, !tbaa !11
  %16 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %16, ptr %13, align 4, !tbaa !5
  %17 = add nuw nsw i64 %indvars.iv, 1
  %18 = getelementptr inbounds [801 x %struct.Line], ptr @line, i64 0, i64 %17
  store i32 %11, ptr %18, align 4, !tbaa !9
  %19 = sext i32 %9 to i64
  %20 = getelementptr inbounds [21 x i32], ptr @head, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %18, i64 8
  store i32 %21, ptr %22, align 4, !tbaa !11
  %23 = trunc nuw nsw i64 %17 to i32
  store i32 %23, ptr %20, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %18, i64 4
  store i32 %24, ptr %25, align 4, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 %24, ptr %26, align 4, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %27 = load i32, ptr @e, align 4, !tbaa !5
  %28 = shl nsw i32 %27, 1
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %0
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @d)
  %32 = load i32, ptr @d, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph36, label %.preheader

.preheader:                                       ; preds = %46, %._crit_edge
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %.not41 = icmp slt i32 %34, 1
  br i1 %.not41, label %.preheader.._crit_edge44_crit_edge, label %.lr.ph43

.preheader.._crit_edge44_crit_edge:               ; preds = %.preheader
  %.pre = sext i32 %34 to i64
  br label %._crit_edge44

.lr.ph36:                                         ; preds = %._crit_edge, %46
  %.134 = phi i32 [ %47, %46 ], [ 0, %._crit_edge ]
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %.promoted = load i32, ptr %2, align 4, !tbaa !5
  %.not2729 = icmp sgt i32 %.promoted, %36
  br i1 %.not2729, label %46, label %.lr.ph31

.lr.ph31:                                         ; preds = %.lr.ph36
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = mul nsw i64 %38, 101
  %40 = sext i32 %.promoted to i64
  %41 = getelementptr i8, ptr @flag, i64 %39
  %scevgep = getelementptr i8, ptr %41, i64 %40
  %42 = sub i32 %36, %.promoted
  %43 = zext i32 %42 to i64
  %44 = add nuw nsw i64 %43, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 1, i64 %44, i1 false), !tbaa !15
  %45 = add i32 %36, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %.lr.ph31, %.lr.ph36
  %47 = add nuw nsw i32 %.134, 1
  %48 = load i32, ptr @d, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %.lr.ph36, label %.preheader, !llvm.loop !17

.lr.ph43:                                         ; preds = %.preheader, %._crit_edge40
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %._crit_edge40 ], [ 1, %.preheader ]
  %50 = trunc nuw nsw i64 %indvars.iv54 to i32
  %51 = call noundef i32 @_Z8shortestii(i32 noundef 1, i32 noundef %50)
  %52 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv54
  store i32 %51, ptr %52, align 4, !tbaa !5
  %53 = icmp ugt i64 %indvars.iv54, 1
  br i1 %53, label %.lr.ph39, label %._crit_edge40

.lr.ph39:                                         ; preds = %.lr.ph43, %.lr.ph39
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph39 ], [ 1, %.lr.ph43 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %54 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv51
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %56 = trunc nuw nsw i64 %indvars.iv.next52 to i32
  %57 = call noundef i32 @_Z8shortestii(i32 noundef %56, i32 noundef %50)
  %58 = add nsw i32 %57, %55
  %59 = load i32, ptr @k, align 4, !tbaa !5
  %60 = add nsw i32 %58, %59
  store i32 %60, ptr %4, align 4, !tbaa !5
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %exitcond.not = icmp eq i64 %indvars.iv.next52, %indvars.iv54
  br i1 %exitcond.not, label %._crit_edge40, label %.lr.ph39, !llvm.loop !18

._crit_edge40:                                    ; preds = %.lr.ph39, %.lr.ph43
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %.not.not = icmp slt i64 %indvars.iv54, %64
  br i1 %.not.not, label %.lr.ph43, label %._crit_edge44, !llvm.loop !19

._crit_edge44:                                    ; preds = %._crit_edge40, %.preheader.._crit_edge44_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge44_crit_edge ], [ %64, %._crit_edge40 ]
  %65 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %.pre-phi
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %66)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS4Line", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass