; LLVM IR from indjev99/Evolving-Snakes :: sources/snake.ll (ZN5snake11moveForwardEv)

; 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.block = type { %struct.point, i32 }
%struct.point = type { i32, i32 }
%struct.snake = type { %"class.std::__cxx11::basic_string", i32, double, double, double, double, double, i32, i32, i32, i8, i8, %"class.std::vector", ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<block, std::allocator<block>>::_Vector_impl" }
%"struct.std::_Vector_base<block, std::allocator<block>>::_Vector_impl" = type { %"struct.std::_Vector_base<block, std::allocator<block>>::_Vector_impl_data" }
%"struct.std::_Vector_base<block, std::allocator<block>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN5snake10MAX_ENERGYE = external dso_local global i32, 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: 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 void @_ZNSt6vectorI5blockSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5snake11moveForwardEv(ptr noundef nonnull align 8 dereferenceable(128) %0) #1 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca %struct.block, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 7
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = icmp ne i32 %8, 0
  br i1 %9, label %10, label %49

10:                                               ; preds = %1
  %11 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 7
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = icmp slt i32 %12, -1
  br i1 %13, label %14, label %39

14:                                               ; preds = %10
  %15 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 7
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %15, align 8, !tbaa !9
  %18 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 2
  %19 = load double, ptr %18, align 8, !tbaa !21
  %20 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 7
  %21 = load i32, ptr %20, align 8, !tbaa !9
  %22 = sub nsw i32 0, %21
  %23 = sitofp i32 %22 to double
  %24 = fdiv double %19, %23
  %25 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 2
  %26 = load double, ptr %25, align 8, !tbaa !21
  %27 = fsub double %26, %24
  store double %27, ptr %25, align 8, !tbaa !21
  %28 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 5
  %29 = load double, ptr %28, align 8, !tbaa !22
  %30 = fsub double 1.000000e+00, %29
  %31 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 7
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = sub nsw i32 0, %32
  %34 = sitofp i32 %33 to double
  %35 = fdiv double %30, %34
  %36 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 5
  %37 = load double, ptr %36, align 8, !tbaa !22
  %38 = fadd double %37, %35
  store double %38, ptr %36, align 8, !tbaa !22
  store i1 false, ptr %2, align 1
  br label %149

39:                                               ; preds = %10
  %40 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 7
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %47

43:                                               ; preds = %39
  %44 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 7
  %45 = load i32, ptr %44, align 8, !tbaa !9
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %44, align 8, !tbaa !9
  store i1 false, ptr %2, align 1
  br label %149

47:                                               ; preds = %39
  br label %48

48:                                               ; preds = %47
  store i1 true, ptr %2, align 1
  br label %149

49:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #5
  %50 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %51 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %52 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #5
  %53 = sub i64 %52, 1
  %54 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %53) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %54, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %55 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %56 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #5
  %57 = sub i64 %56, 1
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %5, align 4, !tbaa !23
  br label %59

59:                                               ; preds = %73, %49
  %60 = load i32, ptr %5, align 4, !tbaa !23
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %76

63:                                               ; preds = %59
  %64 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %65 = load i32, ptr %5, align 4, !tbaa !23
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %67) #5
  %69 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %70 = load i32, ptr %5, align 4, !tbaa !23
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %72, ptr align 4 %68, i64 12, i1 false)
  br label %73

73:                                               ; preds = %63
  %74 = load i32, ptr %5, align 4, !tbaa !23
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %5, align 4, !tbaa !23
  br label %59, !llvm.loop !24

76:                                               ; preds = %62
  %77 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %78 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef 0) #5
  %79 = getelementptr inbounds %struct.block, ptr %78, i32 0, i32 1
  store i32 0, ptr %79, align 4, !tbaa !26
  %80 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 9
  %81 = load i32, ptr %80, align 8, !tbaa !29
  %82 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef 0) #5
  call void @_ZN5pointpLEi(ptr noundef nonnull align 4 dereferenceable(8) %83, i32 noundef %81)
  %84 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 8
  %85 = load i32, ptr %84, align 4, !tbaa !30
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %84, align 4, !tbaa !30
  br label %87

87:                                               ; preds = %92, %76
  %88 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 8
  %89 = load i32, ptr %88, align 4, !tbaa !30
  %90 = load i32, ptr @_ZN5snake10MAX_ENERGYE, align 4, !tbaa !23
  %91 = icmp sge i32 %89, %90
  br i1 %91, label %92, label %102

92:                                               ; preds = %87
  %93 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %94 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef 0) #5
  %95 = getelementptr inbounds %struct.block, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !26
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr %95, align 4, !tbaa !26
  %98 = load i32, ptr @_ZN5snake10MAX_ENERGYE, align 4, !tbaa !23
  %99 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 8
  %100 = load i32, ptr %99, align 4, !tbaa !30
  %101 = sub nsw i32 %100, %98
  store i32 %101, ptr %99, align 4, !tbaa !30
  br label %87, !llvm.loop !31

102:                                              ; preds = %87
  %103 = getelementptr inbounds %struct.block, ptr %4, i32 0, i32 1
  %104 = load i32, ptr %103, align 4, !tbaa !26
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %106, label %111

106:                                              ; preds = %102
  %107 = getelementptr inbounds %struct.block, ptr %4, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !26
  %109 = add nsw i32 %108, -1
  store i32 %109, ptr %107, align 4, !tbaa !26
  %110 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  call void @_ZNSt6vectorI5blockSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %110, ptr noundef nonnull align 4 dereferenceable(12) %4)
  br label %111

111:                                              ; preds = %106, %102
  %112 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %113 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %114 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %113) #5
  %115 = sub i64 %114, 1
  %116 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %112, i64 noundef %115) #5
  %117 = getelementptr inbounds %struct.block, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !26
  %119 = icmp slt i32 %118, 0
  br i1 %119, label %120, label %148

120:                                              ; preds = %111
  %121 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %122 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %121) #5
  %123 = icmp ugt i64 %122, 1
  br i1 %123, label %124, label %145

124:                                              ; preds = %120
  %125 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %126 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %127 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %126) #5
  %128 = sub i64 %127, 1
  %129 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %125, i64 noundef %128) #5
  %130 = getelementptr inbounds %struct.block, ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !26
  %132 = add nsw i32 %131, 1
  %133 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %134 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %135 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %134) #5
  %136 = sub i64 %135, 2
  %137 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %133, i64 noundef %136) #5
  %138 = getelementptr inbounds %struct.block, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !26
  %140 = add nsw i32 %139, %132
  store i32 %140, ptr %138, align 4, !tbaa !26
  %141 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %142 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  %143 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %142) #5
  %144 = sub i64 %143, 1
  call void @_ZNSt6vectorI5blockSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %141, i64 noundef %144)
  br label %147

145:                                              ; preds = %120
  call void @_ZN5snake3dieEb(ptr noundef nonnull align 8 dereferenceable(128) %6, i1 noundef zeroext false)
  %146 = getelementptr inbounds %struct.snake, ptr %6, i32 0, i32 12
  call void @_ZNSt6vectorI5blockSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %146, i64 noundef 0)
  br label %147

147:                                              ; preds = %145, %124
  br label %148

148:                                              ; preds = %147, %111
  store i1 false, ptr %2, align 1
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #5
  br label %149

149:                                              ; preds = %148, %48, %43, %14
  %150 = load i1, ptr %2, align 1
  ret i1 %150
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; 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) #3

declare void @_ZN5pointpLEi(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI5blockSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5snake3dieEb(ptr noundef nonnull align 8 dereferenceable(128), i1 noundef zeroext) #2 align 2

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

!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++ TBAA"}
!9 = !{!10, !14, i64 80}
!10 = !{!"_ZTS5snake", !11, i64 0, !14, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !14, i64 80, !14, i64 84, !14, i64 88, !16, i64 92, !16, i64 93, !17, i64 96, !6, i64 120}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt6vectorI5blockSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseI5blockSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!10, !15, i64 40}
!22 = !{!10, !15, i64 64}
!23 = !{!14, !14, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !14, i64 8}
!27 = !{!"_ZTS5block", !28, i64 0, !14, i64 8}
!28 = !{!"_ZTS5point", !14, i64 0, !14, i64 4}
!29 = !{!10, !14, i64 88}
!30 = !{!10, !14, i64 84}
!31 = distinct !{!31, !25}


; 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.block = type { %struct.point, i32 }
%struct.point = type { i32, i32 }

@_ZN5snake10MAX_ENERGYE = external dso_local local_unnamed_addr global i32, 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 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 void @_ZNSt6vectorI5blockSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5snake11moveForwardEv(ptr noundef nonnull align 8 dereferenceable(128) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %struct.block, align 4
  %3 = getelementptr inbounds i8, ptr %0, i64 80
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %24, label %5

5:                                                ; preds = %1
  %6 = icmp slt i32 %4, -1
  br i1 %6, label %7, label %20

7:                                                ; preds = %5
  %8 = add nuw nsw i32 %4, 1
  store i32 %8, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  %10 = load double, ptr %9, align 8, !tbaa !20
  %11 = xor i32 %4, -1
  %12 = uitofp nneg i32 %11 to double
  %13 = fdiv double %10, %12
  %14 = fsub double %10, %13
  store double %14, ptr %9, align 8, !tbaa !20
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  %16 = load double, ptr %15, align 8, !tbaa !21
  %17 = fsub double 1.000000e+00, %16
  %18 = fdiv double %17, %12
  %19 = fadd double %16, %18
  store double %19, ptr %15, align 8, !tbaa !21
  br label %87

20:                                               ; preds = %5
  %21 = icmp sgt i32 %4, 0
  br i1 %21, label %22, label %87

22:                                               ; preds = %20
  %23 = add nsw i32 %4, -1
  store i32 %23, ptr %3, align 8, !tbaa !5
  br label %87

24:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %25 = getelementptr inbounds i8, ptr %0, i64 96
  %26 = tail call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %27 = add i64 %26, -1
  %28 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %27) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %28, i64 12, i1 false)
  %29 = tail call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %30 = trunc i64 %29 to i32
  %.09 = add i32 %30, -1
  %31 = icmp sgt i32 %.09, 0
  br i1 %31, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %24
  %32 = zext nneg i32 %.09 to i64
  %33 = and i64 %29, 4294967295
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %24
  %34 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef 0) #5
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  store i32 0, ptr %35, align 4, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %0, i64 88
  %37 = load i32, ptr %36, align 8, !tbaa !25
  %38 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef 0) #5
  tail call void @_ZN5pointpLEi(ptr noundef nonnull align 4 dereferenceable(8) %38, i32 noundef %37)
  %39 = getelementptr inbounds i8, ptr %0, i64 84
  %40 = load i32, ptr %39, align 4, !tbaa !26
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %39, align 4, !tbaa !26
  %42 = load i32, ptr @_ZN5snake10MAX_ENERGYE, align 4, !tbaa !27
  %.not812 = icmp slt i32 %41, %42
  br i1 %.not812, label %._crit_edge15, label %.lr.ph14

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv16 = phi i64 [ %33, %.lr.ph.preheader ], [ %indvars.iv.next17, %.lr.ph ]
  %indvars.iv = phi i64 [ %32, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %43 = add i64 %indvars.iv16, 4294967294
  %44 = and i64 %43, 4294967295
  %45 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %44) #5
  %46 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %indvars.iv) #5
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %46, ptr noundef nonnull align 4 dereferenceable(12) %45, i64 12, i1 false)
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %47 = icmp ugt i64 %indvars.iv, 1
  %indvars.iv.next17 = add nsw i64 %indvars.iv16, -1
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !28

.lr.ph14:                                         ; preds = %._crit_edge, %.lr.ph14
  %48 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef 0) #5
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load i32, ptr %49, align 4, !tbaa !22
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %49, align 4, !tbaa !22
  %52 = load i32, ptr @_ZN5snake10MAX_ENERGYE, align 4, !tbaa !27
  %53 = load i32, ptr %39, align 4, !tbaa !26
  %54 = sub nsw i32 %53, %52
  store i32 %54, ptr %39, align 4, !tbaa !26
  %.not8 = icmp slt i32 %54, %52
  br i1 %.not8, label %._crit_edge15, label %.lr.ph14, !llvm.loop !30

._crit_edge15:                                    ; preds = %.lr.ph14, %._crit_edge
  %55 = getelementptr inbounds i8, ptr %2, i64 8
  %56 = load i32, ptr %55, align 4, !tbaa !22
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %60

58:                                               ; preds = %._crit_edge15
  %59 = add nsw i32 %56, -1
  store i32 %59, ptr %55, align 4, !tbaa !22
  call void @_ZNSt6vectorI5blockSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br label %60

60:                                               ; preds = %58, %._crit_edge15
  %61 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %62 = add i64 %61, -1
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %62) #5
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load i32, ptr %64, align 4, !tbaa !22
  %66 = icmp slt i32 %65, 0
  br i1 %66, label %67, label %86

67:                                               ; preds = %60
  %68 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %69 = icmp ugt i64 %68, 1
  br i1 %69, label %70, label %85

70:                                               ; preds = %67
  %71 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %72 = add i64 %71, -1
  %73 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %72) #5
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = load i32, ptr %74, align 4, !tbaa !22
  %76 = add nsw i32 %75, 1
  %77 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %78 = add i64 %77, -2
  %79 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5blockSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %78) #5
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = load i32, ptr %80, align 4, !tbaa !22
  %82 = add nsw i32 %76, %81
  store i32 %82, ptr %80, align 4, !tbaa !22
  %83 = call noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #5
  %84 = add i64 %83, -1
  br label %.sink.split

85:                                               ; preds = %67
  call void @_ZN5snake3dieEb(ptr noundef nonnull align 8 dereferenceable(128) %0, i1 noundef zeroext false)
  br label %.sink.split

.sink.split:                                      ; preds = %85, %70
  %.sink = phi i64 [ %84, %70 ], [ 0, %85 ]
  call void @_ZNSt6vectorI5blockSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %.sink)
  br label %86

86:                                               ; preds = %.sink.split, %60
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  br label %87

87:                                               ; preds = %20, %86, %22, %7
  %.05 = phi i1 [ false, %7 ], [ false, %22 ], [ false, %86 ], [ true, %20 ]
  ret i1 %.05
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI5blockSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress 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) #3

declare void @_ZN5pointpLEi(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI5blockSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5snake3dieEb(ptr noundef nonnull align 8 dereferenceable(128), i1 noundef zeroext) local_unnamed_addr #2 align 2

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

!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, !13, i64 80}
!6 = !{!"_ZTS5snake", !7, i64 0, !13, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !13, i64 80, !13, i64 84, !13, i64 88, !15, i64 92, !15, i64 93, !16, i64 96, !9, i64 120}
!7 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !8, i64 0, !12, i64 8, !10, i64 16}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"int", !10, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"_ZTSSt6vectorI5blockSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseI5blockSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!20 = !{!6, !14, i64 40}
!21 = !{!6, !14, i64 64}
!22 = !{!23, !13, i64 8}
!23 = !{!"_ZTS5block", !24, i64 0, !13, i64 8}
!24 = !{!"_ZTS5point", !13, i64 0, !13, i64 4}
!25 = !{!6, !13, i64 88}
!26 = !{!6, !13, i64 84}
!27 = !{!13, !13, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass