; LLVM IR from turi-code/SFrame :: oss_src/image/image_type.ll (ZN8graphlab10image_typeC2EPKcmmmmii)

; 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.graphlab::image_type" = type { %"class.boost::shared_ptr", i64, i64, i64, i64, i8, i64 }
%"class.boost::shared_ptr" = type { ptr, %"class.boost::detail::shared_count" }
%"class.boost::detail::shared_count" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab10image_typeC2EPKcmmmmii(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, i32 noundef %6, i32 noundef %7) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i64 %2, ptr %11, align 8, !tbaa !9
  store i64 %3, ptr %12, align 8, !tbaa !9
  store i64 %4, ptr %13, align 8, !tbaa !9
  store i64 %5, ptr %14, align 8, !tbaa !9
  store i32 %6, ptr %15, align 4, !tbaa !11
  store i32 %7, ptr %16, align 4, !tbaa !11
  %19 = load ptr, ptr %9, align 8
  %20 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 0
  call void @_ZN5boost10shared_ptrIA_cEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  %21 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 1
  store i64 0, ptr %21, align 8, !tbaa !13
  %22 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 2
  store i64 0, ptr %22, align 8, !tbaa !18
  %23 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 3
  store i64 0, ptr %23, align 8, !tbaa !19
  %24 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 4
  store i64 0, ptr %24, align 8, !tbaa !20
  %25 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 5
  store i8 0, ptr %25, align 8, !tbaa !21
  %26 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 6
  store i64 3, ptr %26, align 8, !tbaa !22
  %27 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 0
  %28 = load i64, ptr %14, align 8, !tbaa !9
  %29 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %28) #6
          to label %30 unwind label %50

30:                                               ; preds = %8
  invoke void @_ZN5boost10shared_ptrIA_cE5resetIcEEvPT_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef %29)
          to label %31 unwind label %50

31:                                               ; preds = %30
  %32 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 0
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK5boost10shared_ptrIA_cEixEl(ptr noundef nonnull align 8 dereferenceable(16) %32, i64 noundef 0) #5
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = load i64, ptr %14, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %33, ptr align 1 %34, i64 %35, i1 false)
  %36 = load i64, ptr %11, align 8, !tbaa !9
  %37 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 1
  store i64 %36, ptr %37, align 8, !tbaa !13
  %38 = load i64, ptr %12, align 8, !tbaa !9
  %39 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 2
  store i64 %38, ptr %39, align 8, !tbaa !18
  %40 = load i64, ptr %13, align 8, !tbaa !9
  %41 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 3
  store i64 %40, ptr %41, align 8, !tbaa !19
  %42 = load i64, ptr %14, align 8, !tbaa !9
  %43 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 4
  store i64 %42, ptr %43, align 8, !tbaa !20
  %44 = load i32, ptr %15, align 4, !tbaa !11
  %45 = trunc i32 %44 to i8
  %46 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 5
  store i8 %45, ptr %46, align 8, !tbaa !21
  %47 = load i32, ptr %16, align 4, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds %"class.graphlab::image_type", ptr %19, i32 0, i32 6
  store i64 %48, ptr %49, align 8, !tbaa !22
  ret void

50:                                               ; preds = %30, %8
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %17, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %18, align 4
  call void @_ZN5boost10shared_ptrIA_cED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  br label %54

54:                                               ; preds = %50
  %55 = load ptr, ptr %17, align 8
  %56 = load i32, ptr %18, align 4
  %57 = insertvalue { ptr, i32 } poison, ptr %55, 0
  %58 = insertvalue { ptr, i32 } %57, i32 %56, 1
  resume { ptr, i32 } %58
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost10shared_ptrIA_cEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost10shared_ptrIA_cE5resetIcEEvPT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #0 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK5boost10shared_ptrIA_cEixEl(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #1 align 2

; 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) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5boost10shared_ptrIA_cED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { 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" }
attributes #2 = { nobuiltin allocsize(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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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" }
attributes #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTSN8graphlab10image_typeE", !15, i64 0, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !17, i64 56}
!15 = !{!"_ZTSN5boost10shared_ptrIA_cEE", !6, i64 0, !16, i64 8}
!16 = !{!"_ZTSN5boost6detail12shared_countE", !6, i64 0}
!17 = !{!"_ZTSN8graphlab6FormatE", !7, i64 0}
!18 = !{!14, !10, i64 24}
!19 = !{!14, !10, i64 32}
!20 = !{!14, !10, i64 40}
!21 = !{!14, !7, i64 48}
!22 = !{!14, !17, i64 56}


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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab10image_typeC2EPKcmmmmii(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr nocapture noundef readonly %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, i32 noundef %6, i32 noundef %7) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN5boost10shared_ptrIA_cEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(33) %9, i8 0, i64 33, i1 false)
  store i64 3, ptr %10, align 8, !tbaa !5
  %11 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %5) #7
          to label %12 unwind label %21

12:                                               ; preds = %8
  invoke void @_ZN5boost10shared_ptrIA_cE5resetIcEEvPT_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %11)
          to label %13 unwind label %21

13:                                               ; preds = %12
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK5boost10shared_ptrIA_cEixEl(ptr noundef nonnull align 8 dereferenceable(16) %0, i64 noundef 0) #6
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %18, ptr align 1 %1, i64 %5, i1 false)
  store i64 %2, ptr %9, align 8, !tbaa !14
  store i64 %3, ptr %17, align 8, !tbaa !15
  store i64 %4, ptr %16, align 8, !tbaa !16
  store i64 %5, ptr %15, align 8, !tbaa !17
  %19 = trunc i32 %6 to i8
  store i8 %19, ptr %14, align 8, !tbaa !18
  %20 = sext i32 %7 to i64
  store i64 %20, ptr %10, align 8, !tbaa !5
  ret void

21:                                               ; preds = %12, %8
  %22 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN5boost10shared_ptrIA_cED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #6
  resume { ptr, i32 } %22
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost10shared_ptrIA_cEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost10shared_ptrIA_cE5resetIcEEvPT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK5boost10shared_ptrIA_cEixEl(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #1 align 2

; 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) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5boost10shared_ptrIA_cED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

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

attributes #0 = { 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 #1 = { 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" }
attributes #2 = { nobuiltin allocsize(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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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, !13, i64 56}
!6 = !{!"_ZTSN8graphlab10image_typeE", !7, i64 0, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !9, i64 48, !13, i64 56}
!7 = !{!"_ZTSN5boost10shared_ptrIA_cEE", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN5boost6detail12shared_countE", !8, i64 0}
!12 = !{!"long", !9, i64 0}
!13 = !{!"_ZTSN8graphlab6FormatE", !9, i64 0}
!14 = !{!6, !12, i64 16}
!15 = !{!6, !12, i64 24}
!16 = !{!6, !12, i64 32}
!17 = !{!6, !12, i64 40}
!18 = !{!6, !9, i64 48}


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