; LLVM IR from ROCm/aomp :: test/smoke-fails/dominik-AD (dominik-AD)

; 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 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [10 x double], align 16
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca [10 x double], align 16
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 80, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %17, %0
  %8 = load i32, ptr %3, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 10
  br i1 %9, label %10, label %20

10:                                               ; preds = %7
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 %12
  store double 1.000000e+00, ptr %13, align 8, !tbaa !9
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [10 x double], ptr %5, i64 0, i64 %15
  store double 3.000000e+00, ptr %16, align 8, !tbaa !9
  br label %17

17:                                               ; preds = %10
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %3, align 4, !tbaa !5
  br label %7, !llvm.loop !11

20:                                               ; preds = %7
  %21 = getelementptr inbounds [10 x double], ptr %5, i64 0, i64 0
  store ptr %21, ptr %4, align 8, !tbaa !13
  %22 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 0
  %23 = getelementptr inbounds [10 x double], ptr %5, i64 0, i64 0
  %24 = load ptr, ptr %4, align 8, !tbaa !13
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %22, ptr noundef %23, ptr noundef %24)
  %26 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 0
  store ptr %26, ptr %4, align 8, !tbaa !13
  %27 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 0
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %27)
  %29 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 0
  %30 = getelementptr inbounds [10 x double], ptr %5, i64 0, i64 0
  %31 = load ptr, ptr %4, align 8, !tbaa !13
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %29, ptr noundef %30, ptr noundef %31)
  %33 = load ptr, ptr %4, align 8, !tbaa !13
  %34 = getelementptr inbounds double, ptr %33, i64 0
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = load ptr, ptr %4, align 8, !tbaa !13
  %37 = getelementptr inbounds double, ptr %36, i64 1
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %35, double noundef %38)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %47, %20
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = icmp slt i32 %41, 10
  br i1 %42, label %43, label %50

43:                                               ; preds = %40
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 %45
  store double 4.000000e+00, ptr %46, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %43
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  br label %40, !llvm.loop !15

50:                                               ; preds = %40
  %51 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 0
  %52 = getelementptr inbounds [10 x double], ptr %5, i64 0, i64 0
  %53 = load ptr, ptr %4, align 8, !tbaa !13
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %51, ptr noundef %52, ptr noundef %53)
  %55 = load ptr, ptr %4, align 8, !tbaa !13
  %56 = getelementptr inbounds double, ptr %55, i64 0
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 0
  %59 = load double, ptr %58, align 16, !tbaa !9
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %57, double noundef %59)
  %61 = load ptr, ptr %4, align 8, !tbaa !13
  %62 = getelementptr inbounds double, ptr %61, i64 0
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds [10 x double], ptr %2, i64 0, i64 0
  %65 = load double, ptr %64, align 16, !tbaa !9
  %66 = fcmp une double %63, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %50
  store i32 1, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %69

68:                                               ; preds = %50
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %69

69:                                               ; preds = %68, %67
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 80, ptr %2) #3
  %70 = load i32, ptr %1, align 4
  ret i32 %70
}

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

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

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

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

@.str = external hidden unnamed_addr constant [47 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca [10 x double], align 16
  %2 = alloca [10 x double], align 16
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #3
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %1, align 16, !tbaa !5
  store <2 x double> <double 3.000000e+00, double 3.000000e+00>, ptr %2, align 16, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 16
  %5 = getelementptr inbounds i8, ptr %2, i64 16
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %4, align 16, !tbaa !5
  store <2 x double> <double 3.000000e+00, double 3.000000e+00>, ptr %5, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 32
  %7 = getelementptr inbounds i8, ptr %2, i64 32
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %6, align 16, !tbaa !5
  store <2 x double> <double 3.000000e+00, double 3.000000e+00>, ptr %7, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 48
  %9 = getelementptr inbounds i8, ptr %2, i64 48
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %8, align 16, !tbaa !5
  store <2 x double> <double 3.000000e+00, double 3.000000e+00>, ptr %9, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 64
  %11 = getelementptr inbounds i8, ptr %2, i64 64
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %10, align 16, !tbaa !5
  store <2 x double> <double 3.000000e+00, double 3.000000e+00>, ptr %11, align 16, !tbaa !5
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %2)
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %1)
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %1)
  %15 = load double, ptr %1, align 16, !tbaa !5
  %16 = load double, ptr %3, align 8, !tbaa !5
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %15, double noundef %16)
  store <2 x double> <double 4.000000e+00, double 4.000000e+00>, ptr %1, align 16, !tbaa !5
  store <2 x double> <double 4.000000e+00, double 4.000000e+00>, ptr %4, align 16, !tbaa !5
  store <2 x double> <double 4.000000e+00, double 4.000000e+00>, ptr %6, align 16, !tbaa !5
  store <2 x double> <double 4.000000e+00, double 4.000000e+00>, ptr %8, align 16, !tbaa !5
  store <2 x double> <double 4.000000e+00, double 4.000000e+00>, ptr %10, align 16, !tbaa !5
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %1)
  %19 = load double, ptr %1, align 16, !tbaa !5
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, double noundef %19, double noundef %19)
  %21 = load double, ptr %1, align 16, !tbaa !5
  %22 = fcmp uno double %21, 0.000000e+00
  %. = zext i1 %22 to i32
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #3
  ret i32 %.
}

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

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

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

attributes #0 = { 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 #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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass