; LLVM IR from OpenMathLib/OpenBLAS :: cpuid_x86 (get_vendor)

; 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 [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 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: inlinehint nounwind uwtable
declare hidden void @cpuid(i32 noundef, ptr noundef, ptr noundef, 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 i32 @get_vendor() #2 {
  %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 [13 x i8], align 1
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 13, ptr %6) #4
  call void @cpuid(i32 noundef 0, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  %8 = load i32, ptr %3, align 4, !tbaa !5
  %9 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  store i32 %8, ptr %9, align 1, !tbaa !5
  %10 = load i32, ptr %5, align 4, !tbaa !5
  %11 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 4
  store i32 %10, ptr %11, align 1, !tbaa !5
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 8
  store i32 %12, ptr %13, align 1, !tbaa !5
  %14 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 12
  store i8 0, ptr %14, align 1, !tbaa !9
  %15 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %16 = call i32 @strcmp(ptr noundef %15, ptr noundef @.str) #5
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %19, label %18

18:                                               ; preds = %0
  store i32 1, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

19:                                               ; preds = %0
  %20 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %21 = call i32 @strcmp(ptr noundef %20, ptr noundef @.str.1) #5
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 2, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

24:                                               ; preds = %19
  %25 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %26 = call i32 @strcmp(ptr noundef %25, ptr noundef @.str.2) #5
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 3, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

29:                                               ; preds = %24
  %30 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %31 = call i32 @strcmp(ptr noundef %30, ptr noundef @.str.3) #5
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 4, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

34:                                               ; preds = %29
  %35 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %36 = call i32 @strcmp(ptr noundef %35, ptr noundef @.str.4) #5
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 5, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

39:                                               ; preds = %34
  %40 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %41 = call i32 @strcmp(ptr noundef %40, ptr noundef @.str.5) #5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 6, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

44:                                               ; preds = %39
  %45 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %46 = call i32 @strcmp(ptr noundef %45, ptr noundef @.str.6) #5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 12, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

49:                                               ; preds = %44
  %50 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %51 = call i32 @strcmp(ptr noundef %50, ptr noundef @.str.7) #5
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 7, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

54:                                               ; preds = %49
  %55 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %56 = call i32 @strcmp(ptr noundef %55, ptr noundef @.str.8) #5
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 8, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

59:                                               ; preds = %54
  %60 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %61 = call i32 @strcmp(ptr noundef %60, ptr noundef @.str.9) #5
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 9, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

64:                                               ; preds = %59
  %65 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %66 = call i32 @strcmp(ptr noundef %65, ptr noundef @.str.10) #5
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 10, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

69:                                               ; preds = %64
  %70 = getelementptr inbounds [13 x i8], ptr %6, i64 0, i64 0
  %71 = call i32 @strcmp(ptr noundef %70, ptr noundef @.str.11) #5
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 11, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

74:                                               ; preds = %69
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %81, label %77

77:                                               ; preds = %74
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = and i32 %78, 1280
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %77, %74
  store i32 1, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

82:                                               ; preds = %77
  store i32 99, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %83

83:                                               ; preds = %82, %81, %73, %68, %63, %58, %53, %48, %43, %38, %33, %28, %23, %18
  call void @llvm.lifetime.end.p0(i64 13, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %84 = load i32, ptr %1, align 4
  ret i32 %84
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 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 willreturn memory(read) "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 = { nounwind }
attributes #5 = { 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/C++ TBAA"}
!9 = !{!7, !7, i64 0}


; 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 [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cpuid(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress 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 range(i32 1, 100) i32 @get_vendor() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [13 x i8], 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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %5) #4
  call void @cpuid(i32 noundef 0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %6 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %6, ptr %5, align 4, !tbaa !5
  %7 = load i32, ptr %4, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %7, ptr %8, align 4, !tbaa !5
  %9 = load i32, ptr %3, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %9, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %5, i64 12
  store i8 0, ptr %11, align 4, !tbaa !9
  %12 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str) #5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %39, label %13

13:                                               ; preds = %0
  %14 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.1) #5
  %.not2 = icmp eq i32 %14, 0
  br i1 %.not2, label %39, label %15

15:                                               ; preds = %13
  %16 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.2) #5
  %.not3 = icmp eq i32 %16, 0
  br i1 %.not3, label %39, label %17

17:                                               ; preds = %15
  %18 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.3) #5
  %.not4 = icmp eq i32 %18, 0
  br i1 %.not4, label %39, label %19

19:                                               ; preds = %17
  %20 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.4) #5
  %.not5 = icmp eq i32 %20, 0
  br i1 %.not5, label %39, label %21

21:                                               ; preds = %19
  %22 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.5) #5
  %.not6 = icmp eq i32 %22, 0
  br i1 %.not6, label %39, label %23

23:                                               ; preds = %21
  %24 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.6) #5
  %.not7 = icmp eq i32 %24, 0
  br i1 %.not7, label %39, label %25

25:                                               ; preds = %23
  %26 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.7) #5
  %.not8 = icmp eq i32 %26, 0
  br i1 %.not8, label %39, label %27

27:                                               ; preds = %25
  %28 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.8) #5
  %.not9 = icmp eq i32 %28, 0
  br i1 %.not9, label %39, label %29

29:                                               ; preds = %27
  %30 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.9) #5
  %.not10 = icmp eq i32 %30, 0
  br i1 %.not10, label %39, label %31

31:                                               ; preds = %29
  %32 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.10) #5
  %.not11 = icmp eq i32 %32, 0
  br i1 %.not11, label %39, label %33

33:                                               ; preds = %31
  %34 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.11) #5
  %.not12 = icmp eq i32 %34, 0
  br i1 %.not12, label %39, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 0
  %38 = and i32 %36, 1280
  %.not13 = icmp eq i32 %38, 0
  %or.cond = and i1 %37, %.not13
  %spec.select = select i1 %or.cond, i32 99, i32 1
  br label %39

39:                                               ; preds = %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %0
  %.0 = phi i32 [ 1, %0 ], [ 2, %13 ], [ 3, %15 ], [ 4, %17 ], [ 5, %19 ], [ 6, %21 ], [ 12, %23 ], [ 7, %25 ], [ 8, %27 ], [ 9, %29 ], [ 10, %31 ], [ 11, %33 ], [ %spec.select, %35 ]
  call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 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 nofree nounwind willreturn memory(argmem: read) "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 = { nounwind }
attributes #5 = { 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/C++ TBAA"}
!9 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass