; LLVM IR from MtSaka/library :: test/aoj/CGL/CGL_2_D.test (main)

; 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.fastio::Scanner" = type <{ i32, [131073 x i8], [3 x i8], i32, i32, i8, [3 x i8] }>
%"struct.geometry::segment" = type { %"struct.geometry::point", %"struct.geometry::point" }
%"struct.geometry::point" = type { x86_fp80, x86_fp80 }

@_ZN6fastio2scE = external dso_local global %"struct.fastio::Scanner", align 4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef, x86_fp80 noundef) unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_ZN8geometry4distENS_7segmentES0_(ptr noundef byval(%"struct.geometry::segment") align 16, ptr noundef byval(%"struct.geometry::segment") align 16) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8geometry7segmentC2ENS_5pointES1_(ptr noundef nonnull align 16 dereferenceable(64), ptr noundef byval(%"struct.geometry::point") align 16, ptr noundef byval(%"struct.geometry::point") align 16) unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca %"struct.geometry::point", align 16
  %5 = alloca %"struct.geometry::point", align 16
  %6 = alloca %"struct.geometry::point", align 16
  %7 = alloca %"struct.geometry::point", align 16
  %8 = alloca %"struct.geometry::segment", align 16
  %9 = alloca %"struct.geometry::point", align 16
  %10 = alloca %"struct.geometry::point", align 16
  %11 = alloca %"struct.geometry::segment", align 16
  %12 = alloca %"struct.geometry::point", align 16
  %13 = alloca %"struct.geometry::point", align 16
  %14 = alloca x86_fp80, align 16
  %15 = alloca %"struct.geometry::segment", align 16
  %16 = alloca %"struct.geometry::segment", align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %29, %0
  %18 = load i64, ptr %3, align 8, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %18, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %32

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %4, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #6
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %5, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #6
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %6, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %7, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  %24 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) @_ZN6fastio2scE, ptr noundef nonnull align 16 dereferenceable(32) %4)
  %25 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) %24, ptr noundef nonnull align 16 dereferenceable(32) %5)
  %26 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) %25, ptr noundef nonnull align 16 dereferenceable(32) %6)
  %27 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) %26, ptr noundef nonnull align 16 dereferenceable(32) %7)
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %4, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %5, i64 32, i1 false), !tbaa.struct !11
  call void @_ZN8geometry7segmentC2ENS_5pointES1_(ptr noundef nonnull align 16 dereferenceable(64) %8, ptr noundef byval(%"struct.geometry::point") align 16 %9, ptr noundef byval(%"struct.geometry::point") align 16 %10)
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %6, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %7, i64 32, i1 false), !tbaa.struct !11
  call void @_ZN8geometry7segmentC2ENS_5pointES1_(ptr noundef nonnull align 16 dereferenceable(64) %11, ptr noundef byval(%"struct.geometry::point") align 16 %12, ptr noundef byval(%"struct.geometry::point") align 16 %13)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %8, i64 64, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %11, i64 64, i1 false), !tbaa.struct !14
  %28 = call noundef x86_fp80 @_ZN8geometry4distENS_7segmentES0_(ptr noundef byval(%"struct.geometry::segment") align 16 %15, ptr noundef byval(%"struct.geometry::segment") align 16 %16)
  store x86_fp80 %28, ptr %14, align 16, !tbaa !12
  call void @_Z5printIeEvRKT_(ptr noundef nonnull align 16 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  br label %29

29:                                               ; preds = %23
  %30 = load i64, ptr %3, align 8, !tbaa !5
  %31 = add nsw i64 %30, 1
  store i64 %31, ptr %3, align 8, !tbaa !5
  br label %17, !llvm.loop !15

32:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %33 = load i32, ptr %1, align 4
  ret i32 %33
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089), ptr noundef nonnull align 16 dereferenceable(32)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIeEvRKT_(ptr noundef nonnull align 16 dereferenceable(16)) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 = { mustprogress norecurse 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 = { inlinehint mustprogress 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 #6 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 16, !12, i64 16, i64 16, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long double", !7, i64 0}
!14 = !{i64 0, i64 16, !12, i64 16, i64 16, !12, i64 32, i64 16, !12, i64 48, i64 16, !12}
!15 = distinct !{!15, !16}
!16 = !{!"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"

%"struct.fastio::Scanner" = type <{ i32, [131073 x i8], [3 x i8], i32, i32, i8, [3 x i8] }>
%"struct.geometry::segment" = type { %"struct.geometry::point", %"struct.geometry::point" }
%"struct.geometry::point" = type { x86_fp80, x86_fp80 }

@_ZN6fastio2scE = external dso_local global %"struct.fastio::Scanner", align 4

; 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 nounwind uwtable
declare dso_local void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef, x86_fp80 noundef) unnamed_addr #1 align 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: mustprogress uwtable
declare dso_local noundef x86_fp80 @_ZN8geometry4distENS_7segmentES0_(ptr noundef byval(%"struct.geometry::segment") align 16, ptr noundef byval(%"struct.geometry::segment") align 16) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8geometry7segmentC2ENS_5pointES1_(ptr noundef nonnull align 16 dereferenceable(64), ptr noundef byval(%"struct.geometry::point") align 16, ptr noundef byval(%"struct.geometry::point") align 16) unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.geometry::point", align 16
  %3 = alloca %"struct.geometry::point", align 16
  %4 = alloca %"struct.geometry::point", align 16
  %5 = alloca %"struct.geometry::point", align 16
  %6 = alloca %"struct.geometry::segment", align 16
  %7 = alloca %"struct.geometry::segment", align 16
  %8 = alloca x86_fp80, align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %1)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03 = phi i64 [ %16, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %2, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %3, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %4, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %5, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  %11 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) @_ZN6fastio2scE, ptr noundef nonnull align 16 dereferenceable(32) %2)
  %12 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) %11, ptr noundef nonnull align 16 dereferenceable(32) %3)
  %13 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) %12, ptr noundef nonnull align 16 dereferenceable(32) %4)
  %14 = call noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089) %13, ptr noundef nonnull align 16 dereferenceable(32) %5)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #5
  call void @_ZN8geometry7segmentC2ENS_5pointES1_(ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull byval(%"struct.geometry::point") align 16 %2, ptr noundef nonnull byval(%"struct.geometry::point") align 16 %3)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #5
  call void @_ZN8geometry7segmentC2ENS_5pointES1_(ptr noundef nonnull align 16 dereferenceable(64) %7, ptr noundef nonnull byval(%"struct.geometry::point") align 16 %4, ptr noundef nonnull byval(%"struct.geometry::point") align 16 %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %15 = call noundef x86_fp80 @_ZN8geometry4distENS_7segmentES0_(ptr noundef nonnull byval(%"struct.geometry::segment") align 16 %6, ptr noundef nonnull byval(%"struct.geometry::segment") align 16 %7)
  store x86_fp80 %15, ptr %8, align 16, !tbaa !9
  call void @_Z5printIeEvRKT_(ptr noundef nonnull align 16 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  %16 = add nuw nsw i64 %.03, 1
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %16, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !11
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(131089) ptr @_ZN6fastio7ScannerILm131072ELi16EErsIN8geometry5pointEEERS1_RT_(ptr noundef nonnull align 4 dereferenceable(131089), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIeEvRKT_(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #4

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass