; ModuleID = 'loop.c'
source_filename = "loop.c"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx11.0.0"
; Function Attrs: nounwind ssp uwtable
define void @loop(i32 %0, i32 %1) local_unnamed_addr #0 {
%3 = alloca [10 x i32], align 16
%4 = bitcast [10 x i32]* %3 to i8*
call void @llvm.lifetime.start.p0i8(i64 40, i8* nonnull %4) #3
call void @llvm.memset.p0i8.i64(i8* nonnull align 16 %4, i8 0, i64 40, i1 true)
%5 = add i32 %1, -1
%6 = icmp ult i32 %5, 10
br i1 %6, label %7, label %24
7: ; preds = %2
%8 = add nsw i32 %0, 3
%9 = icmp sgt i32 %1, 1
%10 = select i1 %9, i32 %1, i32 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store volatile i32 %8, i32* %12, align 16, !tbaa !4
%13 = icmp slt i32 %1, 2
br i1 %13, label %24, label %14
14: ; preds = %7, %14
%15 = phi i64 [ %22, %14 ], [ 1, %7 ]
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %15
store volatile i32 %8, i32* %16, align 4, !tbaa !4
%17 = add nuw nsw i64 %15, 4294967295
%18 = and i64 %17, 4294967295
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %18
%20 = load volatile i32, i32* %19, align 4, !tbaa !4
%21 = add nsw i32 %20, %1
store volatile i32 %21, i32* %19, align 4, !tbaa !4
%22 = add nuw nsw i64 %15, 1
%23 = icmp eq i64 %22, %11
br i1 %23, label %24, label %14, !llvm.loop !8
24: ; preds = %7, %14, %2
call void @llvm.lifetime.end.p0i8(i64 40, i8* nonnull %4) #3
ret void
}
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
; Function Attrs: argmemonly nounwind willreturn writeonly
declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
attributes #0 = { nounwind ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
attributes #2 = { argmemonly nounwind willreturn writeonly }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2}
!llvm.ident = !{!3}
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 11, i32 3]}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 7, !"PIC Level", i32 2}
!3 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git 176249bd6732a8044d457092ed932768724a6f06)"}
!4 = !{!5, !5, i64 0}
!5 = !{!"int", !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.peeled.count", i32 1}