; LLVM IR from jingweizhanghuai/Morn :: test (test_dictionary)

; 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.49 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [5 x i8], align 1
@__const.test4.b = external hidden unnamed_addr constant [4 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

declare ptr @m_DictionaryWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

declare ptr @m_DictionaryRead(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare i32 @printf(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: 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: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @test4() #4 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca [4 x i8], align 1
  %4 = alloca i32, align 4
  %5 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  store ptr @.str.53, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !9
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = call i64 @strlen(ptr noundef %7) #6
  %9 = trunc i64 %8 to i32
  %10 = call ptr @m_DictionaryWrite(ptr noundef %6, i32 noundef %9, ptr noundef %2, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %3, ptr align 1 @__const.test4.b, i64 4, i1 false)
  store i32 2, ptr %2, align 4, !tbaa !9
  %11 = getelementptr inbounds [4 x i8], ptr %3, i64 0, i64 0
  %12 = call ptr @m_DictionaryWrite(ptr noundef %11, i32 noundef 4, ptr noundef %2, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1684234849, ptr %4, align 4, !tbaa !9
  store i32 3, ptr %2, align 4, !tbaa !9
  %13 = call ptr @m_DictionaryWrite(ptr noundef %4, i32 noundef 4, ptr noundef %2, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store float 0x448C6C4C20000000, ptr %5, align 4, !tbaa !11
  store i32 4, ptr %2, align 4, !tbaa !9
  %14 = call ptr @m_DictionaryWrite(ptr noundef %5, i32 noundef 4, ptr noundef %2, i32 noundef 4)
  %15 = load ptr, ptr %1, align 8, !tbaa !5
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = call i64 @strlen(ptr noundef %16) #6
  %18 = trunc i64 %17 to i32
  %19 = call ptr @m_DictionaryRead(ptr noundef %15, i32 noundef %18, ptr noundef null, ptr noundef null)
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.52, i32 noundef %20)
  %22 = getelementptr inbounds [4 x i8], ptr %3, i64 0, i64 0
  %23 = call ptr @m_DictionaryRead(ptr noundef %22, i32 noundef 4, ptr noundef null, ptr noundef null)
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.51, i32 noundef %24)
  %26 = call ptr @m_DictionaryRead(ptr noundef %4, i32 noundef 4, ptr noundef null, ptr noundef null)
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.50, i32 noundef %27)
  %29 = call ptr @m_DictionaryRead(ptr noundef %5, i32 noundef 4, ptr noundef null, ptr noundef null)
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.49, i32 noundef %30)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !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.49 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [5 x i8], align 1
@__const.test4.b = external hidden unnamed_addr constant [4 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

declare ptr @m_DictionaryWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @m_DictionaryRead(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #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) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @test4() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca [4 x i8], align 4
  %3 = alloca i32, align 4
  %4 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  %5 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.53) #6
  %6 = trunc i64 %5 to i32
  %7 = call ptr @m_DictionaryWrite(ptr noundef nonnull @.str.53, i32 noundef %6, ptr noundef nonnull %1, i32 noundef 4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %8 = load i32, ptr @__const.test4.b, align 1
  store i32 %8, ptr %2, align 4
  store i32 2, ptr %1, align 4, !tbaa !5
  %9 = call ptr @m_DictionaryWrite(ptr noundef nonnull %2, i32 noundef 4, ptr noundef nonnull %1, i32 noundef 4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 1684234849, ptr %3, align 4, !tbaa !5
  store i32 3, ptr %1, align 4, !tbaa !5
  %10 = call ptr @m_DictionaryWrite(ptr noundef nonnull %3, i32 noundef 4, ptr noundef nonnull %1, i32 noundef 4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store float 0x448C6C4C20000000, ptr %4, align 4, !tbaa !9
  store i32 4, ptr %1, align 4, !tbaa !5
  %11 = call ptr @m_DictionaryWrite(ptr noundef nonnull %4, i32 noundef 4, ptr noundef nonnull %1, i32 noundef 4) #5
  %12 = call ptr @m_DictionaryRead(ptr noundef nonnull @.str.53, i32 noundef %6, ptr noundef null, ptr noundef null) #5
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.52, i32 noundef %13)
  %15 = call ptr @m_DictionaryRead(ptr noundef nonnull %2, i32 noundef 4, ptr noundef null, ptr noundef null) #5
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.51, i32 noundef %16)
  %18 = call ptr @m_DictionaryRead(ptr noundef nonnull %3, i32 noundef 4, ptr noundef null, ptr noundef null) #5
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50, i32 noundef %19)
  %21 = call ptr @m_DictionaryRead(ptr noundef nonnull %4, i32 noundef 4, ptr noundef null, ptr noundef null) #5
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.49, i32 noundef %22)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = { 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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}


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