; LLVM IR from AlgoGenesis/C :: Mathematical Algorithms/Euler Algorithm (Euler's Algo)

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

@pathIndex = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@degree = external dso_local global [100 x i32], align 16
@graph = external dso_local global [100 x [100 x i32]], align 16
@path = external dso_local global [100 x i32], align 16
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @isEulerian() #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: nounwind uwtable
declare dso_local void @findEulerian(i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %42, %0
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100 x i32], ptr @degree, i64 0, i64 %24
  store i32 0, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %38, %22
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %41

31:                                               ; preds = %26
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %33
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100 x i32], ptr %34, i64 0, i64 %36
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %31
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %7, align 4, !tbaa !5
  br label %26, !llvm.loop !9

41:                                               ; preds = %30
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %5, align 4, !tbaa !5
  br label %17, !llvm.loop !11

45:                                               ; preds = %21
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %80, %45
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %83

52:                                               ; preds = %47
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %3, ptr noundef %4)
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100 x i32], ptr %56, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %59, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %63
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100 x i32], ptr %64, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %67, align 4, !tbaa !5
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100 x i32], ptr @degree, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %72, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100 x i32], ptr @degree, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %77, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %52
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %8, align 4, !tbaa !5
  br label %47, !llvm.loop !12

83:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %84 = call i32 @isEulerian()
  store i32 %84, ptr %9, align 4, !tbaa !5
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = icmp eq i32 %85, -1
  br i1 %86, label %87, label %89

87:                                               ; preds = %83
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %137

89:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %113

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

93:                                               ; preds = %108, %92
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 11, ptr %6, align 4
  br label %111

98:                                               ; preds = %93
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100 x i32], ptr @degree, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = srem i32 %102, 2
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %98
  %106 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %106, ptr %10, align 4, !tbaa !5
  store i32 11, ptr %6, align 4
  br label %111

107:                                              ; preds = %98
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %11, align 4, !tbaa !5
  br label %93, !llvm.loop !13

111:                                              ; preds = %105, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112, %89
  %114 = load i32, ptr %10, align 4, !tbaa !5
  call void @findEulerian(i32 noundef %114)
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = icmp eq i32 %115, 0
  %117 = zext i1 %116 to i64
  %118 = select i1 %116, ptr @.str.7, ptr @.str.8
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %118)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %120 = load i32, ptr @pathIndex, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  store i32 %121, ptr %12, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %132, %113
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = icmp sge i32 %123, 0
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %135

126:                                              ; preds = %122
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100 x i32], ptr @path, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %130)
  br label %132

132:                                              ; preds = %126
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = add nsw i32 %133, -1
  store i32 %134, ptr %12, align 4, !tbaa !5
  br label %122, !llvm.loop !14

135:                                              ; preds = %125
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %137

137:                                              ; preds = %135, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  %138 = load i32, ptr %1, align 4
  ret i32 %138
}

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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"

@pathIndex = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global i32, align 4
@degree = external dso_local local_unnamed_addr global [100 x i32], align 16
@graph = external dso_local local_unnamed_addr global [100 x [100 x i32]], align 16
@path = external dso_local local_unnamed_addr global [100 x i32], align 16
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @isEulerian() 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: nounwind uwtable
declare dso_local void @findEulerian(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph.us.preheader, label %._crit_edge32

.lr.ph.us.preheader:                              ; preds = %0
  %10 = zext nneg i32 %8 to i64
  %11 = shl nuw nsw i64 %10, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @degree, i8 0, i64 %11, i1 false), !tbaa !5
  %xtraiter = and i64 %10, 7
  %12 = icmp ult i32 %8, 8
  br i1 %12, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph.us.preheader.new

.lr.ph.us.preheader.new:                          ; preds = %.lr.ph.us.preheader
  %unroll_iter = and i64 %10, 2147483640
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us, %.lr.ph.us.preheader.new
  %indvar = phi i64 [ 0, %.lr.ph.us.preheader.new ], [ %indvar.next.7, %.lr.ph.us ]
  %niter = phi i64 [ 0, %.lr.ph.us.preheader.new ], [ %niter.next.7, %.lr.ph.us ]
  %13 = mul nuw nsw i64 %indvar, 400
  %scevgep = getelementptr i8, ptr @graph, i64 %13
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %11, i1 false), !tbaa !5
  %14 = mul nuw i64 %indvar, 400
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @graph, i64 400), i64 %14
  call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %11, i1 false), !tbaa !5
  %15 = mul nuw i64 %indvar, 400
  %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @graph, i64 800), i64 %15
  call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %11, i1 false), !tbaa !5
  %16 = mul nuw i64 %indvar, 400
  %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @graph, i64 1200), i64 %16
  call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %11, i1 false), !tbaa !5
  %17 = mul nuw i64 %indvar, 400
  %gep57 = getelementptr i8, ptr getelementptr (i8, ptr @graph, i64 1600), i64 %17
  call void @llvm.memset.p0.i64(ptr align 16 %gep57, i8 0, i64 %11, i1 false), !tbaa !5
  %18 = mul nuw i64 %indvar, 400
  %gep58 = getelementptr i8, ptr getelementptr (i8, ptr @graph, i64 2000), i64 %18
  call void @llvm.memset.p0.i64(ptr align 16 %gep58, i8 0, i64 %11, i1 false), !tbaa !5
  %19 = mul nuw i64 %indvar, 400
  %gep59 = getelementptr i8, ptr getelementptr (i8, ptr @graph, i64 2400), i64 %19
  call void @llvm.memset.p0.i64(ptr align 16 %gep59, i8 0, i64 %11, i1 false), !tbaa !5
  %20 = mul nuw i64 %indvar, 400
  %gep60 = getelementptr i8, ptr getelementptr (i8, ptr @graph, i64 2800), i64 %20
  call void @llvm.memset.p0.i64(ptr align 16 %gep60, i8 0, i64 %11, i1 false), !tbaa !5
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph.us, !llvm.loop !9

._crit_edge32.loopexit.unr-lcssa:                 ; preds = %.lr.ph.us, %.lr.ph.us.preheader
  %indvar.unr = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvar.next.7, %.lr.ph.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge32, label %.lr.ph.us.epil

.lr.ph.us.epil:                                   ; preds = %._crit_edge32.loopexit.unr-lcssa, %.lr.ph.us.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.lr.ph.us.epil ], [ %indvar.unr, %._crit_edge32.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.us.epil ], [ 0, %._crit_edge32.loopexit.unr-lcssa ]
  %21 = mul nuw nsw i64 %indvar.epil, 400
  %scevgep.epil = getelementptr i8, ptr @graph, i64 %21
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %11, i1 false), !tbaa !5
  %indvar.next.epil = add nuw nsw i64 %indvar.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_edge32, label %.lr.ph.us.epil, !llvm.loop !11

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit.unr-lcssa, %.lr.ph.us.epil, %0
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %._crit_edge32
  %25 = call i32 @isEulerian()
  switch i32 %25, label %.loopexit [
    i32 -1, label %._crit_edge41
    i32 1, label %.preheader
  ]

.preheader:                                       ; preds = %._crit_edge
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph35.preheader, label %.loopexit

.lr.ph35.preheader:                               ; preds = %.preheader
  %wide.trip.count45 = zext nneg i32 %26 to i64
  br label %.lr.ph35

.lr.ph:                                           ; preds = %._crit_edge32, %.lr.ph
  %.02433 = phi i32 [ %45, %.lr.ph ], [ 0, %._crit_edge32 ]
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %30, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %33, align 4, !tbaa !5
  %36 = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %32, i64 %30
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = getelementptr inbounds [100 x i32], ptr @degree, i64 0, i64 %30
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %39, align 4, !tbaa !5
  %42 = getelementptr inbounds [100 x i32], ptr @degree, i64 0, i64 %32
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !5
  %45 = add nuw nsw i32 %.02433, 1
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.lr.ph35:                                         ; preds = %.lr.ph35.preheader, %51
  %indvars.iv = phi i64 [ 0, %.lr.ph35.preheader ], [ %indvars.iv.next, %51 ]
  %48 = getelementptr inbounds [100 x i32], ptr @degree, i64 0, i64 %indvars.iv
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = and i32 %49, 1
  %.not = icmp eq i32 %50, 0
  br i1 %.not, label %51, label %.loopexit.loopexit.split.loop.exit50

51:                                               ; preds = %.lr.ph35
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond46.not = icmp eq i64 %indvars.iv.next, %wide.trip.count45
  br i1 %exitcond46.not, label %.loopexit, label %.lr.ph35, !llvm.loop !14

.loopexit.loopexit.split.loop.exit50:             ; preds = %.lr.ph35
  %52 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.loopexit

.loopexit:                                        ; preds = %51, %.loopexit.loopexit.split.loop.exit50, %.preheader, %._crit_edge
  %.1 = phi i32 [ 0, %._crit_edge ], [ 0, %.preheader ], [ %52, %.loopexit.loopexit.split.loop.exit50 ], [ 0, %51 ]
  call void @findEulerian(i32 noundef %.1)
  %53 = icmp eq i32 %25, 0
  %54 = select i1 %53, ptr @.str.7, ptr @.str.8
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %54)
  %56 = load i32, ptr @pathIndex, align 4, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph40.preheader, label %._crit_edge41

.lr.ph40.preheader:                               ; preds = %.loopexit
  %58 = zext nneg i32 %56 to i64
  br label %.lr.ph40

.lr.ph40:                                         ; preds = %.lr.ph40.preheader, %.lr.ph40
  %indvars.iv47 = phi i64 [ %58, %.lr.ph40.preheader ], [ %indvars.iv.next48, %.lr.ph40 ]
  %indvars.iv.next48 = add nsw i64 %indvars.iv47, -1
  %59 = getelementptr inbounds [100 x i32], ptr @path, i64 0, i64 %indvars.iv.next48
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %60)
  %62 = icmp ugt i64 %indvars.iv47, 1
  br i1 %62, label %.lr.ph40, label %._crit_edge41, !llvm.loop !15

._crit_edge41:                                    ; preds = %.lr.ph40, %.loopexit, %._crit_edge
  %.str.10.sink = phi ptr [ @.str.5, %._crit_edge ], [ @.str.10, %.loopexit ], [ @.str.10, %.lr.ph40 ]
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.10.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0
}

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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