; LLVM IR from AF-GRILL/DISPluginForUnreal :: Source/ThirdParty/include/dis6 (AggregateMarking)

; 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.DIS::AggregateMarking" = type { ptr, i8, [31 x i8] }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3DIS16AggregateMarking13setCharactersEPKc(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %7

7:                                                ; preds = %21, %2
  %8 = load i32, ptr %5, align 4, !tbaa !9
  %9 = icmp slt i32 %8, 31
  br i1 %9, label %11, label %10

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

11:                                               ; preds = %7
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load i32, ptr %5, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds i8, ptr %12, i64 %14
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = getelementptr inbounds %"class.DIS::AggregateMarking", ptr %6, i32 0, i32 2
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [31 x i8], ptr %17, i64 0, i64 %19
  store i8 %16, ptr %20, align 1, !tbaa !11
  br label %21

21:                                               ; preds = %11
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %5, align 4, !tbaa !9
  br label %7, !llvm.loop !12

24:                                               ; preds = %10
  ret void
}

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

!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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"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"

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN3DIS16AggregateMarking13setCharactersEPKc(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(40) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 9
  %4 = load i8, ptr %1, align 1, !tbaa !5
  store i8 %4, ptr %3, align 1, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 1
  %6 = load i8, ptr %5, align 1, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 10
  store i8 %6, ptr %7, align 2, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 2
  %9 = load i8, ptr %8, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 11
  store i8 %9, ptr %10, align 1, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 3
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  store i8 %12, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %1, i64 4
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 13
  store i8 %15, ptr %16, align 1, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %1, i64 5
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 14
  store i8 %18, ptr %19, align 2, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %1, i64 6
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 15
  store i8 %21, ptr %22, align 1, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %1, i64 7
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  store i8 %24, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %1, i64 8
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %0, i64 17
  store i8 %27, ptr %28, align 1, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %1, i64 9
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 18
  store i8 %30, ptr %31, align 2, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %1, i64 10
  %33 = load i8, ptr %32, align 1, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %0, i64 19
  store i8 %33, ptr %34, align 1, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %1, i64 11
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 20
  store i8 %36, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %1, i64 12
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %0, i64 21
  store i8 %39, ptr %40, align 1, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %1, i64 13
  %42 = load i8, ptr %41, align 1, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %0, i64 22
  store i8 %42, ptr %43, align 2, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %1, i64 14
  %45 = load i8, ptr %44, align 1, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %0, i64 23
  store i8 %45, ptr %46, align 1, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %1, i64 15
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %0, i64 24
  store i8 %48, ptr %49, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %1, i64 16
  %51 = load i8, ptr %50, align 1, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %0, i64 25
  store i8 %51, ptr %52, align 1, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %1, i64 17
  %54 = load i8, ptr %53, align 1, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %0, i64 26
  store i8 %54, ptr %55, align 2, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %1, i64 18
  %57 = load i8, ptr %56, align 1, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %0, i64 27
  store i8 %57, ptr %58, align 1, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %1, i64 19
  %60 = load i8, ptr %59, align 1, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %0, i64 28
  store i8 %60, ptr %61, align 4, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %1, i64 20
  %63 = load i8, ptr %62, align 1, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %0, i64 29
  store i8 %63, ptr %64, align 1, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %1, i64 21
  %66 = load i8, ptr %65, align 1, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %0, i64 30
  store i8 %66, ptr %67, align 2, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %1, i64 22
  %69 = load i8, ptr %68, align 1, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %0, i64 31
  store i8 %69, ptr %70, align 1, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %1, i64 23
  %72 = load i8, ptr %71, align 1, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 %72, ptr %73, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %1, i64 24
  %75 = load i8, ptr %74, align 1, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %0, i64 33
  store i8 %75, ptr %76, align 1, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %1, i64 25
  %78 = load i8, ptr %77, align 1, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %0, i64 34
  store i8 %78, ptr %79, align 2, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %1, i64 26
  %81 = load i8, ptr %80, align 1, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %0, i64 35
  store i8 %81, ptr %82, align 1, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %1, i64 27
  %84 = load i8, ptr %83, align 1, !tbaa !5
  %85 = getelementptr inbounds i8, ptr %0, i64 36
  store i8 %84, ptr %85, align 4, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %1, i64 28
  %87 = load i8, ptr %86, align 1, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %0, i64 37
  store i8 %87, ptr %88, align 1, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %1, i64 29
  %90 = load i8, ptr %89, align 1, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %0, i64 38
  store i8 %90, ptr %91, align 2, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %1, i64 30
  %93 = load i8, ptr %92, align 1, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %0, i64 39
  store i8 %93, ptr %94, align 1, !tbaa !5
  ret void
}

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

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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