; LLVM IR from Aeternum-Veritas/Merry :: tests (hashtest)

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

@__const.main.strings = external hidden unnamed_addr constant [23 x [50 x i8]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @hash(ptr noundef, i64 noundef) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [23 x [50 x i8]], align 16
  %3 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1150, ptr %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.main.strings, i64 1150, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  br label %4

4:                                                ; preds = %21, %0
  %5 = load i64, ptr %3, align 8, !tbaa !5
  %6 = icmp ult i64 %5, 20
  br i1 %6, label %8, label %7

7:                                                ; preds = %4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %24

8:                                                ; preds = %4
  %9 = load i64, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds [23 x [50 x i8]], ptr %2, i64 0, i64 %9
  %11 = getelementptr inbounds [50 x i8], ptr %10, i64 0, i64 0
  %12 = load i64, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds [23 x [50 x i8]], ptr %2, i64 0, i64 %12
  %14 = getelementptr inbounds [50 x i8], ptr %13, i64 0, i64 0
  %15 = load i64, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds [23 x [50 x i8]], ptr %2, i64 0, i64 %15
  %17 = getelementptr inbounds [50 x i8], ptr %16, i64 0, i64 0
  %18 = call i64 @strlen(ptr noundef %17) #6
  %19 = call i64 @hash(ptr noundef %14, i64 noundef %18)
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %11, i64 noundef %19)
  br label %21

21:                                               ; preds = %8
  %22 = load i64, ptr %3, align 8, !tbaa !5
  %23 = add i64 %22, 1
  store i64 %23, ptr %3, align 8, !tbaa !5
  br label %4, !llvm.loop !9

24:                                               ; preds = %7
  call void @llvm.lifetime.end.p0(i64 1150, ptr %2) #5
  %25 = load i32, ptr %1, align 4
  ret i32 %25
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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

@__const.main.strings = external hidden unnamed_addr constant [23 x [50 x i8]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @hash(ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [23 x [50 x i8]], align 16
  call void @llvm.lifetime.start.p0(i64 1150, ptr nonnull %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1150) %1, ptr noundef nonnull align 16 dereferenceable(1150) @__const.main.strings, i64 1150, i1 false)
  %2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #6
  %3 = call i64 @hash(ptr noundef nonnull %1, i64 noundef %2)
  %4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %1, i64 noundef %3)
  %5 = getelementptr inbounds i8, ptr %1, i64 50
  %6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %5) #6
  %7 = call i64 @hash(ptr noundef nonnull %5, i64 noundef %6)
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %5, i64 noundef %7)
  %9 = getelementptr inbounds i8, ptr %1, i64 100
  %10 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %9) #6
  %11 = call i64 @hash(ptr noundef nonnull %9, i64 noundef %10)
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %9, i64 noundef %11)
  %13 = getelementptr inbounds i8, ptr %1, i64 150
  %14 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %13) #6
  %15 = call i64 @hash(ptr noundef nonnull %13, i64 noundef %14)
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %13, i64 noundef %15)
  %17 = getelementptr inbounds i8, ptr %1, i64 200
  %18 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %17) #6
  %19 = call i64 @hash(ptr noundef nonnull %17, i64 noundef %18)
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %17, i64 noundef %19)
  %21 = getelementptr inbounds i8, ptr %1, i64 250
  %22 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %21) #6
  %23 = call i64 @hash(ptr noundef nonnull %21, i64 noundef %22)
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %21, i64 noundef %23)
  %25 = getelementptr inbounds i8, ptr %1, i64 300
  %26 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %25) #6
  %27 = call i64 @hash(ptr noundef nonnull %25, i64 noundef %26)
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %25, i64 noundef %27)
  %29 = getelementptr inbounds i8, ptr %1, i64 350
  %30 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %29) #6
  %31 = call i64 @hash(ptr noundef nonnull %29, i64 noundef %30)
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %29, i64 noundef %31)
  %33 = getelementptr inbounds i8, ptr %1, i64 400
  %34 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %33) #6
  %35 = call i64 @hash(ptr noundef nonnull %33, i64 noundef %34)
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %33, i64 noundef %35)
  %37 = getelementptr inbounds i8, ptr %1, i64 450
  %38 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %37) #6
  %39 = call i64 @hash(ptr noundef nonnull %37, i64 noundef %38)
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %37, i64 noundef %39)
  %41 = getelementptr inbounds i8, ptr %1, i64 500
  %42 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %41) #6
  %43 = call i64 @hash(ptr noundef nonnull %41, i64 noundef %42)
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %41, i64 noundef %43)
  %45 = getelementptr inbounds i8, ptr %1, i64 550
  %46 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %45) #6
  %47 = call i64 @hash(ptr noundef nonnull %45, i64 noundef %46)
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %45, i64 noundef %47)
  %49 = getelementptr inbounds i8, ptr %1, i64 600
  %50 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %49) #6
  %51 = call i64 @hash(ptr noundef nonnull %49, i64 noundef %50)
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %49, i64 noundef %51)
  %53 = getelementptr inbounds i8, ptr %1, i64 650
  %54 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %53) #6
  %55 = call i64 @hash(ptr noundef nonnull %53, i64 noundef %54)
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %53, i64 noundef %55)
  %57 = getelementptr inbounds i8, ptr %1, i64 700
  %58 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %57) #6
  %59 = call i64 @hash(ptr noundef nonnull %57, i64 noundef %58)
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %57, i64 noundef %59)
  %61 = getelementptr inbounds i8, ptr %1, i64 750
  %62 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %61) #6
  %63 = call i64 @hash(ptr noundef nonnull %61, i64 noundef %62)
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %61, i64 noundef %63)
  %65 = getelementptr inbounds i8, ptr %1, i64 800
  %66 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %65) #6
  %67 = call i64 @hash(ptr noundef nonnull %65, i64 noundef %66)
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %65, i64 noundef %67)
  %69 = getelementptr inbounds i8, ptr %1, i64 850
  %70 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %69) #6
  %71 = call i64 @hash(ptr noundef nonnull %69, i64 noundef %70)
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %69, i64 noundef %71)
  %73 = getelementptr inbounds i8, ptr %1, i64 900
  %74 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %73) #6
  %75 = call i64 @hash(ptr noundef nonnull %73, i64 noundef %74)
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %73, i64 noundef %75)
  %77 = getelementptr inbounds i8, ptr %1, i64 950
  %78 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %77) #6
  %79 = call i64 @hash(ptr noundef nonnull %77, i64 noundef %78)
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %77, i64 noundef %79)
  call void @llvm.lifetime.end.p0(i64 1150, ptr nonnull %1) #5
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #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)"}


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