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

@__const.write_pdb_atom_line.id_buf = external hidden unnamed_addr constant [6 x i8], align 1
@__const.write_pdb_atom_line.res_id_buf = external hidden unnamed_addr constant [5 x i8], align 1
@__const.write_pdb_atom_line.charge_buf = external hidden unnamed_addr constant [3 x i8], align 1
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [70 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @write_pdb_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, i8 noundef signext %8, float noundef %9, float noundef %10, float noundef %11, float noundef %12, float noundef %13, i32 noundef %14, ptr noundef %15, i32 noundef %16, float noundef %17) #0 {
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i8, align 1
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i8, align 1
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca float, align 4
  %33 = alloca i32, align 4
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca float, align 4
  %37 = alloca i32, align 4
  %38 = alloca [6 x i8], align 1
  %39 = alloca [5 x i8], align 1
  %40 = alloca [3 x i8], align 1
  %41 = alloca i8, align 1
  %42 = alloca float, align 4
  store ptr %0, ptr %19, align 8, !tbaa !5
  store ptr %1, ptr %20, align 8, !tbaa !5
  store i32 %2, ptr %21, align 4, !tbaa !9
  store ptr %3, ptr %22, align 8, !tbaa !5
  store i8 %4, ptr %23, align 1, !tbaa !11
  store ptr %5, ptr %24, align 8, !tbaa !5
  store ptr %6, ptr %25, align 8, !tbaa !5
  store i32 %7, ptr %26, align 4, !tbaa !9
  store i8 %8, ptr %27, align 1, !tbaa !11
  store float %9, ptr %28, align 4, !tbaa !12
  store float %10, ptr %29, align 4, !tbaa !12
  store float %11, ptr %30, align 4, !tbaa !12
  store float %12, ptr %31, align 4, !tbaa !12
  store float %13, ptr %32, align 4, !tbaa !12
  store i32 %14, ptr %33, align 4, !tbaa !9
  store ptr %15, ptr %34, align 8, !tbaa !5
  store i32 %16, ptr %35, align 4, !tbaa !9
  store float %17, ptr %36, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #4
  store i32 0, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 6, ptr %38) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %38, ptr align 1 @__const.write_pdb_atom_line.id_buf, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 5, ptr %39) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %39, ptr align 1 @__const.write_pdb_atom_line.res_id_buf, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 3, ptr %40) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %40, ptr align 1 @__const.write_pdb_atom_line.charge_buf, i64 3, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %41) #4
  store i8 32, ptr %41, align 1, !tbaa !11
  %43 = load i8, ptr %27, align 1, !tbaa !11
  %44 = sext i8 %43 to i64
  %45 = inttoptr i64 %44 to ptr
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %49

47:                                               ; preds = %18
  %48 = load i8, ptr %27, align 1, !tbaa !11
  store i8 %48, ptr %41, align 1, !tbaa !11
  br label %49

49:                                               ; preds = %47, %18
  %50 = load i32, ptr %21, align 4, !tbaa !9
  %51 = icmp slt i32 %50, 100000
  br i1 %51, label %52, label %56

52:                                               ; preds = %49
  %53 = getelementptr inbounds [6 x i8], ptr %38, i64 0, i64 0
  %54 = load i32, ptr %21, align 4, !tbaa !9
  %55 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %53, ptr noundef @.str, i32 noundef %54) #4
  br label %60

56:                                               ; preds = %49
  %57 = getelementptr inbounds [6 x i8], ptr %38, i64 0, i64 0
  %58 = load i32, ptr %21, align 4, !tbaa !9
  %59 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %57, ptr noundef @.str.1, i32 noundef %58) #4
  br label %60

60:                                               ; preds = %56, %52
  %61 = load i32, ptr %26, align 4, !tbaa !9
  %62 = icmp slt i32 %61, 10000
  br i1 %62, label %63, label %67

63:                                               ; preds = %60
  %64 = getelementptr inbounds [5 x i8], ptr %39, i64 0, i64 0
  %65 = load i32, ptr %26, align 4, !tbaa !9
  %66 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %64, ptr noundef @.str.2, i32 noundef %65) #4
  br label %78

67:                                               ; preds = %60
  %68 = load i32, ptr %26, align 4, !tbaa !9
  %69 = icmp slt i32 %68, 65536
  br i1 %69, label %70, label %74

70:                                               ; preds = %67
  %71 = getelementptr inbounds [5 x i8], ptr %39, i64 0, i64 0
  %72 = load i32, ptr %26, align 4, !tbaa !9
  %73 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %71, ptr noundef @.str.3, i32 noundef %72) #4
  br label %77

74:                                               ; preds = %67
  %75 = getelementptr inbounds [5 x i8], ptr %39, i64 0, i64 0
  %76 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %75, ptr noundef @.str.4) #4
  br label %77

77:                                               ; preds = %74, %70
  br label %78

78:                                               ; preds = %77, %63
  %79 = load i8, ptr %23, align 1, !tbaa !11
  %80 = sext i8 %79 to i32
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %78
  br label %86

83:                                               ; preds = %78
  %84 = load i8, ptr %23, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  br label %86

86:                                               ; preds = %83, %82
  %87 = phi i32 [ 32, %82 ], [ %85, %83 ]
  %88 = trunc i32 %87 to i8
  store i8 %88, ptr %23, align 1, !tbaa !11
  %89 = load i32, ptr %35, align 4, !tbaa !9
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %91, label %94

91:                                               ; preds = %86
  %92 = getelementptr inbounds [3 x i8], ptr %40, i64 0, i64 0
  %93 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %92, ptr noundef @.str.5) #4
  br label %98

94:                                               ; preds = %86
  %95 = getelementptr inbounds [3 x i8], ptr %40, i64 0, i64 0
  %96 = load i32, ptr %35, align 4, !tbaa !9
  %97 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %95, ptr noundef @.str.6, i32 noundef %96) #4
  br label %98

98:                                               ; preds = %94, %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #4
  store float 0.000000e+00, ptr %42, align 4, !tbaa !12
  %99 = load i32, ptr %33, align 4, !tbaa !9
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %103

101:                                              ; preds = %98
  %102 = load float, ptr %36, align 4, !tbaa !12
  store float %102, ptr %42, align 4, !tbaa !12
  br label %103

103:                                              ; preds = %101, %98
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = load ptr, ptr %20, align 8, !tbaa !5
  %106 = getelementptr inbounds [6 x i8], ptr %38, i64 0, i64 0
  %107 = load ptr, ptr %22, align 8, !tbaa !5
  %108 = load i8, ptr %23, align 1, !tbaa !11
  %109 = sext i8 %108 to i32
  %110 = load ptr, ptr %24, align 8, !tbaa !5
  %111 = load ptr, ptr %25, align 8, !tbaa !5
  %112 = getelementptr inbounds [5 x i8], ptr %39, i64 0, i64 0
  %113 = load i8, ptr %41, align 1, !tbaa !11
  %114 = sext i8 %113 to i32
  %115 = load float, ptr %28, align 4, !tbaa !12
  %116 = fpext float %115 to double
  %117 = load float, ptr %29, align 4, !tbaa !12
  %118 = fpext float %117 to double
  %119 = load float, ptr %30, align 4, !tbaa !12
  %120 = fpext float %119 to double
  %121 = load float, ptr %42, align 4, !tbaa !12
  %122 = fpext float %121 to double
  %123 = load float, ptr %32, align 4, !tbaa !12
  %124 = fpext float %123 to double
  %125 = load ptr, ptr %34, align 8, !tbaa !5
  %126 = getelementptr inbounds [3 x i8], ptr %40, i64 0, i64 0
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.7, ptr noundef %105, ptr noundef %106, ptr noundef %107, i32 noundef %109, ptr noundef %110, ptr noundef %111, ptr noundef %112, i32 noundef %114, double noundef %116, double noundef %118, double noundef %120, double noundef %122, double noundef %124, ptr noundef %125, ptr noundef %126) #4
  store i32 %127, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #4
  call void @llvm.lifetime.end.p0(i64 3, ptr %40) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 6, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #4
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

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

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

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

@__const.write_pdb_atom_line.id_buf = external hidden unnamed_addr constant [6 x i8], align 1
@__const.write_pdb_atom_line.res_id_buf = external hidden unnamed_addr constant [5 x i8], align 1
@__const.write_pdb_atom_line.charge_buf = external hidden unnamed_addr constant [3 x i8], align 1
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [70 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @write_pdb_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, i8 noundef signext %8, float noundef %9, float noundef %10, float noundef %11, float noundef %12, float noundef %13, i32 noundef %14, ptr noundef %15, i32 noundef %16, float noundef %17) local_unnamed_addr #0 {
  %19 = alloca [6 x i8], align 1
  %20 = alloca [5 x i8], align 1
  %21 = alloca [3 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %19) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) %19, ptr noundef nonnull align 1 dereferenceable(6) @__const.write_pdb_atom_line.id_buf, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %20) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %20, ptr noundef nonnull align 1 dereferenceable(5) @__const.write_pdb_atom_line.res_id_buf, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %21) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %21, ptr noundef nonnull align 1 dereferenceable(3) @__const.write_pdb_atom_line.charge_buf, i64 3, i1 false)
  %22 = icmp slt i32 %2, 100000
  %.str..str.1 = select i1 %22, ptr @.str, ptr @.str.1
  %23 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) %.str..str.1, i32 noundef %2) #4
  %24 = icmp slt i32 %7, 10000
  br i1 %24, label %25, label %27

25:                                               ; preds = %18
  %26 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) #4
  br label %33

27:                                               ; preds = %18
  %28 = icmp ult i32 %7, 65536
  br i1 %28, label %29, label %31

29:                                               ; preds = %27
  %30 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %7) #4
  br label %33

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

33:                                               ; preds = %29, %31, %25
  %34 = icmp eq i32 %16, -1
  br i1 %34, label %35, label %37

35:                                               ; preds = %33
  %36 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %21, ptr noundef nonnull dereferenceable(1) @.str.5) #4
  br label %39

37:                                               ; preds = %33
  %38 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %21, ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %16) #4
  br label %39

39:                                               ; preds = %37, %35
  %.not = icmp eq i8 %8, 0
  %narrow33 = select i1 %.not, i8 32, i8 %8
  %spec.select = sext i8 %narrow33 to i32
  %.not32 = icmp eq i32 %14, 0
  %40 = fpext float %17 to double
  %.0 = select i1 %.not32, double 0.000000e+00, double %40
  %41 = icmp eq i8 %4, 0
  %narrow = select i1 %41, i8 32, i8 %4
  %42 = sext i8 %narrow to i32
  %43 = fpext float %9 to double
  %44 = fpext float %10 to double
  %45 = fpext float %11 to double
  %46 = fpext float %13 to double
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.7, ptr noundef %1, ptr noundef nonnull %19, ptr noundef %3, i32 noundef %42, ptr noundef %5, ptr noundef %6, ptr noundef nonnull %20, i32 noundef %spec.select, double noundef %43, double noundef %44, double noundef %45, double noundef %.0, double noundef %46, ptr noundef %15, ptr noundef nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %20) #4
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %19) #4
  ret void
}

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

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass