; LLVM IR from boschglobal/dse.network :: dse/network/examples/stub (stub)

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

%struct.stub_float_types_t = type { double, float }

; 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: inlinehint nounwind uwtable
declare hidden i32 @unpack_left_shift_u32(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @unpack_right_shift_u32(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @unpack_left_shift_u64(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @unpack_right_shift_u64(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #1

; 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 uwtable
define dso_local i32 @stub_float_types_unpack(ptr noundef %0, ptr noundef %1, i64 noundef %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %11 = load i64, ptr %7, align 8, !tbaa !9
  %12 = icmp ult i64 %11, 16
  br i1 %12, label %13, label %14

13:                                               ; preds = %3
  store i32 -22, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %87

14:                                               ; preds = %3
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 0
  %17 = load i8, ptr %16, align 1, !tbaa !11
  %18 = call i64 @unpack_right_shift_u64(i8 noundef zeroext %17, i8 noundef zeroext 0, i8 noundef zeroext -1)
  store i64 %18, ptr %9, align 8, !tbaa !9
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 1
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = call i64 @unpack_left_shift_u64(i8 noundef zeroext %21, i8 noundef zeroext 8, i8 noundef zeroext -1)
  %23 = load i64, ptr %9, align 8, !tbaa !9
  %24 = or i64 %23, %22
  store i64 %24, ptr %9, align 8, !tbaa !9
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 2
  %27 = load i8, ptr %26, align 1, !tbaa !11
  %28 = call i64 @unpack_left_shift_u64(i8 noundef zeroext %27, i8 noundef zeroext 16, i8 noundef zeroext -1)
  %29 = load i64, ptr %9, align 8, !tbaa !9
  %30 = or i64 %29, %28
  store i64 %30, ptr %9, align 8, !tbaa !9
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 3
  %33 = load i8, ptr %32, align 1, !tbaa !11
  %34 = call i64 @unpack_left_shift_u64(i8 noundef zeroext %33, i8 noundef zeroext 24, i8 noundef zeroext -1)
  %35 = load i64, ptr %9, align 8, !tbaa !9
  %36 = or i64 %35, %34
  store i64 %36, ptr %9, align 8, !tbaa !9
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = call i64 @unpack_left_shift_u64(i8 noundef zeroext %39, i8 noundef zeroext 32, i8 noundef zeroext -1)
  %41 = load i64, ptr %9, align 8, !tbaa !9
  %42 = or i64 %41, %40
  store i64 %42, ptr %9, align 8, !tbaa !9
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 5
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = call i64 @unpack_left_shift_u64(i8 noundef zeroext %45, i8 noundef zeroext 40, i8 noundef zeroext -1)
  %47 = load i64, ptr %9, align 8, !tbaa !9
  %48 = or i64 %47, %46
  store i64 %48, ptr %9, align 8, !tbaa !9
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 6
  %51 = load i8, ptr %50, align 1, !tbaa !11
  %52 = call i64 @unpack_left_shift_u64(i8 noundef zeroext %51, i8 noundef zeroext 48, i8 noundef zeroext -1)
  %53 = load i64, ptr %9, align 8, !tbaa !9
  %54 = or i64 %53, %52
  store i64 %54, ptr %9, align 8, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 7
  %57 = load i8, ptr %56, align 1, !tbaa !11
  %58 = call i64 @unpack_left_shift_u64(i8 noundef zeroext %57, i8 noundef zeroext 56, i8 noundef zeroext -1)
  %59 = load i64, ptr %9, align 8, !tbaa !9
  %60 = or i64 %59, %58
  store i64 %60, ptr %9, align 8, !tbaa !9
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.stub_float_types_t, ptr %61, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %62, ptr align 8 %9, i64 8, i1 false)
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load i8, ptr %64, align 1, !tbaa !11
  %66 = call i32 @unpack_right_shift_u32(i8 noundef zeroext %65, i8 noundef zeroext 0, i8 noundef zeroext -1)
  store i32 %66, ptr %8, align 4, !tbaa !12
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 9
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = call i32 @unpack_left_shift_u32(i8 noundef zeroext %69, i8 noundef zeroext 8, i8 noundef zeroext -1)
  %71 = load i32, ptr %8, align 4, !tbaa !12
  %72 = or i32 %71, %70
  store i32 %72, ptr %8, align 4, !tbaa !12
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 10
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = call i32 @unpack_left_shift_u32(i8 noundef zeroext %75, i8 noundef zeroext 16, i8 noundef zeroext -1)
  %77 = load i32, ptr %8, align 4, !tbaa !12
  %78 = or i32 %77, %76
  store i32 %78, ptr %8, align 4, !tbaa !12
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 11
  %81 = load i8, ptr %80, align 1, !tbaa !11
  %82 = call i32 @unpack_left_shift_u32(i8 noundef zeroext %81, i8 noundef zeroext 24, i8 noundef zeroext -1)
  %83 = load i32, ptr %8, align 4, !tbaa !12
  %84 = or i32 %83, %82
  store i32 %84, ptr %8, align 4, !tbaa !12
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.stub_float_types_t, ptr %85, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %86, ptr align 4 %8, i64 4, i1 false)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %87

87:                                               ; preds = %14, %13
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %88 = load i32, ptr %4, align 4
  ret i32 %88
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !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"

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @unpack_left_shift_u32(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @unpack_right_shift_u32(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @unpack_left_shift_u64(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @unpack_right_shift_u64(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 -22, 1) i32 @stub_float_types_unpack(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = icmp ult i64 %2, 16
  br i1 %4, label %52, label %5

5:                                                ; preds = %3
  %6 = load i8, ptr %1, align 1, !tbaa !5
  %7 = tail call i64 @unpack_right_shift_u64(i8 noundef zeroext %6, i8 noundef zeroext 0, i8 noundef zeroext -1)
  %8 = getelementptr inbounds i8, ptr %1, i64 1
  %9 = load i8, ptr %8, align 1, !tbaa !5
  %10 = tail call i64 @unpack_left_shift_u64(i8 noundef zeroext %9, i8 noundef zeroext 8, i8 noundef zeroext -1)
  %11 = or i64 %10, %7
  %12 = getelementptr inbounds i8, ptr %1, i64 2
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %14 = tail call i64 @unpack_left_shift_u64(i8 noundef zeroext %13, i8 noundef zeroext 16, i8 noundef zeroext -1)
  %15 = or i64 %11, %14
  %16 = getelementptr inbounds i8, ptr %1, i64 3
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = tail call i64 @unpack_left_shift_u64(i8 noundef zeroext %17, i8 noundef zeroext 24, i8 noundef zeroext -1)
  %19 = or i64 %15, %18
  %20 = getelementptr inbounds i8, ptr %1, i64 4
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = tail call i64 @unpack_left_shift_u64(i8 noundef zeroext %21, i8 noundef zeroext 32, i8 noundef zeroext -1)
  %23 = or i64 %19, %22
  %24 = getelementptr inbounds i8, ptr %1, i64 5
  %25 = load i8, ptr %24, align 1, !tbaa !5
  %26 = tail call i64 @unpack_left_shift_u64(i8 noundef zeroext %25, i8 noundef zeroext 40, i8 noundef zeroext -1)
  %27 = or i64 %23, %26
  %28 = getelementptr inbounds i8, ptr %1, i64 6
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = tail call i64 @unpack_left_shift_u64(i8 noundef zeroext %29, i8 noundef zeroext 48, i8 noundef zeroext -1)
  %31 = or i64 %27, %30
  %32 = getelementptr inbounds i8, ptr %1, i64 7
  %33 = load i8, ptr %32, align 1, !tbaa !5
  %34 = tail call i64 @unpack_left_shift_u64(i8 noundef zeroext %33, i8 noundef zeroext 56, i8 noundef zeroext -1)
  %35 = or i64 %31, %34
  store i64 %35, ptr %0, align 8
  %36 = getelementptr inbounds i8, ptr %1, i64 8
  %37 = load i8, ptr %36, align 1, !tbaa !5
  %38 = tail call i32 @unpack_right_shift_u32(i8 noundef zeroext %37, i8 noundef zeroext 0, i8 noundef zeroext -1)
  %39 = getelementptr inbounds i8, ptr %1, i64 9
  %40 = load i8, ptr %39, align 1, !tbaa !5
  %41 = tail call i32 @unpack_left_shift_u32(i8 noundef zeroext %40, i8 noundef zeroext 8, i8 noundef zeroext -1)
  %42 = or i32 %41, %38
  %43 = getelementptr inbounds i8, ptr %1, i64 10
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = tail call i32 @unpack_left_shift_u32(i8 noundef zeroext %44, i8 noundef zeroext 16, i8 noundef zeroext -1)
  %46 = or i32 %42, %45
  %47 = getelementptr inbounds i8, ptr %1, i64 11
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %49 = tail call i32 @unpack_left_shift_u32(i8 noundef zeroext %48, i8 noundef zeroext 24, i8 noundef zeroext -1)
  %50 = or i32 %46, %49
  %51 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %50, ptr %51, align 8
  br label %52

52:                                               ; preds = %3, %5
  %.0 = phi i32 [ 0, %5 ], [ -22, %3 ]
  ret i32 %.0
}

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


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