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

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

@num = external dso_local global [36 x i32], align 16
@len = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [11 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 [12 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 [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() #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
  store i32 0, ptr %1, align 4
  %6 = load ptr, ptr @stdin, align 8, !tbaa !5
  %7 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %6)
  %8 = load ptr, ptr @stdout, align 8, !tbaa !5
  %9 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %8)
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @n, ptr noundef @s)
  %11 = load i32, ptr @s, align 4, !tbaa !9
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr @s, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %56, %0
  %14 = load i32, ptr @n, align 4, !tbaa !9
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %59

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

17:                                               ; preds = %51, %16
  %18 = load i32, ptr %2, align 4, !tbaa !9
  %19 = icmp sle i32 %18, 10
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  store i32 5, ptr %5, align 4
  br label %54

21:                                               ; preds = %17
  call void @llvm.memset.p0.i64(ptr align 16 @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %22 = load i32, ptr @s, align 4, !tbaa !9
  store i32 %22, ptr %3, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %26, %21
  %24 = load i32, ptr %3, align 4, !tbaa !9
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %37

26:                                               ; preds = %23
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = srem i32 %27, %28
  %30 = load i32, ptr @len, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr @len, align 4, !tbaa !9
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %32
  store i32 %29, ptr %33, align 4, !tbaa !9
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = load i32, ptr %3, align 4, !tbaa !9
  %36 = sdiv i32 %35, %34
  store i32 %36, ptr %3, align 4, !tbaa !9
  br label %23, !llvm.loop !11

37:                                               ; preds = %23
  %38 = call noundef zeroext i1 @_Z5checkv()
  br i1 %38, label %39, label %42

39:                                               ; preds = %37
  %40 = load i32, ptr %4, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %4, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %39, %37
  %43 = load i32, ptr %4, align 4, !tbaa !9
  %44 = icmp eq i32 %43, 2
  br i1 %44, label %45, label %50

45:                                               ; preds = %42
  %46 = load i32, ptr @s, align 4, !tbaa !9
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %46)
  %48 = load i32, ptr @n, align 4, !tbaa !9
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr @n, align 4, !tbaa !9
  store i32 5, ptr %5, align 4
  br label %54

50:                                               ; preds = %42
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %2, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %2, align 4, !tbaa !9
  br label %17, !llvm.loop !13

54:                                               ; preds = %45, %20
  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
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr @s, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @s, align 4, !tbaa !9
  br label %13, !llvm.loop !14

59:                                               ; preds = %13
  %60 = load ptr, ptr @stdin, align 8, !tbaa !5
  %61 = call i32 @fclose(ptr noundef %60)
  %62 = load ptr, ptr @stdout, align 8, !tbaa !5
  %63 = call i32 @fclose(ptr noundef %62)
  ret i32 0
}

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

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

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

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

declare i32 @fclose(ptr noundef) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@num = external dso_local local_unnamed_addr global [36 x i32], align 16
@len = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [11 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 [12 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 [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = load ptr, ptr @stdin, align 8, !tbaa !5
  %2 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %1)
  %3 = load ptr, ptr @stdout, align 8, !tbaa !5
  %4 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %3)
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n, ptr noundef nonnull @s)
  %storemerge.in16 = load i32, ptr @s, align 4, !tbaa !9
  %storemerge17 = add nsw i32 %storemerge.in16, 1
  store i32 %storemerge17, ptr @s, align 4, !tbaa !9
  %6 = load i32, ptr @n, align 4, !tbaa !9
  %.not18 = icmp eq i32 %6, 0
  br i1 %.not18, label %._crit_edge19, label %.preheader

.preheader:                                       ; preds = %0, %.loopexit
  %7 = phi i32 [ %storemerge, %.loopexit ], [ %storemerge17, %0 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %.not1112 = icmp eq i32 %7, 0
  br i1 %.not1112, label %8, label %.lr.ph

8:                                                ; preds = %.preheader, %._crit_edge
  %9 = tail call noundef zeroext i1 @_Z5checkv()
  %10 = zext i1 %9 to i32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %11 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.1 = icmp eq i32 %11, 0
  br i1 %.not1112.1, label %16, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %8, %.lr.ph.1
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %.lr.ph.1 ], [ 0, %8 ]
  %.0913.1 = phi i32 [ %14, %.lr.ph.1 ], [ %11, %8 ]
  %12 = srem i32 %.0913.1, 3
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %13 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.1
  store i32 %12, ptr %13, align 4, !tbaa !9
  %14 = sdiv i32 %.0913.1, 3
  %.0913.1.off = add i32 %.0913.1, 2
  %.not11.1 = icmp ult i32 %.0913.1.off, 5
  br i1 %.not11.1, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !11

._crit_edge.1:                                    ; preds = %.lr.ph.1
  %15 = trunc nuw i64 %indvars.iv.next.1 to i32
  store i32 %15, ptr @len, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %._crit_edge.1, %8
  %17 = tail call noundef zeroext i1 @_Z5checkv()
  %18 = zext i1 %17 to i32
  %spec.select.1 = add nuw nsw i32 %10, %18
  %19 = and i1 %9, %17
  br i1 %19, label %94, label %20

20:                                               ; preds = %16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %21 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.2 = icmp eq i32 %21, 0
  br i1 %.not1112.2, label %26, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %20, %.lr.ph.2
  %indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %.lr.ph.2 ], [ 0, %20 ]
  %.0913.2 = phi i32 [ %24, %.lr.ph.2 ], [ %21, %20 ]
  %22 = srem i32 %.0913.2, 4
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %23 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.2
  store i32 %22, ptr %23, align 4, !tbaa !9
  %24 = sdiv i32 %.0913.2, 4
  %.0913.2.off = add i32 %.0913.2, 3
  %.not11.2 = icmp ult i32 %.0913.2.off, 7
  br i1 %.not11.2, label %._crit_edge.2, label %.lr.ph.2, !llvm.loop !11

._crit_edge.2:                                    ; preds = %.lr.ph.2
  %25 = trunc nuw i64 %indvars.iv.next.2 to i32
  store i32 %25, ptr @len, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %._crit_edge.2, %20
  %27 = tail call noundef zeroext i1 @_Z5checkv()
  %28 = zext i1 %27 to i32
  %spec.select.2 = add nuw nsw i32 %spec.select.1, %28
  %29 = icmp eq i32 %spec.select.2, 2
  br i1 %29, label %94, label %30

30:                                               ; preds = %26
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %31 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.3 = icmp eq i32 %31, 0
  br i1 %.not1112.3, label %36, label %.lr.ph.3

.lr.ph.3:                                         ; preds = %30, %.lr.ph.3
  %indvars.iv.3 = phi i64 [ %indvars.iv.next.3, %.lr.ph.3 ], [ 0, %30 ]
  %.0913.3 = phi i32 [ %34, %.lr.ph.3 ], [ %31, %30 ]
  %32 = srem i32 %.0913.3, 5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %33 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.3
  store i32 %32, ptr %33, align 4, !tbaa !9
  %34 = sdiv i32 %.0913.3, 5
  %.0913.3.off = add i32 %.0913.3, 4
  %.not11.3 = icmp ult i32 %.0913.3.off, 9
  br i1 %.not11.3, label %._crit_edge.3, label %.lr.ph.3, !llvm.loop !11

._crit_edge.3:                                    ; preds = %.lr.ph.3
  %35 = trunc nuw i64 %indvars.iv.next.3 to i32
  store i32 %35, ptr @len, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %._crit_edge.3, %30
  %37 = tail call noundef zeroext i1 @_Z5checkv()
  %38 = zext i1 %37 to i32
  %spec.select.3 = add nuw nsw i32 %spec.select.2, %38
  %39 = icmp eq i32 %spec.select.3, 2
  br i1 %39, label %94, label %40

40:                                               ; preds = %36
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %41 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.4 = icmp eq i32 %41, 0
  br i1 %.not1112.4, label %46, label %.lr.ph.4

.lr.ph.4:                                         ; preds = %40, %.lr.ph.4
  %indvars.iv.4 = phi i64 [ %indvars.iv.next.4, %.lr.ph.4 ], [ 0, %40 ]
  %.0913.4 = phi i32 [ %44, %.lr.ph.4 ], [ %41, %40 ]
  %42 = srem i32 %.0913.4, 6
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
  %43 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.4
  store i32 %42, ptr %43, align 4, !tbaa !9
  %44 = sdiv i32 %.0913.4, 6
  %.0913.4.off = add i32 %.0913.4, 5
  %.not11.4 = icmp ult i32 %.0913.4.off, 11
  br i1 %.not11.4, label %._crit_edge.4, label %.lr.ph.4, !llvm.loop !11

._crit_edge.4:                                    ; preds = %.lr.ph.4
  %45 = trunc nuw i64 %indvars.iv.next.4 to i32
  store i32 %45, ptr @len, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %._crit_edge.4, %40
  %47 = tail call noundef zeroext i1 @_Z5checkv()
  %48 = zext i1 %47 to i32
  %spec.select.4 = add nuw nsw i32 %spec.select.3, %48
  %49 = icmp eq i32 %spec.select.4, 2
  br i1 %49, label %94, label %50

50:                                               ; preds = %46
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %51 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.5 = icmp eq i32 %51, 0
  br i1 %.not1112.5, label %56, label %.lr.ph.5

.lr.ph.5:                                         ; preds = %50, %.lr.ph.5
  %indvars.iv.5 = phi i64 [ %indvars.iv.next.5, %.lr.ph.5 ], [ 0, %50 ]
  %.0913.5 = phi i32 [ %54, %.lr.ph.5 ], [ %51, %50 ]
  %52 = srem i32 %.0913.5, 7
  %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
  %53 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.5
  store i32 %52, ptr %53, align 4, !tbaa !9
  %54 = sdiv i32 %.0913.5, 7
  %.0913.5.off = add i32 %.0913.5, 6
  %.not11.5 = icmp ult i32 %.0913.5.off, 13
  br i1 %.not11.5, label %._crit_edge.5, label %.lr.ph.5, !llvm.loop !11

._crit_edge.5:                                    ; preds = %.lr.ph.5
  %55 = trunc nuw i64 %indvars.iv.next.5 to i32
  store i32 %55, ptr @len, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %._crit_edge.5, %50
  %57 = tail call noundef zeroext i1 @_Z5checkv()
  %58 = zext i1 %57 to i32
  %spec.select.5 = add nuw nsw i32 %spec.select.4, %58
  %59 = icmp eq i32 %spec.select.5, 2
  br i1 %59, label %94, label %60

60:                                               ; preds = %56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %61 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.6 = icmp eq i32 %61, 0
  br i1 %.not1112.6, label %66, label %.lr.ph.6

.lr.ph.6:                                         ; preds = %60, %.lr.ph.6
  %indvars.iv.6 = phi i64 [ %indvars.iv.next.6, %.lr.ph.6 ], [ 0, %60 ]
  %.0913.6 = phi i32 [ %64, %.lr.ph.6 ], [ %61, %60 ]
  %62 = srem i32 %.0913.6, 8
  %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
  %63 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.6
  store i32 %62, ptr %63, align 4, !tbaa !9
  %64 = sdiv i32 %.0913.6, 8
  %.0913.6.off = add i32 %.0913.6, 7
  %.not11.6 = icmp ult i32 %.0913.6.off, 15
  br i1 %.not11.6, label %._crit_edge.6, label %.lr.ph.6, !llvm.loop !11

._crit_edge.6:                                    ; preds = %.lr.ph.6
  %65 = trunc nuw i64 %indvars.iv.next.6 to i32
  store i32 %65, ptr @len, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %._crit_edge.6, %60
  %67 = tail call noundef zeroext i1 @_Z5checkv()
  %68 = zext i1 %67 to i32
  %spec.select.6 = add nuw nsw i32 %spec.select.5, %68
  %69 = icmp eq i32 %spec.select.6, 2
  br i1 %69, label %94, label %70

70:                                               ; preds = %66
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %71 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.7 = icmp eq i32 %71, 0
  br i1 %.not1112.7, label %76, label %.lr.ph.7

.lr.ph.7:                                         ; preds = %70, %.lr.ph.7
  %indvars.iv.7 = phi i64 [ %indvars.iv.next.7, %.lr.ph.7 ], [ 0, %70 ]
  %.0913.7 = phi i32 [ %74, %.lr.ph.7 ], [ %71, %70 ]
  %72 = srem i32 %.0913.7, 9
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
  %73 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.7
  store i32 %72, ptr %73, align 4, !tbaa !9
  %74 = sdiv i32 %.0913.7, 9
  %.0913.7.off = add i32 %.0913.7, 8
  %.not11.7 = icmp ult i32 %.0913.7.off, 17
  br i1 %.not11.7, label %._crit_edge.7, label %.lr.ph.7, !llvm.loop !11

._crit_edge.7:                                    ; preds = %.lr.ph.7
  %75 = trunc nuw i64 %indvars.iv.next.7 to i32
  store i32 %75, ptr @len, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %._crit_edge.7, %70
  %77 = tail call noundef zeroext i1 @_Z5checkv()
  %78 = zext i1 %77 to i32
  %spec.select.7 = add nuw nsw i32 %spec.select.6, %78
  %79 = icmp eq i32 %spec.select.7, 2
  br i1 %79, label %94, label %80

80:                                               ; preds = %76
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) @num, i8 0, i64 144, i1 false)
  store i32 0, ptr @len, align 4, !tbaa !9
  %81 = load i32, ptr @s, align 4, !tbaa !9
  %.not1112.8 = icmp eq i32 %81, 0
  br i1 %.not1112.8, label %86, label %.lr.ph.8

.lr.ph.8:                                         ; preds = %80, %.lr.ph.8
  %indvars.iv.8 = phi i64 [ %indvars.iv.next.8, %.lr.ph.8 ], [ 0, %80 ]
  %.0913.8 = phi i32 [ %84, %.lr.ph.8 ], [ %81, %80 ]
  %82 = srem i32 %.0913.8, 10
  %indvars.iv.next.8 = add nuw nsw i64 %indvars.iv.8, 1
  %83 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv.8
  store i32 %82, ptr %83, align 4, !tbaa !9
  %84 = sdiv i32 %.0913.8, 10
  %.0913.8.off = add i32 %.0913.8, 9
  %.not11.8 = icmp ult i32 %.0913.8.off, 19
  br i1 %.not11.8, label %._crit_edge.8, label %.lr.ph.8, !llvm.loop !11

._crit_edge.8:                                    ; preds = %.lr.ph.8
  %85 = trunc nuw i64 %indvars.iv.next.8 to i32
  store i32 %85, ptr @len, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %._crit_edge.8, %80
  %87 = tail call noundef zeroext i1 @_Z5checkv()
  %88 = zext i1 %87 to i32
  %spec.select.8 = add nuw nsw i32 %spec.select.7, %88
  %89 = icmp eq i32 %spec.select.8, 2
  br i1 %89, label %94, label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %86
  %.pre = load i32, ptr @n, align 4, !tbaa !9
  br label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %.0913 = phi i32 [ %92, %.lr.ph ], [ %7, %.preheader ]
  %90 = srem i32 %.0913, 2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %91 = getelementptr inbounds [36 x i32], ptr @num, i64 0, i64 %indvars.iv
  store i32 %90, ptr %91, align 4, !tbaa !9
  %92 = sdiv i32 %.0913, 2
  %.0913.off = add i32 %.0913, 1
  %.not11 = icmp ult i32 %.0913.off, 3
  br i1 %.not11, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %93 = trunc nuw i64 %indvars.iv.next to i32
  store i32 %93, ptr @len, align 4, !tbaa !9
  br label %8

94:                                               ; preds = %86, %76, %66, %56, %46, %36, %26, %16
  %95 = load i32, ptr @s, align 4, !tbaa !9
  %96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %95)
  %97 = load i32, ptr @n, align 4, !tbaa !9
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr @n, align 4, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %94
  %99 = phi i32 [ %.pre, %.loopexit.loopexit ], [ %98, %94 ]
  %storemerge.in = load i32, ptr @s, align 4, !tbaa !9
  %storemerge = add nsw i32 %storemerge.in, 1
  store i32 %storemerge, ptr @s, align 4, !tbaa !9
  %.not = icmp eq i32 %99, 0
  br i1 %.not, label %._crit_edge19, label %.preheader, !llvm.loop !13

._crit_edge19:                                    ; preds = %.loopexit, %0
  %100 = load ptr, ptr @stdin, align 8, !tbaa !5
  %101 = tail call i32 @fclose(ptr noundef %100)
  %102 = load ptr, ptr @stdout, align 8, !tbaa !5
  %103 = tail call i32 @fclose(ptr noundef %102)
  ret i32 0
}

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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