; LLVM IR from opset/openset :: lib/cjson/cjson.ll (ZN5cjsonaSEOS_)

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

%class.cjson = type <{ ptr, i64, ptr, ptr, ptr, ptr, i32, [4 x i8], ptr, ptr, ptr, ptr, i8, [7 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef nonnull align 8 dereferenceable(89) ptr @_ZN5cjsonaSEOS_(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 8 dereferenceable(89) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds %class.cjson, ptr %6, i32 0, i32 0
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 0
  store ptr %8, ptr %9, align 8, !tbaa !9
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %class.cjson, ptr %10, i32 0, i32 1
  %12 = load i64, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 1
  store i64 %12, ptr %13, align 8, !tbaa !14
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %class.cjson, ptr %14, i32 0, i32 2
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 2
  store ptr %16, ptr %17, align 8, !tbaa !15
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %class.cjson, ptr %18, i32 0, i32 3
  %20 = load ptr, ptr %19, align 8, !tbaa !16
  %21 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 3
  store ptr %20, ptr %21, align 8, !tbaa !16
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %class.cjson, ptr %22, i32 0, i32 4
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %25 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 4
  store ptr %24, ptr %25, align 8, !tbaa !17
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %class.cjson, ptr %26, i32 0, i32 5
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %29 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 5
  store ptr %28, ptr %29, align 8, !tbaa !18
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.cjson, ptr %30, i32 0, i32 6
  %32 = load i32, ptr %31, align 8, !tbaa !19
  %33 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 6
  store i32 %32, ptr %33, align 8, !tbaa !19
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %class.cjson, ptr %34, i32 0, i32 8
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %37 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 8
  store ptr %36, ptr %37, align 8, !tbaa !20
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %class.cjson, ptr %38, i32 0, i32 9
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 9
  store ptr %40, ptr %41, align 8, !tbaa !21
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %class.cjson, ptr %42, i32 0, i32 10
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 10
  store ptr %44, ptr %45, align 8, !tbaa !22
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %class.cjson, ptr %46, i32 0, i32 11
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  %49 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 11
  store ptr %48, ptr %49, align 8, !tbaa !23
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %class.cjson, ptr %50, i32 0, i32 12
  %52 = load i8, ptr %51, align 8, !tbaa !24, !range !25, !noundef !26
  %53 = trunc i8 %52 to i1
  %54 = getelementptr inbounds %class.cjson, ptr %5, i32 0, i32 12
  %55 = zext i1 %53 to i8
  store i8 %55, ptr %54, align 8, !tbaa !24
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.cjson, ptr %56, i32 0, i32 12
  store i8 0, ptr %57, align 8, !tbaa !24
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.cjson, ptr %58, i32 0, i32 0
  store ptr null, ptr %59, align 8, !tbaa !9
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %class.cjson, ptr %60, i32 0, i32 4
  store ptr null, ptr %61, align 8, !tbaa !17
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %class.cjson, ptr %62, i32 0, i32 5
  store ptr null, ptr %63, align 8, !tbaa !18
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %class.cjson, ptr %64, i32 0, i32 8
  store ptr null, ptr %65, align 8, !tbaa !20
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.cjson, ptr %66, i32 0, i32 10
  store ptr null, ptr %67, align 8, !tbaa !22
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %class.cjson, ptr %68, i32 0, i32 9
  store ptr null, ptr %69, align 8, !tbaa !21
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %class.cjson, ptr %70, i32 0, i32 11
  store ptr null, ptr %71, align 8, !tbaa !23
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %class.cjson, ptr %72, i32 0, i32 1
  store i64 0, ptr %73, align 8, !tbaa !14
  ret ptr %5
}

attributes #0 = { mustprogress 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" }

!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 0}
!10 = !{!"_ZTS5cjson", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88}
!11 = !{!"_ZTSN5cjson7Types_eE", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !6, i64 16}
!16 = !{!10, !6, i64 24}
!17 = !{!10, !6, i64 32}
!18 = !{!10, !6, i64 40}
!19 = !{!10, !12, i64 48}
!20 = !{!10, !6, i64 56}
!21 = !{!10, !6, i64 64}
!22 = !{!10, !6, i64 72}
!23 = !{!10, !6, i64 80}
!24 = !{!10, !13, i64 88}
!25 = !{i8 0, i8 2}
!26 = !{}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef nonnull align 8 dereferenceable(89) ptr @_ZN5cjsonaSEOS_(ptr noundef nonnull returned writeonly align 8 dereferenceable(89) %0, ptr nocapture noundef nonnull align 8 dereferenceable(89) %1) local_unnamed_addr #0 align 2 {
  %3 = load ptr, ptr %1, align 8, !tbaa !5
  store ptr %3, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load i64, ptr %4, align 8, !tbaa !13
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %5, ptr %6, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load <2 x ptr>, ptr %7, align 8, !tbaa !14
  store <2 x ptr> %9, ptr %8, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %1, i64 32
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load <2 x ptr>, ptr %10, align 8, !tbaa !14
  store <2 x ptr> %12, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %1, i64 48
  %14 = load i32, ptr %13, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 %14, ptr %15, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %1, i64 56
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  %18 = load <2 x ptr>, ptr %16, align 8, !tbaa !14
  store <2 x ptr> %18, ptr %17, align 8, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %1, i64 72
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  %21 = load <2 x ptr>, ptr %19, align 8, !tbaa !14
  store <2 x ptr> %21, ptr %20, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %1, i64 88
  %23 = load i8, ptr %22, align 8, !tbaa !16, !range !17, !noundef !18
  %24 = getelementptr inbounds i8, ptr %0, i64 88
  store i8 %23, ptr %24, align 8, !tbaa !16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %1, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %10, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(33) %16, i8 0, i64 33, i1 false)
  ret ptr %0
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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 nounwind willreturn memory(argmem: write) }

!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 0}
!6 = !{!"_ZTS5cjson", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !11, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !12, i64 88}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN5cjson7Types_eE", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"bool", !8, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !11, i64 48}
!16 = !{!6, !12, i64 88}
!17 = !{i8 0, i8 2}
!18 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass