; LLVM IR from alexzheng42/sDMD :: src (Initialization)

; 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.PropertyStr = type { [8 x i8], [2 x [16 x i8]], [8 x i8], i32, i32, i32, double, double, [3 x double], %struct.AtomSeqStr, ptr, ptr }
%struct.AtomSeqStr = type { i32, i32, i32 }
%struct.ConstraintStr = type { i32, double, ptr, double, ptr }

@.str.2 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [34 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 willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #1

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; 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 @RemoveConstr(ptr noundef %0, i32 noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  %11 = call i32 @strcmp(ptr noundef %10, ptr noundef @.str.169) #6
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %19

13:                                               ; preds = %3
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.PropertyStr, ptr %14, i32 0, i32 10
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %16, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.PropertyStr, ptr %17, i32 0, i32 10
  store ptr %18, ptr %8, align 8, !tbaa !5
  br label %32

19:                                               ; preds = %3
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call i32 @strcmp(ptr noundef %20, ptr noundef @.str.170) #6
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %29

23:                                               ; preds = %19
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.PropertyStr, ptr %24, i32 0, i32 11
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  store ptr %26, ptr %7, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.PropertyStr, ptr %27, i32 0, i32 11
  store ptr %28, ptr %8, align 8, !tbaa !5
  br label %31

29:                                               ; preds = %19
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.171, ptr noundef @.str.2, i32 noundef 1244)
  call void @exit(i32 noundef 1) #7
  unreachable

31:                                               ; preds = %23
  br label %32

32:                                               ; preds = %31, %13
  br label %33

33:                                               ; preds = %48, %32
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %54

36:                                               ; preds = %33
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ConstraintStr, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !16
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = icmp eq i32 %39, %40
  br i1 %41, label %42, label %48

42:                                               ; preds = %36
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ConstraintStr, ptr %43, i32 0, i32 4
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %45, ptr %46, align 8, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreeConstr(ptr noundef %47)
  store i32 1, ptr %9, align 4
  br label %55

48:                                               ; preds = %36
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ConstraintStr, ptr %49, i32 0, i32 4
  store ptr %50, ptr %8, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ConstraintStr, ptr %51, i32 0, i32 4
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  store ptr %53, ptr %7, align 8, !tbaa !5
  br label %33, !llvm.loop !19

54:                                               ; preds = %33
  store i32 1, ptr %9, align 4
  br label %55

55:                                               ; preds = %54, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

declare void @FreeConstr(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(read) "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 = { noreturn 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 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { noreturn 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, !6, i64 120}
!12 = !{!"PropertyStr", !7, i64 0, !7, i64 8, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !13, i64 64, !13, i64 72, !7, i64 80, !14, i64 104, !6, i64 120, !6, i64 128}
!13 = !{!"double", !7, i64 0}
!14 = !{!"AtomSeqStr", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!12, !6, i64 128}
!16 = !{!17, !10, i64 0}
!17 = !{!"ConstraintStr", !10, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !6, i64 32}
!18 = !{!17, !6, i64 32}
!19 = distinct !{!19, !20}
!20 = !{!"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.2 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #0

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @RemoveConstr(ptr nocapture noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #3 {
  %4 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.169) #5
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %11, label %6

6:                                                ; preds = %3
  %7 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.170) #5
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %11, label %9

9:                                                ; preds = %6
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.171, ptr noundef nonnull @.str.2, i32 noundef 1244)
  tail call void @exit(i32 noundef 1) #6
  unreachable

11:                                               ; preds = %6, %3
  %.sink = phi i64 [ 120, %3 ], [ 128, %6 ]
  %12 = getelementptr inbounds i8, ptr %0, i64 %.sink
  %.11417 = load ptr, ptr %12, align 8, !tbaa !5
  %.not18 = icmp eq ptr %.11417, null
  br i1 %.not18, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %11
  %13 = load i32, ptr %.11417, align 8, !tbaa !9
  %14 = icmp eq i32 %13, %1
  br i1 %14, label %.lr.ph._crit_edge, label %.lr.ph28

.lr.ph:                                           ; preds = %.lr.ph28
  %15 = load i32, ptr %.114, align 8, !tbaa !9
  %16 = icmp eq i32 %15, %1
  br i1 %16, label %.lr.ph._crit_edge.loopexit, label %.lr.ph28, !llvm.loop !13

.lr.ph._crit_edge.loopexit:                       ; preds = %.lr.ph
  %17 = getelementptr inbounds i8, ptr %.1142027, i64 32
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph._crit_edge.loopexit, %.lr.ph.preheader
  %.11420.lcssa = phi ptr [ %.11417, %.lr.ph.preheader ], [ %.114, %.lr.ph._crit_edge.loopexit ]
  %.119.lcssa = phi ptr [ %12, %.lr.ph.preheader ], [ %17, %.lr.ph._crit_edge.loopexit ]
  %18 = getelementptr inbounds i8, ptr %.11420.lcssa, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  store ptr %19, ptr %.119.lcssa, align 8, !tbaa !5
  tail call void @FreeConstr(ptr noundef nonnull %.11420.lcssa) #7
  br label %.loopexit

.lr.ph28:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %.1142027 = phi ptr [ %.114, %.lr.ph ], [ %.11417, %.lr.ph.preheader ]
  %20 = getelementptr inbounds i8, ptr %.1142027, i64 32
  %.114 = load ptr, ptr %20, align 8, !tbaa !5
  %.not = icmp eq ptr %.114, null
  br i1 %.not, label %.loopexit, label %.lr.ph, !llvm.loop !13

.loopexit:                                        ; preds = %.lr.ph28, %11, %.lr.ph._crit_edge
  ret void
}

declare void @FreeConstr(ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { 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 = { noreturn 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 = { "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 #5 = { nounwind willreturn memory(read) }
attributes #6 = { noreturn nounwind }
attributes #7 = { 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, !11, i64 0}
!10 = !{!"ConstraintStr", !11, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !6, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!10, !6, i64 32}


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