; LLVM IR from huawei-noah/bolt :: compute/blas_enhance/tests (test_mmm)

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

@stdout = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [46 x i8], align 1

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

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

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) #1

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

declare i32 @fflush(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7mmmTestjjjb(i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #4 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %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
  %13 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = icmp eq i32 %14, 4
  br i1 %15, label %16, label %32

16:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds ptr, ptr %17, i64 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call i32 @atoi(ptr noundef %19) #7
  store i32 %20, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = getelementptr inbounds ptr, ptr %21, i64 2
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = call i32 @atoi(ptr noundef %23) #7
  store i32 %24, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = getelementptr inbounds ptr, ptr %25, i64 3
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = call i32 @atoi(ptr noundef %27) #7
  store i32 %28, ptr %8, align 4, !tbaa !5
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !5
  call void @_Z7mmmTestjjjb(i32 noundef %29, i32 noundef %30, i32 noundef %31, i1 noundef zeroext true)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %72

32:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %33 = call i64 (i64, ...) @syscall(i64 noundef 186) #6
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %9, align 4, !tbaa !5
  %35 = load i32, ptr %9, align 4, !tbaa !5
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %35)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !9
  %38 = call i32 @fflush(ptr noundef %37)
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %40 = load ptr, ptr @stdout, align 8, !tbaa !9
  %41 = call i32 @fflush(ptr noundef %40)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %68, %32
  %43 = load i32, ptr %10, align 4, !tbaa !5
  %44 = icmp ule i32 %43, 33
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %71

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

47:                                               ; preds = %64, %46
  %48 = load i32, ptr %12, align 4, !tbaa !5
  %49 = icmp ule i32 %48, 33
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %67

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %60, %51
  %53 = load i32, ptr %13, align 4, !tbaa !5
  %54 = icmp ule i32 %53, 33
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %63

56:                                               ; preds = %52
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !5
  %59 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z7mmmTestjjjb(i32 noundef %57, i32 noundef %58, i32 noundef %59, i1 noundef zeroext false)
  br label %60

60:                                               ; preds = %56
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = add i32 %61, 1
  store i32 %62, ptr %13, align 4, !tbaa !5
  br label %52, !llvm.loop !11

63:                                               ; preds = %55
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %12, align 4, !tbaa !5
  %66 = add i32 %65, 1
  store i32 %66, ptr %12, align 4, !tbaa !5
  br label %47, !llvm.loop !13

67:                                               ; preds = %50
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = add i32 %69, 1
  store i32 %70, ptr %10, align 4, !tbaa !5
  br label %42, !llvm.loop !14

71:                                               ; preds = %45
  br label %72

72:                                               ; preds = %71, %16
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { "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 = { 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 #4 = { 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 #5 = { inlinehint mustprogress nounwind willreturn memory(read) 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 }
attributes #7 = { nounwind willreturn memory(read) }

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


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

@stdout = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7mmmTestjjjb(i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = icmp eq i32 %0, 4
  br i1 %3, label %4, label %14

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @atoi(ptr nocapture noundef %6) #5
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 @atoi(ptr nocapture noundef %9) #5
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call i32 @atoi(ptr nocapture noundef %12) #5
  tail call void @_Z7mmmTestjjjb(i32 noundef %7, i32 noundef %10, i32 noundef %13, i1 noundef zeroext true)
  br label %.loopexit

14:                                               ; preds = %2
  %15 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #6
  %16 = trunc i64 %15 to i32
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %16)
  %18 = load ptr, ptr @stdout, align 8, !tbaa !5
  %19 = tail call i32 @fflush(ptr noundef %18)
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %21 = load ptr, ptr @stdout, align 8, !tbaa !5
  %22 = tail call i32 @fflush(ptr noundef %21)
  br label %.preheader18

.preheader18:                                     ; preds = %14, %24
  %.01721 = phi i32 [ 1, %14 ], [ %25, %24 ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader18, %.preheader
  %.01620 = phi i32 [ 1, %.preheader18 ], [ %23, %.preheader ]
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 1, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 2, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 3, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 4, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 5, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 6, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 7, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 8, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 9, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 10, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 11, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 12, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 13, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 14, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 15, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 16, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 17, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 18, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 19, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 20, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 21, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 22, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 23, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 24, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 25, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 26, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 27, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 28, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 29, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 30, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 31, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 32, i1 noundef zeroext false)
  tail call void @_Z7mmmTestjjjb(i32 noundef %.01721, i32 noundef %.01620, i32 noundef 33, i1 noundef zeroext false)
  %23 = add nuw nsw i32 %.01620, 1
  %exitcond.not = icmp eq i32 %23, 34
  br i1 %exitcond.not, label %24, label %.preheader, !llvm.loop !9

24:                                               ; preds = %.preheader
  %25 = add nuw nsw i32 %.01721, 1
  %exitcond22.not = icmp eq i32 %25, 34
  br i1 %exitcond22.not, label %.loopexit, label %.preheader18, !llvm.loop !11

.loopexit:                                        ; preds = %24, %4
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #4

attributes #0 = { 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 #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 = { 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 #3 = { mustprogress 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 #4 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { nounwind willreturn memory(read) }
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 = !{!"any pointer", !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: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass