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

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

@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.write_mmcif_atom_line.id_buf = external hidden unnamed_addr constant [6 x i8], align 1
@__const.write_mmcif_atom_line.res_id_buf = external hidden unnamed_addr constant [5 x i8], align 1
@__const.write_mmcif_atom_line.charge_buf = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [70 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: 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) #1

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @write_mmcif_atom_line(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i8 noundef signext %4, ptr noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, i32 noundef %9, i8 noundef signext %10, float noundef %11, float noundef %12, float noundef %13, float noundef %14, float noundef %15, i32 noundef %16, ptr noundef %17, i32 noundef %18, float noundef %19) #3 {
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i8, align 1
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i8, align 1
  %32 = alloca float, align 4
  %33 = alloca float, align 4
  %34 = alloca float, align 4
  %35 = alloca float, align 4
  %36 = alloca float, align 4
  %37 = alloca i32, align 4
  %38 = alloca ptr, align 8
  %39 = alloca i32, align 4
  %40 = alloca float, align 4
  %41 = alloca i32, align 4
  %42 = alloca [6 x i8], align 1
  %43 = alloca [5 x i8], align 1
  %44 = alloca [3 x i8], align 1
  %45 = alloca float, align 4
  store ptr %0, ptr %21, align 8, !tbaa !5
  store ptr %1, ptr %22, align 8, !tbaa !5
  store i32 %2, ptr %23, align 4, !tbaa !9
  store ptr %3, ptr %24, align 8, !tbaa !5
  store i8 %4, ptr %25, align 1, !tbaa !11
  store ptr %5, ptr %26, align 8, !tbaa !5
  store ptr %6, ptr %27, align 8, !tbaa !5
  store i32 %7, ptr %28, align 4, !tbaa !9
  store ptr %8, ptr %29, align 8, !tbaa !5
  store i32 %9, ptr %30, align 4, !tbaa !9
  store i8 %10, ptr %31, align 1, !tbaa !11
  store float %11, ptr %32, align 4, !tbaa !12
  store float %12, ptr %33, align 4, !tbaa !12
  store float %13, ptr %34, align 4, !tbaa !12
  store float %14, ptr %35, align 4, !tbaa !12
  store float %15, ptr %36, align 4, !tbaa !12
  store i32 %16, ptr %37, align 4, !tbaa !9
  store ptr %17, ptr %38, align 8, !tbaa !5
  store i32 %18, ptr %39, align 4, !tbaa !9
  store float %19, ptr %40, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #4
  store i32 0, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 6, ptr %42) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %42, ptr align 1 @__const.write_mmcif_atom_line.id_buf, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 5, ptr %43) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %43, ptr align 1 @__const.write_mmcif_atom_line.res_id_buf, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 3, ptr %44) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %44, ptr align 1 @__const.write_mmcif_atom_line.charge_buf, i64 3, i1 false)
  %46 = getelementptr inbounds [6 x i8], ptr %42, i64 0, i64 0
  %47 = load i32, ptr %23, align 4, !tbaa !9
  %48 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %46, ptr noundef @.str.9, i32 noundef %47) #4
  %49 = getelementptr inbounds [5 x i8], ptr %43, i64 0, i64 0
  %50 = load i32, ptr %28, align 4, !tbaa !9
  %51 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %49, ptr noundef @.str.9, i32 noundef %50) #4
  %52 = load i8, ptr %25, align 1, !tbaa !11
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %59, label %55

55:                                               ; preds = %20
  %56 = load i8, ptr %25, align 1, !tbaa !11
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %57, 32
  br i1 %58, label %59, label %60

59:                                               ; preds = %55, %20
  br label %63

60:                                               ; preds = %55
  %61 = load i8, ptr %25, align 1, !tbaa !11
  %62 = sext i8 %61 to i32
  br label %63

63:                                               ; preds = %60, %59
  %64 = phi i32 [ 63, %59 ], [ %62, %60 ]
  %65 = trunc i32 %64 to i8
  store i8 %65, ptr %25, align 1, !tbaa !11
  %66 = load i8, ptr %31, align 1, !tbaa !11
  %67 = sext i8 %66 to i32
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %73, label %69

69:                                               ; preds = %63
  %70 = load i8, ptr %31, align 1, !tbaa !11
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 32
  br i1 %72, label %73, label %74

73:                                               ; preds = %69, %63
  br label %77

74:                                               ; preds = %69
  %75 = load i8, ptr %31, align 1, !tbaa !11
  %76 = sext i8 %75 to i32
  br label %77

77:                                               ; preds = %74, %73
  %78 = phi i32 [ 63, %73 ], [ %76, %74 ]
  %79 = trunc i32 %78 to i8
  store i8 %79, ptr %31, align 1, !tbaa !11
  %80 = load i32, ptr %39, align 4, !tbaa !9
  %81 = icmp eq i32 %80, -1
  br i1 %81, label %82, label %85

82:                                               ; preds = %77
  %83 = getelementptr inbounds [3 x i8], ptr %44, i64 0, i64 0
  %84 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %83, ptr noundef @.str.10) #4
  br label %89

85:                                               ; preds = %77
  %86 = getelementptr inbounds [3 x i8], ptr %44, i64 0, i64 0
  %87 = load i32, ptr %39, align 4, !tbaa !9
  %88 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %86, ptr noundef @.str.6, i32 noundef %87) #4
  br label %89

89:                                               ; preds = %85, %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #4
  store float 0.000000e+00, ptr %45, align 4, !tbaa !12
  %90 = load i32, ptr %37, align 4, !tbaa !9
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %89
  %93 = load float, ptr %40, align 4, !tbaa !12
  store float %93, ptr %45, align 4, !tbaa !12
  br label %94

94:                                               ; preds = %92, %89
  %95 = load ptr, ptr %21, align 8, !tbaa !5
  %96 = load ptr, ptr %22, align 8, !tbaa !5
  %97 = getelementptr inbounds [6 x i8], ptr %42, i64 0, i64 0
  %98 = load ptr, ptr %38, align 8, !tbaa !5
  %99 = load ptr, ptr %24, align 8, !tbaa !5
  %100 = load i8, ptr %25, align 1, !tbaa !11
  %101 = sext i8 %100 to i32
  %102 = load ptr, ptr %26, align 8, !tbaa !5
  %103 = load ptr, ptr %29, align 8, !tbaa !5
  %104 = load i32, ptr %30, align 4, !tbaa !9
  %105 = load i8, ptr %31, align 1, !tbaa !11
  %106 = sext i8 %105 to i32
  %107 = load float, ptr %32, align 4, !tbaa !12
  %108 = fpext float %107 to double
  %109 = load float, ptr %33, align 4, !tbaa !12
  %110 = fpext float %109 to double
  %111 = load float, ptr %34, align 4, !tbaa !12
  %112 = fpext float %111 to double
  %113 = load float, ptr %35, align 4, !tbaa !12
  %114 = fpext float %113 to double
  %115 = getelementptr inbounds [3 x i8], ptr %44, i64 0, i64 0
  %116 = load i32, ptr %28, align 4, !tbaa !9
  %117 = load ptr, ptr %27, align 8, !tbaa !5
  %118 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.11, ptr noundef %96, ptr noundef %97, ptr noundef %98, ptr noundef %99, i32 noundef %101, ptr noundef %102, ptr noundef %103, i32 noundef %104, i32 noundef %106, double noundef %108, double noundef %110, double noundef %112, double noundef %114, ptr noundef %115, i32 noundef %116, ptr noundef %117) #4
  store i32 %118, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #4
  call void @llvm.lifetime.end.p0(i64 3, ptr %44) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr %43) #4
  call void @llvm.lifetime.end.p0(i64 6, ptr %42) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !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"

@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.write_mmcif_atom_line.id_buf = external hidden unnamed_addr constant [6 x i8], align 1
@__const.write_mmcif_atom_line.charge_buf = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [70 x i8], align 1

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

; Function Attrs: mustprogress 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) #1

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @write_mmcif_atom_line(ptr nocapture noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i8 noundef signext %4, ptr noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, i32 noundef %9, i8 noundef signext %10, float noundef %11, float noundef %12, float noundef %13, float noundef %14, float noundef %15, i32 noundef %16, ptr noundef %17, i32 noundef %18, float noundef %19) local_unnamed_addr #3 {
  %21 = alloca [6 x i8], align 1
  %22 = alloca [5 x i8], align 1
  %23 = alloca [3 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %21) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) %21, ptr noundef nonnull align 1 dereferenceable(6) @__const.write_mmcif_atom_line.id_buf, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %22) #4
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %23) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %23, ptr noundef nonnull align 1 dereferenceable(3) @__const.write_mmcif_atom_line.charge_buf, i64 3, i1 false)
  %24 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %21, ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %2) #4
  %25 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %7) #4
  %26 = icmp eq i32 %18, -1
  br i1 %26, label %27, label %29

27:                                               ; preds = %20
  %28 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) @.str.10) #4
  br label %31

29:                                               ; preds = %20
  %30 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %18) #4
  br label %31

31:                                               ; preds = %29, %27
  %32 = and i8 %10, -33
  %or.cond5 = icmp eq i8 %32, 0
  %narrow31 = select i1 %or.cond5, i8 63, i8 %10
  %33 = and i8 %4, -33
  %or.cond = icmp eq i8 %33, 0
  %narrow = select i1 %or.cond, i8 63, i8 %4
  %34 = sext i8 %narrow to i32
  %35 = sext i8 %narrow31 to i32
  %36 = fpext float %11 to double
  %37 = fpext float %12 to double
  %38 = fpext float %13 to double
  %39 = fpext float %14 to double
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.11, ptr noundef %1, ptr noundef nonnull %21, ptr noundef %17, ptr noundef %3, i32 noundef %34, ptr noundef %5, ptr noundef %8, i32 noundef %9, i32 noundef %35, double noundef %36, double noundef %37, double noundef %38, double noundef %39, ptr noundef nonnull %23, i32 noundef %7, ptr noundef %6) #4
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %23) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %22) #4
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %21) #4
  ret void
}

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


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