; LLVM IR from MtSaka/library :: test/aoj/CGL/CGL_1_A.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::point" = type { x86_fp80, x86_fp80 }
%"struct.geometry::line" = type { %"struct.geometry::point", %"struct.geometry::point" }

@_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 nounwind uwtable
declare dso_local void @_ZN8geometry4lineC2ENS_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 uwtable
declare dso_local void @_ZN8geometry7projectENS_4lineENS_5pointE(ptr dead_on_unwind noalias writable sret(%"struct.geometry::point") align 16, ptr noundef byval(%"struct.geometry::line") align 16, ptr noundef byval(%"struct.geometry::point") align 16) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.geometry::point", align 16
  %3 = alloca %"struct.geometry::point", align 16
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca %"struct.geometry::point", align 16
  %7 = alloca %"struct.geometry::point", align 16
  %8 = alloca %"struct.geometry::line", align 16
  %9 = alloca %"struct.geometry::point", align 16
  %10 = alloca %"struct.geometry::point", align 16
  %11 = alloca %"struct.geometry::point", align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #6
  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 %3) #6
  call void @_ZN8geometry5pointC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %3, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  %12 = 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)
  %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) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %24, %0
  %15 = load i64, ptr %5, align 8, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %15, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %27

20:                                               ; preds = %14
  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)
  %21 = 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) %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %3, i64 32, i1 false), !tbaa.struct !11
  call void @_ZN8geometry4lineC2ENS_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.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 %6, i64 32, i1 false), !tbaa.struct !11
  call void @_ZN8geometry7projectENS_4lineENS_5pointE(ptr dead_on_unwind writable sret(%"struct.geometry::point") align 16 %7, ptr noundef byval(%"struct.geometry::line") align 16 %8, ptr noundef byval(%"struct.geometry::point") align 16 %11)
  %22 = getelementptr inbounds %"struct.geometry::point", ptr %7, i32 0, i32 0
  %23 = getelementptr inbounds %"struct.geometry::point", ptr %7, i32 0, i32 1
  call void @_Z5printIeJeEEvRKT_DpRKT0_(ptr noundef nonnull align 16 dereferenceable(16) %22, ptr noundef nonnull align 16 dereferenceable(16) %23)
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  br label %24

24:                                               ; preds = %20
  %25 = load i64, ptr %5, align 8, !tbaa !5
  %26 = add nsw i64 %25, 1
  store i64 %26, ptr %5, align 8, !tbaa !5
  br label %14, !llvm.loop !14

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

; 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 @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIeJeEEvRKT_DpRKT0_(ptr noundef nonnull align 16 dereferenceable(16), 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 = distinct !{!14, !15}
!15 = !{!"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::point" = type { x86_fp80, x86_fp80 }
%"struct.geometry::line" = type { %"struct.geometry::point", %"struct.geometry::point" }

@_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 nounwind uwtable
declare dso_local void @_ZN8geometry4lineC2ENS_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 uwtable
declare dso_local void @_ZN8geometry7projectENS_4lineENS_5pointE(ptr dead_on_unwind noalias writable sret(%"struct.geometry::point") align 16, ptr noundef byval(%"struct.geometry::line") align 16, ptr noundef byval(%"struct.geometry::point") align 16) local_unnamed_addr #2

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

.lr.ph:                                           ; preds = %0
  %11 = getelementptr inbounds i8, ptr %5, i64 16
  br label %12

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

12:                                               ; preds = %.lr.ph, %12
  %.03 = phi i64 [ 0, %.lr.ph ], [ %14, %12 ]
  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)
  %13 = 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)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN8geometry4lineC2ENS_5pointES1_(ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull byval(%"struct.geometry::point") align 16 %1, ptr noundef nonnull byval(%"struct.geometry::point") align 16 %2)
  call void @_ZN8geometry7projectENS_4lineENS_5pointE(ptr dead_on_unwind nonnull writable sret(%"struct.geometry::point") align 16 %5, ptr noundef nonnull byval(%"struct.geometry::line") align 16 %6, ptr noundef nonnull byval(%"struct.geometry::point") align 16 %4)
  call void @_Z5printIeJeEEvRKT_DpRKT0_(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  %14 = add nuw nsw i64 %.03, 1
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %14, %16
  br i1 %17, label %12, label %._crit_edge, !llvm.loop !9
}

; 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 @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIeJeEEvRKT_DpRKT0_(ptr noundef nonnull align 16 dereferenceable(16), 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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