; LLVM IR from Discngine/fpocket :: src (writepocket)

; 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.s_atm = type { i32, float, float, float, float, float, float, float, [5 x i8], [7 x i8], [16 x i8], [16 x i8], [3 x i8], [8 x i8], i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float, float, i8, i8, float, float, float, float, i16, ptr, i32 }

; 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

declare void @write_pdb_atom_line(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i8 noundef signext, ptr noundef, ptr noundef, i32 noundef, i8 noundef signext, float noundef, float noundef, float noundef, float noundef, float noundef, i32 noundef, ptr noundef, i32 noundef, float noundef) #1

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

9:                                                ; preds = %70, %3
  %10 = load i32, ptr %8, align 4, !tbaa !9
  %11 = load i32, ptr %6, align 4, !tbaa !9
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %13, label %73

13:                                               ; preds = %9
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load i32, ptr %8, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds %struct.s_atm, ptr %14, i64 %16
  store ptr %17, ptr %7, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.s_atm, ptr %19, i32 0, i32 9
  %21 = getelementptr inbounds [7 x i8], ptr %20, i64 0, i64 0
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.s_atm, ptr %22, i32 0, i32 14
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.s_atm, ptr %25, i32 0, i32 8
  %27 = getelementptr inbounds [5 x i8], ptr %26, i64 0, i64 0
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.s_atm, ptr %28, i32 0, i32 29
  %30 = load i8, ptr %29, align 1, !tbaa !15
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.s_atm, ptr %31, i32 0, i32 13
  %33 = getelementptr inbounds [8 x i8], ptr %32, i64 0, i64 0
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.s_atm, ptr %34, i32 0, i32 10
  %36 = getelementptr inbounds [16 x i8], ptr %35, i64 0, i64 0
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.s_atm, ptr %37, i32 0, i32 16
  %39 = load i32, ptr %38, align 8, !tbaa !16
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.s_atm, ptr %40, i32 0, i32 28
  %42 = load i8, ptr %41, align 8, !tbaa !17
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s_atm, ptr %43, i32 0, i32 5
  %45 = load float, ptr %44, align 4, !tbaa !18
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.s_atm, ptr %46, i32 0, i32 6
  %48 = load float, ptr %47, align 8, !tbaa !19
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s_atm, ptr %49, i32 0, i32 7
  %51 = load float, ptr %50, align 4, !tbaa !20
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.s_atm, ptr %52, i32 0, i32 26
  %54 = load float, ptr %53, align 8, !tbaa !21
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.s_atm, ptr %55, i32 0, i32 25
  %57 = load float, ptr %56, align 4, !tbaa !22
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.s_atm, ptr %58, i32 0, i32 20
  %60 = load i32, ptr %59, align 8, !tbaa !23
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.s_atm, ptr %61, i32 0, i32 12
  %63 = getelementptr inbounds [3 x i8], ptr %62, i64 0, i64 0
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.s_atm, ptr %64, i32 0, i32 19
  %66 = load i32, ptr %65, align 4, !tbaa !24
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.s_atm, ptr %67, i32 0, i32 27
  %69 = load float, ptr %68, align 4, !tbaa !25
  call void @write_pdb_atom_line(ptr noundef %18, ptr noundef %21, i32 noundef %24, ptr noundef %27, i8 noundef signext %30, ptr noundef %33, ptr noundef %36, i32 noundef %39, i8 noundef signext %42, float noundef %45, float noundef %48, float noundef %51, float noundef %54, float noundef %57, i32 noundef %60, ptr noundef %63, i32 noundef %66, float noundef %69)
  br label %70

70:                                               ; preds = %13
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %8, align 4, !tbaa !9
  br label %9, !llvm.loop !26

73:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  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 = { 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 #3 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 88}
!12 = !{!"s_atm", !10, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !7, i64 32, !7, i64 37, !7, i64 44, !7, i64 60, !7, i64 76, !7, i64 79, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !7, i64 144, !7, i64 145, !13, i64 148, !13, i64 152, !13, i64 156, !13, i64 160, !14, i64 164, !6, i64 168, !10, i64 176}
!13 = !{!"float", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!12, !7, i64 145}
!16 = !{!12, !10, i64 96}
!17 = !{!12, !7, i64 144}
!18 = !{!12, !13, i64 20}
!19 = !{!12, !13, i64 24}
!20 = !{!12, !13, i64 28}
!21 = !{!12, !13, i64 136}
!22 = !{!12, !13, i64 132}
!23 = !{!12, !10, i64 112}
!24 = !{!12, !10, i64 108}
!25 = !{!12, !13, i64 140}
!26 = distinct !{!26, !27}
!27 = !{!"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"

%struct.s_atm = type { i32, float, float, float, float, float, float, float, [5 x i8], [7 x i8], [16 x i8], [16 x i8], [3 x i8], [8 x i8], i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float, float, i8, i8, float, float, float, float, i16, ptr, i32 }

declare void @write_pdb_atom_line(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i8 noundef signext, ptr noundef, ptr noundef, i32 noundef, i8 noundef signext, float noundef, float noundef, float noundef, float noundef, float noundef, i32 noundef, ptr noundef, i32 noundef, float noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @write_pdb_atoms(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = icmp sgt i32 %2, 0
  br i1 %4, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %5 = getelementptr inbounds %struct.s_atm, ptr %1, i64 %indvars.iv
  %6 = getelementptr inbounds i8, ptr %5, i64 37
  %7 = getelementptr inbounds i8, ptr %5, i64 88
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 32
  %10 = getelementptr inbounds i8, ptr %5, i64 145
  %11 = load i8, ptr %10, align 1, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %5, i64 79
  %13 = getelementptr inbounds i8, ptr %5, i64 44
  %14 = getelementptr inbounds i8, ptr %5, i64 96
  %15 = load i32, ptr %14, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %5, i64 144
  %17 = load i8, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %5, i64 20
  %19 = load float, ptr %18, align 4, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %5, i64 24
  %21 = load float, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %5, i64 28
  %23 = load float, ptr %22, align 4, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %5, i64 136
  %25 = load float, ptr %24, align 8, !tbaa !19
  %26 = getelementptr inbounds i8, ptr %5, i64 132
  %27 = load float, ptr %26, align 4, !tbaa !20
  %28 = getelementptr inbounds i8, ptr %5, i64 112
  %29 = load i32, ptr %28, align 8, !tbaa !21
  %30 = getelementptr inbounds i8, ptr %5, i64 76
  %31 = getelementptr inbounds i8, ptr %5, i64 108
  %32 = load i32, ptr %31, align 4, !tbaa !22
  %33 = getelementptr inbounds i8, ptr %5, i64 140
  %34 = load float, ptr %33, align 4, !tbaa !23
  tail call void @write_pdb_atom_line(ptr noundef %0, ptr noundef nonnull %6, i32 noundef %8, ptr noundef nonnull %9, i8 noundef signext %11, ptr noundef nonnull %12, ptr noundef nonnull %13, i32 noundef %15, i8 noundef signext %17, float noundef %19, float noundef %21, float noundef %23, float noundef %25, float noundef %27, i32 noundef %29, ptr noundef nonnull %30, i32 noundef %32, float noundef %34) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !24

._crit_edge:                                      ; preds = %.lr.ph, %3
  ret void
}

attributes #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" }
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, !7, i64 88}
!6 = !{!"s_atm", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !8, i64 32, !8, i64 37, !8, i64 44, !8, i64 60, !8, i64 76, !8, i64 79, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !8, i64 144, !8, i64 145, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !11, i64 164, !12, i64 168, !7, i64 176}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !8, i64 145}
!14 = !{!6, !7, i64 96}
!15 = !{!6, !8, i64 144}
!16 = !{!6, !10, i64 20}
!17 = !{!6, !10, i64 24}
!18 = !{!6, !10, i64 28}
!19 = !{!6, !10, i64 136}
!20 = !{!6, !10, i64 132}
!21 = !{!6, !7, i64 112}
!22 = !{!6, !7, i64 108}
!23 = !{!6, !10, i64 140}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass