; LLVM IR from godofecht/GANN-Object-Avoidance :: Box2D/Testbed/Framework/RenderGL3.ll (Z12RenderGLInitPKc)

; 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.stbtt_bakedchar = type { i16, i16, i16, i16, float, float, float }

@_ZL13g_circleVerts = external hidden global [64 x float], align 16
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL7g_cdata = external hidden global [96 x %struct.stbtt_bakedchar], align 16
@_ZL6g_ftex = external hidden global i32, align 4
@_ZL10g_whitetex = external hidden global i32, align 4
@__glewGenVertexArrays = external global ptr, align 8
@_ZL5g_vao = external hidden global i32, align 4
@__glewGenBuffers = external global ptr, align 8
@_ZL6g_vbos = external hidden global [3 x i32], align 4
@__glewBindVertexArray = external global ptr, align 8
@__glewEnableVertexAttribArray = external global ptr, align 8
@__glewBindBuffer = external global ptr, align 8
@__glewVertexAttribPointer = external global ptr, align 8
@__glewBufferData = external global ptr, align 8
@__glewCreateProgram = external global ptr, align 8
@_ZL9g_program = external hidden global i32, align 4
@.str.16 = external hidden unnamed_addr constant [302 x i8], align 1
@__glewCreateShader = external global ptr, align 8
@__glewShaderSource = external global ptr, align 8
@__glewCompileShader = external global ptr, align 8
@__glewAttachShader = external global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [223 x i8], align 1
@__glewBindAttribLocation = external global ptr, align 8
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 x i8], align 1
@__glewBindFragDataLocation = external global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@__glewLinkProgram = external global ptr, align 8
@__glewDeleteShader = external global ptr, align 8
@__glewUseProgram = external global ptr, align 8
@__glewGetUniformLocation = external global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL25g_programViewportLocation = external hidden global i32, align 4
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZL24g_programTextureLocation = external hidden global i32, align 4

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_BakeFontBitmap(ptr noundef, i32 noundef, float noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z12RenderGLInitPKc(ptr noundef %0) #3 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %40, %1
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = icmp slt i32 %17, 32
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %43

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %21 = load i32, ptr %4, align 4, !tbaa !9
  %22 = sitofp i32 %21 to float
  %23 = fdiv float %22, 3.200000e+01
  %24 = fmul float %23, 0x400921FB60000000
  %25 = fmul float %24, 2.000000e+00
  store float %25, ptr %5, align 4, !tbaa !11
  %26 = load float, ptr %5, align 4, !tbaa !11
  %27 = call float @cosf(float noundef %26) #5
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = mul nsw i32 %28, 2
  %30 = add nsw i32 %29, 0
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [64 x float], ptr @_ZL13g_circleVerts, i64 0, i64 %31
  store float %27, ptr %32, align 4, !tbaa !11
  %33 = load float, ptr %5, align 4, !tbaa !11
  %34 = call float @sinf(float noundef %33) #5
  %35 = load i32, ptr %4, align 4, !tbaa !9
  %36 = mul nsw i32 %35, 2
  %37 = add nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [64 x float], ptr @_ZL13g_circleVerts, i64 0, i64 %38
  store float %34, ptr %39, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %40

40:                                               ; preds = %20
  %41 = load i32, ptr %4, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !9
  br label %16, !llvm.loop !13

43:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = call noalias ptr @fopen(ptr noundef %44, ptr noundef @.str.15)
  store ptr %45, ptr %6, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  store i1 false, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %151

49:                                               ; preds = %43
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = call i32 @fseek(ptr noundef %50, i64 noundef 0, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call i64 @ftell(ptr noundef %52)
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %8, align 4, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = call i32 @fseek(ptr noundef %55, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call noalias ptr @malloc(i64 noundef %58) #6
  store ptr %59, ptr %9, align 8, !tbaa !5
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %65, label %62

62:                                               ; preds = %49
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = call i32 @fclose(ptr noundef %63)
  store i1 false, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %150

65:                                               ; preds = %49
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = call i64 @fread(ptr noundef %66, i64 noundef 1, i64 noundef %68, ptr noundef %69)
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = call i32 @fclose(ptr noundef %71)
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %73 = call noalias ptr @malloc(i64 noundef 262144) #6
  store ptr %73, ptr %10, align 8, !tbaa !5
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %78, label %76

76:                                               ; preds = %65
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %77) #5
  store i1 false, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %149

78:                                               ; preds = %65
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = call i32 @stbtt_BakeFontBitmap(ptr noundef %79, i32 noundef 0, float noundef 1.500000e+01, ptr noundef %80, i32 noundef 512, i32 noundef 512, i32 noundef 32, i32 noundef 96, ptr noundef @_ZL7g_cdata)
  call void @glGenTextures(i32 noundef 1, ptr noundef @_ZL6g_ftex)
  %82 = load i32, ptr @_ZL6g_ftex, align 4, !tbaa !9
  call void @glBindTexture(i32 noundef 3553, i32 noundef %82)
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef 512, i32 noundef 512, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef %83)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  store i8 -1, ptr %11, align 1, !tbaa !15
  call void @glGenTextures(i32 noundef 1, ptr noundef @_ZL10g_whitetex)
  %84 = load i32, ptr @_ZL10g_whitetex, align 4, !tbaa !9
  call void @glBindTexture(i32 noundef 3553, i32 noundef %84)
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef %11)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %85 = load ptr, ptr @__glewGenVertexArrays, align 8, !tbaa !5
  call void %85(i32 noundef 1, ptr noundef @_ZL5g_vao)
  %86 = load ptr, ptr @__glewGenBuffers, align 8, !tbaa !5
  call void %86(i32 noundef 3, ptr noundef @_ZL6g_vbos)
  %87 = load ptr, ptr @__glewBindVertexArray, align 8, !tbaa !5
  %88 = load i32, ptr @_ZL5g_vao, align 4, !tbaa !9
  call void %87(i32 noundef %88)
  %89 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !5
  call void %89(i32 noundef 0)
  %90 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !5
  call void %90(i32 noundef 1)
  %91 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !5
  call void %91(i32 noundef 2)
  %92 = load ptr, ptr @__glewBindBuffer, align 8, !tbaa !5
  %93 = load i32, ptr @_ZL6g_vbos, align 4, !tbaa !9
  call void %92(i32 noundef 34962, i32 noundef %93)
  %94 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !5
  call void %94(i32 noundef 0, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  %95 = load ptr, ptr @__glewBufferData, align 8, !tbaa !5
  call void %95(i32 noundef 34962, i64 noundef 0, ptr noundef null, i32 noundef 35044)
  %96 = load ptr, ptr @__glewBindBuffer, align 8, !tbaa !5
  %97 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @_ZL6g_vbos, i64 0, i64 1), align 4, !tbaa !9
  call void %96(i32 noundef 34962, i32 noundef %97)
  %98 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !5
  call void %98(i32 noundef 1, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  %99 = load ptr, ptr @__glewBufferData, align 8, !tbaa !5
  call void %99(i32 noundef 34962, i64 noundef 0, ptr noundef null, i32 noundef 35044)
  %100 = load ptr, ptr @__glewBindBuffer, align 8, !tbaa !5
  %101 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @_ZL6g_vbos, i64 0, i64 2), align 4, !tbaa !9
  call void %100(i32 noundef 34962, i32 noundef %101)
  %102 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !5
  call void %102(i32 noundef 2, i32 noundef 4, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 16, ptr noundef null)
  %103 = load ptr, ptr @__glewBufferData, align 8, !tbaa !5
  call void %103(i32 noundef 34962, i64 noundef 0, ptr noundef null, i32 noundef 35044)
  %104 = load ptr, ptr @__glewCreateProgram, align 8, !tbaa !5
  %105 = call i32 %104()
  store i32 %105, ptr @_ZL9g_program, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr @.str.16, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %106 = load ptr, ptr @__glewCreateShader, align 8, !tbaa !5
  %107 = call i32 %106(i32 noundef 35633)
  store i32 %107, ptr %13, align 4, !tbaa !9
  %108 = load ptr, ptr @__glewShaderSource, align 8, !tbaa !5
  %109 = load i32, ptr %13, align 4, !tbaa !9
  call void %108(i32 noundef %109, i32 noundef 1, ptr noundef %12, ptr noundef null)
  %110 = load ptr, ptr @__glewCompileShader, align 8, !tbaa !5
  %111 = load i32, ptr %13, align 4, !tbaa !9
  call void %110(i32 noundef %111)
  %112 = load ptr, ptr @__glewAttachShader, align 8, !tbaa !5
  %113 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  %114 = load i32, ptr %13, align 4, !tbaa !9
  call void %112(i32 noundef %113, i32 noundef %114)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr @.str.17, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %115 = load ptr, ptr @__glewCreateShader, align 8, !tbaa !5
  %116 = call i32 %115(i32 noundef 35632)
  store i32 %116, ptr %15, align 4, !tbaa !9
  %117 = load ptr, ptr @__glewShaderSource, align 8, !tbaa !5
  %118 = load i32, ptr %15, align 4, !tbaa !9
  call void %117(i32 noundef %118, i32 noundef 1, ptr noundef %14, ptr noundef null)
  %119 = load ptr, ptr @__glewCompileShader, align 8, !tbaa !5
  %120 = load i32, ptr %15, align 4, !tbaa !9
  call void %119(i32 noundef %120)
  %121 = load ptr, ptr @__glewAttachShader, align 8, !tbaa !5
  %122 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  %123 = load i32, ptr %15, align 4, !tbaa !9
  call void %121(i32 noundef %122, i32 noundef %123)
  %124 = load ptr, ptr @__glewBindAttribLocation, align 8, !tbaa !5
  %125 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  call void %124(i32 noundef %125, i32 noundef 0, ptr noundef @.str.18)
  %126 = load ptr, ptr @__glewBindAttribLocation, align 8, !tbaa !5
  %127 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  call void %126(i32 noundef %127, i32 noundef 1, ptr noundef @.str.19)
  %128 = load ptr, ptr @__glewBindAttribLocation, align 8, !tbaa !5
  %129 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  call void %128(i32 noundef %129, i32 noundef 2, ptr noundef @.str.20)
  %130 = load ptr, ptr @__glewBindFragDataLocation, align 8, !tbaa !5
  %131 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  call void %130(i32 noundef %131, i32 noundef 0, ptr noundef @.str.21)
  %132 = load ptr, ptr @__glewLinkProgram, align 8, !tbaa !5
  %133 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  call void %132(i32 noundef %133)
  %134 = load ptr, ptr @__glewDeleteShader, align 8, !tbaa !5
  %135 = load i32, ptr %13, align 4, !tbaa !9
  call void %134(i32 noundef %135)
  %136 = load ptr, ptr @__glewDeleteShader, align 8, !tbaa !5
  %137 = load i32, ptr %15, align 4, !tbaa !9
  call void %136(i32 noundef %137)
  %138 = load ptr, ptr @__glewUseProgram, align 8, !tbaa !5
  %139 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  call void %138(i32 noundef %139)
  %140 = load ptr, ptr @__glewGetUniformLocation, align 8, !tbaa !5
  %141 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  %142 = call i32 %140(i32 noundef %141, ptr noundef @.str.22)
  store i32 %142, ptr @_ZL25g_programViewportLocation, align 4, !tbaa !9
  %143 = load ptr, ptr @__glewGetUniformLocation, align 8, !tbaa !5
  %144 = load i32, ptr @_ZL9g_program, align 4, !tbaa !9
  %145 = call i32 %143(i32 noundef %144, ptr noundef @.str.23)
  store i32 %145, ptr @_ZL24g_programTextureLocation, align 4, !tbaa !9
  %146 = load ptr, ptr @__glewUseProgram, align 8, !tbaa !5
  call void %146(i32 noundef 0)
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %147) #5
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %148) #5
  store i1 true, ptr %2, align 1
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %149

149:                                              ; preds = %78, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %150

150:                                              ; preds = %149, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %151

151:                                              ; preds = %150, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %152 = load i1, ptr %2, align 1
  ret i1 %152
}

; Function Attrs: nounwind
declare float @cosf(float noundef) #2

; Function Attrs: nounwind
declare float @sinf(float noundef) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #4

declare i64 @ftell(ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare void @glGenTextures(i32 noundef, ptr noundef) #4

declare void @glBindTexture(i32 noundef, i32 noundef) #4

declare void @glTexImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #4

declare void @glTexParameteri(i32 noundef, i32 noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}


; 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.stbtt_bakedchar = type { i16, i16, i16, i16, float, float, float }

@_ZL13g_circleVerts = external hidden local_unnamed_addr global [64 x float], align 16
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL7g_cdata = external hidden global [96 x %struct.stbtt_bakedchar], align 16
@_ZL6g_ftex = external hidden global i32, align 4
@_ZL10g_whitetex = external hidden global i32, align 4
@__glewGenVertexArrays = external local_unnamed_addr global ptr, align 8
@_ZL5g_vao = external hidden global i32, align 4
@__glewGenBuffers = external local_unnamed_addr global ptr, align 8
@_ZL6g_vbos = external hidden global [3 x i32], align 4
@__glewBindVertexArray = external local_unnamed_addr global ptr, align 8
@__glewEnableVertexAttribArray = external local_unnamed_addr global ptr, align 8
@__glewBindBuffer = external local_unnamed_addr global ptr, align 8
@__glewVertexAttribPointer = external local_unnamed_addr global ptr, align 8
@__glewBufferData = external local_unnamed_addr global ptr, align 8
@__glewCreateProgram = external local_unnamed_addr global ptr, align 8
@_ZL9g_program = external hidden local_unnamed_addr global i32, align 4
@.str.16 = external hidden unnamed_addr constant [302 x i8], align 1
@__glewCreateShader = external local_unnamed_addr global ptr, align 8
@__glewShaderSource = external local_unnamed_addr global ptr, align 8
@__glewCompileShader = external local_unnamed_addr global ptr, align 8
@__glewAttachShader = external local_unnamed_addr global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [223 x i8], align 1
@__glewBindAttribLocation = external local_unnamed_addr global ptr, align 8
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 x i8], align 1
@__glewBindFragDataLocation = external local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@__glewLinkProgram = external local_unnamed_addr global ptr, align 8
@__glewDeleteShader = external local_unnamed_addr global ptr, align 8
@__glewUseProgram = external local_unnamed_addr global ptr, align 8
@__glewGetUniformLocation = external local_unnamed_addr global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL25g_programViewportLocation = external hidden local_unnamed_addr global i32, align 4
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZL24g_programTextureLocation = external hidden local_unnamed_addr global i32, align 4

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_BakeFontBitmap(ptr noundef, i32 noundef, float noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z12RenderGLInitPKc(ptr nocapture noundef readonly %0) local_unnamed_addr #3 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  br label %7

5:                                                ; preds = %7
  %6 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str.15)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %101, label %30

7:                                                ; preds = %7, %1
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next.1, %7 ]
  %8 = trunc nuw nsw i64 %indvars.iv to i32
  %9 = uitofp nneg i32 %8 to float
  %10 = fmul float %9, 3.125000e-02
  %11 = fmul float %10, 0x400921FB60000000
  %12 = fmul float %11, 2.000000e+00
  %13 = tail call float @cosf(float noundef %12) #7
  %14 = shl nuw nsw i64 %indvars.iv, 1
  %15 = getelementptr inbounds [64 x float], ptr @_ZL13g_circleVerts, i64 0, i64 %14
  store float %13, ptr %15, align 16, !tbaa !5
  %16 = tail call float @sinf(float noundef %12) #7
  %17 = or disjoint i64 %14, 1
  %18 = getelementptr inbounds [64 x float], ptr @_ZL13g_circleVerts, i64 0, i64 %17
  store float %16, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %19 = trunc nuw nsw i64 %indvars.iv.next to i32
  %20 = uitofp nneg i32 %19 to float
  %21 = fmul float %20, 3.125000e-02
  %22 = fmul float %21, 0x400921FB60000000
  %23 = fmul float %22, 2.000000e+00
  %24 = tail call float @cosf(float noundef %23) #7
  %25 = shl nuw nsw i64 %indvars.iv.next, 1
  %26 = getelementptr inbounds [64 x float], ptr @_ZL13g_circleVerts, i64 0, i64 %25
  store float %24, ptr %26, align 8, !tbaa !5
  %27 = tail call float @sinf(float noundef %23) #7
  %28 = or disjoint i64 %25, 1
  %29 = getelementptr inbounds [64 x float], ptr @_ZL13g_circleVerts, i64 0, i64 %28
  store float %27, ptr %29, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 32
  br i1 %exitcond.not.1, label %5, label %7, !llvm.loop !9

30:                                               ; preds = %5
  %31 = tail call i32 @fseek(ptr noundef nonnull %6, i64 noundef 0, i32 noundef 2)
  %32 = tail call i64 @ftell(ptr noundef nonnull %6)
  %33 = tail call i32 @fseek(ptr noundef nonnull %6, i64 noundef 0, i32 noundef 0)
  %sext = shl i64 %32, 32
  %34 = ashr exact i64 %sext, 32
  %35 = tail call noalias ptr @malloc(i64 noundef %34) #8
  %.not38 = icmp eq ptr %35, null
  br i1 %.not38, label %36, label %38

36:                                               ; preds = %30
  %37 = tail call i32 @fclose(ptr noundef nonnull %6)
  br label %101

38:                                               ; preds = %30
  %39 = tail call i64 @fread(ptr noundef nonnull %35, i64 noundef 1, i64 noundef %34, ptr noundef nonnull %6)
  %40 = tail call i32 @fclose(ptr noundef nonnull %6)
  %41 = tail call noalias dereferenceable_or_null(262144) ptr @malloc(i64 noundef 262144) #8
  %.not39.not = icmp eq ptr %41, null
  br i1 %.not39.not, label %42, label %43

42:                                               ; preds = %38
  tail call void @free(ptr noundef nonnull %35) #7
  br label %101

43:                                               ; preds = %38
  %44 = tail call i32 @stbtt_BakeFontBitmap(ptr noundef nonnull %35, i32 noundef 0, float noundef 1.500000e+01, ptr noundef nonnull %41, i32 noundef 512, i32 noundef 512, i32 noundef 32, i32 noundef 96, ptr noundef nonnull @_ZL7g_cdata)
  tail call void @glGenTextures(i32 noundef 1, ptr noundef nonnull @_ZL6g_ftex)
  %45 = load i32, ptr @_ZL6g_ftex, align 4, !tbaa !11
  tail call void @glBindTexture(i32 noundef 3553, i32 noundef %45)
  tail call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef 512, i32 noundef 512, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef nonnull %41)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  store i8 -1, ptr %2, align 1, !tbaa !13
  tail call void @glGenTextures(i32 noundef 1, ptr noundef nonnull @_ZL10g_whitetex)
  %46 = load i32, ptr @_ZL10g_whitetex, align 4, !tbaa !11
  tail call void @glBindTexture(i32 noundef 3553, i32 noundef %46)
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 6403, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef nonnull %2)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %47 = load ptr, ptr @__glewGenVertexArrays, align 8, !tbaa !14
  call void %47(i32 noundef 1, ptr noundef nonnull @_ZL5g_vao)
  %48 = load ptr, ptr @__glewGenBuffers, align 8, !tbaa !14
  call void %48(i32 noundef 3, ptr noundef nonnull @_ZL6g_vbos)
  %49 = load ptr, ptr @__glewBindVertexArray, align 8, !tbaa !14
  %50 = load i32, ptr @_ZL5g_vao, align 4, !tbaa !11
  call void %49(i32 noundef %50)
  %51 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !14
  call void %51(i32 noundef 0)
  %52 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !14
  call void %52(i32 noundef 1)
  %53 = load ptr, ptr @__glewEnableVertexAttribArray, align 8, !tbaa !14
  call void %53(i32 noundef 2)
  %54 = load ptr, ptr @__glewBindBuffer, align 8, !tbaa !14
  %55 = load i32, ptr @_ZL6g_vbos, align 4, !tbaa !11
  call void %54(i32 noundef 34962, i32 noundef %55)
  %56 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !14
  call void %56(i32 noundef 0, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  %57 = load ptr, ptr @__glewBufferData, align 8, !tbaa !14
  call void %57(i32 noundef 34962, i64 noundef 0, ptr noundef null, i32 noundef 35044)
  %58 = load ptr, ptr @__glewBindBuffer, align 8, !tbaa !14
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL6g_vbos, i64 4), align 4, !tbaa !11
  call void %58(i32 noundef 34962, i32 noundef %59)
  %60 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !14
  call void %60(i32 noundef 1, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  %61 = load ptr, ptr @__glewBufferData, align 8, !tbaa !14
  call void %61(i32 noundef 34962, i64 noundef 0, ptr noundef null, i32 noundef 35044)
  %62 = load ptr, ptr @__glewBindBuffer, align 8, !tbaa !14
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL6g_vbos, i64 8), align 4, !tbaa !11
  call void %62(i32 noundef 34962, i32 noundef %63)
  %64 = load ptr, ptr @__glewVertexAttribPointer, align 8, !tbaa !14
  call void %64(i32 noundef 2, i32 noundef 4, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 16, ptr noundef null)
  %65 = load ptr, ptr @__glewBufferData, align 8, !tbaa !14
  call void %65(i32 noundef 34962, i64 noundef 0, ptr noundef null, i32 noundef 35044)
  %66 = load ptr, ptr @__glewCreateProgram, align 8, !tbaa !14
  %67 = call i32 %66()
  store i32 %67, ptr @_ZL9g_program, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store ptr @.str.16, ptr %3, align 8, !tbaa !14
  %68 = load ptr, ptr @__glewCreateShader, align 8, !tbaa !14
  %69 = call i32 %68(i32 noundef 35633)
  %70 = load ptr, ptr @__glewShaderSource, align 8, !tbaa !14
  call void %70(i32 noundef %69, i32 noundef 1, ptr noundef nonnull %3, ptr noundef null)
  %71 = load ptr, ptr @__glewCompileShader, align 8, !tbaa !14
  call void %71(i32 noundef %69)
  %72 = load ptr, ptr @__glewAttachShader, align 8, !tbaa !14
  %73 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %72(i32 noundef %73, i32 noundef %69)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store ptr @.str.17, ptr %4, align 8, !tbaa !14
  %74 = load ptr, ptr @__glewCreateShader, align 8, !tbaa !14
  %75 = call i32 %74(i32 noundef 35632)
  %76 = load ptr, ptr @__glewShaderSource, align 8, !tbaa !14
  call void %76(i32 noundef %75, i32 noundef 1, ptr noundef nonnull %4, ptr noundef null)
  %77 = load ptr, ptr @__glewCompileShader, align 8, !tbaa !14
  call void %77(i32 noundef %75)
  %78 = load ptr, ptr @__glewAttachShader, align 8, !tbaa !14
  %79 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %78(i32 noundef %79, i32 noundef %75)
  %80 = load ptr, ptr @__glewBindAttribLocation, align 8, !tbaa !14
  %81 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %80(i32 noundef %81, i32 noundef 0, ptr noundef nonnull @.str.18)
  %82 = load ptr, ptr @__glewBindAttribLocation, align 8, !tbaa !14
  %83 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %82(i32 noundef %83, i32 noundef 1, ptr noundef nonnull @.str.19)
  %84 = load ptr, ptr @__glewBindAttribLocation, align 8, !tbaa !14
  %85 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %84(i32 noundef %85, i32 noundef 2, ptr noundef nonnull @.str.20)
  %86 = load ptr, ptr @__glewBindFragDataLocation, align 8, !tbaa !14
  %87 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %86(i32 noundef %87, i32 noundef 0, ptr noundef nonnull @.str.21)
  %88 = load ptr, ptr @__glewLinkProgram, align 8, !tbaa !14
  %89 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %88(i32 noundef %89)
  %90 = load ptr, ptr @__glewDeleteShader, align 8, !tbaa !14
  call void %90(i32 noundef %69)
  %91 = load ptr, ptr @__glewDeleteShader, align 8, !tbaa !14
  call void %91(i32 noundef %75)
  %92 = load ptr, ptr @__glewUseProgram, align 8, !tbaa !14
  %93 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  call void %92(i32 noundef %93)
  %94 = load ptr, ptr @__glewGetUniformLocation, align 8, !tbaa !14
  %95 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  %96 = call i32 %94(i32 noundef %95, ptr noundef nonnull @.str.22)
  store i32 %96, ptr @_ZL25g_programViewportLocation, align 4, !tbaa !11
  %97 = load ptr, ptr @__glewGetUniformLocation, align 8, !tbaa !14
  %98 = load i32, ptr @_ZL9g_program, align 4, !tbaa !11
  %99 = call i32 %97(i32 noundef %98, ptr noundef nonnull @.str.23)
  store i32 %99, ptr @_ZL24g_programTextureLocation, align 4, !tbaa !11
  %100 = load ptr, ptr @__glewUseProgram, align 8, !tbaa !14
  call void %100(i32 noundef 0)
  call void @free(ptr noundef nonnull %35) #7
  call void @free(ptr noundef nonnull %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  br label %101

101:                                              ; preds = %36, %43, %42, %5
  %.2 = phi i1 [ false, %5 ], [ false, %36 ], [ true, %43 ], [ false, %42 ]
  ret i1 %.2
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @cosf(float noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sinf(float noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5

declare void @glGenTextures(i32 noundef, ptr noundef) local_unnamed_addr #6

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

declare void @glTexImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 #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 = { nounwind allocsize(0) }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass