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

; 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_pdb = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, float, float, float, float, float, float, [83 x i8], [500 x i8], float, float, float, i32, i32 }
%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 }

@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

7:                                                ; preds = %70, %2
  %8 = load i32, ptr %6, align 4, !tbaa !9
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.s_pdb, ptr %9, i32 0, i32 10
  %11 = load i32, ptr %10, align 4, !tbaa !11
  %12 = icmp slt i32 %8, %11
  br i1 %12, label %13, label %73

13:                                               ; preds = %7
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.s_pdb, ptr %14, i32 0, i32 3
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds ptr, ptr %16, i64 %18
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %20, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.s_atm, ptr %22, i32 0, i32 14
  %24 = load i32, ptr %23, align 8, !tbaa !15
  %25 = load ptr, ptr %5, 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 %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.s_atm, ptr %28, i32 0, i32 29
  %30 = load i8, ptr %29, align 1, !tbaa !18
  %31 = load ptr, ptr %5, 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 %5, 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 %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.s_atm, ptr %37, i32 0, i32 16
  %39 = load i32, ptr %38, align 8, !tbaa !19
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.s_atm, ptr %40, i32 0, i32 28
  %42 = load i8, ptr %41, align 8, !tbaa !20
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s_atm, ptr %43, i32 0, i32 5
  %45 = load float, ptr %44, align 4, !tbaa !21
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.s_atm, ptr %46, i32 0, i32 6
  %48 = load float, ptr %47, align 8, !tbaa !22
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s_atm, ptr %49, i32 0, i32 7
  %51 = load float, ptr %50, align 4, !tbaa !23
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.s_atm, ptr %52, i32 0, i32 23
  %54 = load float, ptr %53, align 4, !tbaa !24
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.s_atm, ptr %55, i32 0, i32 24
  %57 = load float, ptr %56, align 8, !tbaa !25
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.s_atm, ptr %58, i32 0, i32 20
  %60 = load i32, ptr %59, align 8, !tbaa !26
  %61 = load ptr, ptr %5, 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 %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.s_atm, ptr %64, i32 0, i32 19
  %66 = load i32, ptr %65, align 4, !tbaa !27
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.s_atm, ptr %67, i32 0, i32 27
  %69 = load float, ptr %68, align 4, !tbaa !28
  call void @write_pdb_atom_line(ptr noundef %21, ptr noundef @.str.18, 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 %6, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %6, align 4, !tbaa !9
  br label %7, !llvm.loop !29

73:                                               ; preds = %7
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.20) #4
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 = { "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 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 76}
!12 = !{!"s_pdb", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !13, i64 112, !7, i64 116, !7, i64 199, !13, i64 700, !13, i64 704, !13, i64 708, !10, i64 712, !10, i64 716}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !6, i64 24}
!15 = !{!16, !10, i64 88}
!16 = !{!"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, !17, i64 164, !6, i64 168, !10, i64 176}
!17 = !{!"short", !7, i64 0}
!18 = !{!16, !7, i64 145}
!19 = !{!16, !10, i64 96}
!20 = !{!16, !7, i64 144}
!21 = !{!16, !13, i64 20}
!22 = !{!16, !13, i64 24}
!23 = !{!16, !13, i64 28}
!24 = !{!16, !13, i64 124}
!25 = !{!16, !13, i64 128}
!26 = !{!16, !10, i64 112}
!27 = !{!16, !10, i64 108}
!28 = !{!16, !13, i64 140}
!29 = distinct !{!29, !30}
!30 = !{!"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"

@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #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) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @write_first_bfactor_density(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 76
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %6 = getelementptr inbounds i8, ptr %1, i64 24
  br label %7

7:                                                ; preds = %.lr.ph, %7
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %7 ]
  %8 = load ptr, ptr %6, align 8, !tbaa !12
  %9 = getelementptr inbounds ptr, ptr %8, i64 %indvars.iv
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %10, i64 88
  %12 = load i32, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %10, i64 32
  %14 = getelementptr inbounds i8, ptr %10, i64 145
  %15 = load i8, ptr %14, align 1, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %10, i64 79
  %17 = getelementptr inbounds i8, ptr %10, i64 44
  %18 = getelementptr inbounds i8, ptr %10, i64 96
  %19 = load i32, ptr %18, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %10, i64 144
  %21 = load i8, ptr %20, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %10, i64 20
  %23 = load float, ptr %22, align 4, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %10, i64 24
  %25 = load float, ptr %24, align 8, !tbaa !21
  %26 = getelementptr inbounds i8, ptr %10, i64 28
  %27 = load float, ptr %26, align 4, !tbaa !22
  %28 = getelementptr inbounds i8, ptr %10, i64 124
  %29 = load float, ptr %28, align 4, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %10, i64 128
  %31 = load float, ptr %30, align 8, !tbaa !24
  %32 = getelementptr inbounds i8, ptr %10, i64 112
  %33 = load i32, ptr %32, align 8, !tbaa !25
  %34 = getelementptr inbounds i8, ptr %10, i64 76
  %35 = getelementptr inbounds i8, ptr %10, i64 108
  %36 = load i32, ptr %35, align 4, !tbaa !26
  %37 = getelementptr inbounds i8, ptr %10, i64 140
  %38 = load float, ptr %37, align 4, !tbaa !27
  tail call void @write_pdb_atom_line(ptr noundef %0, ptr noundef nonnull @.str.18, i32 noundef %12, ptr noundef nonnull %13, i8 noundef signext %15, ptr noundef nonnull %16, ptr noundef nonnull %17, i32 noundef %19, i8 noundef signext %21, float noundef %23, float noundef %25, float noundef %27, float noundef %29, float noundef %31, i32 noundef %33, ptr noundef nonnull %34, i32 noundef %36, float noundef %38) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %7, label %._crit_edge, !llvm.loop !28

._crit_edge:                                      ; preds = %7, %2
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.20) #3
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.21) #3
  ret void
}

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


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