; 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 = 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.8 = external hidden unnamed_addr constant [59 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 @sprintf(ptr noundef, ptr noundef, ...) #1

; 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

; Function Attrs: nounwind uwtable
define dso_local void @write_pqr_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) #2 {
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i8, align 1
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca i32, align 4
  %30 = alloca [7 x i8], align 1
  %31 = alloca [6 x i8], align 1
  store ptr %0, ptr %15, align 8, !tbaa !5
  store ptr %1, ptr %16, align 8, !tbaa !5
  store i32 %2, ptr %17, align 4, !tbaa !9
  store ptr %3, ptr %18, align 8, !tbaa !5
  store i8 %4, ptr %19, align 1, !tbaa !11
  store ptr %5, ptr %20, align 8, !tbaa !5
  store ptr %6, ptr %21, align 8, !tbaa !5
  store i32 %7, ptr %22, align 4, !tbaa !9
  store i8 %8, ptr %23, align 1, !tbaa !11
  store float %9, ptr %24, align 4, !tbaa !12
  store float %10, ptr %25, align 4, !tbaa !12
  store float %11, ptr %26, align 4, !tbaa !12
  store float %12, ptr %27, align 4, !tbaa !12
  store float %13, ptr %28, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 7, ptr %30) #3
  call void @llvm.lifetime.start.p0(i64 6, ptr %31) #3
  %32 = load i32, ptr %17, align 4, !tbaa !9
  %33 = icmp slt i32 %32, 100000
  br i1 %33, label %34, label %38

34:                                               ; preds = %14
  %35 = getelementptr inbounds [7 x i8], ptr %30, i64 0, i64 0
  %36 = load i32, ptr %17, align 4, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %35, ptr noundef @.str, i32 noundef %36) #3
  br label %42

38:                                               ; preds = %14
  %39 = getelementptr inbounds [7 x i8], ptr %30, i64 0, i64 0
  %40 = load i32, ptr %17, align 4, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %39, ptr noundef @.str.1, i32 noundef %40) #3
  br label %42

42:                                               ; preds = %38, %34
  %43 = load i32, ptr %22, align 4, !tbaa !9
  %44 = icmp slt i32 %43, 10000
  br i1 %44, label %45, label %49

45:                                               ; preds = %42
  %46 = getelementptr inbounds [6 x i8], ptr %31, i64 0, i64 0
  %47 = load i32, ptr %22, align 4, !tbaa !9
  %48 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %46, ptr noundef @.str.2, i32 noundef %47) #3
  br label %57

49:                                               ; preds = %42
  %50 = load i32, ptr %22, align 4, !tbaa !9
  %51 = icmp slt i32 %50, 65536
  br i1 %51, label %52, label %56

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

56:                                               ; preds = %52, %49
  br label %57

57:                                               ; preds = %56, %45
  %58 = load i8, ptr %19, align 1, !tbaa !11
  %59 = sext i8 %58 to i32
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %57
  br label %65

62:                                               ; preds = %57
  %63 = load i8, ptr %19, align 1, !tbaa !11
  %64 = sext i8 %63 to i32
  br label %65

65:                                               ; preds = %62, %61
  %66 = phi i32 [ 32, %61 ], [ %64, %62 ]
  %67 = trunc i32 %66 to i8
  store i8 %67, ptr %19, align 1, !tbaa !11
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = load ptr, ptr %16, align 8, !tbaa !5
  %70 = getelementptr inbounds [7 x i8], ptr %30, i64 0, i64 0
  %71 = load ptr, ptr %18, align 8, !tbaa !5
  %72 = load i8, ptr %19, align 1, !tbaa !11
  %73 = sext i8 %72 to i32
  %74 = load ptr, ptr %20, align 8, !tbaa !5
  %75 = load ptr, ptr %21, align 8, !tbaa !5
  %76 = getelementptr inbounds [6 x i8], ptr %31, i64 0, i64 0
  %77 = load i8, ptr %23, align 1, !tbaa !11
  %78 = sext i8 %77 to i32
  %79 = load float, ptr %24, align 4, !tbaa !12
  %80 = fpext float %79 to double
  %81 = load float, ptr %25, align 4, !tbaa !12
  %82 = fpext float %81 to double
  %83 = load float, ptr %26, align 4, !tbaa !12
  %84 = fpext float %83 to double
  %85 = load float, ptr %27, align 4, !tbaa !12
  %86 = fpext float %85 to double
  %87 = load float, ptr %28, align 4, !tbaa !12
  %88 = fpext float %87 to double
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.8, ptr noundef %69, ptr noundef %70, ptr noundef %71, i32 noundef %73, ptr noundef %74, ptr noundef %75, ptr noundef %76, i32 noundef %78, double noundef %80, double noundef %82, double noundef %84, double noundef %86, double noundef %88) #3
  store i32 %89, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 6, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 7, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  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 = { 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 = !{!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 = 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.8 = external hidden unnamed_addr constant [59 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: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; 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_pqr_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) local_unnamed_addr #2 {
  %15 = alloca [7 x i8], align 1
  %16 = alloca [6 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %15) #3
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %16) #3
  %17 = icmp slt i32 %2, 100000
  %.str..str.1 = select i1 %17, ptr @.str, ptr @.str.1
  %18 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %15, ptr noundef nonnull dereferenceable(1) %.str..str.1, i32 noundef %2) #3
  %19 = icmp slt i32 %7, 10000
  br i1 %19, label %.sink.split, label %20

20:                                               ; preds = %14
  %21 = icmp ult i32 %7, 65536
  br i1 %21, label %.sink.split, label %23

.sink.split:                                      ; preds = %20, %14
  %.str.3.sink = phi ptr [ @.str.2, %14 ], [ @.str.3, %20 ]
  %22 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) %.str.3.sink, i32 noundef %7) #3
  br label %23

23:                                               ; preds = %.sink.split, %20
  %24 = icmp eq i8 %4, 0
  %narrow = select i1 %24, i8 32, i8 %4
  %25 = sext i8 %narrow to i32
  %26 = sext i8 %8 to i32
  %27 = fpext float %9 to double
  %28 = fpext float %10 to double
  %29 = fpext float %11 to double
  %30 = fpext float %12 to double
  %31 = fpext float %13 to double
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.8, ptr noundef %1, ptr noundef nonnull %15, ptr noundef %3, i32 noundef %25, ptr noundef %5, ptr noundef %6, ptr noundef nonnull %16, i32 noundef %26, double noundef %27, double noundef %28, double noundef %29, double noundef %30, double noundef %31) #3
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %15) #3
  ret void
}

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


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