; LLVM IR from blat-blatnik/GPU-Life :: main (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.gladGLversionStruct = type { i32, i32 }

@vsyncIsOn = external dso_local global i8, align 1
@updatesPerFrame = external dso_local global i32, align 4
@framesPerUpdate = external dso_local global i32, align 4
@vertShaderSource = external dso_local global ptr, align 8
@renderShaderSource = external dso_local global ptr, align 8
@updateShaderSource = external dso_local global ptr, align 8
@stderr = external global ptr, align 8
@maxTextureSize = external dso_local global i32, align 4
@patternName = external dso_local global ptr, align 8
@window = external dso_local global ptr, align 8
@cellsWriteFramebuffer = external dso_local global i32, align 4
@numCellsX = external dso_local global i32, align 4
@numCellsY = external dso_local global i32, align 4
@updateProgram = external dso_local global i32, align 4
@cellsRead = external dso_local global i32, align 4
@cellsWrite = external dso_local global i32, align 4
@cellsReadFramebuffer = external dso_local global i32, align 4
@generation = external dso_local global i32, align 4
@glad_glGetError = external global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [62 x i8], align 1
@windowWidth = external dso_local global i32, align 4
@windowHeight = external dso_local global i32, align 4
@renderProgram = external dso_local global i32, align 4
@uniformScale = external dso_local global i32, align 4
@uniformOffset = external dso_local global i32, align 4
@uniformBorderSize = external dso_local global i32, align 4
@uniformBackgroundColor = external dso_local global i32, align 4
@uniformDeadColor = external dso_local global i32, align 4
@uniformAliveColor = external dso_local global i32, align 4
@mouseX = external dso_local global double, align 8
@mouseY = external dso_local global double, align 8
@isRunning = external dso_local global i8, align 1
@.str.41 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [21 x i8], align 1
@glad_glGetString = external global ptr, align 8
@GLVersion = external global %struct.gladGLversionStruct, align 4
@.str.46 = external hidden unnamed_addr constant [52 x i8], align 1
@glad_glGetUniformLocation = external global ptr, align 8
@.str.47 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [11 x i8], align 1
@glad_glDeleteShader = external global ptr, align 8
@__const.main.quadData = external hidden unnamed_addr constant [4 x [2 x float]], align 16
@glad_glGenVertexArrays = external global ptr, align 8
@glad_glBindVertexArray = external global ptr, align 8
@glad_glGenBuffers = external global ptr, align 8
@glad_glBindBuffer = external global ptr, align 8
@glad_glBufferData = external global ptr, align 8
@glad_glGetAttribLocation = external global ptr, align 8
@.str.53 = external hidden unnamed_addr constant [9 x i8], align 1
@glad_glEnableVertexAttribArray = external global ptr, align 8
@glad_glVertexAttribPointer = external global ptr, align 8
@glad_glGetIntegerv = external global ptr, align 8
@.str.54 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [61 x i8], align 1
@glad_glDeleteTextures = external global ptr, align 8
@glad_glDeleteFramebuffers = external global ptr, align 8
@glad_glDeleteProgram = external global ptr, align 8
@glad_glDeleteVertexArrays = external global ptr, align 8
@glad_glDeleteBuffers = external global ptr, align 8

; Function Attrs: nounwind
declare void @free(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @compileShader(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

; Function Attrs: noreturn nounwind
declare void @abort() #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @linkShaderProgram(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @createTexture(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @createFramebuffer(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @ceilMultipleOf32(i32 noundef) #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) #4

; Function Attrs: nounwind uwtable
declare dso_local void @updateCells() #2

; Function Attrs: nounwind uwtable
declare dso_local void @renderCells() #2

; Function Attrs: nounwind uwtable
declare dso_local void @centerCellsOnScreen() #2

; Function Attrs: nounwind uwtable
declare dso_local void @clearCells() #2

; Function Attrs: nounwind uwtable
declare dso_local void @onGlfwError(i32 noundef, ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #5

; Function Attrs: nounwind uwtable
declare dso_local void @onFramebufferResized(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onMouseButton(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onMouseMove(ptr noundef, double noundef, double noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onMouseWheel(ptr noundef, double noundef, double noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onKey(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @glfwSwapInterval(i32 noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @onFileDragAndDrop(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [2 x i32], align 4
  %8 = alloca [2 x i32], align 4
  %9 = alloca [4 x [2 x float]], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca double, align 8
  %19 = alloca i64, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i64, align 8
  %23 = alloca double, align 8
  %24 = alloca i32, align 4
  %25 = alloca [512 x i8], align 16
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  %31 = call ptr @glfwSetErrorCallback(ptr noundef @onGlfwError)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %32 = call i32 @glfwInit()
  store i32 %32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %38, label %35

35:                                               ; preds = %0
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.41) #6
  call void @abort() #7
  unreachable

38:                                               ; preds = %0
  call void @glfwWindowHint(i32 noundef 135173, i32 noundef 0)
  call void @glfwWindowHint(i32 noundef 135174, i32 noundef 0)
  call void @glfwWindowHint(i32 noundef 139266, i32 noundef 3)
  call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0)
  call void @glfwWindowHint(i32 noundef 139270, i32 noundef 1)
  %39 = call ptr @glfwCreateWindow(i32 noundef 1280, i32 noundef 720, ptr noundef @.str.42, ptr noundef null, ptr noundef null)
  store ptr %39, ptr @window, align 8, !tbaa !9
  %40 = load ptr, ptr @window, align 8, !tbaa !9
  %41 = icmp ne ptr %40, null
  br i1 %41, label %45, label %42

42:                                               ; preds = %38
  %43 = load ptr, ptr @stderr, align 8, !tbaa !9
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.43) #6
  call void @abort() #7
  unreachable

45:                                               ; preds = %38
  %46 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %47 = call i32 @gladLoadGLLoader(ptr noundef @glfwGetProcAddress)
  store i32 %47, ptr %3, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %53, label %50

50:                                               ; preds = %45
  %51 = load ptr, ptr @stderr, align 8, !tbaa !9
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.44) #6
  call void @abort() #7
  unreachable

53:                                               ; preds = %45
  %54 = load ptr, ptr @glad_glGetString, align 8, !tbaa !9
  %55 = call ptr %54(i32 noundef 7938)
  %56 = load ptr, ptr @glad_glGetString, align 8, !tbaa !9
  %57 = call ptr %56(i32 noundef 7937)
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.45, ptr noundef %55, ptr noundef %57)
  %59 = load i32, ptr @GLVersion, align 4, !tbaa !11
  %60 = icmp slt i32 %59, 3
  br i1 %60, label %61, label %64

61:                                               ; preds = %53
  %62 = load ptr, ptr @stderr, align 8, !tbaa !9
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str.46) #6
  call void @abort() #7
  unreachable

64:                                               ; preds = %53
  %65 = load i8, ptr @vsyncIsOn, align 1, !tbaa !13
  %66 = zext i8 %65 to i32
  call void @glfwSwapInterval(i32 noundef %66)
  %67 = load ptr, ptr @window, align 8, !tbaa !9
  %68 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %67, ptr noundef @onFramebufferResized)
  %69 = load ptr, ptr @window, align 8, !tbaa !9
  %70 = call ptr @glfwSetKeyCallback(ptr noundef %69, ptr noundef @onKey)
  %71 = load ptr, ptr @window, align 8, !tbaa !9
  %72 = call ptr @glfwSetMouseButtonCallback(ptr noundef %71, ptr noundef @onMouseButton)
  %73 = load ptr, ptr @window, align 8, !tbaa !9
  %74 = call ptr @glfwSetCursorPosCallback(ptr noundef %73, ptr noundef @onMouseMove)
  %75 = load ptr, ptr @window, align 8, !tbaa !9
  %76 = call ptr @glfwSetScrollCallback(ptr noundef %75, ptr noundef @onMouseWheel)
  %77 = load ptr, ptr @window, align 8, !tbaa !9
  %78 = call ptr @glfwSetDropCallback(ptr noundef %77, ptr noundef @onFileDragAndDrop)
  %79 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwGetCursorPos(ptr noundef %79, ptr noundef @mouseX, ptr noundef @mouseY)
  %80 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwGetFramebufferSize(ptr noundef %80, ptr noundef @windowWidth, ptr noundef @windowHeight)
  %81 = load i32, ptr @windowHeight, align 4, !tbaa !5
  %82 = sitofp i32 %81 to double
  %83 = load double, ptr @mouseY, align 8, !tbaa !14
  %84 = fsub double %82, %83
  store double %84, ptr @mouseY, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %85 = load ptr, ptr @vertShaderSource, align 8, !tbaa !9
  %86 = call i32 @compileShader(i32 noundef 35633, ptr noundef %85)
  store i32 %86, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %87 = load ptr, ptr @renderShaderSource, align 8, !tbaa !9
  %88 = call i32 @compileShader(i32 noundef 35632, ptr noundef %87)
  store i32 %88, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %89 = load ptr, ptr @updateShaderSource, align 8, !tbaa !9
  %90 = call i32 @compileShader(i32 noundef 35632, ptr noundef %89)
  store i32 %90, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = getelementptr inbounds [2 x i32], ptr %7, i64 0, i64 0
  store i32 %91, ptr %92, align 4, !tbaa !5
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = getelementptr inbounds [2 x i32], ptr %7, i64 0, i64 1
  store i32 %93, ptr %94, align 4, !tbaa !5
  %95 = getelementptr inbounds [2 x i32], ptr %7, i64 0, i64 0
  %96 = call i32 @linkShaderProgram(ptr noundef %95, i32 noundef 2)
  store i32 %96, ptr @renderProgram, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 0
  store i32 %97, ptr %98, align 4, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 1
  store i32 %99, ptr %100, align 4, !tbaa !5
  %101 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 0
  %102 = call i32 @linkShaderProgram(ptr noundef %101, i32 noundef 2)
  store i32 %102, ptr @updateProgram, align 4, !tbaa !5
  %103 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %104 = load i32, ptr @renderProgram, align 4, !tbaa !5
  %105 = call i32 %103(i32 noundef %104, ptr noundef @.str.47)
  store i32 %105, ptr @uniformScale, align 4, !tbaa !5
  %106 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %107 = load i32, ptr @renderProgram, align 4, !tbaa !5
  %108 = call i32 %106(i32 noundef %107, ptr noundef @.str.48)
  store i32 %108, ptr @uniformOffset, align 4, !tbaa !5
  %109 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %110 = load i32, ptr @renderProgram, align 4, !tbaa !5
  %111 = call i32 %109(i32 noundef %110, ptr noundef @.str.49)
  store i32 %111, ptr @uniformBorderSize, align 4, !tbaa !5
  %112 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %113 = load i32, ptr @renderProgram, align 4, !tbaa !5
  %114 = call i32 %112(i32 noundef %113, ptr noundef @.str.50)
  store i32 %114, ptr @uniformBackgroundColor, align 4, !tbaa !5
  %115 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %116 = load i32, ptr @renderProgram, align 4, !tbaa !5
  %117 = call i32 %115(i32 noundef %116, ptr noundef @.str.51)
  store i32 %117, ptr @uniformDeadColor, align 4, !tbaa !5
  %118 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %119 = load i32, ptr @renderProgram, align 4, !tbaa !5
  %120 = call i32 %118(i32 noundef %119, ptr noundef @.str.52)
  store i32 %120, ptr @uniformAliveColor, align 4, !tbaa !5
  %121 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !9
  %122 = load i32, ptr %4, align 4, !tbaa !5
  call void %121(i32 noundef %122)
  %123 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !9
  %124 = load i32, ptr %5, align 4, !tbaa !5
  call void %123(i32 noundef %124)
  %125 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !9
  %126 = load i32, ptr %6, align 4, !tbaa !5
  call void %125(i32 noundef %126)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @__const.main.quadData, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %127 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !9
  call void %127(i32 noundef 1, ptr noundef %10)
  %128 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !9
  %129 = load i32, ptr %10, align 4, !tbaa !5
  call void %128(i32 noundef %129)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %130 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !9
  call void %130(i32 noundef 1, ptr noundef %11)
  %131 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !9
  %132 = load i32, ptr %11, align 4, !tbaa !5
  call void %131(i32 noundef 34962, i32 noundef %132)
  %133 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !9
  %134 = getelementptr inbounds [4 x [2 x float]], ptr %9, i64 0, i64 0
  %135 = getelementptr inbounds [2 x float], ptr %134, i64 0, i64 0
  call void %133(i32 noundef 34962, i64 noundef 32, ptr noundef %135, i32 noundef 35044)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %136 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !9
  %137 = load i32, ptr @updateProgram, align 4, !tbaa !5
  %138 = call i32 %136(i32 noundef %137, ptr noundef @.str.53)
  store i32 %138, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %139 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !9
  %140 = load i32, ptr @renderProgram, align 4, !tbaa !5
  %141 = call i32 %139(i32 noundef %140, ptr noundef @.str.53)
  store i32 %141, ptr %13, align 4, !tbaa !5
  %142 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !9
  %143 = load i32, ptr %12, align 4, !tbaa !5
  call void %142(i32 noundef %143)
  %144 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !9
  %145 = load i32, ptr %12, align 4, !tbaa !5
  call void %144(i32 noundef %145, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  %146 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !9
  %147 = load i32, ptr %13, align 4, !tbaa !5
  call void %146(i32 noundef %147)
  %148 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !9
  %149 = load i32, ptr %13, align 4, !tbaa !5
  call void %148(i32 noundef %149, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  %150 = load ptr, ptr @glad_glGetIntegerv, align 8, !tbaa !9
  call void %150(i32 noundef 3379, ptr noundef @maxTextureSize)
  %151 = call i32 @ceilMultipleOf32(i32 noundef 256)
  store i32 %151, ptr @numCellsX, align 4, !tbaa !5
  %152 = call i32 @ceilMultipleOf32(i32 noundef 256)
  store i32 %152, ptr @numCellsY, align 4, !tbaa !5
  %153 = load i32, ptr @numCellsX, align 4, !tbaa !5
  %154 = load i32, ptr @numCellsY, align 4, !tbaa !5
  %155 = sdiv i32 %154, 32
  %156 = call i32 @createTexture(ptr noundef null, i32 noundef %153, i32 noundef %155, i32 noundef 36244, i32 noundef 33334)
  store i32 %156, ptr @cellsRead, align 4, !tbaa !5
  %157 = load i32, ptr @numCellsX, align 4, !tbaa !5
  %158 = load i32, ptr @numCellsY, align 4, !tbaa !5
  %159 = sdiv i32 %158, 32
  %160 = call i32 @createTexture(ptr noundef null, i32 noundef %157, i32 noundef %159, i32 noundef 36244, i32 noundef 33334)
  store i32 %160, ptr @cellsWrite, align 4, !tbaa !5
  %161 = load i32, ptr @cellsRead, align 4, !tbaa !5
  %162 = call i32 @createFramebuffer(i32 noundef %161)
  store i32 %162, ptr @cellsReadFramebuffer, align 4, !tbaa !5
  %163 = load i32, ptr @cellsWrite, align 4, !tbaa !5
  %164 = call i32 @createFramebuffer(i32 noundef %163)
  store i32 %164, ptr @cellsWriteFramebuffer, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %166 = load ptr, ptr @glad_glGetError, align 8, !tbaa !9
  %167 = call i32 %166()
  store i32 %167, ptr %14, align 4, !tbaa !5
  %168 = load i32, ptr %14, align 4, !tbaa !5
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %182

170:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %171 = load i32, ptr %14, align 4, !tbaa !5
  switch i32 %171, label %177 [
    i32 1280, label %172
    i32 1281, label %173
    i32 1282, label %174
    i32 1285, label %175
    i32 1286, label %176
  ]

172:                                              ; preds = %170
  store ptr @.str.15, ptr %15, align 8, !tbaa !9
  br label %178

173:                                              ; preds = %170
  store ptr @.str.16, ptr %15, align 8, !tbaa !9
  br label %178

174:                                              ; preds = %170
  store ptr @.str.17, ptr %15, align 8, !tbaa !9
  br label %178

175:                                              ; preds = %170
  store ptr @.str.18, ptr %15, align 8, !tbaa !9
  br label %178

176:                                              ; preds = %170
  store ptr @.str.19, ptr %15, align 8, !tbaa !9
  br label %178

177:                                              ; preds = %170
  store ptr @.str.20, ptr %15, align 8, !tbaa !9
  br label %178

178:                                              ; preds = %177, %176, %175, %174, %173, %172
  %179 = load ptr, ptr @stderr, align 8, !tbaa !9
  %180 = load ptr, ptr %15, align 8, !tbaa !9
  %181 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.21, ptr noundef %180, ptr noundef @.str.22, i32 noundef 932) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %182

182:                                              ; preds = %178, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  call void @clearCells()
  call void @centerCellsOnScreen()
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store double 0.000000e+00, ptr %18, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %185 = call i64 @glfwGetTimerValue()
  store i64 %185, ptr %19, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %186 = call i64 @glfwGetTimerFrequency()
  %187 = uitofp i64 %186 to double
  store double %187, ptr %20, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %188 = load double, ptr %20, align 8, !tbaa !14
  %189 = fdiv double 1.000000e+00, %188
  store double %189, ptr %21, align 8, !tbaa !14
  br label %190

190:                                              ; preds = %276, %184
  %191 = load ptr, ptr @window, align 8, !tbaa !9
  %192 = call i32 @glfwWindowShouldClose(ptr noundef %191)
  %193 = icmp ne i32 %192, 0
  %194 = xor i1 %193, true
  br i1 %194, label %195, label %278

195:                                              ; preds = %190
  call void @glfwPollEvents()
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %196 = call i64 @glfwGetTimerValue()
  store i64 %196, ptr %22, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %197 = load i64, ptr %22, align 8, !tbaa !16
  %198 = load i64, ptr %19, align 8, !tbaa !16
  %199 = icmp ugt i64 %197, %198
  br i1 %199, label %200, label %204

200:                                              ; preds = %195
  %201 = load i64, ptr %22, align 8, !tbaa !16
  %202 = load i64, ptr %19, align 8, !tbaa !16
  %203 = sub i64 %201, %202
  br label %208

204:                                              ; preds = %195
  %205 = load i64, ptr %19, align 8, !tbaa !16
  %206 = load i64, ptr %22, align 8, !tbaa !16
  %207 = sub i64 %205, %206
  br label %208

208:                                              ; preds = %204, %200
  %209 = phi i64 [ %203, %200 ], [ %207, %204 ]
  %210 = uitofp i64 %209 to double
  %211 = load double, ptr %21, align 8, !tbaa !14
  %212 = fmul double %210, %211
  store double %212, ptr %23, align 8, !tbaa !14
  %213 = load i64, ptr %22, align 8, !tbaa !16
  store i64 %213, ptr %19, align 8, !tbaa !16
  %214 = load double, ptr %23, align 8, !tbaa !14
  %215 = load double, ptr %18, align 8, !tbaa !14
  %216 = fadd double %215, %214
  store double %216, ptr %18, align 8, !tbaa !14
  %217 = load i64, ptr %16, align 8, !tbaa !16
  %218 = add i64 %217, 1
  store i64 %218, ptr %16, align 8, !tbaa !16
  %219 = load i64, ptr %17, align 8, !tbaa !16
  %220 = add i64 %219, 1
  store i64 %220, ptr %17, align 8, !tbaa !16
  %221 = load i8, ptr @isRunning, align 1, !tbaa !13
  %222 = zext i8 %221 to i32
  %223 = icmp ne i32 %222, 0
  br i1 %223, label %224, label %240

224:                                              ; preds = %208
  %225 = load i64, ptr %16, align 8, !tbaa !16
  %226 = load i32, ptr @framesPerUpdate, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = icmp uge i64 %225, %227
  br i1 %228, label %229, label %240

229:                                              ; preds = %224
  store i64 0, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %236, %229
  %231 = load i32, ptr %24, align 4, !tbaa !5
  %232 = load i32, ptr @updatesPerFrame, align 4, !tbaa !5
  %233 = icmp slt i32 %231, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %239

235:                                              ; preds = %230
  call void @updateCells()
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %24, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %24, align 4, !tbaa !5
  br label %230, !llvm.loop !18

239:                                              ; preds = %234
  br label %240

240:                                              ; preds = %239, %224, %208
  call void @renderCells()
  %241 = load double, ptr %18, align 8, !tbaa !14
  %242 = fcmp ogt double %241, 5.000000e-02
  br i1 %242, label %243, label %276

243:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 512, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %244 = load i32, ptr @updatesPerFrame, align 4, !tbaa !5
  %245 = icmp sgt i32 %244, 1
  br i1 %245, label %246, label %249

246:                                              ; preds = %243
  %247 = load i32, ptr @updatesPerFrame, align 4, !tbaa !5
  %248 = sitofp i32 %247 to double
  br label %253

249:                                              ; preds = %243
  %250 = load i32, ptr @framesPerUpdate, align 4, !tbaa !5
  %251 = sitofp i32 %250 to double
  %252 = fdiv double 1.000000e+00, %251
  br label %253

253:                                              ; preds = %249, %246
  %254 = phi double [ %248, %246 ], [ %252, %249 ]
  store double %254, ptr %26, align 8, !tbaa !14
  %255 = load i8, ptr @isRunning, align 1, !tbaa !13
  %256 = icmp ne i8 %255, 0
  br i1 %256, label %257, label %267

257:                                              ; preds = %253
  %258 = getelementptr inbounds [512 x i8], ptr %25, i64 0, i64 0
  %259 = load ptr, ptr @patternName, align 8, !tbaa !9
  %260 = load double, ptr %26, align 8, !tbaa !14
  %261 = load i64, ptr %17, align 8, !tbaa !16
  %262 = uitofp i64 %261 to double
  %263 = load double, ptr %18, align 8, !tbaa !14
  %264 = fdiv double %262, %263
  %265 = load i32, ptr @generation, align 4, !tbaa !5
  %266 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %258, i64 noundef 512, ptr noundef @.str.54, ptr noundef %259, double noundef %260, double noundef %264, i32 noundef %265) #6
  br label %273

267:                                              ; preds = %253
  %268 = getelementptr inbounds [512 x i8], ptr %25, i64 0, i64 0
  %269 = load ptr, ptr @patternName, align 8, !tbaa !9
  %270 = load double, ptr %26, align 8, !tbaa !14
  %271 = load i32, ptr @generation, align 4, !tbaa !5
  %272 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %268, i64 noundef 512, ptr noundef @.str.55, ptr noundef %269, double noundef %270, i32 noundef %271) #6
  br label %273

273:                                              ; preds = %267, %257
  %274 = load ptr, ptr @window, align 8, !tbaa !9
  %275 = getelementptr inbounds [512 x i8], ptr %25, i64 0, i64 0
  call void @glfwSetWindowTitle(ptr noundef %274, ptr noundef %275)
  store double 0.000000e+00, ptr %18, align 8, !tbaa !14
  store i64 0, ptr %17, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %25) #6
  br label %276

276:                                              ; preds = %273, %240
  %277 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %277)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %190, !llvm.loop !20

278:                                              ; preds = %190
  br label %279

279:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %280 = load ptr, ptr @glad_glGetError, align 8, !tbaa !9
  %281 = call i32 %280()
  store i32 %281, ptr %27, align 4, !tbaa !5
  %282 = load i32, ptr %27, align 4, !tbaa !5
  %283 = icmp ne i32 %282, 0
  br i1 %283, label %284, label %296

284:                                              ; preds = %279
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %285 = load i32, ptr %27, align 4, !tbaa !5
  switch i32 %285, label %291 [
    i32 1280, label %286
    i32 1281, label %287
    i32 1282, label %288
    i32 1285, label %289
    i32 1286, label %290
  ]

286:                                              ; preds = %284
  store ptr @.str.15, ptr %28, align 8, !tbaa !9
  br label %292

287:                                              ; preds = %284
  store ptr @.str.16, ptr %28, align 8, !tbaa !9
  br label %292

288:                                              ; preds = %284
  store ptr @.str.17, ptr %28, align 8, !tbaa !9
  br label %292

289:                                              ; preds = %284
  store ptr @.str.18, ptr %28, align 8, !tbaa !9
  br label %292

290:                                              ; preds = %284
  store ptr @.str.19, ptr %28, align 8, !tbaa !9
  br label %292

291:                                              ; preds = %284
  store ptr @.str.20, ptr %28, align 8, !tbaa !9
  br label %292

292:                                              ; preds = %291, %290, %289, %288, %287, %286
  %293 = load ptr, ptr @stderr, align 8, !tbaa !9
  %294 = load ptr, ptr %28, align 8, !tbaa !9
  %295 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %293, ptr noundef @.str.21, ptr noundef %294, ptr noundef @.str.22, i32 noundef 1008) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %296

296:                                              ; preds = %292, %279
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %297

297:                                              ; preds = %296
  br label %298

298:                                              ; preds = %297
  %299 = load ptr, ptr @glad_glDeleteTextures, align 8, !tbaa !9
  call void %299(i32 noundef 1, ptr noundef @cellsRead)
  %300 = load ptr, ptr @glad_glDeleteTextures, align 8, !tbaa !9
  call void %300(i32 noundef 1, ptr noundef @cellsWrite)
  %301 = load ptr, ptr @glad_glDeleteFramebuffers, align 8, !tbaa !9
  call void %301(i32 noundef 1, ptr noundef @cellsReadFramebuffer)
  %302 = load ptr, ptr @glad_glDeleteFramebuffers, align 8, !tbaa !9
  call void %302(i32 noundef 1, ptr noundef @cellsWriteFramebuffer)
  %303 = load ptr, ptr @glad_glDeleteProgram, align 8, !tbaa !9
  %304 = load i32, ptr @renderProgram, align 4, !tbaa !5
  call void %303(i32 noundef %304)
  %305 = load ptr, ptr @glad_glDeleteProgram, align 8, !tbaa !9
  %306 = load i32, ptr @updateProgram, align 4, !tbaa !5
  call void %305(i32 noundef %306)
  %307 = load ptr, ptr @glad_glDeleteVertexArrays, align 8, !tbaa !9
  call void %307(i32 noundef 1, ptr noundef %10)
  %308 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !9
  call void %308(i32 noundef 1, ptr noundef %11)
  br label %309

309:                                              ; preds = %298
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %310 = load ptr, ptr @glad_glGetError, align 8, !tbaa !9
  %311 = call i32 %310()
  store i32 %311, ptr %29, align 4, !tbaa !5
  %312 = load i32, ptr %29, align 4, !tbaa !5
  %313 = icmp ne i32 %312, 0
  br i1 %313, label %314, label %326

314:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %315 = load i32, ptr %29, align 4, !tbaa !5
  switch i32 %315, label %321 [
    i32 1280, label %316
    i32 1281, label %317
    i32 1282, label %318
    i32 1285, label %319
    i32 1286, label %320
  ]

316:                                              ; preds = %314
  store ptr @.str.15, ptr %30, align 8, !tbaa !9
  br label %322

317:                                              ; preds = %314
  store ptr @.str.16, ptr %30, align 8, !tbaa !9
  br label %322

318:                                              ; preds = %314
  store ptr @.str.17, ptr %30, align 8, !tbaa !9
  br label %322

319:                                              ; preds = %314
  store ptr @.str.18, ptr %30, align 8, !tbaa !9
  br label %322

320:                                              ; preds = %314
  store ptr @.str.19, ptr %30, align 8, !tbaa !9
  br label %322

321:                                              ; preds = %314
  store ptr @.str.20, ptr %30, align 8, !tbaa !9
  br label %322

322:                                              ; preds = %321, %320, %319, %318, %317, %316
  %323 = load ptr, ptr @stderr, align 8, !tbaa !9
  %324 = load ptr, ptr %30, align 8, !tbaa !9
  %325 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %323, ptr noundef @.str.21, ptr noundef %324, ptr noundef @.str.22, i32 noundef 1017) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %326

326:                                              ; preds = %322, %309
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %327

327:                                              ; preds = %326
  br label %328

328:                                              ; preds = %327
  %329 = load ptr, ptr @patternName, align 8, !tbaa !9
  call void @free(ptr noundef %329) #6
  %330 = load ptr, ptr @window, align 8, !tbaa !9
  call void @glfwDestroyWindow(ptr noundef %330)
  call void @glfwTerminate()
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

declare ptr @glfwSetErrorCallback(ptr noundef) #5

declare i32 @glfwInit() #5

declare void @glfwWindowHint(i32 noundef, i32 noundef) #5

declare ptr @glfwCreateWindow(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #5

declare void @glfwMakeContextCurrent(ptr noundef) #5

declare i32 @gladLoadGLLoader(ptr noundef) #5

declare ptr @glfwGetProcAddress(ptr noundef) #5

declare ptr @glfwSetFramebufferSizeCallback(ptr noundef, ptr noundef) #5

declare ptr @glfwSetKeyCallback(ptr noundef, ptr noundef) #5

declare ptr @glfwSetMouseButtonCallback(ptr noundef, ptr noundef) #5

declare ptr @glfwSetCursorPosCallback(ptr noundef, ptr noundef) #5

declare ptr @glfwSetScrollCallback(ptr noundef, ptr noundef) #5

declare ptr @glfwSetDropCallback(ptr noundef, ptr noundef) #5

declare void @glfwGetCursorPos(ptr noundef, ptr noundef, ptr noundef) #5

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

declare i64 @glfwGetTimerValue() #5

declare i64 @glfwGetTimerFrequency() #5

declare i32 @glfwWindowShouldClose(ptr noundef) #5

declare void @glfwPollEvents() #5

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #0

declare void @glfwSetWindowTitle(ptr noundef, ptr noundef) #5

declare void @glfwSwapBuffers(ptr noundef) #5

declare void @glfwDestroyWindow(ptr noundef) #5

declare void @glfwTerminate() #5

attributes #0 = { nounwind "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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { noreturn nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 }
attributes #7 = { noreturn 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"gladGLversionStruct", !6, i64 0, !6, i64 4}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.gladGLversionStruct = type { i32, i32 }

@vsyncIsOn = external dso_local local_unnamed_addr global i8, align 1
@updatesPerFrame = external dso_local local_unnamed_addr global i32, align 4
@framesPerUpdate = external dso_local local_unnamed_addr global i32, align 4
@vertShaderSource = external dso_local local_unnamed_addr global ptr, align 8
@renderShaderSource = external dso_local local_unnamed_addr global ptr, align 8
@updateShaderSource = external dso_local local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@maxTextureSize = external dso_local global i32, align 4
@patternName = external dso_local local_unnamed_addr global ptr, align 8
@window = external dso_local local_unnamed_addr global ptr, align 8
@cellsWriteFramebuffer = external dso_local global i32, align 4
@numCellsX = external dso_local local_unnamed_addr global i32, align 4
@numCellsY = external dso_local local_unnamed_addr global i32, align 4
@updateProgram = external dso_local local_unnamed_addr global i32, align 4
@cellsRead = external dso_local global i32, align 4
@cellsWrite = external dso_local global i32, align 4
@cellsReadFramebuffer = external dso_local global i32, align 4
@generation = external dso_local local_unnamed_addr global i32, align 4
@glad_glGetError = external local_unnamed_addr global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [62 x i8], align 1
@windowWidth = external dso_local global i32, align 4
@windowHeight = external dso_local global i32, align 4
@renderProgram = external dso_local local_unnamed_addr global i32, align 4
@uniformScale = external dso_local local_unnamed_addr global i32, align 4
@uniformOffset = external dso_local local_unnamed_addr global i32, align 4
@uniformBorderSize = external dso_local local_unnamed_addr global i32, align 4
@uniformBackgroundColor = external dso_local local_unnamed_addr global i32, align 4
@uniformDeadColor = external dso_local local_unnamed_addr global i32, align 4
@uniformAliveColor = external dso_local local_unnamed_addr global i32, align 4
@mouseX = external dso_local global double, align 8
@mouseY = external dso_local global double, align 8
@isRunning = external dso_local local_unnamed_addr global i8, align 1
@.str.41 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [21 x i8], align 1
@glad_glGetString = external local_unnamed_addr global ptr, align 8
@GLVersion = external local_unnamed_addr global %struct.gladGLversionStruct, align 4
@.str.46 = external hidden unnamed_addr constant [52 x i8], align 1
@glad_glGetUniformLocation = external local_unnamed_addr global ptr, align 8
@.str.47 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [11 x i8], align 1
@glad_glDeleteShader = external local_unnamed_addr global ptr, align 8
@__const.main.quadData = external hidden unnamed_addr constant [4 x [2 x float]], align 16
@glad_glGenVertexArrays = external local_unnamed_addr global ptr, align 8
@glad_glBindVertexArray = external local_unnamed_addr global ptr, align 8
@glad_glGenBuffers = external local_unnamed_addr global ptr, align 8
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glBufferData = external local_unnamed_addr global ptr, align 8
@glad_glGetAttribLocation = external local_unnamed_addr global ptr, align 8
@.str.53 = external hidden unnamed_addr constant [9 x i8], align 1
@glad_glEnableVertexAttribArray = external local_unnamed_addr global ptr, align 8
@glad_glVertexAttribPointer = external local_unnamed_addr global ptr, align 8
@glad_glGetIntegerv = external local_unnamed_addr global ptr, align 8
@.str.54 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [61 x i8], align 1
@glad_glDeleteTextures = external local_unnamed_addr global ptr, align 8
@glad_glDeleteFramebuffers = external local_unnamed_addr global ptr, align 8
@glad_glDeleteProgram = external local_unnamed_addr global ptr, align 8
@glad_glDeleteVertexArrays = external local_unnamed_addr global ptr, align 8
@glad_glDeleteBuffers = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @compileShader(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @linkShaderProgram(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @createTexture(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @createFramebuffer(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @ceilMultipleOf32(i32 noundef) local_unnamed_addr #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) #5

; Function Attrs: nounwind uwtable
declare dso_local void @updateCells() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @renderCells() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @centerCellsOnScreen() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @clearCells() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @onGlfwError(i32 noundef, ptr noundef) #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @onFramebufferResized(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onMouseButton(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onMouseMove(ptr noundef, double noundef, double noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onMouseWheel(ptr noundef, double noundef, double noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @onKey(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @glfwSwapInterval(i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @onFileDragAndDrop(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca [2 x i32], align 4
  %2 = alloca [2 x i32], align 4
  %3 = alloca [4 x [2 x float]], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [512 x i8], align 16
  %7 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @onGlfwError) #7
  %8 = tail call i32 @glfwInit() #7
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %12

9:                                                ; preds = %0
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.41) #8
  tail call void @abort() #9
  unreachable

12:                                               ; preds = %0
  tail call void @glfwWindowHint(i32 noundef 135173, i32 noundef 0) #7
  tail call void @glfwWindowHint(i32 noundef 135174, i32 noundef 0) #7
  tail call void @glfwWindowHint(i32 noundef 139266, i32 noundef 3) #7
  tail call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0) #7
  tail call void @glfwWindowHint(i32 noundef 139270, i32 noundef 1) #7
  %13 = tail call ptr @glfwCreateWindow(i32 noundef 1280, i32 noundef 720, ptr noundef nonnull @.str.42, ptr noundef null, ptr noundef null) #7
  store ptr %13, ptr @window, align 8, !tbaa !5
  %.not61 = icmp eq ptr %13, null
  br i1 %.not61, label %14, label %17

14:                                               ; preds = %12
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.43) #8
  tail call void @abort() #9
  unreachable

17:                                               ; preds = %12
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %13) #7
  %18 = tail call i32 @gladLoadGLLoader(ptr noundef nonnull @glfwGetProcAddress) #7
  %.not62 = icmp eq i32 %18, 0
  br i1 %.not62, label %19, label %22

19:                                               ; preds = %17
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.44) #8
  tail call void @abort() #9
  unreachable

22:                                               ; preds = %17
  %23 = load ptr, ptr @glad_glGetString, align 8, !tbaa !5
  %24 = tail call ptr %23(i32 noundef 7938) #7
  %25 = load ptr, ptr @glad_glGetString, align 8, !tbaa !5
  %26 = tail call ptr %25(i32 noundef 7937) #7
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.45, ptr noundef %24, ptr noundef %26)
  %28 = load i32, ptr @GLVersion, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 3
  br i1 %29, label %30, label %33

30:                                               ; preds = %22
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.46) #8
  tail call void @abort() #9
  unreachable

33:                                               ; preds = %22
  %34 = load i8, ptr @vsyncIsOn, align 1, !tbaa !12
  %35 = zext i8 %34 to i32
  tail call void @glfwSwapInterval(i32 noundef %35) #7
  %36 = load ptr, ptr @window, align 8, !tbaa !5
  %37 = tail call ptr @glfwSetFramebufferSizeCallback(ptr noundef %36, ptr noundef nonnull @onFramebufferResized) #7
  %38 = load ptr, ptr @window, align 8, !tbaa !5
  %39 = tail call ptr @glfwSetKeyCallback(ptr noundef %38, ptr noundef nonnull @onKey) #7
  %40 = load ptr, ptr @window, align 8, !tbaa !5
  %41 = tail call ptr @glfwSetMouseButtonCallback(ptr noundef %40, ptr noundef nonnull @onMouseButton) #7
  %42 = load ptr, ptr @window, align 8, !tbaa !5
  %43 = tail call ptr @glfwSetCursorPosCallback(ptr noundef %42, ptr noundef nonnull @onMouseMove) #7
  %44 = load ptr, ptr @window, align 8, !tbaa !5
  %45 = tail call ptr @glfwSetScrollCallback(ptr noundef %44, ptr noundef nonnull @onMouseWheel) #7
  %46 = load ptr, ptr @window, align 8, !tbaa !5
  %47 = tail call ptr @glfwSetDropCallback(ptr noundef %46, ptr noundef nonnull @onFileDragAndDrop) #7
  %48 = load ptr, ptr @window, align 8, !tbaa !5
  tail call void @glfwGetCursorPos(ptr noundef %48, ptr noundef nonnull @mouseX, ptr noundef nonnull @mouseY) #7
  %49 = load ptr, ptr @window, align 8, !tbaa !5
  tail call void @glfwGetFramebufferSize(ptr noundef %49, ptr noundef nonnull @windowWidth, ptr noundef nonnull @windowHeight) #7
  %50 = load i32, ptr @windowHeight, align 4, !tbaa !13
  %51 = sitofp i32 %50 to double
  %52 = load double, ptr @mouseY, align 8, !tbaa !14
  %53 = fsub double %51, %52
  store double %53, ptr @mouseY, align 8, !tbaa !14
  %54 = load ptr, ptr @vertShaderSource, align 8, !tbaa !5
  %55 = tail call i32 @compileShader(i32 noundef 35633, ptr noundef %54)
  %56 = load ptr, ptr @renderShaderSource, align 8, !tbaa !5
  %57 = tail call i32 @compileShader(i32 noundef 35632, ptr noundef %56)
  %58 = load ptr, ptr @updateShaderSource, align 8, !tbaa !5
  %59 = tail call i32 @compileShader(i32 noundef 35632, ptr noundef %58)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i32 %55, ptr %1, align 4, !tbaa !13
  %60 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 %57, ptr %60, align 4, !tbaa !13
  %61 = call i32 @linkShaderProgram(ptr noundef nonnull %1, i32 noundef 2)
  store i32 %61, ptr @renderProgram, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i32 %55, ptr %2, align 4, !tbaa !13
  %62 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %59, ptr %62, align 4, !tbaa !13
  %63 = call i32 @linkShaderProgram(ptr noundef nonnull %2, i32 noundef 2)
  store i32 %63, ptr @updateProgram, align 4, !tbaa !13
  %64 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %65 = load i32, ptr @renderProgram, align 4, !tbaa !13
  %66 = call i32 %64(i32 noundef %65, ptr noundef nonnull @.str.47) #7
  store i32 %66, ptr @uniformScale, align 4, !tbaa !13
  %67 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %68 = load i32, ptr @renderProgram, align 4, !tbaa !13
  %69 = call i32 %67(i32 noundef %68, ptr noundef nonnull @.str.48) #7
  store i32 %69, ptr @uniformOffset, align 4, !tbaa !13
  %70 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %71 = load i32, ptr @renderProgram, align 4, !tbaa !13
  %72 = call i32 %70(i32 noundef %71, ptr noundef nonnull @.str.49) #7
  store i32 %72, ptr @uniformBorderSize, align 4, !tbaa !13
  %73 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %74 = load i32, ptr @renderProgram, align 4, !tbaa !13
  %75 = call i32 %73(i32 noundef %74, ptr noundef nonnull @.str.50) #7
  store i32 %75, ptr @uniformBackgroundColor, align 4, !tbaa !13
  %76 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %77 = load i32, ptr @renderProgram, align 4, !tbaa !13
  %78 = call i32 %76(i32 noundef %77, ptr noundef nonnull @.str.51) #7
  store i32 %78, ptr @uniformDeadColor, align 4, !tbaa !13
  %79 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %80 = load i32, ptr @renderProgram, align 4, !tbaa !13
  %81 = call i32 %79(i32 noundef %80, ptr noundef nonnull @.str.52) #7
  store i32 %81, ptr @uniformAliveColor, align 4, !tbaa !13
  %82 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !5
  call void %82(i32 noundef %55) #7
  %83 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !5
  call void %83(i32 noundef %57) #7
  %84 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !5
  call void %84(i32 noundef %59) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %3, ptr noundef nonnull align 16 dereferenceable(32) @__const.main.quadData, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %85 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  call void %85(i32 noundef 1, ptr noundef nonnull %4) #7
  %86 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !13
  call void %86(i32 noundef %87) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %88 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %88(i32 noundef 1, ptr noundef nonnull %5) #7
  %89 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %90 = load i32, ptr %5, align 4, !tbaa !13
  call void %89(i32 noundef 34962, i32 noundef %90) #7
  %91 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %91(i32 noundef 34962, i64 noundef 32, ptr noundef nonnull %3, i32 noundef 35044) #7
  %92 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %93 = load i32, ptr @updateProgram, align 4, !tbaa !13
  %94 = call i32 %92(i32 noundef %93, ptr noundef nonnull @.str.53) #7
  %95 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %96 = load i32, ptr @renderProgram, align 4, !tbaa !13
  %97 = call i32 %95(i32 noundef %96, ptr noundef nonnull @.str.53) #7
  %98 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %98(i32 noundef %94) #7
  %99 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %99(i32 noundef %94, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null) #7
  %100 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %100(i32 noundef %97) #7
  %101 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %101(i32 noundef %97, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null) #7
  %102 = load ptr, ptr @glad_glGetIntegerv, align 8, !tbaa !5
  call void %102(i32 noundef 3379, ptr noundef nonnull @maxTextureSize) #7
  %103 = call i32 @ceilMultipleOf32(i32 noundef 256)
  store i32 %103, ptr @numCellsX, align 4, !tbaa !13
  %104 = call i32 @ceilMultipleOf32(i32 noundef 256)
  store i32 %104, ptr @numCellsY, align 4, !tbaa !13
  %105 = load i32, ptr @numCellsX, align 4, !tbaa !13
  %106 = sdiv i32 %104, 32
  %107 = call i32 @createTexture(ptr noundef null, i32 noundef %105, i32 noundef %106, i32 noundef 36244, i32 noundef 33334)
  store i32 %107, ptr @cellsRead, align 4, !tbaa !13
  %108 = load i32, ptr @numCellsX, align 4, !tbaa !13
  %109 = load i32, ptr @numCellsY, align 4, !tbaa !13
  %110 = sdiv i32 %109, 32
  %111 = call i32 @createTexture(ptr noundef null, i32 noundef %108, i32 noundef %110, i32 noundef 36244, i32 noundef 33334)
  store i32 %111, ptr @cellsWrite, align 4, !tbaa !13
  %112 = load i32, ptr @cellsRead, align 4, !tbaa !13
  %113 = call i32 @createFramebuffer(i32 noundef %112)
  store i32 %113, ptr @cellsReadFramebuffer, align 4, !tbaa !13
  %114 = load i32, ptr @cellsWrite, align 4, !tbaa !13
  %115 = call i32 @createFramebuffer(i32 noundef %114)
  store i32 %115, ptr @cellsWriteFramebuffer, align 4, !tbaa !13
  %116 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %117 = call i32 %116() #7
  switch i32 %117, label %122 [
    i32 0, label %126
    i32 1280, label %123
    i32 1281, label %118
    i32 1282, label %119
    i32 1285, label %120
    i32 1286, label %121
  ]

118:                                              ; preds = %33
  br label %123

119:                                              ; preds = %33
  br label %123

120:                                              ; preds = %33
  br label %123

121:                                              ; preds = %33
  br label %123

122:                                              ; preds = %33
  br label %123

123:                                              ; preds = %33, %122, %121, %120, %119, %118
  %.042 = phi ptr [ @.str.20, %122 ], [ @.str.19, %121 ], [ @.str.18, %120 ], [ @.str.17, %119 ], [ @.str.16, %118 ], [ @.str.15, %33 ]
  %124 = load ptr, ptr @stderr, align 8, !tbaa !5
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef nonnull @.str.21, ptr noundef nonnull %.042, ptr noundef nonnull @.str.22, i32 noundef 932) #8
  br label %126

126:                                              ; preds = %33, %123
  call void @clearCells()
  call void @centerCellsOnScreen()
  %127 = call i64 @glfwGetTimerValue() #7
  %128 = call i64 @glfwGetTimerFrequency() #7
  %129 = uitofp i64 %128 to double
  %130 = fdiv double 1.000000e+00, %129
  %131 = load ptr, ptr @window, align 8, !tbaa !5
  %132 = call i32 @glfwWindowShouldClose(ptr noundef %131) #7
  %.not6472 = icmp eq i32 %132, 0
  br i1 %.not6472, label %.lr.ph77, label %._crit_edge

.lr.ph77:                                         ; preds = %126, %172
  %.04476 = phi i64 [ %.1, %172 ], [ 0, %126 ]
  %.04575 = phi i64 [ %.146, %172 ], [ 0, %126 ]
  %.04874 = phi double [ %.149, %172 ], [ 0.000000e+00, %126 ]
  %.05073 = phi i64 [ %133, %172 ], [ %127, %126 ]
  call void @glfwPollEvents() #7
  %133 = call i64 @glfwGetTimerValue() #7
  %134 = icmp ugt i64 %133, %.05073
  %135 = sub i64 %133, %.05073
  %136 = sub i64 %.05073, %133
  %137 = select i1 %134, i64 %135, i64 %136
  %138 = uitofp i64 %137 to double
  %139 = fmul double %130, %138
  %140 = fadd double %.04874, %139
  %141 = add i64 %.04476, 1
  %142 = add i64 %.04575, 1
  %143 = load i8, ptr @isRunning, align 1, !tbaa !12
  %.not67 = icmp eq i8 %143, 0
  %144 = load i32, ptr @framesPerUpdate, align 4
  %145 = sext i32 %144 to i64
  %.not68 = icmp ult i64 %141, %145
  %or.cond = select i1 %.not67, i1 true, i1 %.not68
  br i1 %or.cond, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.lr.ph77
  %146 = load i32, ptr @updatesPerFrame, align 4, !tbaa !13
  %147 = icmp sgt i32 %146, 0
  br i1 %147, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.04771 = phi i32 [ %148, %.lr.ph ], [ 0, %.preheader ]
  call void @updateCells()
  %148 = add nuw nsw i32 %.04771, 1
  %149 = load i32, ptr @updatesPerFrame, align 4, !tbaa !13
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %.lr.ph, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph, %.preheader, %.lr.ph77
  %.1 = phi i64 [ %141, %.lr.ph77 ], [ 0, %.preheader ], [ 0, %.lr.ph ]
  call void @renderCells()
  %151 = fcmp ogt double %140, 5.000000e-02
  br i1 %151, label %152, label %172

152:                                              ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %6) #7
  %153 = load i32, ptr @updatesPerFrame, align 4, !tbaa !13
  %154 = icmp sgt i32 %153, 1
  %155 = uitofp nneg i32 %153 to double
  %156 = load i32, ptr @framesPerUpdate, align 4
  %157 = sitofp i32 %156 to double
  %158 = fdiv double 1.000000e+00, %157
  %159 = select i1 %154, double %155, double %158
  %160 = load i8, ptr @isRunning, align 1, !tbaa !12
  %.not69 = icmp eq i8 %160, 0
  %161 = load ptr, ptr @patternName, align 8, !tbaa !5
  br i1 %.not69, label %167, label %162

162:                                              ; preds = %152
  %163 = uitofp i64 %142 to double
  %164 = fdiv double %163, %140
  %165 = load i32, ptr @generation, align 4, !tbaa !13
  %166 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 512, ptr noundef nonnull @.str.54, ptr noundef %161, double noundef %159, double noundef %164, i32 noundef %165) #7
  br label %170

167:                                              ; preds = %152
  %168 = load i32, ptr @generation, align 4, !tbaa !13
  %169 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 512, ptr noundef nonnull @.str.55, ptr noundef %161, double noundef %159, i32 noundef %168) #7
  br label %170

170:                                              ; preds = %167, %162
  %171 = load ptr, ptr @window, align 8, !tbaa !5
  call void @glfwSetWindowTitle(ptr noundef %171, ptr noundef nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %6) #7
  br label %172

172:                                              ; preds = %170, %.loopexit
  %.149 = phi double [ 0.000000e+00, %170 ], [ %140, %.loopexit ]
  %.146 = phi i64 [ 0, %170 ], [ %142, %.loopexit ]
  %173 = load ptr, ptr @window, align 8, !tbaa !5
  call void @glfwSwapBuffers(ptr noundef %173) #7
  %174 = load ptr, ptr @window, align 8, !tbaa !5
  %175 = call i32 @glfwWindowShouldClose(ptr noundef %174) #7
  %.not64 = icmp eq i32 %175, 0
  br i1 %.not64, label %.lr.ph77, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %172, %126
  %176 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %177 = call i32 %176() #7
  switch i32 %177, label %182 [
    i32 0, label %186
    i32 1280, label %183
    i32 1281, label %178
    i32 1282, label %179
    i32 1285, label %180
    i32 1286, label %181
  ]

178:                                              ; preds = %._crit_edge
  br label %183

179:                                              ; preds = %._crit_edge
  br label %183

180:                                              ; preds = %._crit_edge
  br label %183

181:                                              ; preds = %._crit_edge
  br label %183

182:                                              ; preds = %._crit_edge
  br label %183

183:                                              ; preds = %._crit_edge, %182, %181, %180, %179, %178
  %.043 = phi ptr [ @.str.20, %182 ], [ @.str.19, %181 ], [ @.str.18, %180 ], [ @.str.17, %179 ], [ @.str.16, %178 ], [ @.str.15, %._crit_edge ]
  %184 = load ptr, ptr @stderr, align 8, !tbaa !5
  %185 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %184, ptr noundef nonnull @.str.21, ptr noundef nonnull %.043, ptr noundef nonnull @.str.22, i32 noundef 1008) #8
  br label %186

186:                                              ; preds = %._crit_edge, %183
  %187 = load ptr, ptr @glad_glDeleteTextures, align 8, !tbaa !5
  call void %187(i32 noundef 1, ptr noundef nonnull @cellsRead) #7
  %188 = load ptr, ptr @glad_glDeleteTextures, align 8, !tbaa !5
  call void %188(i32 noundef 1, ptr noundef nonnull @cellsWrite) #7
  %189 = load ptr, ptr @glad_glDeleteFramebuffers, align 8, !tbaa !5
  call void %189(i32 noundef 1, ptr noundef nonnull @cellsReadFramebuffer) #7
  %190 = load ptr, ptr @glad_glDeleteFramebuffers, align 8, !tbaa !5
  call void %190(i32 noundef 1, ptr noundef nonnull @cellsWriteFramebuffer) #7
  %191 = load ptr, ptr @glad_glDeleteProgram, align 8, !tbaa !5
  %192 = load i32, ptr @renderProgram, align 4, !tbaa !13
  call void %191(i32 noundef %192) #7
  %193 = load ptr, ptr @glad_glDeleteProgram, align 8, !tbaa !5
  %194 = load i32, ptr @updateProgram, align 4, !tbaa !13
  call void %193(i32 noundef %194) #7
  %195 = load ptr, ptr @glad_glDeleteVertexArrays, align 8, !tbaa !5
  call void %195(i32 noundef 1, ptr noundef nonnull %4) #7
  %196 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !5
  call void %196(i32 noundef 1, ptr noundef nonnull %5) #7
  %197 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %198 = call i32 %197() #7
  switch i32 %198, label %203 [
    i32 0, label %207
    i32 1280, label %204
    i32 1281, label %199
    i32 1282, label %200
    i32 1285, label %201
    i32 1286, label %202
  ]

199:                                              ; preds = %186
  br label %204

200:                                              ; preds = %186
  br label %204

201:                                              ; preds = %186
  br label %204

202:                                              ; preds = %186
  br label %204

203:                                              ; preds = %186
  br label %204

204:                                              ; preds = %186, %203, %202, %201, %200, %199
  %.0 = phi ptr [ @.str.20, %203 ], [ @.str.19, %202 ], [ @.str.18, %201 ], [ @.str.17, %200 ], [ @.str.16, %199 ], [ @.str.15, %186 ]
  %205 = load ptr, ptr @stderr, align 8, !tbaa !5
  %206 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %205, ptr noundef nonnull @.str.21, ptr noundef nonnull %.0, ptr noundef nonnull @.str.22, i32 noundef 1017) #8
  br label %207

207:                                              ; preds = %186, %204
  %208 = load ptr, ptr @patternName, align 8, !tbaa !5
  call void @free(ptr noundef %208) #7
  %209 = load ptr, ptr @window, align 8, !tbaa !5
  call void @glfwDestroyWindow(ptr noundef %209) #7
  call void @glfwTerminate() #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0
}

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #6

declare i32 @glfwInit() local_unnamed_addr #6

declare void @glfwWindowHint(i32 noundef, i32 noundef) local_unnamed_addr #6

declare ptr @glfwCreateWindow(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #6

declare i32 @gladLoadGLLoader(ptr noundef) local_unnamed_addr #6

declare ptr @glfwGetProcAddress(ptr noundef) #6

declare ptr @glfwSetFramebufferSizeCallback(ptr noundef, ptr noundef) local_unnamed_addr #6

declare ptr @glfwSetKeyCallback(ptr noundef, ptr noundef) local_unnamed_addr #6

declare ptr @glfwSetMouseButtonCallback(ptr noundef, ptr noundef) local_unnamed_addr #6

declare ptr @glfwSetCursorPosCallback(ptr noundef, ptr noundef) local_unnamed_addr #6

declare ptr @glfwSetScrollCallback(ptr noundef, ptr noundef) local_unnamed_addr #6

declare ptr @glfwSetDropCallback(ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @glfwGetCursorPos(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

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

declare i64 @glfwGetTimerValue() local_unnamed_addr #6

declare i64 @glfwGetTimerFrequency() local_unnamed_addr #6

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #6

declare void @glfwPollEvents() local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare void @glfwSetWindowTitle(ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #6

declare void @glfwDestroyWindow(ptr noundef) local_unnamed_addr #6

declare void @glfwTerminate() local_unnamed_addr #6

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { nofree nounwind "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 = { noreturn nounwind "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 #7 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { noreturn 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/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"gladGLversionStruct", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass