; LLVM IR from tangjz/acm-icpc :: usaco/Training/Chapter 1 Getting started (combo)

; 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
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@vis = external dso_local global [101 x [101 x [101 x i8]]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

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

18:                                               ; preds = %123, %0
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 2
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %126

22:                                               ; preds = %18
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef @a, ptr noundef @b, ptr noundef @c)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %119, %22
  %25 = load i32, ptr %4, align 4, !tbaa !9
  %26 = load i32, ptr @n, align 4, !tbaa !9
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %30 = load i32, ptr @a, align 4, !tbaa !9
  %31 = load i32, ptr %4, align 4, !tbaa !9
  %32 = sub nsw i32 %30, %31
  %33 = call i32 @llvm.abs.i32(i32 %32, i1 true)
  store i32 %33, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %34 = load i32, ptr @n, align 4, !tbaa !9
  %35 = load i32, ptr @a, align 4, !tbaa !9
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = sub nsw i32 %35, %36
  %38 = call i32 @llvm.abs.i32(i32 %37, i1 true)
  %39 = sub nsw i32 %34, %38
  store i32 %39, ptr %6, align 4, !tbaa !9
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %41 = load i32, ptr %40, align 4, !tbaa !9
  %42 = icmp sgt i32 %41, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br i1 %42, label %43, label %44

43:                                               ; preds = %29
  br label %119

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

45:                                               ; preds = %115, %44
  %46 = load i32, ptr %7, align 4, !tbaa !9
  %47 = load i32, ptr @n, align 4, !tbaa !9
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %51 = load i32, ptr @b, align 4, !tbaa !9
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = sub nsw i32 %51, %52
  %54 = call i32 @llvm.abs.i32(i32 %53, i1 true)
  store i32 %54, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %55 = load i32, ptr @n, align 4, !tbaa !9
  %56 = load i32, ptr @b, align 4, !tbaa !9
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = sub nsw i32 %56, %57
  %59 = call i32 @llvm.abs.i32(i32 %58, i1 true)
  %60 = sub nsw i32 %55, %59
  store i32 %60, ptr %9, align 4, !tbaa !9
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = icmp sgt i32 %62, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br i1 %63, label %64, label %65

64:                                               ; preds = %50
  br label %115

65:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %111, %65
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = load i32, ptr @n, align 4, !tbaa !9
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %114

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %72 = load i32, ptr @c, align 4, !tbaa !9
  %73 = load i32, ptr %10, align 4, !tbaa !9
  %74 = sub nsw i32 %72, %73
  %75 = call i32 @llvm.abs.i32(i32 %74, i1 true)
  store i32 %75, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %76 = load i32, ptr @n, align 4, !tbaa !9
  %77 = load i32, ptr @c, align 4, !tbaa !9
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = sub nsw i32 %77, %78
  %80 = call i32 @llvm.abs.i32(i32 %79, i1 true)
  %81 = sub nsw i32 %76, %80
  store i32 %81, ptr %12, align 4, !tbaa !9
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = icmp sgt i32 %83, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br i1 %84, label %85, label %86

85:                                               ; preds = %71
  br label %111

86:                                               ; preds = %71
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [101 x [101 x [101 x i8]]], ptr @vis, i64 0, i64 %88
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [101 x [101 x i8]], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %10, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [101 x i8], ptr %92, i64 0, i64 %94
  %96 = load i8, ptr %95, align 1, !tbaa !11, !range !13, !noundef !14
  %97 = trunc i8 %96 to i1
  br i1 %97, label %110, label %98

98:                                               ; preds = %86
  %99 = load i32, ptr %4, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [101 x [101 x [101 x i8]]], ptr @vis, i64 0, i64 %100
  %102 = load i32, ptr %7, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [101 x [101 x i8]], ptr %101, i64 0, i64 %103
  %105 = load i32, ptr %10, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [101 x i8], ptr %104, i64 0, i64 %106
  store i8 1, ptr %107, align 1, !tbaa !11
  %108 = load i32, ptr @ans, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr @ans, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %98, %86
  br label %111

111:                                              ; preds = %110, %85
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %10, align 4, !tbaa !9
  br label %66, !llvm.loop !15

114:                                              ; preds = %70
  br label %115

115:                                              ; preds = %114, %64
  %116 = load i32, ptr %7, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %7, align 4, !tbaa !9
  br label %45, !llvm.loop !17

118:                                              ; preds = %49
  br label %119

119:                                              ; preds = %118, %43
  %120 = load i32, ptr %4, align 4, !tbaa !9
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %4, align 4, !tbaa !9
  br label %24, !llvm.loop !18

122:                                              ; preds = %28
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %2, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %2, align 4, !tbaa !9
  br label %18, !llvm.loop !19

126:                                              ; preds = %21
  %127 = load i32, ptr @ans, align 4, !tbaa !9
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %127)
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

; 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)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; 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
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [101 x [101 x [101 x i8]]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %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 = load ptr, ptr @stdin, align 8, !tbaa !5
  %8 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %7)
  %9 = load ptr, ptr @stdout, align 8, !tbaa !5
  %10 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %9)
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n)
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c)
  %13 = load i32, ptr @n, align 4, !tbaa !9
  %.not33 = icmp slt i32 %13, 1
  br i1 %.not33, label %._crit_edge, label %.lr.ph36

._crit_edge:                                      ; preds = %.loopexit26, %0
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c)
  %15 = load i32, ptr @n, align 4, !tbaa !9
  %.not33.1 = icmp slt i32 %15, 1
  br i1 %.not33.1, label %._crit_edge.1, label %.lr.ph36.1

.lr.ph36.1:                                       ; preds = %._crit_edge, %.loopexit26.1
  %indvars.iv42.1 = phi i64 [ %indvars.iv.next43.1, %.loopexit26.1 ], [ 1, %._crit_edge ]
  %16 = phi i32 [ %55, %.loopexit26.1 ], [ %15, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %17 = load i32, ptr @a, align 4, !tbaa !9
  %18 = trunc nuw nsw i64 %indvars.iv42.1 to i32
  %19 = sub nsw i32 %17, %18
  %20 = call i32 @llvm.abs.i32(i32 %19, i1 true)
  store i32 %20, ptr %1, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %21 = sub nsw i32 %16, %20
  store i32 %21, ptr %2, align 4, !tbaa !9
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = icmp sgt i32 %23, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %.pre47 = load i32, ptr @n, align 4, !tbaa !9
  %.not2329.1 = icmp slt i32 %.pre47, 1
  %or.cond = select i1 %24, i1 true, i1 %.not2329.1
  br i1 %or.cond, label %.loopexit26.1, label %.lr.ph32.1

.lr.ph32.1:                                       ; preds = %.lr.ph36.1, %.loopexit.1
  %indvars.iv39.1 = phi i64 [ %indvars.iv.next40.1, %.loopexit.1 ], [ 1, %.lr.ph36.1 ]
  %25 = phi i32 [ %53, %.loopexit.1 ], [ %.pre47, %.lr.ph36.1 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %26 = load i32, ptr @b, align 4, !tbaa !9
  %27 = trunc nuw nsw i64 %indvars.iv39.1 to i32
  %28 = sub nsw i32 %26, %27
  %29 = call i32 @llvm.abs.i32(i32 %28, i1 true)
  store i32 %29, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %30 = sub nsw i32 %25, %29
  store i32 %30, ptr %4, align 4, !tbaa !9
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = icmp sgt i32 %32, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %.pre46 = load i32, ptr @n, align 4, !tbaa !9
  %.not2427.1 = icmp slt i32 %.pre46, 1
  %or.cond51 = select i1 %33, i1 true, i1 %.not2427.1
  br i1 %or.cond51, label %.loopexit.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph32.1, %50
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %50 ], [ 1, %.lr.ph32.1 ]
  %34 = phi i32 [ %51, %50 ], [ %.pre46, %.lr.ph32.1 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %35 = load i32, ptr @c, align 4, !tbaa !9
  %36 = trunc nuw nsw i64 %indvars.iv.1 to i32
  %37 = sub nsw i32 %35, %36
  %38 = call i32 @llvm.abs.i32(i32 %37, i1 true)
  store i32 %38, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %39 = sub nsw i32 %34, %38
  store i32 %39, ptr %6, align 4, !tbaa !9
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %41 = load i32, ptr %40, align 4, !tbaa !9
  %42 = icmp sgt i32 %41, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br i1 %42, label %50, label %43

43:                                               ; preds = %.lr.ph.1
  %44 = getelementptr inbounds [101 x [101 x [101 x i8]]], ptr @vis, i64 0, i64 %indvars.iv42.1, i64 %indvars.iv39.1, i64 %indvars.iv.1
  %45 = load i8, ptr %44, align 1, !tbaa !11, !range !13, !noundef !14
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %50, label %47

47:                                               ; preds = %43
  store i8 1, ptr %44, align 1, !tbaa !11
  %48 = load i32, ptr @ans, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @ans, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %47, %43, %.lr.ph.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %51 = load i32, ptr @n, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %.not24.not.1 = icmp slt i64 %indvars.iv.1, %52
  br i1 %.not24.not.1, label %.lr.ph.1, label %.loopexit.1, !llvm.loop !15

.loopexit.1:                                      ; preds = %50, %.lr.ph32.1
  %53 = phi i32 [ %.pre46, %.lr.ph32.1 ], [ %51, %50 ]
  %indvars.iv.next40.1 = add nuw nsw i64 %indvars.iv39.1, 1
  %54 = sext i32 %53 to i64
  %.not23.not.1 = icmp slt i64 %indvars.iv39.1, %54
  br i1 %.not23.not.1, label %.lr.ph32.1, label %.loopexit26.1, !llvm.loop !17

.loopexit26.1:                                    ; preds = %.loopexit.1, %.lr.ph36.1
  %55 = phi i32 [ %.pre47, %.lr.ph36.1 ], [ %53, %.loopexit.1 ]
  %indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42.1, 1
  %56 = sext i32 %55 to i64
  %.not.not.1 = icmp slt i64 %indvars.iv42.1, %56
  br i1 %.not.not.1, label %.lr.ph36.1, label %._crit_edge.1, !llvm.loop !18

._crit_edge.1:                                    ; preds = %.loopexit26.1, %._crit_edge
  %57 = load i32, ptr @ans, align 4, !tbaa !9
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %57)
  ret i32 0

.lr.ph36:                                         ; preds = %0, %.loopexit26
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.loopexit26 ], [ 1, %0 ]
  %59 = phi i32 [ %98, %.loopexit26 ], [ %13, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %60 = load i32, ptr @a, align 4, !tbaa !9
  %61 = trunc nuw nsw i64 %indvars.iv42 to i32
  %62 = sub nsw i32 %60, %61
  %63 = call i32 @llvm.abs.i32(i32 %62, i1 true)
  store i32 %63, ptr %1, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %64 = sub nsw i32 %59, %63
  store i32 %64, ptr %2, align 4, !tbaa !9
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = icmp sgt i32 %66, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %.pre45 = load i32, ptr @n, align 4, !tbaa !9
  %.not2329 = icmp slt i32 %.pre45, 1
  %or.cond52 = select i1 %67, i1 true, i1 %.not2329
  br i1 %or.cond52, label %.loopexit26, label %.lr.ph32

.lr.ph32:                                         ; preds = %.lr.ph36, %.loopexit
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %.loopexit ], [ 1, %.lr.ph36 ]
  %68 = phi i32 [ %96, %.loopexit ], [ %.pre45, %.lr.ph36 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %69 = load i32, ptr @b, align 4, !tbaa !9
  %70 = trunc nuw nsw i64 %indvars.iv39 to i32
  %71 = sub nsw i32 %69, %70
  %72 = call i32 @llvm.abs.i32(i32 %71, i1 true)
  store i32 %72, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %73 = sub nsw i32 %68, %72
  store i32 %73, ptr %4, align 4, !tbaa !9
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = icmp sgt i32 %75, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %.pre = load i32, ptr @n, align 4, !tbaa !9
  %.not2427 = icmp slt i32 %.pre, 1
  %or.cond53 = select i1 %76, i1 true, i1 %.not2427
  br i1 %or.cond53, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph32, %93
  %indvars.iv = phi i64 [ %indvars.iv.next, %93 ], [ 1, %.lr.ph32 ]
  %77 = phi i32 [ %94, %93 ], [ %.pre, %.lr.ph32 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %78 = load i32, ptr @c, align 4, !tbaa !9
  %79 = trunc nuw nsw i64 %indvars.iv to i32
  %80 = sub nsw i32 %78, %79
  %81 = call i32 @llvm.abs.i32(i32 %80, i1 true)
  store i32 %81, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %82 = sub nsw i32 %77, %81
  store i32 %82, ptr %6, align 4, !tbaa !9
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = icmp sgt i32 %84, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br i1 %85, label %93, label %86

86:                                               ; preds = %.lr.ph
  %87 = getelementptr inbounds [101 x [101 x [101 x i8]]], ptr @vis, i64 0, i64 %indvars.iv42, i64 %indvars.iv39, i64 %indvars.iv
  %88 = load i8, ptr %87, align 1, !tbaa !11, !range !13, !noundef !14
  %89 = trunc nuw i8 %88 to i1
  br i1 %89, label %93, label %90

90:                                               ; preds = %86
  store i8 1, ptr %87, align 1, !tbaa !11
  %91 = load i32, ptr @ans, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr @ans, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %86, %90, %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %94 = load i32, ptr @n, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %.not24.not = icmp slt i64 %indvars.iv, %95
  br i1 %.not24.not, label %.lr.ph, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %93, %.lr.ph32
  %96 = phi i32 [ %.pre, %.lr.ph32 ], [ %94, %93 ]
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %97 = sext i32 %96 to i64
  %.not23.not = icmp slt i64 %indvars.iv39, %97
  br i1 %.not23.not, label %.lr.ph32, label %.loopexit26, !llvm.loop !17

.loopexit26:                                      ; preds = %.loopexit, %.lr.ph36
  %98 = phi i32 [ %.pre45, %.lr.ph36 ], [ %96, %.loopexit ]
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %99 = sext i32 %98 to i64
  %.not.not = icmp slt i64 %indvars.iv42, %99
  br i1 %.not.not, label %.lr.ph36, label %._crit_edge, !llvm.loop !18
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

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

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


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