; LLVM IR from intel/intel-ipsec-mb :: test/common (utils)

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

@stderr = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 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 i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

12:                                               ; preds = %3
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %18, label %15

15:                                               ; preds = %12
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %21

18:                                               ; preds = %15, %12, %3
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.6) #4
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %90

21:                                               ; preds = %15
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call i32 @strcmp(ptr noundef %22, ptr noundef @.str.7) #5
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %21
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 3
  store i8 0, ptr %27, align 1, !tbaa !11
  br label %28

28:                                               ; preds = %25, %21
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call i32 @strcmp(ptr noundef %29, ptr noundef @.str.8) #5
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %35

32:                                               ; preds = %28
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 4
  store i8 0, ptr %34, align 1, !tbaa !11
  br label %88

35:                                               ; preds = %28
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call i32 @strcmp(ptr noundef %36, ptr noundef @.str.9) #5
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %35
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 2
  store i8 0, ptr %41, align 1, !tbaa !11
  br label %87

42:                                               ; preds = %35
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call i32 @strcmp(ptr noundef %43, ptr noundef @.str.10) #5
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %49

46:                                               ; preds = %42
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 1
  store i8 0, ptr %48, align 1, !tbaa !11
  br label %86

49:                                               ; preds = %42
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = call i32 @strcmp(ptr noundef %50, ptr noundef @.str.11) #5
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %57

53:                                               ; preds = %49
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = load i64, ptr %54, align 8, !tbaa !12
  %56 = and i64 %55, -2
  store i64 %56, ptr %54, align 8, !tbaa !12
  br label %85

57:                                               ; preds = %49
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call i32 @strcmp(ptr noundef %58, ptr noundef @.str.12) #5
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %57
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load i64, ptr %62, align 8, !tbaa !12
  %64 = or i64 %63, 1
  store i64 %64, ptr %62, align 8, !tbaa !12
  br label %84

65:                                               ; preds = %57
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = call i32 @strcmp(ptr noundef %66, ptr noundef @.str.13) #5
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %73

69:                                               ; preds = %65
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load i64, ptr %70, align 8, !tbaa !12
  %72 = and i64 %71, -3
  store i64 %72, ptr %70, align 8, !tbaa !12
  br label %83

73:                                               ; preds = %65
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = call i32 @strcmp(ptr noundef %74, ptr noundef @.str.14) #5
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %81

77:                                               ; preds = %73
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = load i64, ptr %78, align 8, !tbaa !12
  %80 = or i64 %79, 2
  store i64 %80, ptr %78, align 8, !tbaa !12
  br label %82

81:                                               ; preds = %73
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %81, %77
  br label %83

83:                                               ; preds = %82, %69
  br label %84

84:                                               ; preds = %83, %61
  br label %85

85:                                               ; preds = %84, %53
  br label %86

86:                                               ; preds = %85, %46
  br label %87

87:                                               ; preds = %86, %39
  br label %88

88:                                               ; preds = %87, %32
  %89 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %89, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %90

90:                                               ; preds = %88, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %91 = load i32, ptr %4, align 4
  ret i32 %91
}

; 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 = { 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 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 = !{!"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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 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 range(i32 -1, 2) i32 @update_flags_and_archs(ptr noundef readonly %0, ptr noundef writeonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = icmp eq ptr %1, null
  %5 = icmp eq ptr %2, null
  %or.cond = or i1 %4, %5
  %6 = icmp eq ptr %0, null
  %or.cond3 = or i1 %6, %or.cond
  br i1 %or.cond3, label %7, label %10

7:                                                ; preds = %3
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.6) #3
  br label %54

10:                                               ; preds = %3
  %11 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.7) #4
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %15

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %1, i64 3
  store i8 0, ptr %14, align 1, !tbaa !9
  br label %15

15:                                               ; preds = %13, %10
  %16 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.8) #4
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %20

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %1, i64 4
  store i8 0, ptr %19, align 1, !tbaa !9
  br label %54

20:                                               ; preds = %15
  %21 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.9) #4
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %1, i64 2
  store i8 0, ptr %24, align 1, !tbaa !9
  br label %54

25:                                               ; preds = %20
  %26 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.10) #4
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %30

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %1, i64 1
  store i8 0, ptr %29, align 1, !tbaa !9
  br label %54

30:                                               ; preds = %25
  %31 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.11) #4
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %30
  %34 = load i64, ptr %2, align 8, !tbaa !10
  %35 = and i64 %34, -2
  store i64 %35, ptr %2, align 8, !tbaa !10
  br label %54

36:                                               ; preds = %30
  %37 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.12) #4
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = load i64, ptr %2, align 8, !tbaa !10
  %41 = or i64 %40, 1
  store i64 %41, ptr %2, align 8, !tbaa !10
  br label %54

42:                                               ; preds = %36
  %43 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.13) #4
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %48

45:                                               ; preds = %42
  %46 = load i64, ptr %2, align 8, !tbaa !10
  %47 = and i64 %46, -3
  store i64 %47, ptr %2, align 8, !tbaa !10
  br label %54

48:                                               ; preds = %42
  %49 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.14) #4
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  %52 = load i64, ptr %2, align 8, !tbaa !10
  %53 = or i64 %52, 2
  store i64 %53, ptr %2, align 8, !tbaa !10
  br label %54

54:                                               ; preds = %18, %28, %39, %51, %45, %33, %23, %48, %7
  %.023 = phi i32 [ -1, %7 ], [ 1, %18 ], [ 1, %23 ], [ 1, %28 ], [ 1, %33 ], [ 1, %39 ], [ 1, %45 ], [ 1, %51 ], [ 0, %48 ]
  ret i32 %.023
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

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 = { 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 #3 = { cold nounwind }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass