; LLVM IR from MtSaka/library :: test/aoj/CGL/CGL_2_C.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 @_ZN8geometry10crosspointENS_4lineES0_(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::line") align 16) #3

; 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::line", align 16
  %9 = alloca %"struct.geometry::point", align 16
  %10 = alloca %"struct.geometry::point", align 16
  %11 = alloca %"struct.geometry::line", align 16
  %12 = alloca %"struct.geometry::point", align 16
  %13 = alloca %"struct.geometry::point", align 16
  %14 = alloca %"struct.geometry::point", align 16
  %15 = alloca %"struct.geometry::line", align 16
  %16 = alloca %"struct.geometry::line", 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 = %30, %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 %33

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 @_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.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 @_ZN8geometry4lineC2ENS_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 32, 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
  call void @_ZN8geometry10crosspointENS_4lineES0_(ptr dead_on_unwind writable sret(%"struct.geometry::point") align 16 %14, ptr noundef byval(%"struct.geometry::line") align 16 %15, ptr noundef byval(%"struct.geometry::line") align 16 %16)
  %28 = getelementptr inbounds %"struct.geometry::point", ptr %14, i32 0, i32 0
  %29 = getelementptr inbounds %"struct.geometry::point", ptr %14, i32 0, i32 1
  call void @_Z5printIeJeEEvRKT_DpRKT0_(ptr noundef nonnull align 16 dereferenceable(16) %28, ptr noundef nonnull align 16 dereferenceable(16) %29)
  call void @llvm.lifetime.end.p0(i64 32, 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 %30

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

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

; 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 @_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 = !{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::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 @_ZN8geometry10crosspointENS_4lineES0_(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::line") align 16) local_unnamed_addr #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::line", align 16
  %7 = alloca %"struct.geometry::line", align 16
  %8 = alloca %"struct.geometry::point", 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

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

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

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

; 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 @_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