; LLVM IR from bqi343/cp-notebook :: Contests/USACO Training/Ch 6/6.5 latin (main)

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

%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }

@N = external dso_local global i32, align 4
@ans = external dso_local global i64, align 8
@z = external dso_local global [7 x [7 x i8]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::basic_ifstream", align 8
  %3 = alloca %"class.std::basic_ofstream", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %2, ptr noundef @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr %3) #6
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef @.str.1, i32 noundef 16)
          to label %9 unwind label %17

9:                                                ; preds = %0
  %10 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @N)
          to label %11 unwind label %21

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

12:                                               ; preds = %33, %11
  %13 = load i32, ptr %6, align 4, !tbaa !5
  %14 = load i32, ptr @N, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %25, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %36

17:                                               ; preds = %0
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = extractvalue { ptr, i32 } %18, 0
  store ptr %19, ptr %4, align 8
  %20 = extractvalue { ptr, i32 } %18, 1
  store i32 %20, ptr %5, align 4
  br label %108

21:                                               ; preds = %103, %100, %43, %9
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %4, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %5, align 4
  br label %107

25:                                               ; preds = %12
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [7 x i8], ptr @z, i64 0, i64 %27
  store i8 1, ptr %28, align 1, !tbaa !9
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [7 x [7 x i8]], ptr @z, i64 0, i64 %30
  %32 = getelementptr inbounds [7 x i8], ptr %31, i64 0, i64 0
  store i8 1, ptr %32, align 1, !tbaa !9
  br label %33

33:                                               ; preds = %25
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %6, align 4, !tbaa !5
  br label %12, !llvm.loop !11

36:                                               ; preds = %16
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %38 = icmp sle i32 %37, 2
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store i64 1, ptr @ans, align 8, !tbaa !13
  br label %86

40:                                               ; preds = %36
  %41 = load i32, ptr @N, align 4, !tbaa !5
  %42 = icmp sle i32 %41, 6
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  invoke void @_Z3dfsiii(i32 noundef 1, i32 noundef 2, i32 noundef 0)
          to label %44 unwind label %21

44:                                               ; preds = %43
  br label %85

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !13
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 5), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 4), align 4, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 3), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 2), align 2, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %46 unwind label %81

46:                                               ; preds = %45
  %47 = load i64, ptr @ans, align 8, !tbaa !13
  %48 = load i64, ptr %7, align 8, !tbaa !13
  %49 = add nsw i64 %48, %47
  store i64 %49, ptr %7, align 8, !tbaa !13
  store i64 0, ptr @ans, align 8, !tbaa !13
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 5), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 4), align 4, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 3), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 2), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 5), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 4), align 4, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 2), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %50 unwind label %81

50:                                               ; preds = %46
  %51 = load i64, ptr @ans, align 8, !tbaa !13
  %52 = mul nsw i64 10, %51
  %53 = load i64, ptr %7, align 8, !tbaa !13
  %54 = add nsw i64 %53, %52
  store i64 %54, ptr %7, align 8, !tbaa !13
  store i64 0, ptr @ans, align 8, !tbaa !13
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 5), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 4), align 4, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 2), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 4), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 5), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 2), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %55 unwind label %81

55:                                               ; preds = %50
  %56 = load i64, ptr @ans, align 8, !tbaa !13
  %57 = mul nsw i64 15, %56
  %58 = load i64, ptr %7, align 8, !tbaa !13
  %59 = add nsw i64 %58, %57
  store i64 %59, ptr %7, align 8, !tbaa !13
  store i64 0, ptr @ans, align 8, !tbaa !13
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 4), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 5), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 2), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 5), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 6), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 2), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %60 unwind label %81

60:                                               ; preds = %55
  %61 = load i64, ptr @ans, align 8, !tbaa !13
  %62 = mul nsw i64 20, %61
  %63 = load i64, ptr %7, align 8, !tbaa !13
  %64 = add nsw i64 %63, %62
  store i64 %64, ptr %7, align 8, !tbaa !13
  store i64 0, ptr @ans, align 8, !tbaa !13
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 5), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 6), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 2), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 5), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 2), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %65 unwind label %81

65:                                               ; preds = %60
  %66 = load i64, ptr @ans, align 8, !tbaa !13
  %67 = mul nsw i64 20, %66
  %68 = load i64, ptr %7, align 8, !tbaa !13
  %69 = add nsw i64 %68, %67
  store i64 %69, ptr %7, align 8, !tbaa !13
  store i64 0, ptr @ans, align 8, !tbaa !13
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 5), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 2), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 2), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 5), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %70 unwind label %81

70:                                               ; preds = %65
  %71 = load i64, ptr @ans, align 8, !tbaa !13
  %72 = mul nsw i64 30, %71
  %73 = load i64, ptr %7, align 8, !tbaa !13
  %74 = add nsw i64 %73, %72
  store i64 %74, ptr %7, align 8, !tbaa !13
  store i64 0, ptr @ans, align 8, !tbaa !13
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 6), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 2), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 5), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 2), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 6), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 5), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %75 unwind label %81

75:                                               ; preds = %70
  %76 = load i64, ptr @ans, align 8, !tbaa !13
  %77 = mul nsw i64 24, %76
  %78 = load i64, ptr %7, align 8, !tbaa !13
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %7, align 8, !tbaa !13
  store i64 0, ptr @ans, align 8, !tbaa !13
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 6), i64 0, i64 2), align 2, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 5), i64 0, i64 6), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 4), i64 0, i64 5), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 3), i64 0, i64 4), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr @z, i64 0, i64 2), i64 0, i64 3), align 1, !tbaa !9
  %80 = load i64, ptr %7, align 8, !tbaa !13
  store i64 %80, ptr @ans, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %85

81:                                               ; preds = %70, %65, %60, %55, %50, %46, %45
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %4, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %107

85:                                               ; preds = %75, %44
  br label %86

86:                                               ; preds = %85, %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %97, %86
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = load i32, ptr @N, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %100

92:                                               ; preds = %87
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = load i64, ptr @ans, align 8, !tbaa !13
  %96 = mul nsw i64 %95, %94
  store i64 %96, ptr @ans, align 8, !tbaa !13
  br label %97

97:                                               ; preds = %92
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %8, align 4, !tbaa !5
  br label %87, !llvm.loop !15

100:                                              ; preds = %91
  %101 = load i64, ptr @ans, align 8, !tbaa !13
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %101)
          to label %103 unwind label %21

103:                                              ; preds = %100
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @.str.2)
          to label %105 unwind label %21

105:                                              ; preds = %103
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #6
  %106 = load i32, ptr %1, align 4
  ret i32 %106

107:                                              ; preds = %81, %21
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #6
  br label %108

108:                                              ; preds = %107, %17
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #6
  br label %109

109:                                              ; preds = %108
  %110 = load ptr, ptr %4, align 8
  %111 = load i32, ptr %5, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #5 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !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"

%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }

@N = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global i64, align 8
@z = external dso_local local_unnamed_addr global [7 x [7 x i8]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::basic_ifstream", align 8
  %2 = alloca %"class.std::basic_ofstream", align 8
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %1) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef nonnull @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #6
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.1, i32 noundef 16)
          to label %3 unwind label %11

3:                                                ; preds = %0
  %4 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @N)
          to label %.preheader unwind label %13

.preheader:                                       ; preds = %3
  %5 = load i32, ptr @N, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %5 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %7 = icmp ult i32 %5, 4
  br i1 %7, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.unr-lcssa ]
  %8 = getelementptr inbounds [7 x i8], ptr @z, i64 0, i64 %indvars.iv.epil
  store i8 1, ptr %8, align 1, !tbaa !9
  %9 = getelementptr inbounds [7 x [7 x i8]], ptr @z, i64 0, i64 %indvars.iv.epil
  store i8 1, ptr %9, align 1, !tbaa !9
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph.epil, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.unr-lcssa
  %10 = icmp slt i32 %5, 3
  br i1 %10, label %._crit_edge.thread, label %23

11:                                               ; preds = %0
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %76

13:                                               ; preds = %72, %60, %25, %3
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %75

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %15 = getelementptr inbounds [7 x i8], ptr @z, i64 0, i64 %indvars.iv
  store i8 1, ptr %15, align 4, !tbaa !9
  %16 = getelementptr inbounds [7 x [7 x i8]], ptr @z, i64 0, i64 %indvars.iv
  store i8 1, ptr %16, align 4, !tbaa !9
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %17 = getelementptr inbounds [7 x i8], ptr @z, i64 0, i64 %indvars.iv.next
  store i8 1, ptr %17, align 1, !tbaa !9
  %18 = getelementptr inbounds [7 x [7 x i8]], ptr @z, i64 0, i64 %indvars.iv.next
  store i8 1, ptr %18, align 1, !tbaa !9
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %19 = getelementptr inbounds [7 x i8], ptr @z, i64 0, i64 %indvars.iv.next.1
  store i8 1, ptr %19, align 2, !tbaa !9
  %20 = getelementptr inbounds [7 x [7 x i8]], ptr @z, i64 0, i64 %indvars.iv.next.1
  store i8 1, ptr %20, align 2, !tbaa !9
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %21 = getelementptr inbounds [7 x i8], ptr @z, i64 0, i64 %indvars.iv.next.2
  store i8 1, ptr %21, align 1, !tbaa !9
  %22 = getelementptr inbounds [7 x [7 x i8]], ptr @z, i64 0, i64 %indvars.iv.next.2
  store i8 1, ptr %22, align 1, !tbaa !9
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !13

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  store i64 1, ptr @ans, align 8, !tbaa !15
  br label %52

23:                                               ; preds = %._crit_edge
  %24 = icmp ult i32 %5, 7
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  invoke void @_Z3dfsiii(i32 noundef 1, i32 noundef 2, i32 noundef 0)
          to label %._crit_edge36 unwind label %13

._crit_edge36:                                    ; preds = %25
  %ans.promoted.pre = load i64, ptr @ans, align 8, !tbaa !15
  br label %52

26:                                               ; preds = %23
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 48), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 40), align 8, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 32), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 24), align 8, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 16), align 16, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %27 unwind label %50

27:                                               ; preds = %26
  %28 = load i64, ptr @ans, align 8, !tbaa !15
  store i64 0, ptr @ans, align 8, !tbaa !15
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 24), align 8, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 16), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 48), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 40), align 8, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 32), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 23), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 17), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %29 unwind label %50

29:                                               ; preds = %27
  %30 = load i64, ptr @ans, align 8, !tbaa !15
  store i64 0, ptr @ans, align 8, !tbaa !15
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 40), align 8, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 32), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 48), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 39), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 33), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 23), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 17), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %31 unwind label %50

31:                                               ; preds = %29
  %32 = load i64, ptr @ans, align 8, !tbaa !15
  store i64 0, ptr @ans, align 8, !tbaa !15
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 48), align 16, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 39), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 33), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 23), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 47), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 41), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 30), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 25), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 17), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %33 unwind label %50

33:                                               ; preds = %31
  %34 = load i64, ptr @ans, align 8, !tbaa !15
  store i64 0, ptr @ans, align 8, !tbaa !15
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 47), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 41), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 48), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 40), align 8, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 30), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 25), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 17), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %35 unwind label %50

35:                                               ; preds = %33
  %36 = load i64, ptr @ans, align 8, !tbaa !15
  store i64 0, ptr @ans, align 8, !tbaa !15
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 40), align 8, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 30), align 2, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 48), align 16, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 37), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 33), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 25), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 17), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %37 unwind label %50

37:                                               ; preds = %35
  %38 = load i64, ptr @ans, align 8, !tbaa !15
  store i64 0, ptr @ans, align 8, !tbaa !15
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 48), align 16, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 37), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 44), align 4, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 41), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 33), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 25), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @z, i64 17), align 1, !tbaa !9
  invoke void @_Z3dfsiii(i32 noundef 2, i32 noundef 1, i32 noundef 0)
          to label %39 unwind label %50

39:                                               ; preds = %37
  %40 = mul nsw i64 %30, 10
  %41 = mul nsw i64 %32, 15
  %42 = mul nsw i64 %38, 30
  %43 = load i64, ptr @ans, align 8, !tbaa !15
  %44 = mul nsw i64 %43, 24
  %reass.add = add i64 %36, %34
  %reass.mul = mul i64 %reass.add, 20
  %45 = add i64 %40, %28
  %46 = add i64 %45, %41
  %47 = add i64 %46, %reass.mul
  %48 = add i64 %47, %42
  %49 = add i64 %48, %44
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 44), align 4, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 41), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 33), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 25), align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds (i8, ptr @z, i64 17), align 1, !tbaa !9
  store i64 %49, ptr @ans, align 8, !tbaa !15
  br label %52

50:                                               ; preds = %37, %35, %33, %31, %29, %27, %26
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %75

52:                                               ; preds = %._crit_edge36, %39, %._crit_edge.thread
  %ans.promoted = phi i64 [ %ans.promoted.pre, %._crit_edge36 ], [ %49, %39 ], [ 1, %._crit_edge.thread ]
  %53 = load i32, ptr @N, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 1
  br i1 %54, label %.lr.ph27.preheader, label %60

.lr.ph27.preheader:                               ; preds = %52
  %wide.trip.count34 = zext nneg i32 %53 to i64
  %55 = add nsw i64 %wide.trip.count34, -1
  %56 = add nsw i64 %wide.trip.count34, -2
  %xtraiter38 = and i64 %55, 7
  %57 = icmp ult i64 %56, 7
  br i1 %57, label %._crit_edge28.unr-lcssa, label %.lr.ph27.preheader.new

.lr.ph27.preheader.new:                           ; preds = %.lr.ph27.preheader
  %unroll_iter42 = and i64 %55, -8
  br label %.lr.ph27

._crit_edge28.unr-lcssa:                          ; preds = %.lr.ph27, %.lr.ph27.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph27.preheader ], [ %71, %.lr.ph27 ]
  %indvars.iv31.unr = phi i64 [ 1, %.lr.ph27.preheader ], [ %indvars.iv.next32.7, %.lr.ph27 ]
  %.unr = phi i64 [ %ans.promoted, %.lr.ph27.preheader ], [ %71, %.lr.ph27 ]
  %lcmp.mod40.not = icmp eq i64 %xtraiter38, 0
  br i1 %lcmp.mod40.not, label %._crit_edge28, label %.lr.ph27.epil

.lr.ph27.epil:                                    ; preds = %._crit_edge28.unr-lcssa, %.lr.ph27.epil
  %indvars.iv31.epil = phi i64 [ %indvars.iv.next32.epil, %.lr.ph27.epil ], [ %indvars.iv31.unr, %._crit_edge28.unr-lcssa ]
  %58 = phi i64 [ %59, %.lr.ph27.epil ], [ %.unr, %._crit_edge28.unr-lcssa ]
  %epil.iter39 = phi i64 [ %epil.iter39.next, %.lr.ph27.epil ], [ 0, %._crit_edge28.unr-lcssa ]
  %59 = mul nsw i64 %58, %indvars.iv31.epil
  %indvars.iv.next32.epil = add nuw nsw i64 %indvars.iv31.epil, 1
  %epil.iter39.next = add i64 %epil.iter39, 1
  %epil.iter39.cmp.not = icmp eq i64 %epil.iter39.next, %xtraiter38
  br i1 %epil.iter39.cmp.not, label %._crit_edge28, label %.lr.ph27.epil, !llvm.loop !17

._crit_edge28:                                    ; preds = %.lr.ph27.epil, %._crit_edge28.unr-lcssa
  %.lcssa = phi i64 [ %.lcssa.ph, %._crit_edge28.unr-lcssa ], [ %59, %.lr.ph27.epil ]
  store i64 %.lcssa, ptr @ans, align 8, !tbaa !15
  br label %60

60:                                               ; preds = %._crit_edge28, %52
  %61 = phi i64 [ %.lcssa, %._crit_edge28 ], [ %ans.promoted, %52 ]
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %2, i64 noundef %61)
          to label %72 unwind label %13

.lr.ph27:                                         ; preds = %.lr.ph27, %.lr.ph27.preheader.new
  %indvars.iv31 = phi i64 [ 1, %.lr.ph27.preheader.new ], [ %indvars.iv.next32.7, %.lr.ph27 ]
  %63 = phi i64 [ %ans.promoted, %.lr.ph27.preheader.new ], [ %71, %.lr.ph27 ]
  %niter43 = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %niter43.next.7, %.lr.ph27 ]
  %64 = mul nsw i64 %63, %indvars.iv31
  %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
  %65 = mul nsw i64 %64, %indvars.iv.next32
  %indvars.iv.next32.1 = add nuw nsw i64 %indvars.iv31, 2
  %66 = mul nsw i64 %65, %indvars.iv.next32.1
  %indvars.iv.next32.2 = add nuw nsw i64 %indvars.iv31, 3
  %67 = mul nsw i64 %66, %indvars.iv.next32.2
  %indvars.iv.next32.3 = add nuw nsw i64 %indvars.iv31, 4
  %68 = mul nsw i64 %67, %indvars.iv.next32.3
  %indvars.iv.next32.4 = add nuw nsw i64 %indvars.iv31, 5
  %69 = mul nsw i64 %68, %indvars.iv.next32.4
  %indvars.iv.next32.5 = add nuw nsw i64 %indvars.iv31, 6
  %70 = mul nsw i64 %69, %indvars.iv.next32.5
  %indvars.iv.next32.6 = add nuw nsw i64 %indvars.iv31, 7
  %71 = mul nsw i64 %70, %indvars.iv.next32.6
  %indvars.iv.next32.7 = add nuw nsw i64 %indvars.iv31, 8
  %niter43.next.7 = add i64 %niter43, 8
  %niter43.ncmp.7 = icmp eq i64 %niter43.next.7, %unroll_iter42
  br i1 %niter43.ncmp.7, label %._crit_edge28.unr-lcssa, label %.lr.ph27, !llvm.loop !18

72:                                               ; preds = %60
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @.str.2)
          to label %74 unwind label %13

74:                                               ; preds = %72
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  ret i32 0

75:                                               ; preds = %50, %13
  %.pn = phi { ptr, i32 } [ %14, %13 ], [ %51, %50 ]
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  br label %76

76:                                               ; preds = %75, %11
  %.pn.pn = phi { ptr, i32 } [ %.pn, %75 ], [ %12, %11 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #5 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !14}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass