; LLVM IR from indjev99/Evolving-Snakes :: sources/draw.ll (Z10drawWindowP10GLFWwindowRSt6vectorI5snakeSaIS2_EERS1_I4foodSaIS6_EEii)

; 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.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 }

@BACKGROUND_COLOUR_R = external constant double, align 8
@BACKGROUND_COLOUR_G = external constant double, align 8
@BACKGROUND_COLOUR_B = external constant double, align 8
@pressed = external 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

declare void @glVertex2f(float noundef, float noundef) #1

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

declare void @glColor3f(float noundef, float noundef, float noundef) #1

declare void @glBegin(i32 noundef) #1

declare void @glEnd() #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8drawFoodR4food(ptr noundef nonnull align 8 dereferenceable(37)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10drawWindowP10GLFWwindowRSt6vectorI5snakeSaIS2_EERS1_I4foodSaIS6_EEii(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3, i32 noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  call void @glfwSetWindowShouldClose(ptr noundef %16, i32 noundef 0)
  store i32 -1, ptr @pressed, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  call void @glfwMakeContextCurrent(ptr noundef %17)
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  call void @glfwGetFramebufferSize(ptr noundef %18, ptr noundef %12, ptr noundef %13)
  %19 = load i32, ptr %12, align 4, !tbaa !9
  %20 = sitofp i32 %19 to float
  %21 = load i32, ptr %13, align 4, !tbaa !9
  %22 = sitofp i32 %21 to float
  %23 = fdiv float %20, %22
  store float %23, ptr %11, align 4, !tbaa !11
  %24 = load i32, ptr %12, align 4, !tbaa !9
  %25 = load i32, ptr %13, align 4, !tbaa !9
  call void @glViewport(i32 noundef 0, i32 noundef 0, i32 noundef %24, i32 noundef %25)
  call void @glClear(i32 noundef 16384)
  call void @glMatrixMode(i32 noundef 5889)
  call void @glLoadIdentity()
  %26 = load float, ptr %11, align 4, !tbaa !11
  %27 = fneg float %26
  %28 = fpext float %27 to double
  %29 = load float, ptr %11, align 4, !tbaa !11
  %30 = fpext float %29 to double
  call void @glOrtho(double noundef %28, double noundef %30, double noundef -1.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00, double noundef -1.000000e+00)
  call void @glMatrixMode(i32 noundef 5888)
  call void @glLoadIdentity()
  %31 = load double, ptr @BACKGROUND_COLOUR_R, align 8, !tbaa !13
  %32 = fptrunc double %31 to float
  %33 = load double, ptr @BACKGROUND_COLOUR_G, align 8, !tbaa !13
  %34 = fptrunc double %33 to float
  %35 = load double, ptr @BACKGROUND_COLOUR_B, align 8, !tbaa !13
  %36 = fptrunc double %35 to float
  call void @glColor3f(float noundef %32, float noundef %34, float noundef %36)
  call void @glBegin(i32 noundef 7)
  call void @glVertex2f(float noundef -1.000000e+00, float noundef -1.000000e+00)
  call void @glVertex2f(float noundef 1.000000e+00, float noundef -1.000000e+00)
  call void @glVertex2f(float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @glVertex2f(float noundef -1.000000e+00, float noundef 1.000000e+00)
  call void @glEnd()
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %89, %5
  %38 = load i32, ptr %14, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call noundef i64 @_ZNKSt6vectorI5snakeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #4
  %42 = icmp ult i64 %39, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %92

44:                                               ; preds = %37
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %80, label %47

47:                                               ; preds = %44
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = icmp eq i32 %48, 1
  br i1 %49, label %50, label %58

50:                                               ; preds = %47
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load i32, ptr %14, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %53) #4
  %55 = getelementptr inbounds %struct.snake, ptr %54, i32 0, i32 7
  %56 = load i32, ptr %55, align 8, !tbaa !15
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %80, label %58

58:                                               ; preds = %50, %47
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 2
  br i1 %60, label %61, label %69

61:                                               ; preds = %58
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %64) #4
  %66 = getelementptr inbounds %struct.snake, ptr %65, i32 0, i32 7
  %67 = load i32, ptr %66, align 8, !tbaa !15
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %80, label %69

69:                                               ; preds = %61, %58
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = icmp eq i32 %70, 3
  br i1 %71, label %72, label %88

72:                                               ; preds = %69
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %75) #4
  %77 = getelementptr inbounds %struct.snake, ptr %76, i32 0, i32 7
  %78 = load i32, ptr %77, align 8, !tbaa !15
  %79 = icmp slt i32 %78, 0
  br i1 %79, label %80, label %88

80:                                               ; preds = %72, %61, %50, %44
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load i32, ptr %14, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %83) #4
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = icmp eq i32 %85, %86
  call void @_Z9drawSnakeR5snakeb(ptr noundef nonnull align 8 dereferenceable(128) %84, i1 noundef zeroext %87)
  br label %88

88:                                               ; preds = %80, %72, %69
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %14, align 4, !tbaa !9
  br label %37, !llvm.loop !25

92:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %109, %92
  %94 = load i32, ptr %15, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = call noundef i64 @_ZNKSt6vectorI4foodSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #4
  %98 = icmp ult i64 %95, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %112

100:                                              ; preds = %93
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %108

103:                                              ; preds = %100
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(37) ptr @_ZNSt6vectorI4foodSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106) #4
  call void @_Z8drawFoodR4food(ptr noundef nonnull align 8 dereferenceable(37) %107)
  br label %108

108:                                              ; preds = %103, %100
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %15, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %15, align 4, !tbaa !9
  br label %93, !llvm.loop !27

112:                                              ; preds = %99
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  call void @glfwSwapBuffers(ptr noundef %113)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret void
}

declare void @glfwSetWindowShouldClose(ptr noundef, i32 noundef) #1

declare void @glfwMakeContextCurrent(ptr noundef) #1

declare void @glfwGetFramebufferSize(ptr noundef, ptr noundef, ptr noundef) #1

declare void @glViewport(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @glClear(i32 noundef) #1

declare void @glMatrixMode(i32 noundef) #1

declare void @glLoadIdentity() #1

declare void @glOrtho(double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) #1

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

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

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

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

declare void @glfwSwapBuffers(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !10, i64 80}
!16 = !{!"_ZTS5snake", !17, i64 0, !10, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !20, i64 92, !20, i64 93, !21, i64 96, !6, i64 120}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !19, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSSt6vectorI5blockSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseI5blockSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; 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"

@BACKGROUND_COLOUR_R = external local_unnamed_addr constant double, align 8
@BACKGROUND_COLOUR_G = external local_unnamed_addr constant double, align 8
@BACKGROUND_COLOUR_B = external local_unnamed_addr constant double, align 8
@pressed = external 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

declare void @glVertex2f(float noundef, float noundef) local_unnamed_addr #1

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

declare void @glColor3f(float noundef, float noundef, float noundef) local_unnamed_addr #1

declare void @glBegin(i32 noundef) local_unnamed_addr #1

declare void @glEnd() local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8drawFoodR4food(ptr noundef nonnull align 8 dereferenceable(37)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10drawWindowP10GLFWwindowRSt6vectorI5snakeSaIS2_EERS1_I4foodSaIS6_EEii(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  tail call void @glfwSetWindowShouldClose(ptr noundef %0, i32 noundef 0)
  store i32 -1, ptr @pressed, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  tail call void @glfwMakeContextCurrent(ptr noundef %0)
  call void @glfwGetFramebufferSize(ptr noundef %0, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %8 = load i32, ptr %6, align 4, !tbaa !5
  %9 = sitofp i32 %8 to float
  %10 = load i32, ptr %7, align 4, !tbaa !5
  %11 = sitofp i32 %10 to float
  %12 = fdiv float %9, %11
  call void @glViewport(i32 noundef 0, i32 noundef 0, i32 noundef %8, i32 noundef %10)
  call void @glClear(i32 noundef 16384)
  call void @glMatrixMode(i32 noundef 5889)
  call void @glLoadIdentity()
  %13 = fneg float %12
  %14 = fpext float %13 to double
  %15 = fpext float %12 to double
  call void @glOrtho(double noundef %14, double noundef %15, double noundef -1.000000e+00, double noundef 1.000000e+00, double noundef 1.000000e+00, double noundef -1.000000e+00)
  call void @glMatrixMode(i32 noundef 5888)
  call void @glLoadIdentity()
  %16 = load double, ptr @BACKGROUND_COLOUR_R, align 8, !tbaa !9
  %17 = fptrunc double %16 to float
  %18 = load double, ptr @BACKGROUND_COLOUR_G, align 8, !tbaa !9
  %19 = fptrunc double %18 to float
  %20 = load double, ptr @BACKGROUND_COLOUR_B, align 8, !tbaa !9
  %21 = fptrunc double %20 to float
  call void @glColor3f(float noundef %17, float noundef %19, float noundef %21)
  call void @glBegin(i32 noundef 7)
  call void @glVertex2f(float noundef -1.000000e+00, float noundef -1.000000e+00)
  call void @glVertex2f(float noundef 1.000000e+00, float noundef -1.000000e+00)
  call void @glVertex2f(float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @glVertex2f(float noundef -1.000000e+00, float noundef 1.000000e+00)
  call void @glEnd()
  %22 = call noundef i64 @_ZNKSt6vectorI5snakeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %.not = icmp eq i64 %22, 0
  br i1 %.not, label %.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %5
  %23 = zext i32 %4 to i64
  br label %.lr.ph

.preheader:                                       ; preds = %47, %5
  %24 = call noundef i64 @_ZNKSt6vectorI4foodSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not35 = icmp eq i64 %24, 0
  br i1 %.not35, label %._crit_edge, label %.lr.ph34

.lr.ph34:                                         ; preds = %.preheader
  %25 = icmp eq i32 %3, 0
  br i1 %25, label %.lr.ph34.split.us, label %.lr.ph34.split

.lr.ph34.split.us:                                ; preds = %.lr.ph34, %.lr.ph34.split.us
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %.lr.ph34.split.us ], [ 0, %.lr.ph34 ]
  %26 = call noundef nonnull align 8 dereferenceable(37) ptr @_ZNSt6vectorI4foodSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv41) #4
  call void @_Z8drawFoodR4food(ptr noundef nonnull align 8 dereferenceable(37) %26)
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %27 = call noundef i64 @_ZNKSt6vectorI4foodSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %28 = icmp ugt i64 %27, %indvars.iv.next42
  br i1 %28, label %.lr.ph34.split.us, label %._crit_edge, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph.preheader, %47
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %47 ]
  switch i32 %3, label %47 [
    i32 0, label %44
    i32 1, label %29
    i32 2, label %34
    i32 3, label %39
  ]

29:                                               ; preds = %.lr.ph
  %30 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %31 = getelementptr inbounds i8, ptr %30, i64 80
  %32 = load i32, ptr %31, align 8, !tbaa !13
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %44, label %47

34:                                               ; preds = %.lr.ph
  %35 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %36 = getelementptr inbounds i8, ptr %35, i64 80
  %37 = load i32, ptr %36, align 8, !tbaa !13
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %44, label %47

39:                                               ; preds = %.lr.ph
  %40 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %41 = getelementptr inbounds i8, ptr %40, i64 80
  %42 = load i32, ptr %41, align 8, !tbaa !13
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %.lr.ph, %39, %34, %29
  %45 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI5snakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %46 = icmp eq i64 %indvars.iv, %23
  call void @_Z9drawSnakeR5snakeb(ptr noundef nonnull align 8 dereferenceable(128) %45, i1 noundef zeroext %46)
  br label %47

47:                                               ; preds = %34, %29, %.lr.ph, %39, %44
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = call noundef i64 @_ZNKSt6vectorI5snakeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %49 = icmp ugt i64 %48, %indvars.iv.next
  br i1 %49, label %.lr.ph, label %.preheader, !llvm.loop !24

._crit_edge:                                      ; preds = %.lr.ph34.split, %.lr.ph34.split.us, %.preheader
  call void @glfwSwapBuffers(ptr noundef %0)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  ret void

.lr.ph34.split:                                   ; preds = %.lr.ph34, %.lr.ph34.split
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %.lr.ph34.split ], [ 0, %.lr.ph34 ]
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %50 = call noundef i64 @_ZNKSt6vectorI4foodSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %51 = icmp ugt i64 %50, %indvars.iv.next39
  br i1 %51, label %.lr.ph34.split, label %._crit_edge, !llvm.loop !11
}

declare void @glfwSetWindowShouldClose(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #1

declare void @glfwGetFramebufferSize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @glViewport(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @glClear(i32 noundef) local_unnamed_addr #1

declare void @glMatrixMode(i32 noundef) local_unnamed_addr #1

declare void @glLoadIdentity() local_unnamed_addr #1

declare void @glOrtho(double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

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

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

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

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

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 80}
!14 = !{!"_ZTS5snake", !15, i64 0, !6, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !19, i64 92, !19, i64 93, !20, i64 96, !17, i64 120}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !18, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSSt6vectorI5blockSaIS0_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseI5blockSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI5blockSaIS0_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!24 = distinct !{!24, !12}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass