; LLVM IR from square/subzero :: core/external-crypto/aes (tablegen)

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

@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

12:                                               ; preds = %67, %3
  %13 = load i32, ptr %7, align 4, !tbaa !9
  %14 = icmp slt i32 %13, 4
  br i1 %14, label %15, label %70

15:                                               ; preds = %12
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str.10) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %54, %15
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 256
  br i1 %20, label %21, label %57

21:                                               ; preds = %18
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = srem i32 %22, 4
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %21
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.1) #3
  br label %28

28:                                               ; preds = %25, %21
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 255
  br i1 %30, label %31, label %42

31:                                               ; preds = %28
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [256 x i32], ptr %33, i64 %35
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [256 x i32], ptr %36, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.2, i32 noundef %40) #3
  br label %53

42:                                               ; preds = %28
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [256 x i32], ptr %44, i64 %46
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [256 x i32], ptr %47, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.3, i32 noundef %51) #3
  br label %53

53:                                               ; preds = %42, %31
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %8, align 4, !tbaa !9
  br label %18, !llvm.loop !11

57:                                               ; preds = %18
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 3
  br i1 %59, label %60, label %63

60:                                               ; preds = %57
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.11) #3
  br label %66

63:                                               ; preds = %57
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.12) #3
  br label %66

66:                                               ; preds = %63, %60
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %7, align 4, !tbaa !9
  br label %12, !llvm.loop !13

70:                                               ; preds = %12
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void
}

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 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !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"

@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @wtab_4(ptr nocapture noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #1 {
  %4 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.9, ptr noundef %1) #2
  %5 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.10) #2
  %6 = getelementptr inbounds i8, ptr %2, i64 1020
  br label %7

7:                                                ; preds = %13, %3
  %indvars.iv = phi i64 [ 0, %3 ], [ %indvars.iv.next, %13 ]
  %8 = and i64 %indvars.iv, 3
  %9 = icmp eq i64 %8, 0
  br i1 %9, label %10, label %12

10:                                               ; preds = %7
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.1) #2
  br label %12

12:                                               ; preds = %10, %7
  %.not22 = icmp eq i64 %indvars.iv, 255
  br i1 %.not22, label %17, label %13

13:                                               ; preds = %12
  %14 = getelementptr inbounds [256 x i32], ptr %2, i64 0, i64 %indvars.iv
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.2, i32 noundef %15) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %7

17:                                               ; preds = %12
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.3, i32 noundef %18) #2
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.11) #2
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.10) #2
  %22 = getelementptr inbounds i8, ptr %2, i64 2044
  br label %23

23:                                               ; preds = %29, %17
  %indvars.iv.1 = phi i64 [ 0, %17 ], [ %indvars.iv.next.1, %29 ]
  %24 = and i64 %indvars.iv.1, 3
  %25 = icmp eq i64 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.1) #2
  br label %28

28:                                               ; preds = %26, %23
  %.not22.1 = icmp eq i64 %indvars.iv.1, 255
  br i1 %.not22.1, label %33, label %29

29:                                               ; preds = %28
  %30 = getelementptr inbounds [256 x i32], ptr %2, i64 1, i64 %indvars.iv.1
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.2, i32 noundef %31) #2
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  br label %23

33:                                               ; preds = %28
  %34 = load i32, ptr %22, align 4, !tbaa !5
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.3, i32 noundef %34) #2
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.11) #2
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.10) #2
  %38 = getelementptr inbounds i8, ptr %2, i64 3068
  br label %39

39:                                               ; preds = %45, %33
  %indvars.iv.2 = phi i64 [ 0, %33 ], [ %indvars.iv.next.2, %45 ]
  %40 = and i64 %indvars.iv.2, 3
  %41 = icmp eq i64 %40, 0
  br i1 %41, label %42, label %44

42:                                               ; preds = %39
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.1) #2
  br label %44

44:                                               ; preds = %42, %39
  %.not22.2 = icmp eq i64 %indvars.iv.2, 255
  br i1 %.not22.2, label %49, label %45

45:                                               ; preds = %44
  %46 = getelementptr inbounds [256 x i32], ptr %2, i64 2, i64 %indvars.iv.2
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.2, i32 noundef %47) #2
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  br label %39

49:                                               ; preds = %44
  %50 = load i32, ptr %38, align 4, !tbaa !5
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.3, i32 noundef %50) #2
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.11) #2
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.10) #2
  br label %54

54:                                               ; preds = %60, %49
  %indvars.iv.3 = phi i64 [ 0, %49 ], [ %indvars.iv.next.3, %60 ]
  %55 = and i64 %indvars.iv.3, 3
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %54
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.1) #2
  br label %59

59:                                               ; preds = %57, %54
  %.not22.3 = icmp eq i64 %indvars.iv.3, 255
  br i1 %.not22.3, label %64, label %60

60:                                               ; preds = %59
  %61 = getelementptr inbounds [256 x i32], ptr %2, i64 3, i64 %indvars.iv.3
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.2, i32 noundef %62) #2
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  br label %54

64:                                               ; preds = %59
  %65 = getelementptr inbounds i8, ptr %2, i64 4092
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.3, i32 noundef %66) #2
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.12) #2
  %69 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.4) #2
  ret void
}

attributes #0 = { 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 #1 = { nofree 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 #2 = { 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"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass