; LLVM IR from DanEngelbrecht/longtail :: test/test.ll/ZN34Longtail_Longtail_Blake2 (TestCase8TestBodyEv)

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

%struct.jc_test_fixture = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.jc_test_stats, i32, i32, i32, i32 }
%struct.jc_test_stats = type { i32, i32, i32, i32, i64 }
%struct.Longtail_HashAPI = type { %struct.Longtail_API, ptr, ptr, ptr, ptr, ptr }
%struct.Longtail_API = type { ptr }

@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [5 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 mustprogress uwtable
declare hidden noundef ptr @_ZL19jc_test_get_fixturev() #1

declare void @_Z28jc_test_increment_assertionsv() #2

declare void @_Z21jc_test_set_test_faili(i32 noundef) #2

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN21jc_test_cmp_eq_helperILb1EE7compareIiiEEiRKT_RKT0_PKcS9_PN23jc_test_enable_argumentIXntsr18jc_test_is_pointerIS5_EE5valueEE4typeE(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef, ptr noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN21jc_test_cmp_eq_helperILb0EE7compareImmEEiRKT_RKT0_PKcS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) #4 align 2

declare void @Longtail_DisposeAPI(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN34Longtail_Longtail_Blake2__TestCase8TestBodyEv(ptr noundef nonnull align 8 dereferenceable(8) %0) unnamed_addr #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store ptr @.str.59, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %11 = call ptr @Longtail_CreateBlake2HashAPI()
  store ptr %11, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %58

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  br label %15

15:                                               ; preds = %14
  %16 = call noundef ptr @_ZL19jc_test_get_fixturev()
  %17 = getelementptr inbounds %struct.jc_test_fixture, ptr %16, i32 0, i32 11
  %18 = load i32, ptr %17, align 8
  %19 = and i32 %18, -16776961
  %20 = or i32 %19, 115968
  store i32 %20, ptr %17, align 8
  %21 = call noundef ptr @_ZL19jc_test_get_fixturev()
  %22 = getelementptr inbounds %struct.jc_test_fixture, ptr %21, i32 0, i32 4
  store ptr @.str.3, ptr %22, align 8, !tbaa !9
  call void @_Z28jc_test_increment_assertionsv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Longtail_HashAPI, ptr %23, i32 0, i32 5
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = call i64 @strlen(ptr noundef %27) #6
  %29 = add i64 %28, 1
  %30 = trunc i64 %29 to i32
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = call noundef i32 %25(ptr noundef %26, i32 noundef %30, ptr noundef %31, ptr noundef %5)
  store i32 %32, ptr %7, align 4, !tbaa !14
  %33 = call noundef i32 @_ZN21jc_test_cmp_eq_helperILb1EE7compareIiiEEiRKT_RKT0_PKcS9_PN23jc_test_enable_argumentIXntsr18jc_test_is_pointerIS5_EE5valueEE4typeE(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef @.str.46, ptr noundef @.str.60, ptr noundef null)
  %34 = icmp eq i32 %33, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br i1 %34, label %35, label %36

35:                                               ; preds = %15
  call void @_Z21jc_test_set_test_faili(i32 noundef 1)
  store i32 1, ptr %8, align 4
  br label %55

36:                                               ; preds = %15
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = call noundef ptr @_ZL19jc_test_get_fixturev()
  %41 = getelementptr inbounds %struct.jc_test_fixture, ptr %40, i32 0, i32 11
  %42 = load i32, ptr %41, align 8
  %43 = and i32 %42, -16776961
  %44 = or i32 %43, 116224
  store i32 %44, ptr %41, align 8
  %45 = call noundef ptr @_ZL19jc_test_get_fixturev()
  %46 = getelementptr inbounds %struct.jc_test_fixture, ptr %45, i32 0, i32 4
  store ptr @.str.3, ptr %46, align 8, !tbaa !9
  call void @_Z28jc_test_increment_assertionsv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 -3227139540414488755, ptr %9, align 8, !tbaa !18
  %47 = call noundef i32 @_ZN21jc_test_cmp_eq_helperILb0EE7compareImmEEiRKT_RKT0_PKcS9_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.61, ptr noundef @.str.62)
  %48 = icmp eq i32 %47, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br i1 %48, label %49, label %50

49:                                               ; preds = %39
  call void @_Z21jc_test_set_test_faili(i32 noundef 1)
  store i32 1, ptr %8, align 4
  br label %55

50:                                               ; preds = %39
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Longtail_HashAPI, ptr %53, i32 0, i32 0
  call void @Longtail_DisposeAPI(ptr noundef %54)
  store i32 0, ptr %8, align 4
  br label %55

55:                                               ; preds = %52, %49, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %56 = load i32, ptr %8, align 4
  switch i32 %56, label %59 [
    i32 0, label %57
  ]

57:                                               ; preds = %55
  br label %58

58:                                               ; preds = %57, %1
  store i32 0, ptr %8, align 4
  br label %59

59:                                               ; preds = %58, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  %60 = load i32, ptr %8, align 4
  switch i32 %60, label %62 [
    i32 0, label %61
    i32 1, label %61
  ]

61:                                               ; preds = %59, %59
  ret void

62:                                               ; preds = %59
  unreachable
}

declare ptr @Longtail_CreateBlake2HashAPI() #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress 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 = { "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 = { mustprogress 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 #5 = { nounwind }
attributes #6 = { 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++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"_ZTS15jc_test_fixture", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !12, i64 88, !12, i64 91, !12, i64 91, !12, i64 91, !12, i64 91, !12, i64 92, !12, i64 96, !12, i64 97, !12, i64 99, !12, i64 100}
!11 = !{!"_ZTS13jc_test_stats", !12, i64 0, !12, i64 4, !12, i64 6, !12, i64 8, !12, i64 12, !13, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!16, !6, i64 40}
!16 = !{!"_ZTS16Longtail_HashAPI", !17, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!17 = !{!"_ZTS12Longtail_API", !6, i64 0}
!18 = !{!13, !13, 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.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [5 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 mustprogress uwtable
declare hidden noundef ptr @_ZL19jc_test_get_fixturev() local_unnamed_addr #1

declare void @_Z28jc_test_increment_assertionsv() local_unnamed_addr #2

declare void @_Z21jc_test_set_test_faili(i32 noundef) 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) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN21jc_test_cmp_eq_helperILb1EE7compareIiiEEiRKT_RKT0_PKcS9_PN23jc_test_enable_argumentIXntsr18jc_test_is_pointerIS5_EE5valueEE4typeE(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN21jc_test_cmp_eq_helperILb0EE7compareImmEEiRKT_RKT0_PKcS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

declare void @Longtail_DisposeAPI(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN34Longtail_Longtail_Blake2__TestCase8TestBodyEv(ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %0) unnamed_addr #4 align 2 {
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = tail call ptr @Longtail_CreateBlake2HashAPI()
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %34, label %7

7:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %8 = tail call noundef ptr @_ZL19jc_test_get_fixturev()
  %9 = getelementptr inbounds i8, ptr %8, i64 96
  %10 = load i32, ptr %9, align 8
  %11 = and i32 %10, -16776961
  %12 = or disjoint i32 %11, 115968
  store i32 %12, ptr %9, align 8
  %13 = tail call noundef ptr @_ZL19jc_test_get_fixturev()
  %14 = getelementptr inbounds i8, ptr %13, i64 32
  store ptr @.str.3, ptr %14, align 8, !tbaa !5
  tail call void @_Z28jc_test_increment_assertionsv()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 0, ptr %3, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %15 = getelementptr inbounds i8, ptr %6, i64 40
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.59) #6
  %18 = trunc i64 %17 to i32
  %19 = add i32 %18, 1
  %20 = call noundef i32 %16(ptr noundef nonnull %6, i32 noundef %19, ptr noundef nonnull @.str.59, ptr noundef nonnull %2)
  store i32 %20, ptr %4, align 4, !tbaa !13
  %21 = call noundef i32 @_ZN21jc_test_cmp_eq_helperILb1EE7compareIiiEEiRKT_RKT0_PKcS9_PN23jc_test_enable_argumentIXntsr18jc_test_is_pointerIS5_EE5valueEE4typeE(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull @.str.46, ptr noundef nonnull @.str.60, ptr noundef null)
  %22 = icmp eq i32 %21, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br i1 %22, label %.critedge, label %23

23:                                               ; preds = %7
  %24 = call noundef ptr @_ZL19jc_test_get_fixturev()
  %25 = getelementptr inbounds i8, ptr %24, i64 96
  %26 = load i32, ptr %25, align 8
  %27 = and i32 %26, -16776961
  %28 = or disjoint i32 %27, 116224
  store i32 %28, ptr %25, align 8
  %29 = call noundef ptr @_ZL19jc_test_get_fixturev()
  %30 = getelementptr inbounds i8, ptr %29, i64 32
  store ptr @.str.3, ptr %30, align 8, !tbaa !5
  call void @_Z28jc_test_increment_assertionsv()
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store i64 -3227139540414488755, ptr %5, align 8, !tbaa !17
  %31 = call noundef i32 @_ZN21jc_test_cmp_eq_helperILb0EE7compareImmEEiRKT_RKT0_PKcS9_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.61, ptr noundef nonnull @.str.62)
  %32 = icmp eq i32 %31, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %32, label %.critedge, label %33

33:                                               ; preds = %23
  call void @Longtail_DisposeAPI(ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %34

.critedge:                                        ; preds = %23, %7
  call void @_Z21jc_test_set_test_faili(i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %34

34:                                               ; preds = %1, %33, %.critedge
  ret void
}

declare ptr @Longtail_CreateBlake2HashAPI() local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress 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 = { "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 = { mustprogress 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 #5 = { nounwind }
attributes #6 = { 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, !7, i64 32}
!6 = !{!"_ZTS15jc_test_fixture", !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !10, i64 64, !11, i64 88, !11, i64 91, !11, i64 91, !11, i64 91, !11, i64 91, !11, i64 92, !11, i64 96, !11, i64 97, !11, i64 99, !11, i64 100}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS13jc_test_stats", !11, i64 0, !11, i64 4, !11, i64 6, !11, i64 8, !11, i64 12, !12, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !7, i64 40}
!15 = !{!"_ZTS16Longtail_HashAPI", !16, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!16 = !{!"_ZTS12Longtail_API", !7, i64 0}
!17 = !{!12, !12, i64 0}


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