; LLVM IR from tangjz/acm-icpc :: 51nod (1429)

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

@x = external dso_local global [2 x [2 x i32]], align 16
@c = external dso_local global [2 x [2 x i32]], align 16
@ans = 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
@.str.2 = external hidden unnamed_addr constant [3 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %81, %0
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 2
  br i1 %7, label %9, label %8

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

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

10:                                               ; preds = %77, %9
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 2
  br i1 %12, label %14, label %13

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

14:                                               ; preds = %10
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [2 x [2 x i32]], ptr @x, i64 0, i64 %16
  %18 = getelementptr inbounds [2 x i32], ptr %17, i64 0, i64 0
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr %18, i64 %20
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %21)
  br label %23

23:                                               ; preds = %34, %14
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [2 x [2 x i32]], ptr @x, i64 0, i64 %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [2 x i32], ptr %26, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = srem i32 %30, 2
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %49

33:                                               ; preds = %23
  br label %34

34:                                               ; preds = %33
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [2 x [2 x i32]], ptr @c, i64 0, i64 %36
  %38 = getelementptr inbounds [2 x i32], ptr %37, i64 0, i64 0
  %39 = load i32, ptr %38, align 8, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 8, !tbaa !5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [2 x [2 x i32]], ptr @x, i64 0, i64 %42
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [2 x i32], ptr %43, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = ashr i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !5
  br label %23, !llvm.loop !9

49:                                               ; preds = %23
  br label %50

50:                                               ; preds = %61, %49
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [2 x [2 x i32]], ptr @x, i64 0, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [2 x i32], ptr %53, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = srem i32 %57, 3
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %76

60:                                               ; preds = %50
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [2 x [2 x i32]], ptr @c, i64 0, i64 %63
  %65 = getelementptr inbounds [2 x i32], ptr %64, i64 0, i64 1
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !5
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2 x [2 x i32]], ptr @x, i64 0, i64 %69
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2 x i32], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sdiv i32 %74, 3
  store i32 %75, ptr %73, align 4, !tbaa !5
  br label %50, !llvm.loop !11

76:                                               ; preds = %50
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %4, align 4, !tbaa !5
  br label %10, !llvm.loop !12

80:                                               ; preds = %13
  br label %81

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

84:                                               ; preds = %8
  %85 = load i32, ptr @x, align 16, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @x, i64 0, i64 1), align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = mul nsw i64 %86, %88
  %90 = load i32, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @x, i64 0, i64 1), align 8, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([2 x [2 x i32]], ptr @x, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %91, %93
  %95 = icmp eq i64 %89, %94
  br i1 %95, label %96, label %132

96:                                               ; preds = %84
  %97 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
  %98 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %100, label %107

100:                                              ; preds = %96
  %101 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  %102 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
  %103 = sub nsw i32 %101, %102
  store i32 %103, ptr @ans, align 4, !tbaa !5
  %104 = load i32, ptr @ans, align 4, !tbaa !5
  %105 = load i32, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), align 8, !tbaa !5
  %106 = add nsw i32 %105, %104
  store i32 %106, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), align 8, !tbaa !5
  br label %114

107:                                              ; preds = %96
  %108 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
  %109 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  %110 = sub nsw i32 %108, %109
  store i32 %110, ptr @ans, align 4, !tbaa !5
  %111 = load i32, ptr @ans, align 4, !tbaa !5
  %112 = load i32, ptr @c, align 16, !tbaa !5
  %113 = add nsw i32 %112, %111
  store i32 %113, ptr @c, align 16, !tbaa !5
  br label %114

114:                                              ; preds = %107, %100
  %115 = load i32, ptr @c, align 16, !tbaa !5
  %116 = load i32, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), align 8, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %118, label %122

118:                                              ; preds = %114
  %119 = load i32, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), align 8, !tbaa !5
  %120 = load i32, ptr @c, align 16, !tbaa !5
  %121 = sub nsw i32 %119, %120
  br label %126

122:                                              ; preds = %114
  %123 = load i32, ptr @c, align 16, !tbaa !5
  %124 = load i32, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @c, i64 0, i64 1), align 8, !tbaa !5
  %125 = sub nsw i32 %123, %124
  br label %126

126:                                              ; preds = %122, %118
  %127 = phi i32 [ %121, %118 ], [ %125, %122 ]
  %128 = load i32, ptr @ans, align 4, !tbaa !5
  %129 = add nsw i32 %128, %127
  store i32 %129, ptr @ans, align 4, !tbaa !5
  %130 = load i32, ptr @ans, align 4, !tbaa !5
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %130)
  br label %134

132:                                              ; preds = %84
  %133 = call i32 @puts(ptr noundef @.str.2)
  br label %134

134:                                              ; preds = %132, %126
  ret i32 0
}

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

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

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

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

declare i32 @puts(ptr noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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"

@x = external dso_local global [2 x [2 x i32]], align 16
@c = external dso_local local_unnamed_addr global [2 x [2 x i32]], align 16
@ans = 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
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader24:
  %0 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
  %.promoted = load i32, ptr @x, align 16, !tbaa !5
  %1 = and i32 %.promoted, 1
  %2 = icmp eq i32 %1, 0
  br i1 %2, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %.preheader24
  %.promoted25 = load i32, ptr @c, align 16, !tbaa !5
  br label %6

..preheader_crit_edge:                            ; preds = %6
  store i32 %9, ptr @c, align 16, !tbaa !5
  store i32 %10, ptr @x, align 16, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %..preheader_crit_edge, %.preheader24
  %3 = phi i32 [ %10, %..preheader_crit_edge ], [ %.promoted, %.preheader24 ]
  %4 = srem i32 %3, 3
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %.lr.ph28.preheader, label %._crit_edge

.lr.ph28.preheader:                               ; preds = %.preheader
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  br label %.lr.ph28

6:                                                ; preds = %.lr.ph, %6
  %7 = phi i32 [ %.promoted25, %.lr.ph ], [ %9, %6 ]
  %8 = phi i32 [ %.promoted, %.lr.ph ], [ %10, %6 ]
  %9 = add nsw i32 %7, 1
  %10 = ashr exact i32 %8, 1
  %11 = and i32 %8, 2
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %6, label %..preheader_crit_edge, !llvm.loop !9

.lr.ph28:                                         ; preds = %.lr.ph28.preheader, %.lr.ph28
  %13 = phi i32 [ %15, %.lr.ph28 ], [ %.pre, %.lr.ph28.preheader ]
  %14 = phi i32 [ %16, %.lr.ph28 ], [ %3, %.lr.ph28.preheader ]
  %15 = add nsw i32 %13, 1
  %16 = sdiv i32 %14, 3
  %17 = srem i32 %16, 3
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %.lr.ph28, label %._crit_edge.loopexit, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph28
  store i32 %15, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  store i32 %16, ptr @x, align 16, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @x, i64 4))
  %.promoted.1 = load i32, ptr getelementptr inbounds (i8, ptr @x, i64 4), align 4, !tbaa !5
  %20 = and i32 %.promoted.1, 1
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %.lr.ph.1, label %.preheader.1

.lr.ph.1:                                         ; preds = %._crit_edge
  %.promoted25.1 = load i32, ptr @c, align 16, !tbaa !5
  br label %22

22:                                               ; preds = %22, %.lr.ph.1
  %23 = phi i32 [ %.promoted25.1, %.lr.ph.1 ], [ %25, %22 ]
  %24 = phi i32 [ %.promoted.1, %.lr.ph.1 ], [ %26, %22 ]
  %25 = add nsw i32 %23, 1
  %26 = ashr exact i32 %24, 1
  %27 = and i32 %24, 2
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %22, label %..preheader_crit_edge.1, !llvm.loop !9

..preheader_crit_edge.1:                          ; preds = %22
  store i32 %25, ptr @c, align 16, !tbaa !5
  store i32 %26, ptr getelementptr inbounds (i8, ptr @x, i64 4), align 4, !tbaa !5
  br label %.preheader.1

.preheader.1:                                     ; preds = %..preheader_crit_edge.1, %._crit_edge
  %29 = phi i32 [ %26, %..preheader_crit_edge.1 ], [ %.promoted.1, %._crit_edge ]
  %30 = srem i32 %29, 3
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %.lr.ph28.preheader.1, label %._crit_edge.1

.lr.ph28.preheader.1:                             ; preds = %.preheader.1
  %.pre45 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  br label %.lr.ph28.1

.lr.ph28.1:                                       ; preds = %.lr.ph28.1, %.lr.ph28.preheader.1
  %32 = phi i32 [ %34, %.lr.ph28.1 ], [ %.pre45, %.lr.ph28.preheader.1 ]
  %33 = phi i32 [ %35, %.lr.ph28.1 ], [ %29, %.lr.ph28.preheader.1 ]
  %34 = add nsw i32 %32, 1
  %35 = sdiv i32 %33, 3
  %36 = srem i32 %35, 3
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %.lr.ph28.1, label %._crit_edge.1.loopexit, !llvm.loop !11

._crit_edge.1.loopexit:                           ; preds = %.lr.ph28.1
  store i32 %34, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  store i32 %35, ptr getelementptr inbounds (i8, ptr @x, i64 4), align 4, !tbaa !5
  br label %._crit_edge.1

._crit_edge.1:                                    ; preds = %._crit_edge.1.loopexit, %.preheader.1
  %38 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @x, i64 8))
  %.promoted.134 = load i32, ptr getelementptr inbounds (i8, ptr @x, i64 8), align 8, !tbaa !5
  %39 = and i32 %.promoted.134, 1
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %.lr.ph.136, label %.preheader.140

.lr.ph.136:                                       ; preds = %._crit_edge.1
  %.promoted25.135 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  br label %41

41:                                               ; preds = %41, %.lr.ph.136
  %42 = phi i32 [ %.promoted25.135, %.lr.ph.136 ], [ %44, %41 ]
  %43 = phi i32 [ %.promoted.134, %.lr.ph.136 ], [ %45, %41 ]
  %44 = add nsw i32 %42, 1
  %45 = ashr exact i32 %43, 1
  %46 = and i32 %43, 2
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %41, label %..preheader_crit_edge.139, !llvm.loop !9

..preheader_crit_edge.139:                        ; preds = %41
  store i32 %44, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  store i32 %45, ptr getelementptr inbounds (i8, ptr @x, i64 8), align 8, !tbaa !5
  br label %.preheader.140

.preheader.140:                                   ; preds = %..preheader_crit_edge.139, %._crit_edge.1
  %48 = phi i32 [ %45, %..preheader_crit_edge.139 ], [ %.promoted.134, %._crit_edge.1 ]
  %49 = srem i32 %48, 3
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %.lr.ph28.preheader.141, label %._crit_edge.144

.lr.ph28.preheader.141:                           ; preds = %.preheader.140
  %.pre46 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 12), align 4, !tbaa !5
  br label %.lr.ph28.142

.lr.ph28.142:                                     ; preds = %.lr.ph28.142, %.lr.ph28.preheader.141
  %51 = phi i32 [ %53, %.lr.ph28.142 ], [ %.pre46, %.lr.ph28.preheader.141 ]
  %52 = phi i32 [ %54, %.lr.ph28.142 ], [ %48, %.lr.ph28.preheader.141 ]
  %53 = add nsw i32 %51, 1
  %54 = sdiv i32 %52, 3
  %55 = srem i32 %54, 3
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %.lr.ph28.142, label %._crit_edge.144.loopexit, !llvm.loop !11

._crit_edge.144.loopexit:                         ; preds = %.lr.ph28.142
  store i32 %53, ptr getelementptr inbounds (i8, ptr @c, i64 12), align 4, !tbaa !5
  store i32 %54, ptr getelementptr inbounds (i8, ptr @x, i64 8), align 8, !tbaa !5
  br label %._crit_edge.144

._crit_edge.144:                                  ; preds = %._crit_edge.144.loopexit, %.preheader.140
  %57 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @x, i64 12))
  %.promoted.1.1 = load i32, ptr getelementptr inbounds (i8, ptr @x, i64 12), align 4, !tbaa !5
  %58 = and i32 %.promoted.1.1, 1
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %.lr.ph.1.1, label %.preheader.1.1

.lr.ph.1.1:                                       ; preds = %._crit_edge.144
  %.promoted25.1.1 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  br label %60

60:                                               ; preds = %60, %.lr.ph.1.1
  %61 = phi i32 [ %.promoted25.1.1, %.lr.ph.1.1 ], [ %63, %60 ]
  %62 = phi i32 [ %.promoted.1.1, %.lr.ph.1.1 ], [ %64, %60 ]
  %63 = add nsw i32 %61, 1
  %64 = ashr exact i32 %62, 1
  %65 = and i32 %62, 2
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %60, label %..preheader_crit_edge.1.1, !llvm.loop !9

..preheader_crit_edge.1.1:                        ; preds = %60
  store i32 %63, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  store i32 %64, ptr getelementptr inbounds (i8, ptr @x, i64 12), align 4, !tbaa !5
  br label %.preheader.1.1

.preheader.1.1:                                   ; preds = %..preheader_crit_edge.1.1, %._crit_edge.144
  %67 = phi i32 [ %64, %..preheader_crit_edge.1.1 ], [ %.promoted.1.1, %._crit_edge.144 ]
  %68 = srem i32 %67, 3
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %.lr.ph28.preheader.1.1, label %._crit_edge.1.1

.lr.ph28.preheader.1.1:                           ; preds = %.preheader.1.1
  %.pre47 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 12), align 4, !tbaa !5
  br label %.lr.ph28.1.1

.lr.ph28.1.1:                                     ; preds = %.lr.ph28.1.1, %.lr.ph28.preheader.1.1
  %70 = phi i32 [ %72, %.lr.ph28.1.1 ], [ %.pre47, %.lr.ph28.preheader.1.1 ]
  %71 = phi i32 [ %73, %.lr.ph28.1.1 ], [ %67, %.lr.ph28.preheader.1.1 ]
  %72 = add nsw i32 %70, 1
  %73 = sdiv i32 %71, 3
  %74 = srem i32 %73, 3
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %.lr.ph28.1.1, label %._crit_edge.1.1.loopexit, !llvm.loop !11

._crit_edge.1.1.loopexit:                         ; preds = %.lr.ph28.1.1
  store i32 %72, ptr getelementptr inbounds (i8, ptr @c, i64 12), align 4, !tbaa !5
  store i32 %73, ptr getelementptr inbounds (i8, ptr @x, i64 12), align 4, !tbaa !5
  br label %._crit_edge.1.1

._crit_edge.1.1:                                  ; preds = %._crit_edge.1.1.loopexit, %.preheader.1.1
  %76 = phi i32 [ %67, %.preheader.1.1 ], [ %73, %._crit_edge.1.1.loopexit ]
  %77 = load i32, ptr @x, align 16, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @x, i64 4), align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = mul nsw i64 %80, %78
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @x, i64 8), align 8, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = sext i32 %76 to i64
  %85 = mul nsw i64 %84, %83
  %86 = icmp eq i64 %81, %85
  br i1 %86, label %87, label %106

87:                                               ; preds = %._crit_edge.1.1
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 12), align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %91, label %95

91:                                               ; preds = %87
  %92 = sub nsw i32 %89, %88
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  %94 = add nsw i32 %93, %92
  store i32 %94, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  %.pre48 = load i32, ptr @c, align 16, !tbaa !5
  br label %99

95:                                               ; preds = %87
  %96 = sub nsw i32 %88, %89
  %97 = load i32, ptr @c, align 16, !tbaa !5
  %98 = add nsw i32 %97, %96
  store i32 %98, ptr @c, align 16, !tbaa !5
  %.pre49 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  br label %99

99:                                               ; preds = %95, %91
  %100 = phi i32 [ %94, %91 ], [ %.pre49, %95 ]
  %101 = phi i32 [ %.pre48, %91 ], [ %98, %95 ]
  %.sink = phi i32 [ %92, %91 ], [ %96, %95 ]
  %102 = sub nsw i32 %101, %100
  %103 = tail call i32 @llvm.abs.i32(i32 %102, i1 true)
  %104 = add nsw i32 %103, %.sink
  store i32 %104, ptr @ans, align 4, !tbaa !5
  %105 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %104)
  br label %108

106:                                              ; preds = %._crit_edge.1.1
  %107 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %108

108:                                              ; preds = %106, %99
  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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #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"}
!11 = distinct !{!11, !10}


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