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

; 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
@x = external dso_local global i32, align 4
@f = external dso_local global [31 x i32], align 16
@tmp = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = 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
  store i32 0, ptr %1, align 4
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  br label %6

6:                                                ; preds = %60, %0
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @n, align 4, !tbaa !5
  %9 = icmp ne i32 %7, 0
  br i1 %9, label %10, label %61

10:                                               ; preds = %6
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @x)
  store i32 0, ptr @tmp, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %35, %10
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 31
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %38

16:                                               ; preds = %12
  %17 = load i32, ptr @x, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = shl i32 1, %18
  %20 = and i32 %17, %19
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %34

22:                                               ; preds = %16
  %23 = load i32, ptr @tmp, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [31 x i32], ptr @f, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp slt i32 %23, %27
  br i1 %28, label %29, label %34

29:                                               ; preds = %22
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [31 x i32], ptr @f, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  store i32 %33, ptr @tmp, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %29, %22, %16
  br label %35

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

38:                                               ; preds = %15
  %39 = load i32, ptr @tmp, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr @tmp, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %57, %38
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 31
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %60

45:                                               ; preds = %41
  %46 = load i32, ptr @x, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = shl i32 1, %47
  %49 = and i32 %46, %48
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %56

51:                                               ; preds = %45
  %52 = load i32, ptr @tmp, align 4, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [31 x i32], ptr @f, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %51, %45
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !5
  br label %41, !llvm.loop !11

60:                                               ; preds = %44
  br label %6, !llvm.loop !12

61:                                               ; preds = %6
  store i32 0, ptr @tmp, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %79, %61
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 31
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %82

66:                                               ; preds = %62
  %67 = load i32, ptr @tmp, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [31 x i32], ptr @f, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp slt i32 %67, %71
  br i1 %72, label %73, label %78

73:                                               ; preds = %66
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [31 x i32], ptr @f, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr @tmp, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %73, %66
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %4, align 4, !tbaa !5
  br label %62, !llvm.loop !13

82:                                               ; preds = %65
  %83 = load i32, ptr @tmp, align 4, !tbaa !5
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %83)
  ret i32 0
}

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: 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 = { 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}


; 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
@x = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [31 x i32], align 16
@tmp = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @n, align 4, !tbaa !5
  %.not21 = icmp eq i32 %2, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.loopexit
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
  %5 = load i32, ptr @x, align 4, !tbaa !5
  %6 = and i32 %5, 1
  %.not18 = icmp eq i32 %6, 0
  %7 = load i32, ptr @f, align 16
  %spec.select = tail call i32 @llvm.smax.i32(i32 %7, i32 0)
  %8 = select i1 %.not18, i32 0, i32 %spec.select
  %9 = and i32 %5, 2
  %.not18.1 = icmp eq i32 %9, 0
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4
  %spec.select.1 = tail call i32 @llvm.smax.i32(i32 %8, i32 %10)
  %11 = select i1 %.not18.1, i32 %8, i32 %spec.select.1
  %12 = and i32 %5, 4
  %.not18.2 = icmp eq i32 %12, 0
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8
  %spec.select.2 = tail call i32 @llvm.smax.i32(i32 %11, i32 %13)
  %14 = select i1 %.not18.2, i32 %11, i32 %spec.select.2
  %15 = and i32 %5, 8
  %.not18.3 = icmp eq i32 %15, 0
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 12), align 4
  %spec.select.3 = tail call i32 @llvm.smax.i32(i32 %14, i32 %16)
  %17 = select i1 %.not18.3, i32 %14, i32 %spec.select.3
  %18 = and i32 %5, 16
  %.not18.4 = icmp eq i32 %18, 0
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 16), align 16
  %spec.select.4 = tail call i32 @llvm.smax.i32(i32 %17, i32 %19)
  %20 = select i1 %.not18.4, i32 %17, i32 %spec.select.4
  %21 = and i32 %5, 32
  %.not18.5 = icmp eq i32 %21, 0
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 20), align 4
  %spec.select.5 = tail call i32 @llvm.smax.i32(i32 %20, i32 %22)
  %23 = select i1 %.not18.5, i32 %20, i32 %spec.select.5
  %24 = and i32 %5, 64
  %.not18.6 = icmp eq i32 %24, 0
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 24), align 8
  %spec.select.6 = tail call i32 @llvm.smax.i32(i32 %23, i32 %25)
  %26 = select i1 %.not18.6, i32 %23, i32 %spec.select.6
  %27 = and i32 %5, 128
  %.not18.7 = icmp eq i32 %27, 0
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 28), align 4
  %spec.select.7 = tail call i32 @llvm.smax.i32(i32 %26, i32 %28)
  %29 = select i1 %.not18.7, i32 %26, i32 %spec.select.7
  %30 = and i32 %5, 256
  %.not18.8 = icmp eq i32 %30, 0
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 32), align 16
  %spec.select.8 = tail call i32 @llvm.smax.i32(i32 %29, i32 %31)
  %32 = select i1 %.not18.8, i32 %29, i32 %spec.select.8
  %33 = and i32 %5, 512
  %.not18.9 = icmp eq i32 %33, 0
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 36), align 4
  %spec.select.9 = tail call i32 @llvm.smax.i32(i32 %32, i32 %34)
  %35 = select i1 %.not18.9, i32 %32, i32 %spec.select.9
  %36 = and i32 %5, 1024
  %.not18.10 = icmp eq i32 %36, 0
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 40), align 8
  %spec.select.10 = tail call i32 @llvm.smax.i32(i32 %35, i32 %37)
  %38 = select i1 %.not18.10, i32 %35, i32 %spec.select.10
  %39 = and i32 %5, 2048
  %.not18.11 = icmp eq i32 %39, 0
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 44), align 4
  %spec.select.11 = tail call i32 @llvm.smax.i32(i32 %38, i32 %40)
  %41 = select i1 %.not18.11, i32 %38, i32 %spec.select.11
  %42 = and i32 %5, 4096
  %.not18.12 = icmp eq i32 %42, 0
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 48), align 16
  %spec.select.12 = tail call i32 @llvm.smax.i32(i32 %41, i32 %43)
  %44 = select i1 %.not18.12, i32 %41, i32 %spec.select.12
  %45 = and i32 %5, 8192
  %.not18.13 = icmp eq i32 %45, 0
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 52), align 4
  %spec.select.13 = tail call i32 @llvm.smax.i32(i32 %44, i32 %46)
  %47 = select i1 %.not18.13, i32 %44, i32 %spec.select.13
  %48 = and i32 %5, 16384
  %.not18.14 = icmp eq i32 %48, 0
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 56), align 8
  %spec.select.14 = tail call i32 @llvm.smax.i32(i32 %47, i32 %49)
  %50 = select i1 %.not18.14, i32 %47, i32 %spec.select.14
  %51 = and i32 %5, 32768
  %.not18.15 = icmp eq i32 %51, 0
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 60), align 4
  %spec.select.15 = tail call i32 @llvm.smax.i32(i32 %50, i32 %52)
  %53 = select i1 %.not18.15, i32 %50, i32 %spec.select.15
  %54 = and i32 %5, 65536
  %.not18.16 = icmp eq i32 %54, 0
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 64), align 16
  %spec.select.16 = tail call i32 @llvm.smax.i32(i32 %53, i32 %55)
  %56 = select i1 %.not18.16, i32 %53, i32 %spec.select.16
  %57 = and i32 %5, 131072
  %.not18.17 = icmp eq i32 %57, 0
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 68), align 4
  %spec.select.17 = tail call i32 @llvm.smax.i32(i32 %56, i32 %58)
  %59 = select i1 %.not18.17, i32 %56, i32 %spec.select.17
  %60 = and i32 %5, 262144
  %.not18.18 = icmp eq i32 %60, 0
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 72), align 8
  %spec.select.18 = tail call i32 @llvm.smax.i32(i32 %59, i32 %61)
  %62 = select i1 %.not18.18, i32 %59, i32 %spec.select.18
  %63 = and i32 %5, 524288
  %.not18.19 = icmp eq i32 %63, 0
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 76), align 4
  %spec.select.19 = tail call i32 @llvm.smax.i32(i32 %62, i32 %64)
  %65 = select i1 %.not18.19, i32 %62, i32 %spec.select.19
  %66 = and i32 %5, 1048576
  %.not18.20 = icmp eq i32 %66, 0
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 80), align 16
  %spec.select.20 = tail call i32 @llvm.smax.i32(i32 %65, i32 %67)
  %68 = select i1 %.not18.20, i32 %65, i32 %spec.select.20
  %69 = and i32 %5, 2097152
  %.not18.21 = icmp eq i32 %69, 0
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 84), align 4
  %spec.select.21 = tail call i32 @llvm.smax.i32(i32 %68, i32 %70)
  %71 = select i1 %.not18.21, i32 %68, i32 %spec.select.21
  %72 = and i32 %5, 4194304
  %.not18.22 = icmp eq i32 %72, 0
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 88), align 8
  %spec.select.22 = tail call i32 @llvm.smax.i32(i32 %71, i32 %73)
  %74 = select i1 %.not18.22, i32 %71, i32 %spec.select.22
  %75 = and i32 %5, 8388608
  %.not18.23 = icmp eq i32 %75, 0
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 92), align 4
  %spec.select.23 = tail call i32 @llvm.smax.i32(i32 %74, i32 %76)
  %77 = select i1 %.not18.23, i32 %74, i32 %spec.select.23
  %78 = and i32 %5, 16777216
  %.not18.24 = icmp eq i32 %78, 0
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 96), align 16
  %spec.select.24 = tail call i32 @llvm.smax.i32(i32 %77, i32 %79)
  %80 = select i1 %.not18.24, i32 %77, i32 %spec.select.24
  %81 = and i32 %5, 33554432
  %.not18.25 = icmp eq i32 %81, 0
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 100), align 4
  %spec.select.25 = tail call i32 @llvm.smax.i32(i32 %80, i32 %82)
  %83 = select i1 %.not18.25, i32 %80, i32 %spec.select.25
  %84 = and i32 %5, 67108864
  %.not18.26 = icmp eq i32 %84, 0
  %85 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 104), align 8
  %spec.select.26 = tail call i32 @llvm.smax.i32(i32 %83, i32 %85)
  %86 = select i1 %.not18.26, i32 %83, i32 %spec.select.26
  %87 = and i32 %5, 134217728
  %.not18.27 = icmp eq i32 %87, 0
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 108), align 4
  %spec.select.27 = tail call i32 @llvm.smax.i32(i32 %86, i32 %88)
  %89 = select i1 %.not18.27, i32 %86, i32 %spec.select.27
  %90 = and i32 %5, 268435456
  %.not18.28 = icmp eq i32 %90, 0
  %91 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 112), align 16
  %spec.select.28 = tail call i32 @llvm.smax.i32(i32 %89, i32 %91)
  %92 = select i1 %.not18.28, i32 %89, i32 %spec.select.28
  %93 = and i32 %5, 536870912
  %.not18.29 = icmp eq i32 %93, 0
  %94 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 116), align 4
  %spec.select.29 = tail call i32 @llvm.smax.i32(i32 %92, i32 %94)
  %95 = select i1 %.not18.29, i32 %92, i32 %spec.select.29
  %96 = and i32 %5, 1073741824
  %.not18.30 = icmp eq i32 %96, 0
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 120), align 8
  %spec.select.30 = tail call i32 @llvm.smax.i32(i32 %95, i32 %97)
  %98 = select i1 %.not18.30, i32 %95, i32 %spec.select.30
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr @tmp, align 4, !tbaa !5
  %100 = and i32 %5, 1
  %.not17 = icmp eq i32 %100, 0
  br i1 %.not17, label %102, label %101

101:                                              ; preds = %.lr.ph
  store i32 %99, ptr @f, align 16, !tbaa !5
  br label %102

102:                                              ; preds = %.lr.ph, %101
  %103 = and i32 %5, 2
  %.not17.1 = icmp eq i32 %103, 0
  br i1 %.not17.1, label %105, label %104

104:                                              ; preds = %102
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  br label %105

105:                                              ; preds = %104, %102
  %106 = and i32 %5, 4
  %.not17.2 = icmp eq i32 %106, 0
  br i1 %.not17.2, label %108, label %107

107:                                              ; preds = %105
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !5
  br label %108

108:                                              ; preds = %107, %105
  %109 = and i32 %5, 8
  %.not17.3 = icmp eq i32 %109, 0
  br i1 %.not17.3, label %111, label %110

110:                                              ; preds = %108
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 12), align 4, !tbaa !5
  br label %111

111:                                              ; preds = %110, %108
  %112 = and i32 %5, 16
  %.not17.4 = icmp eq i32 %112, 0
  br i1 %.not17.4, label %114, label %113

113:                                              ; preds = %111
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 16), align 16, !tbaa !5
  br label %114

114:                                              ; preds = %113, %111
  %115 = and i32 %5, 32
  %.not17.5 = icmp eq i32 %115, 0
  br i1 %.not17.5, label %117, label %116

116:                                              ; preds = %114
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 20), align 4, !tbaa !5
  br label %117

117:                                              ; preds = %116, %114
  %118 = and i32 %5, 64
  %.not17.6 = icmp eq i32 %118, 0
  br i1 %.not17.6, label %120, label %119

119:                                              ; preds = %117
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 24), align 8, !tbaa !5
  br label %120

120:                                              ; preds = %119, %117
  %121 = and i32 %5, 128
  %.not17.7 = icmp eq i32 %121, 0
  br i1 %.not17.7, label %123, label %122

122:                                              ; preds = %120
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 28), align 4, !tbaa !5
  br label %123

123:                                              ; preds = %122, %120
  %124 = and i32 %5, 256
  %.not17.8 = icmp eq i32 %124, 0
  br i1 %.not17.8, label %126, label %125

125:                                              ; preds = %123
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 32), align 16, !tbaa !5
  br label %126

126:                                              ; preds = %125, %123
  %127 = and i32 %5, 512
  %.not17.9 = icmp eq i32 %127, 0
  br i1 %.not17.9, label %129, label %128

128:                                              ; preds = %126
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 36), align 4, !tbaa !5
  br label %129

129:                                              ; preds = %128, %126
  %130 = and i32 %5, 1024
  %.not17.10 = icmp eq i32 %130, 0
  br i1 %.not17.10, label %132, label %131

131:                                              ; preds = %129
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 40), align 8, !tbaa !5
  br label %132

132:                                              ; preds = %131, %129
  %133 = and i32 %5, 2048
  %.not17.11 = icmp eq i32 %133, 0
  br i1 %.not17.11, label %135, label %134

134:                                              ; preds = %132
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 44), align 4, !tbaa !5
  br label %135

135:                                              ; preds = %134, %132
  %136 = and i32 %5, 4096
  %.not17.12 = icmp eq i32 %136, 0
  br i1 %.not17.12, label %138, label %137

137:                                              ; preds = %135
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 48), align 16, !tbaa !5
  br label %138

138:                                              ; preds = %137, %135
  %139 = and i32 %5, 8192
  %.not17.13 = icmp eq i32 %139, 0
  br i1 %.not17.13, label %141, label %140

140:                                              ; preds = %138
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 52), align 4, !tbaa !5
  br label %141

141:                                              ; preds = %140, %138
  %142 = and i32 %5, 16384
  %.not17.14 = icmp eq i32 %142, 0
  br i1 %.not17.14, label %144, label %143

143:                                              ; preds = %141
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 56), align 8, !tbaa !5
  br label %144

144:                                              ; preds = %143, %141
  %145 = and i32 %5, 32768
  %.not17.15 = icmp eq i32 %145, 0
  br i1 %.not17.15, label %147, label %146

146:                                              ; preds = %144
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 60), align 4, !tbaa !5
  br label %147

147:                                              ; preds = %146, %144
  %148 = and i32 %5, 65536
  %.not17.16 = icmp eq i32 %148, 0
  br i1 %.not17.16, label %150, label %149

149:                                              ; preds = %147
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 64), align 16, !tbaa !5
  br label %150

150:                                              ; preds = %149, %147
  %151 = and i32 %5, 131072
  %.not17.17 = icmp eq i32 %151, 0
  br i1 %.not17.17, label %153, label %152

152:                                              ; preds = %150
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 68), align 4, !tbaa !5
  br label %153

153:                                              ; preds = %152, %150
  %154 = and i32 %5, 262144
  %.not17.18 = icmp eq i32 %154, 0
  br i1 %.not17.18, label %156, label %155

155:                                              ; preds = %153
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 72), align 8, !tbaa !5
  br label %156

156:                                              ; preds = %155, %153
  %157 = and i32 %5, 524288
  %.not17.19 = icmp eq i32 %157, 0
  br i1 %.not17.19, label %159, label %158

158:                                              ; preds = %156
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 76), align 4, !tbaa !5
  br label %159

159:                                              ; preds = %158, %156
  %160 = and i32 %5, 1048576
  %.not17.20 = icmp eq i32 %160, 0
  br i1 %.not17.20, label %162, label %161

161:                                              ; preds = %159
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 80), align 16, !tbaa !5
  br label %162

162:                                              ; preds = %161, %159
  %163 = and i32 %5, 2097152
  %.not17.21 = icmp eq i32 %163, 0
  br i1 %.not17.21, label %165, label %164

164:                                              ; preds = %162
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 84), align 4, !tbaa !5
  br label %165

165:                                              ; preds = %164, %162
  %166 = and i32 %5, 4194304
  %.not17.22 = icmp eq i32 %166, 0
  br i1 %.not17.22, label %168, label %167

167:                                              ; preds = %165
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 88), align 8, !tbaa !5
  br label %168

168:                                              ; preds = %167, %165
  %169 = and i32 %5, 8388608
  %.not17.23 = icmp eq i32 %169, 0
  br i1 %.not17.23, label %171, label %170

170:                                              ; preds = %168
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 92), align 4, !tbaa !5
  br label %171

171:                                              ; preds = %170, %168
  %172 = and i32 %5, 16777216
  %.not17.24 = icmp eq i32 %172, 0
  br i1 %.not17.24, label %174, label %173

173:                                              ; preds = %171
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 96), align 16, !tbaa !5
  br label %174

174:                                              ; preds = %173, %171
  %175 = and i32 %5, 33554432
  %.not17.25 = icmp eq i32 %175, 0
  br i1 %.not17.25, label %177, label %176

176:                                              ; preds = %174
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 100), align 4, !tbaa !5
  br label %177

177:                                              ; preds = %176, %174
  %178 = and i32 %5, 67108864
  %.not17.26 = icmp eq i32 %178, 0
  br i1 %.not17.26, label %180, label %179

179:                                              ; preds = %177
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 104), align 8, !tbaa !5
  br label %180

180:                                              ; preds = %179, %177
  %181 = and i32 %5, 134217728
  %.not17.27 = icmp eq i32 %181, 0
  br i1 %.not17.27, label %183, label %182

182:                                              ; preds = %180
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 108), align 4, !tbaa !5
  br label %183

183:                                              ; preds = %182, %180
  %184 = and i32 %5, 268435456
  %.not17.28 = icmp eq i32 %184, 0
  br i1 %.not17.28, label %186, label %185

185:                                              ; preds = %183
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 112), align 16, !tbaa !5
  br label %186

186:                                              ; preds = %185, %183
  %187 = and i32 %5, 536870912
  %.not17.29 = icmp eq i32 %187, 0
  br i1 %.not17.29, label %189, label %188

188:                                              ; preds = %186
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 116), align 4, !tbaa !5
  br label %189

189:                                              ; preds = %188, %186
  %190 = and i32 %5, 1073741824
  %.not17.30 = icmp eq i32 %190, 0
  br i1 %.not17.30, label %.loopexit, label %191

191:                                              ; preds = %189
  store i32 %99, ptr getelementptr inbounds (i8, ptr @f, i64 120), align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %191, %189
  %192 = load i32, ptr @n, align 4, !tbaa !5
  %193 = add nsw i32 %192, -1
  store i32 %193, ptr @n, align 4, !tbaa !5
  %.not = icmp eq i32 %192, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.loopexit, %0
  store i32 0, ptr @tmp, align 4, !tbaa !5
  %194 = load i32, ptr @f, align 16, !tbaa !5
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %194, i32 0)
  store i32 %spec.store.select, ptr @tmp, align 4
  %spec.select33 = tail call i32 @llvm.smax.i32(i32 %194, i32 0)
  %195 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  %196 = icmp slt i32 %spec.select33, %195
  %spec.store.select34 = select i1 %196, i32 %195, i32 %spec.store.select
  store i32 %spec.store.select34, ptr @tmp, align 4
  %spec.select35 = tail call i32 @llvm.smax.i32(i32 %spec.select33, i32 %195)
  %197 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !5
  %198 = icmp slt i32 %spec.select35, %197
  %spec.store.select36 = select i1 %198, i32 %197, i32 %spec.store.select34
  store i32 %spec.store.select36, ptr @tmp, align 4
  %spec.select37 = tail call i32 @llvm.smax.i32(i32 %spec.select35, i32 %197)
  %199 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 12), align 4, !tbaa !5
  %200 = icmp slt i32 %spec.select37, %199
  %spec.store.select38 = select i1 %200, i32 %199, i32 %spec.store.select36
  store i32 %spec.store.select38, ptr @tmp, align 4
  %spec.select39 = tail call i32 @llvm.smax.i32(i32 %spec.select37, i32 %199)
  %201 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 16), align 16, !tbaa !5
  %202 = icmp slt i32 %spec.select39, %201
  %spec.store.select40 = select i1 %202, i32 %201, i32 %spec.store.select38
  store i32 %spec.store.select40, ptr @tmp, align 4
  %spec.select41 = tail call i32 @llvm.smax.i32(i32 %spec.select39, i32 %201)
  %203 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 20), align 4, !tbaa !5
  %204 = icmp slt i32 %spec.select41, %203
  %spec.store.select42 = select i1 %204, i32 %203, i32 %spec.store.select40
  store i32 %spec.store.select42, ptr @tmp, align 4
  %spec.select43 = tail call i32 @llvm.smax.i32(i32 %spec.select41, i32 %203)
  %205 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 24), align 8, !tbaa !5
  %206 = icmp slt i32 %spec.select43, %205
  %spec.store.select44 = select i1 %206, i32 %205, i32 %spec.store.select42
  store i32 %spec.store.select44, ptr @tmp, align 4
  %spec.select45 = tail call i32 @llvm.smax.i32(i32 %spec.select43, i32 %205)
  %207 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 28), align 4, !tbaa !5
  %208 = icmp slt i32 %spec.select45, %207
  %spec.store.select46 = select i1 %208, i32 %207, i32 %spec.store.select44
  store i32 %spec.store.select46, ptr @tmp, align 4
  %spec.select47 = tail call i32 @llvm.smax.i32(i32 %spec.select45, i32 %207)
  %209 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 32), align 16, !tbaa !5
  %210 = icmp slt i32 %spec.select47, %209
  %spec.store.select48 = select i1 %210, i32 %209, i32 %spec.store.select46
  store i32 %spec.store.select48, ptr @tmp, align 4
  %spec.select49 = tail call i32 @llvm.smax.i32(i32 %spec.select47, i32 %209)
  %211 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 36), align 4, !tbaa !5
  %212 = icmp slt i32 %spec.select49, %211
  %spec.store.select50 = select i1 %212, i32 %211, i32 %spec.store.select48
  store i32 %spec.store.select50, ptr @tmp, align 4
  %spec.select51 = tail call i32 @llvm.smax.i32(i32 %spec.select49, i32 %211)
  %213 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 40), align 8, !tbaa !5
  %214 = icmp slt i32 %spec.select51, %213
  %spec.store.select52 = select i1 %214, i32 %213, i32 %spec.store.select50
  store i32 %spec.store.select52, ptr @tmp, align 4
  %spec.select53 = tail call i32 @llvm.smax.i32(i32 %spec.select51, i32 %213)
  %215 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 44), align 4, !tbaa !5
  %216 = icmp slt i32 %spec.select53, %215
  %spec.store.select54 = select i1 %216, i32 %215, i32 %spec.store.select52
  store i32 %spec.store.select54, ptr @tmp, align 4
  %spec.select55 = tail call i32 @llvm.smax.i32(i32 %spec.select53, i32 %215)
  %217 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 48), align 16, !tbaa !5
  %218 = icmp slt i32 %spec.select55, %217
  %spec.store.select56 = select i1 %218, i32 %217, i32 %spec.store.select54
  store i32 %spec.store.select56, ptr @tmp, align 4
  %spec.select57 = tail call i32 @llvm.smax.i32(i32 %spec.select55, i32 %217)
  %219 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 52), align 4, !tbaa !5
  %220 = icmp slt i32 %spec.select57, %219
  %spec.store.select58 = select i1 %220, i32 %219, i32 %spec.store.select56
  store i32 %spec.store.select58, ptr @tmp, align 4
  %spec.select59 = tail call i32 @llvm.smax.i32(i32 %spec.select57, i32 %219)
  %221 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 56), align 8, !tbaa !5
  %222 = icmp slt i32 %spec.select59, %221
  %spec.store.select60 = select i1 %222, i32 %221, i32 %spec.store.select58
  store i32 %spec.store.select60, ptr @tmp, align 4
  %spec.select61 = tail call i32 @llvm.smax.i32(i32 %spec.select59, i32 %221)
  %223 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 60), align 4, !tbaa !5
  %224 = icmp slt i32 %spec.select61, %223
  %spec.store.select62 = select i1 %224, i32 %223, i32 %spec.store.select60
  store i32 %spec.store.select62, ptr @tmp, align 4
  %spec.select63 = tail call i32 @llvm.smax.i32(i32 %spec.select61, i32 %223)
  %225 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 64), align 16, !tbaa !5
  %226 = icmp slt i32 %spec.select63, %225
  %spec.store.select64 = select i1 %226, i32 %225, i32 %spec.store.select62
  store i32 %spec.store.select64, ptr @tmp, align 4
  %spec.select65 = tail call i32 @llvm.smax.i32(i32 %spec.select63, i32 %225)
  %227 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 68), align 4, !tbaa !5
  %228 = icmp slt i32 %spec.select65, %227
  %spec.store.select66 = select i1 %228, i32 %227, i32 %spec.store.select64
  store i32 %spec.store.select66, ptr @tmp, align 4
  %spec.select67 = tail call i32 @llvm.smax.i32(i32 %spec.select65, i32 %227)
  %229 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 72), align 8, !tbaa !5
  %230 = icmp slt i32 %spec.select67, %229
  %spec.store.select68 = select i1 %230, i32 %229, i32 %spec.store.select66
  store i32 %spec.store.select68, ptr @tmp, align 4
  %spec.select69 = tail call i32 @llvm.smax.i32(i32 %spec.select67, i32 %229)
  %231 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 76), align 4, !tbaa !5
  %232 = icmp slt i32 %spec.select69, %231
  %spec.store.select70 = select i1 %232, i32 %231, i32 %spec.store.select68
  store i32 %spec.store.select70, ptr @tmp, align 4
  %spec.select71 = tail call i32 @llvm.smax.i32(i32 %spec.select69, i32 %231)
  %233 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 80), align 16, !tbaa !5
  %234 = icmp slt i32 %spec.select71, %233
  %spec.store.select72 = select i1 %234, i32 %233, i32 %spec.store.select70
  store i32 %spec.store.select72, ptr @tmp, align 4
  %spec.select73 = tail call i32 @llvm.smax.i32(i32 %spec.select71, i32 %233)
  %235 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 84), align 4, !tbaa !5
  %236 = icmp slt i32 %spec.select73, %235
  %spec.store.select74 = select i1 %236, i32 %235, i32 %spec.store.select72
  store i32 %spec.store.select74, ptr @tmp, align 4
  %spec.select75 = tail call i32 @llvm.smax.i32(i32 %spec.select73, i32 %235)
  %237 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 88), align 8, !tbaa !5
  %238 = icmp slt i32 %spec.select75, %237
  %spec.store.select76 = select i1 %238, i32 %237, i32 %spec.store.select74
  store i32 %spec.store.select76, ptr @tmp, align 4
  %spec.select77 = tail call i32 @llvm.smax.i32(i32 %spec.select75, i32 %237)
  %239 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 92), align 4, !tbaa !5
  %240 = icmp slt i32 %spec.select77, %239
  %spec.store.select78 = select i1 %240, i32 %239, i32 %spec.store.select76
  store i32 %spec.store.select78, ptr @tmp, align 4
  %spec.select79 = tail call i32 @llvm.smax.i32(i32 %spec.select77, i32 %239)
  %241 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 96), align 16, !tbaa !5
  %242 = icmp slt i32 %spec.select79, %241
  %spec.store.select80 = select i1 %242, i32 %241, i32 %spec.store.select78
  store i32 %spec.store.select80, ptr @tmp, align 4
  %spec.select81 = tail call i32 @llvm.smax.i32(i32 %spec.select79, i32 %241)
  %243 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 100), align 4, !tbaa !5
  %244 = icmp slt i32 %spec.select81, %243
  %spec.store.select82 = select i1 %244, i32 %243, i32 %spec.store.select80
  store i32 %spec.store.select82, ptr @tmp, align 4
  %spec.select83 = tail call i32 @llvm.smax.i32(i32 %spec.select81, i32 %243)
  %245 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 104), align 8, !tbaa !5
  %246 = icmp slt i32 %spec.select83, %245
  %spec.store.select84 = select i1 %246, i32 %245, i32 %spec.store.select82
  store i32 %spec.store.select84, ptr @tmp, align 4
  %spec.select85 = tail call i32 @llvm.smax.i32(i32 %spec.select83, i32 %245)
  %247 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 108), align 4, !tbaa !5
  %248 = icmp slt i32 %spec.select85, %247
  %spec.store.select86 = select i1 %248, i32 %247, i32 %spec.store.select84
  store i32 %spec.store.select86, ptr @tmp, align 4
  %spec.select87 = tail call i32 @llvm.smax.i32(i32 %spec.select85, i32 %247)
  %249 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 112), align 16, !tbaa !5
  %250 = icmp slt i32 %spec.select87, %249
  %spec.store.select88 = select i1 %250, i32 %249, i32 %spec.store.select86
  store i32 %spec.store.select88, ptr @tmp, align 4
  %spec.select89 = tail call i32 @llvm.smax.i32(i32 %spec.select87, i32 %249)
  %251 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 116), align 4, !tbaa !5
  %252 = icmp slt i32 %spec.select89, %251
  %spec.store.select90 = select i1 %252, i32 %251, i32 %spec.store.select88
  store i32 %spec.store.select90, ptr @tmp, align 4
  %spec.select91 = tail call i32 @llvm.smax.i32(i32 %spec.select89, i32 %251)
  %253 = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 120), align 8, !tbaa !5
  %254 = icmp slt i32 %spec.select91, %253
  %spec.store.select92 = select i1 %254, i32 %253, i32 %spec.store.select90
  store i32 %spec.store.select92, ptr @tmp, align 4
  %spec.select93 = tail call i32 @llvm.smax.i32(i32 %spec.select91, i32 %253)
  %255 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select93)
  ret i32 0
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #2

attributes #0 = { mustprogress nofree norecurse 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 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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"}


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