; 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_mmcif_atom_line(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i8 noundef signext, ptr noundef, ptr noundef, i32 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_mmcif_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 = %76, %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 %79

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 11
  %42 = getelementptr inbounds [16 x i8], ptr %41, i64 0, i64 0
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s_atm, ptr %43, i32 0, i32 17
  %45 = load i32, ptr %44, align 4, !tbaa !17
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.s_atm, ptr %46, i32 0, i32 28
  %48 = load i8, ptr %47, align 8, !tbaa !18
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s_atm, ptr %49, i32 0, i32 5
  %51 = load float, ptr %50, align 4, !tbaa !19
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.s_atm, ptr %52, i32 0, i32 6
  %54 = load float, ptr %53, align 8, !tbaa !20
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.s_atm, ptr %55, i32 0, i32 7
  %57 = load float, ptr %56, align 4, !tbaa !21
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.s_atm, ptr %58, i32 0, i32 26
  %60 = load float, ptr %59, align 8, !tbaa !22
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.s_atm, ptr %61, i32 0, i32 25
  %63 = load float, ptr %62, align 4, !tbaa !23
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.s_atm, ptr %64, i32 0, i32 20
  %66 = load i32, ptr %65, align 8, !tbaa !24
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.s_atm, ptr %67, i32 0, i32 12
  %69 = getelementptr inbounds [3 x i8], ptr %68, i64 0, i64 0
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.s_atm, ptr %70, i32 0, i32 19
  %72 = load i32, ptr %71, align 4, !tbaa !25
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.s_atm, ptr %73, i32 0, i32 27
  %75 = load float, ptr %74, align 4, !tbaa !26
  call void @write_mmcif_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, ptr noundef %42, i32 noundef %45, i8 noundef signext %48, float noundef %51, float noundef %54, float noundef %57, float noundef %60, float noundef %63, i32 noundef %66, ptr noundef %69, i32 noundef %72, float noundef %75)
  br label %76

76:                                               ; preds = %13
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !9
  br label %9, !llvm.loop !27

79:                                               ; 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, !10, i64 100}
!18 = !{!12, !7, i64 144}
!19 = !{!12, !13, i64 20}
!20 = !{!12, !13, i64 24}
!21 = !{!12, !13, i64 28}
!22 = !{!12, !13, i64 136}
!23 = !{!12, !13, i64 132}
!24 = !{!12, !10, i64 112}
!25 = !{!12, !10, i64 108}
!26 = !{!12, !13, i64 140}
!27 = distinct !{!27, !28}
!28 = !{!"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_mmcif_atom_line(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i8 noundef signext, ptr noundef, ptr noundef, i32 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_mmcif_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 60
  %17 = getelementptr inbounds i8, ptr %5, i64 100
  %18 = load i32, ptr %17, align 4, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %5, i64 144
  %20 = load i8, ptr %19, align 8, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %5, i64 20
  %22 = load float, ptr %21, align 4, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %5, i64 24
  %24 = load float, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %5, i64 28
  %26 = load float, ptr %25, align 4, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %5, i64 136
  %28 = load float, ptr %27, align 8, !tbaa !20
  %29 = getelementptr inbounds i8, ptr %5, i64 132
  %30 = load float, ptr %29, align 4, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %5, i64 112
  %32 = load i32, ptr %31, align 8, !tbaa !22
  %33 = getelementptr inbounds i8, ptr %5, i64 76
  %34 = getelementptr inbounds i8, ptr %5, i64 108
  %35 = load i32, ptr %34, align 4, !tbaa !23
  %36 = getelementptr inbounds i8, ptr %5, i64 140
  %37 = load float, ptr %36, align 4, !tbaa !24
  tail call void @write_mmcif_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, ptr noundef nonnull %16, i32 noundef %18, i8 noundef signext %20, float noundef %22, float noundef %24, float noundef %26, float noundef %28, float noundef %30, i32 noundef %32, ptr noundef nonnull %33, i32 noundef %35, float noundef %37) #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 !25

._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, !7, i64 100}
!16 = !{!6, !8, i64 144}
!17 = !{!6, !10, i64 20}
!18 = !{!6, !10, i64 24}
!19 = !{!6, !10, i64 28}
!20 = !{!6, !10, i64 136}
!21 = !{!6, !10, i64 132}
!22 = !{!6, !7, i64 112}
!23 = !{!6, !7, i64 108}
!24 = !{!6, !10, i64 140}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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