; LLVM IR from erincatto/box2d-lite :: samples (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.Body = type { %struct.Vec2, float, %struct.Vec2, float, %struct.Vec2, float, %struct.Vec2, float, float, float, float, float }
%struct.Vec2 = type { float, float }
%struct.Joint = type { %struct.Mat22, %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, ptr, ptr, float, float }
%struct.Mat22 = type { %struct.Vec2, %struct.Vec2 }
%struct.World = type <{ %"class.std::vector", %"class.std::vector.0", %"class.std::map", %struct.Vec2, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl" }
%"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl" }
%"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<ArbiterKey, std::pair<const ArbiterKey, Arbiter>, std::_Select1st<std::pair<const ArbiterKey, Arbiter>>, std::less<ArbiterKey>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<ArbiterKey, std::pair<const ArbiterKey, Arbiter>, std::_Select1st<std::pair<const ArbiterKey, Arbiter>>, std::less<ArbiterKey>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.ImVec2 = type { float, float }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, float, float, float, [21 x i32], float, float, ptr, ptr, float, i8, ptr, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, i8, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.ImVec2, [5 x i8], float, float, i8, i8, i8, i8, [512 x i8], [21 x float], i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, i32, %struct.ImVec2, %struct.ImVec2, [5 x %struct.ImVec2], [5 x double], [5 x i8], [5 x i8], [5 x i8], [5 x i8], [5 x float], [5 x float], [5 x %struct.ImVec2], [5 x float], [512 x float], [512 x float], [21 x float], [21 x float], %struct.ImVector }
%struct.ImVector = type { i32, i32, ptr }
%"struct.std::pair" = type { %struct.ArbiterKey, %struct.Arbiter }
%struct.ArbiterKey = type { ptr, ptr }
%struct.Arbiter = type <{ [2 x %struct.Contact], i32, [4 x i8], ptr, ptr, float, [4 x i8] }>
%struct.Contact = type { %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, float, float, float, float, float, float, float, %union.FeaturePair }
%union.FeaturePair = type { i32 }

@_ZN12_GLOBAL__N_16bodiesE = external hidden global [200 x %struct.Body], align 16
@_ZN12_GLOBAL__N_16jointsE = external hidden global [100 x %struct.Joint], align 16
@_ZN12_GLOBAL__N_15worldE = external hidden global %struct.World, align 8
@demoStrings = external dso_local global [9 x ptr], align 16
@stderr = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@_ZN12_GLOBAL__N_15widthE = external hidden global i32, align 4
@_ZN12_GLOBAL__N_16heightE = external hidden global i32, align 4
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZN12_GLOBAL__N_110mainWindowE = external hidden global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [9 x i8], align 1
@glad_glViewport = external global ptr, align 8
@glad_glMatrixMode = external global ptr, align 8
@glad_glLoadIdentity = external global ptr, align 8
@glad_glOrtho = external global ptr, align 8
@_ZN12_GLOBAL__N_14zoomE = external hidden global float, align 4
@_ZN12_GLOBAL__N_15pan_yE = external hidden global float, align 4
@glad_glClear = external global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZN12_GLOBAL__N_19demoIndexE = external hidden global i32, align 4
@.str.18 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1
@_ZN5World18accumulateImpulsesE = external global i8, align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZN5World18positionCorrectionE = external global i8, align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@_ZN5World12warmStartingE = external global i8, align 1
@_ZN12_GLOBAL__N_18timeStepE = external hidden global float, align 4
@_ZN12_GLOBAL__N_19numBodiesE = external hidden global i32, align 4
@_ZN12_GLOBAL__N_19numJointsE = external hidden global i32, align 4
@glad_glPointSize = external global ptr, align 8
@glad_glColor3f = external global ptr, align 8
@glad_glBegin = external global ptr, align 8
@glad_glVertex2f = external global ptr, align 8
@glad_glEnd = external global ptr, align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca %struct.ImVec2, align 4
  %14 = alloca %struct.ImVec2, align 4
  %15 = alloca [64 x i8], align 16
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca %struct.Vec2, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %26 = call ptr @glfwSetErrorCallback(ptr noundef @_ZL17glfwErrorCallbackiPKc)
  %27 = call i32 @glfwInit()
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %2
  %30 = load ptr, ptr @stderr, align 8, !tbaa !9
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.12) #8
  store i32 -1, ptr %3, align 4
  br label %225

32:                                               ; preds = %2
  %33 = load i32, ptr @_ZN12_GLOBAL__N_15widthE, align 4, !tbaa !5
  %34 = load i32, ptr @_ZN12_GLOBAL__N_16heightE, align 4, !tbaa !5
  %35 = call ptr @glfwCreateWindow(i32 noundef %33, i32 noundef %34, ptr noundef @.str.13, ptr noundef null, ptr noundef null)
  store ptr %35, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  %36 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %41

38:                                               ; preds = %32
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.14) #8
  call void @glfwTerminate()
  store i32 -1, ptr %3, align 4
  br label %225

41:                                               ; preds = %32
  %42 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %42)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %43 = call i32 @gladLoadGL()
  store i32 %43, ptr %6, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %49

46:                                               ; preds = %41
  %47 = load ptr, ptr @stderr, align 8, !tbaa !9
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.15) #8
  call void @glfwTerminate()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %224

49:                                               ; preds = %41
  call void @glfwSwapInterval(i32 noundef 1)
  %50 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  %51 = call ptr @glfwSetWindowSizeCallback(ptr noundef %50, ptr noundef @_ZL7ReshapeP10GLFWwindowii)
  %52 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  %53 = call ptr @glfwSetKeyCallback(ptr noundef %52, ptr noundef @_ZL8KeyboardP10GLFWwindowiiii)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %54 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  call void @glfwGetWindowContentScale(ptr noundef %54, ptr noundef %8, ptr noundef %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %55 = load float, ptr %8, align 4, !tbaa !11
  store float %55, ptr %10, align 4, !tbaa !11
  %56 = call noundef zeroext i1 @_ZN5ImGui30DebugCheckVersionAndDataLayoutEPKcmmmmm(ptr noundef @.str.16, i64 noundef 5448, i64 noundef 928, i64 noundef 8, i64 noundef 16, i64 noundef 20)
  %57 = call noundef ptr @_ZN5ImGui13CreateContextEP11ImFontAtlas(ptr noundef null)
  call void @_ZN5ImGui18StyleColorsClassicEP10ImGuiStyle(ptr noundef null)
  %58 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  %59 = call noundef zeroext i1 @_Z28ImGui_ImplGlfw_InitForOpenGLP10GLFWwindowb(ptr noundef %58, i1 noundef zeroext true)
  %60 = call noundef zeroext i1 @_Z22ImGui_ImplOpenGL2_Initv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %61 = call noundef nonnull align 8 dereferenceable(5448) ptr @_ZN5ImGui5GetIOEv()
  store ptr %61, ptr %11, align 8, !tbaa !9
  %62 = load float, ptr %10, align 4, !tbaa !11
  %63 = load ptr, ptr %11, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.ImGuiIO, ptr %63, i32 0, i32 15
  store float %62, ptr %64, align 8, !tbaa !13
  %65 = load ptr, ptr @glad_glViewport, align 8, !tbaa !9
  %66 = load i32, ptr @_ZN12_GLOBAL__N_15widthE, align 4, !tbaa !5
  %67 = load i32, ptr @_ZN12_GLOBAL__N_16heightE, align 4, !tbaa !5
  call void %65(i32 noundef 0, i32 noundef 0, i32 noundef %66, i32 noundef %67)
  %68 = load ptr, ptr @glad_glMatrixMode, align 8, !tbaa !9
  call void %68(i32 noundef 5889)
  %69 = load ptr, ptr @glad_glLoadIdentity, align 8, !tbaa !9
  call void %69()
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %70 = load i32, ptr @_ZN12_GLOBAL__N_15widthE, align 4, !tbaa !5
  %71 = sitofp i32 %70 to float
  %72 = load i32, ptr @_ZN12_GLOBAL__N_16heightE, align 4, !tbaa !5
  %73 = sitofp i32 %72 to float
  %74 = fdiv float %71, %73
  store float %74, ptr %12, align 4, !tbaa !11
  %75 = load i32, ptr @_ZN12_GLOBAL__N_15widthE, align 4, !tbaa !5
  %76 = load i32, ptr @_ZN12_GLOBAL__N_16heightE, align 4, !tbaa !5
  %77 = icmp sge i32 %75, %76
  br i1 %77, label %78, label %98

78:                                               ; preds = %49
  %79 = load ptr, ptr @glad_glOrtho, align 8, !tbaa !9
  %80 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %81 = fneg float %80
  %82 = load float, ptr %12, align 4, !tbaa !11
  %83 = fmul float %81, %82
  %84 = fpext float %83 to double
  %85 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %86 = load float, ptr %12, align 4, !tbaa !11
  %87 = fmul float %85, %86
  %88 = fpext float %87 to double
  %89 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %90 = fneg float %89
  %91 = load float, ptr @_ZN12_GLOBAL__N_15pan_yE, align 4, !tbaa !11
  %92 = fadd float %90, %91
  %93 = fpext float %92 to double
  %94 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %95 = load float, ptr @_ZN12_GLOBAL__N_15pan_yE, align 4, !tbaa !11
  %96 = fadd float %94, %95
  %97 = fpext float %96 to double
  call void %79(double noundef %84, double noundef %88, double noundef %93, double noundef %97, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %118

98:                                               ; preds = %49
  %99 = load ptr, ptr @glad_glOrtho, align 8, !tbaa !9
  %100 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %101 = fneg float %100
  %102 = fpext float %101 to double
  %103 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %104 = fpext float %103 to double
  %105 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %106 = fneg float %105
  %107 = load float, ptr %12, align 4, !tbaa !11
  %108 = fdiv float %106, %107
  %109 = load float, ptr @_ZN12_GLOBAL__N_15pan_yE, align 4, !tbaa !11
  %110 = fadd float %108, %109
  %111 = fpext float %110 to double
  %112 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %113 = load float, ptr %12, align 4, !tbaa !11
  %114 = fdiv float %112, %113
  %115 = load float, ptr @_ZN12_GLOBAL__N_15pan_yE, align 4, !tbaa !11
  %116 = fadd float %114, %115
  %117 = fpext float %116 to double
  call void %99(double noundef %102, double noundef %104, double noundef %111, double noundef %117, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %118

118:                                              ; preds = %98, %78
  call void @_ZL8InitDemoi(i32 noundef 0)
  br label %119

119:                                              ; preds = %218, %118
  %120 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  %121 = call i32 @glfwWindowShouldClose(ptr noundef %120)
  %122 = icmp ne i32 %121, 0
  %123 = xor i1 %122, true
  br i1 %123, label %124, label %223

124:                                              ; preds = %119
  %125 = load ptr, ptr @glad_glClear, align 8, !tbaa !9
  call void %125(i32 noundef 16640)
  call void @_Z26ImGui_ImplOpenGL2_NewFramev()
  call void @_Z23ImGui_ImplGlfw_NewFramev()
  call void @_ZN5ImGui8NewFrameEv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %13, float noundef 1.000000e+01, float noundef 1.000000e+01)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %14, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @_ZN5ImGui16SetNextWindowPosERK6ImVec2iS2_(ptr noundef nonnull align 4 dereferenceable(8) %13, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %126 = call noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef @.str.17, ptr noundef null, i32 noundef 787017)
  call void @_ZN5ImGui3EndEv()
  %127 = load i32, ptr @_ZN12_GLOBAL__N_19demoIndexE, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [9 x ptr], ptr @demoStrings, i64 0, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 5, ptr noundef %130)
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 35, ptr noundef @.str.18)
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #8
  %131 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %132 = load i8, ptr @_ZN5World18accumulateImpulsesE, align 1, !tbaa !18, !range !19, !noundef !20
  %133 = trunc i8 %132 to i1
  %134 = zext i1 %133 to i64
  %135 = select i1 %133, ptr @.str.20, ptr @.str.21
  %136 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %131, ptr noundef @.str.19, ptr noundef %135) #8
  %137 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 65, ptr noundef %137)
  %138 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %139 = load i8, ptr @_ZN5World18positionCorrectionE, align 1, !tbaa !18, !range !19, !noundef !20
  %140 = trunc i8 %139 to i1
  %141 = zext i1 %140 to i64
  %142 = select i1 %140, ptr @.str.20, ptr @.str.21
  %143 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %138, ptr noundef @.str.22, ptr noundef %142) #8
  %144 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 95, ptr noundef %144)
  %145 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %146 = load i8, ptr @_ZN5World12warmStartingE, align 1, !tbaa !18, !range !19, !noundef !20
  %147 = trunc i8 %146 to i1
  %148 = zext i1 %147 to i64
  %149 = select i1 %147, ptr @.str.20, ptr @.str.21
  %150 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %145, ptr noundef @.str.23, ptr noundef %149) #8
  %151 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 125, ptr noundef %151)
  %152 = load ptr, ptr @glad_glMatrixMode, align 8, !tbaa !9
  call void %152(i32 noundef 5888)
  %153 = load ptr, ptr @glad_glLoadIdentity, align 8, !tbaa !9
  call void %153()
  %154 = load float, ptr @_ZN12_GLOBAL__N_18timeStepE, align 4, !tbaa !11
  call void @_ZN5World4StepEf(ptr noundef nonnull align 8 dereferenceable(108) @_ZN12_GLOBAL__N_15worldE, float noundef %154)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %164, %124
  %156 = load i32, ptr %16, align 4, !tbaa !5
  %157 = load i32, ptr @_ZN12_GLOBAL__N_19numBodiesE, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  store i32 4, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %167

160:                                              ; preds = %155
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds %struct.Body, ptr @_ZN12_GLOBAL__N_16bodiesE, i64 %162
  call void @_ZL8DrawBodyP4Body(ptr noundef %163)
  br label %164

164:                                              ; preds = %160
  %165 = load i32, ptr %16, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %16, align 4, !tbaa !5
  br label %155, !llvm.loop !21

167:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %177, %167
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = load i32, ptr @_ZN12_GLOBAL__N_19numJointsE, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  store i32 7, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %180

173:                                              ; preds = %168
  %174 = load i32, ptr %17, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.Joint, ptr @_ZN12_GLOBAL__N_16jointsE, i64 %175
  call void @_ZL9DrawJointP5Joint(ptr noundef %176)
  br label %177

177:                                              ; preds = %173
  %178 = load i32, ptr %17, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %17, align 4, !tbaa !5
  br label %168, !llvm.loop !23

180:                                              ; preds = %172
  %181 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !9
  call void %181(float noundef 4.000000e+00)
  %182 = load ptr, ptr @glad_glColor3f, align 8, !tbaa !9
  call void %182(float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %183 = load ptr, ptr @glad_glBegin, align 8, !tbaa !9
  call void %183(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %184 = call ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (%struct.World, ptr @_ZN12_GLOBAL__N_15worldE, i32 0, i32 2)) #8
  %185 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %184, ptr %185, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2ERKSt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %186

186:                                              ; preds = %216, %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %187 = call ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (%struct.World, ptr @_ZN12_GLOBAL__N_15worldE, i32 0, i32 2)) #8
  %188 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %22, i32 0, i32 0
  store ptr %187, ptr %188, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2ERKSt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #8
  %189 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEES7_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br i1 %189, label %190, label %218

190:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %191 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %192 = getelementptr inbounds %"struct.std::pair", ptr %191, i32 0, i32 1
  store ptr %192, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %212, %190
  %194 = load i32, ptr %24, align 4, !tbaa !5
  %195 = load ptr, ptr %23, align 8, !tbaa !9
  %196 = getelementptr inbounds %struct.Arbiter, ptr %195, i32 0, i32 1
  %197 = load i32, ptr %196, align 8, !tbaa !25
  %198 = icmp slt i32 %194, %197
  br i1 %198, label %200, label %199

199:                                              ; preds = %193
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %215

200:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %201 = load ptr, ptr %23, align 8, !tbaa !9
  %202 = getelementptr inbounds %struct.Arbiter, ptr %201, i32 0, i32 0
  %203 = load i32, ptr %24, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [2 x %struct.Contact], ptr %202, i64 0, i64 %204
  %206 = getelementptr inbounds %struct.Contact, ptr %205, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 8 %206, i64 8, i1 false), !tbaa.struct !27
  %207 = load ptr, ptr @glad_glVertex2f, align 8, !tbaa !9
  %208 = getelementptr inbounds %struct.Vec2, ptr %25, i32 0, i32 0
  %209 = load float, ptr %208, align 4, !tbaa !28
  %210 = getelementptr inbounds %struct.Vec2, ptr %25, i32 0, i32 1
  %211 = load float, ptr %210, align 4, !tbaa !30
  call void %207(float noundef %209, float noundef %211)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %212

212:                                              ; preds = %200
  %213 = load i32, ptr %24, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %24, align 4, !tbaa !5
  br label %193, !llvm.loop !31

215:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %216

216:                                              ; preds = %215
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br label %186, !llvm.loop !32

218:                                              ; preds = %186
  %219 = load ptr, ptr @glad_glEnd, align 8, !tbaa !9
  call void %219()
  %220 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !9
  call void %220(float noundef 1.000000e+00)
  call void @_ZN5ImGui6RenderEv()
  %221 = call noundef ptr @_ZN5ImGui11GetDrawDataEv()
  call void @_Z32ImGui_ImplOpenGL2_RenderDrawDataP10ImDrawData(ptr noundef %221)
  call void @glfwPollEvents()
  %222 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %222)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #8
  br label %119, !llvm.loop !33

223:                                              ; preds = %119
  call void @glfwTerminate()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %224

224:                                              ; preds = %223, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %225

225:                                              ; preds = %224, %38, %29
  %226 = load i32, ptr %3, align 4
  ret i32 %226
}

declare ptr @glfwSetErrorCallback(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL17glfwErrorCallbackiPKc(i32 noundef, ptr noundef) #3

declare i32 @glfwInit() #2

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

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

declare void @glfwTerminate() #2

declare void @glfwMakeContextCurrent(ptr noundef) #2

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

declare i32 @gladLoadGL() #2

declare void @glfwSwapInterval(i32 noundef) #2

declare ptr @glfwSetWindowSizeCallback(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL7ReshapeP10GLFWwindowii(ptr noundef, i32 noundef, i32 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8KeyboardP10GLFWwindowiiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare void @glfwGetWindowContentScale(ptr noundef, ptr noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZN5ImGui30DebugCheckVersionAndDataLayoutEPKcmmmmm(ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #2

declare noundef ptr @_ZN5ImGui13CreateContextEP11ImFontAtlas(ptr noundef) #2

declare void @_ZN5ImGui18StyleColorsClassicEP10ImGuiStyle(ptr noundef) #2

declare noundef zeroext i1 @_Z28ImGui_ImplGlfw_InitForOpenGLP10GLFWwindowb(ptr noundef, i1 noundef zeroext) #2

declare noundef zeroext i1 @_Z22ImGui_ImplOpenGL2_Initv() #2

declare noundef nonnull align 8 dereferenceable(5448) ptr @_ZN5ImGui5GetIOEv() #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8InitDemoi(i32 noundef) #3

declare i32 @glfwWindowShouldClose(ptr noundef) #2

declare void @_Z26ImGui_ImplOpenGL2_NewFramev() #2

declare void @_Z23ImGui_ImplGlfw_NewFramev() #2

declare void @_ZN5ImGui8NewFrameEv() #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #6 align 2

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

declare noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef, ptr noundef, i32 noundef) #2

declare void @_ZN5ImGui3EndEv() #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8DrawTextiiPKc(i32 noundef, i32 noundef, ptr noundef) #7

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

declare void @_ZN5World4StepEf(ptr noundef nonnull align 8 dereferenceable(108), float noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8DrawBodyP4Body(ptr noundef) #7

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9DrawJointP5Joint(ptr noundef) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2ERKSt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEES7_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #6 align 2

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

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

declare void @_ZN5ImGui6RenderEv() #2

declare void @_Z32ImGui_ImplOpenGL2_RenderDrawDataP10ImDrawData(ptr noundef) #2

declare noundef ptr @_ZN5ImGui11GetDrawDataEv() #2

declare void @glfwPollEvents() #2

declare void @glfwSwapBuffers(ptr noundef) #2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !12, i64 160}
!14 = !{!"_ZTS7ImGuiIO", !6, i64 0, !6, i64 4, !15, i64 8, !12, i64 16, !12, i64 20, !10, i64 24, !10, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !7, i64 52, !12, i64 136, !12, i64 140, !10, i64 144, !10, i64 152, !12, i64 160, !16, i64 164, !10, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !16, i64 200, !16, i64 201, !16, i64 202, !16, i64 203, !16, i64 204, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !15, i64 296, !7, i64 304, !12, i64 312, !12, i64 316, !16, i64 320, !16, i64 321, !16, i64 322, !16, i64 323, !7, i64 324, !7, i64 836, !16, i64 920, !16, i64 921, !16, i64 922, !16, i64 923, !16, i64 924, !16, i64 925, !16, i64 926, !12, i64 928, !6, i64 932, !6, i64 936, !6, i64 940, !6, i64 944, !6, i64 948, !15, i64 952, !15, i64 960, !7, i64 968, !7, i64 1008, !7, i64 1048, !7, i64 1053, !7, i64 1058, !7, i64 1063, !7, i64 1068, !7, i64 1088, !7, i64 1108, !7, i64 1148, !7, i64 1168, !7, i64 3216, !7, i64 5264, !7, i64 5348, !17, i64 5432}
!15 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTS8ImVectorItE", !6, i64 0, !6, i64 4, !10, i64 8}
!18 = !{!16, !16, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{i64 0, i64 8, !9}
!25 = !{!26, !6, i64 128}
!26 = !{!"_ZTS7Arbiter", !7, i64 0, !6, i64 128, !10, i64 136, !10, i64 144, !12, i64 152}
!27 = !{i64 0, i64 4, !11, i64 4, i64 4, !11}
!28 = !{!29, !12, i64 0}
!29 = !{!"_ZTS4Vec2", !12, i64 0, !12, i64 4}
!30 = !{!29, !12, i64 4}
!31 = distinct !{!31, !22}
!32 = distinct !{!32, !22}
!33 = distinct !{!33, !22}


; 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.Body = type { %struct.Vec2, float, %struct.Vec2, float, %struct.Vec2, float, %struct.Vec2, float, float, float, float, float }
%struct.Vec2 = type { float, float }
%struct.Joint = type { %struct.Mat22, %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, ptr, ptr, float, float }
%struct.Mat22 = type { %struct.Vec2, %struct.Vec2 }
%struct.World = type <{ %"class.std::vector", %"class.std::vector.0", %"class.std::map", %struct.Vec2, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl" }
%"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Body *, std::allocator<Body *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl" }
%"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Joint *, std::allocator<Joint *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<ArbiterKey, std::pair<const ArbiterKey, Arbiter>, std::_Select1st<std::pair<const ArbiterKey, Arbiter>>, std::less<ArbiterKey>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<ArbiterKey, std::pair<const ArbiterKey, Arbiter>, std::_Select1st<std::pair<const ArbiterKey, Arbiter>>, std::less<ArbiterKey>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.ImVec2 = type { float, float }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%struct.Contact = type { %struct.Vec2, %struct.Vec2, %struct.Vec2, %struct.Vec2, float, float, float, float, float, float, float, %union.FeaturePair }
%union.FeaturePair = type { i32 }

@_ZN12_GLOBAL__N_16bodiesE = external hidden global [200 x %struct.Body], align 16
@_ZN12_GLOBAL__N_16jointsE = external hidden global [100 x %struct.Joint], align 16
@_ZN12_GLOBAL__N_15worldE = external hidden global %struct.World, align 8
@demoStrings = external dso_local local_unnamed_addr global [9 x ptr], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@_ZN12_GLOBAL__N_15widthE = external hidden local_unnamed_addr global i32, align 4
@_ZN12_GLOBAL__N_16heightE = external hidden local_unnamed_addr global i32, align 4
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZN12_GLOBAL__N_110mainWindowE = external hidden local_unnamed_addr global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [9 x i8], align 1
@glad_glViewport = external local_unnamed_addr global ptr, align 8
@glad_glMatrixMode = external local_unnamed_addr global ptr, align 8
@glad_glLoadIdentity = external local_unnamed_addr global ptr, align 8
@glad_glOrtho = external local_unnamed_addr global ptr, align 8
@_ZN12_GLOBAL__N_14zoomE = external hidden local_unnamed_addr global float, align 4
@_ZN12_GLOBAL__N_15pan_yE = external hidden local_unnamed_addr global float, align 4
@glad_glClear = external local_unnamed_addr global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZN12_GLOBAL__N_19demoIndexE = external hidden local_unnamed_addr global i32, align 4
@.str.18 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1
@_ZN5World18accumulateImpulsesE = external local_unnamed_addr global i8, align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZN5World18positionCorrectionE = external local_unnamed_addr global i8, align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@_ZN5World12warmStartingE = external local_unnamed_addr global i8, align 1
@_ZN12_GLOBAL__N_18timeStepE = external hidden local_unnamed_addr global float, align 4
@_ZN12_GLOBAL__N_19numBodiesE = external hidden local_unnamed_addr global i32, align 4
@_ZN12_GLOBAL__N_19numJointsE = external hidden local_unnamed_addr global i32, align 4
@glad_glPointSize = external local_unnamed_addr global ptr, align 8
@glad_glColor3f = external local_unnamed_addr global ptr, align 8
@glad_glBegin = external local_unnamed_addr global ptr, align 8
@glad_glVertex2f = external local_unnamed_addr global ptr, align 8
@glad_glEnd = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 -1, 1) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca %struct.ImVec2, align 4
  %6 = alloca %struct.ImVec2, align 4
  %7 = alloca [64 x i8], align 16
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @_ZL17glfwErrorCallbackiPKc)
  %14 = tail call i32 @glfwInit()
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %19

16:                                               ; preds = %2
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.12) #7
  br label %141

19:                                               ; preds = %2
  %20 = load i32, ptr @_ZN12_GLOBAL__N_15widthE, align 4, !tbaa !9
  %21 = load i32, ptr @_ZN12_GLOBAL__N_16heightE, align 4, !tbaa !9
  %22 = tail call ptr @glfwCreateWindow(i32 noundef %20, i32 noundef %21, ptr noundef nonnull @.str.13, ptr noundef null, ptr noundef null)
  store ptr %22, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %27

24:                                               ; preds = %19
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.14) #7
  tail call void @glfwTerminate()
  br label %141

27:                                               ; preds = %19
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %22)
  %28 = tail call i32 @gladLoadGL()
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.15) #7
  tail call void @glfwTerminate()
  br label %141

33:                                               ; preds = %27
  tail call void @glfwSwapInterval(i32 noundef 1)
  %34 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  %35 = tail call ptr @glfwSetWindowSizeCallback(ptr noundef %34, ptr noundef nonnull @_ZL7ReshapeP10GLFWwindowii)
  %36 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  %37 = tail call ptr @glfwSetKeyCallback(ptr noundef %36, ptr noundef nonnull @_ZL8KeyboardP10GLFWwindowiiii)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %38 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  call void @glfwGetWindowContentScale(ptr noundef %38, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %39 = load float, ptr %3, align 4, !tbaa !11
  %40 = call noundef zeroext i1 @_ZN5ImGui30DebugCheckVersionAndDataLayoutEPKcmmmmm(ptr noundef nonnull @.str.16, i64 noundef 5448, i64 noundef 928, i64 noundef 8, i64 noundef 16, i64 noundef 20)
  %41 = call noundef ptr @_ZN5ImGui13CreateContextEP11ImFontAtlas(ptr noundef null)
  call void @_ZN5ImGui18StyleColorsClassicEP10ImGuiStyle(ptr noundef null)
  %42 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  %43 = call noundef zeroext i1 @_Z28ImGui_ImplGlfw_InitForOpenGLP10GLFWwindowb(ptr noundef %42, i1 noundef zeroext true)
  %44 = call noundef zeroext i1 @_Z22ImGui_ImplOpenGL2_Initv()
  %45 = call noundef nonnull align 8 dereferenceable(5448) ptr @_ZN5ImGui5GetIOEv()
  %46 = getelementptr inbounds i8, ptr %45, i64 160
  store float %39, ptr %46, align 8, !tbaa !13
  %47 = load ptr, ptr @glad_glViewport, align 8, !tbaa !5
  %48 = load i32, ptr @_ZN12_GLOBAL__N_15widthE, align 4, !tbaa !9
  %49 = load i32, ptr @_ZN12_GLOBAL__N_16heightE, align 4, !tbaa !9
  call void %47(i32 noundef 0, i32 noundef 0, i32 noundef %48, i32 noundef %49)
  %50 = load ptr, ptr @glad_glMatrixMode, align 8, !tbaa !5
  call void %50(i32 noundef 5889)
  %51 = load ptr, ptr @glad_glLoadIdentity, align 8, !tbaa !5
  call void %51()
  %52 = load i32, ptr @_ZN12_GLOBAL__N_15widthE, align 4, !tbaa !9
  %53 = sitofp i32 %52 to float
  %54 = load i32, ptr @_ZN12_GLOBAL__N_16heightE, align 4, !tbaa !9
  %55 = sitofp i32 %54 to float
  %56 = fdiv float %53, %55
  %.not = icmp slt i32 %52, %54
  %57 = load ptr, ptr @glad_glOrtho, align 8, !tbaa !5
  %58 = load float, ptr @_ZN12_GLOBAL__N_14zoomE, align 4, !tbaa !11
  %59 = fneg float %58
  br i1 %.not, label %70, label %60

60:                                               ; preds = %33
  %61 = fmul float %56, %59
  %62 = fpext float %61 to double
  %63 = fmul float %56, %58
  %64 = fpext float %63 to double
  %65 = load float, ptr @_ZN12_GLOBAL__N_15pan_yE, align 4, !tbaa !11
  %66 = fsub float %65, %58
  %67 = fpext float %66 to double
  %68 = fadd float %58, %65
  %69 = fpext float %68 to double
  call void %57(double noundef %62, double noundef %64, double noundef %67, double noundef %69, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %79

70:                                               ; preds = %33
  %71 = fpext float %59 to double
  %72 = fpext float %58 to double
  %73 = load float, ptr @_ZN12_GLOBAL__N_15pan_yE, align 4, !tbaa !11
  %74 = fdiv float %58, %56
  %75 = fsub float %73, %74
  %76 = fpext float %75 to double
  %77 = fadd float %74, %73
  %78 = fpext float %77 to double
  call void %57(double noundef %71, double noundef %72, double noundef %76, double noundef %78, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %79

79:                                               ; preds = %70, %60
  call void @_ZL8InitDemoi(i32 noundef 0)
  %80 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  %81 = call i32 @glfwWindowShouldClose(ptr noundef %80)
  %.not2233 = icmp eq i32 %81, 0
  br i1 %.not2233, label %.lr.ph35, label %._crit_edge36

.lr.ph35:                                         ; preds = %79, %._crit_edge32
  %82 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  call void %82(i32 noundef 16640)
  call void @_Z26ImGui_ImplOpenGL2_NewFramev()
  call void @_Z23ImGui_ImplGlfw_NewFramev()
  call void @_ZN5ImGui8NewFrameEv()
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 1.000000e+01, float noundef 1.000000e+01)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @_ZN5ImGui16SetNextWindowPosERK6ImVec2iS2_(ptr noundef nonnull align 4 dereferenceable(8) %5, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %83 = call noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef nonnull @.str.17, ptr noundef null, i32 noundef 787017)
  call void @_ZN5ImGui3EndEv()
  %84 = load i32, ptr @_ZN12_GLOBAL__N_19demoIndexE, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [9 x ptr], ptr @demoStrings, i64 0, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 5, ptr noundef %87)
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 35, ptr noundef nonnull @.str.18)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #8
  %88 = load i8, ptr @_ZN5World18accumulateImpulsesE, align 1, !tbaa !18, !range !19, !noundef !20
  %89 = trunc nuw i8 %88 to i1
  %90 = select i1 %89, ptr @.str.20, ptr @.str.21
  %91 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.19, ptr noundef nonnull %90) #8
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 65, ptr noundef nonnull %7)
  %92 = load i8, ptr @_ZN5World18positionCorrectionE, align 1, !tbaa !18, !range !19, !noundef !20
  %93 = trunc nuw i8 %92 to i1
  %94 = select i1 %93, ptr @.str.20, ptr @.str.21
  %95 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef nonnull %94) #8
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 95, ptr noundef nonnull %7)
  %96 = load i8, ptr @_ZN5World12warmStartingE, align 1, !tbaa !18, !range !19, !noundef !20
  %97 = trunc nuw i8 %96 to i1
  %98 = select i1 %97, ptr @.str.20, ptr @.str.21
  %99 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.23, ptr noundef nonnull %98) #8
  call void @_ZL8DrawTextiiPKc(i32 noundef 5, i32 noundef 125, ptr noundef nonnull %7)
  %100 = load ptr, ptr @glad_glMatrixMode, align 8, !tbaa !5
  call void %100(i32 noundef 5888)
  %101 = load ptr, ptr @glad_glLoadIdentity, align 8, !tbaa !5
  call void %101()
  %102 = load float, ptr @_ZN12_GLOBAL__N_18timeStepE, align 4, !tbaa !11
  call void @_ZN5World4StepEf(ptr noundef nonnull align 8 dereferenceable(108) @_ZN12_GLOBAL__N_15worldE, float noundef %102)
  %103 = load i32, ptr @_ZN12_GLOBAL__N_19numBodiesE, align 4, !tbaa !9
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %.lr.ph35
  %105 = load i32, ptr @_ZN12_GLOBAL__N_19numJointsE, align 4, !tbaa !9
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %.lr.ph25, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph35, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph35 ]
  %107 = getelementptr inbounds %struct.Body, ptr @_ZN12_GLOBAL__N_16bodiesE, i64 %indvars.iv
  call void @_ZL8DrawBodyP4Body(ptr noundef nonnull %107)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %108 = load i32, ptr @_ZN12_GLOBAL__N_19numBodiesE, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = icmp slt i64 %indvars.iv.next, %109
  br i1 %110, label %.lr.ph, label %.preheader, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph25, %.preheader
  %111 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  call void %111(float noundef 4.000000e+00)
  %112 = load ptr, ptr @glad_glColor3f, align 8, !tbaa !5
  call void %112(float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %113 = load ptr, ptr @glad_glBegin, align 8, !tbaa !5
  call void %113(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %114 = call ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @_ZN12_GLOBAL__N_15worldE, i64 48)) #8
  store ptr %114, ptr %10, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2ERKSt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %115 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %115, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %116 = call ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @_ZN12_GLOBAL__N_15worldE, i64 48)) #8
  store ptr %116, ptr %12, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2ERKSt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %117 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEES7_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  br i1 %117, label %.lr.ph31, label %._crit_edge32

.lr.ph25:                                         ; preds = %.preheader, %.lr.ph25
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %.lr.ph25 ], [ 0, %.preheader ]
  %118 = getelementptr inbounds %struct.Joint, ptr @_ZN12_GLOBAL__N_16jointsE, i64 %indvars.iv38
  call void @_ZL9DrawJointP5Joint(ptr noundef nonnull %118)
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %119 = load i32, ptr @_ZN12_GLOBAL__N_19numJointsE, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = icmp slt i64 %indvars.iv.next39, %120
  br i1 %121, label %.lr.ph25, label %._crit_edge, !llvm.loop !23

.lr.ph31:                                         ; preds = %._crit_edge, %._crit_edge29
  %122 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %123 = getelementptr inbounds i8, ptr %122, i64 16
  %124 = getelementptr inbounds i8, ptr %122, i64 144
  %125 = load i32, ptr %124, align 8, !tbaa !24
  %126 = icmp sgt i32 %125, 0
  br i1 %126, label %.lr.ph28, label %._crit_edge29

._crit_edge29:                                    ; preds = %.lr.ph28, %.lr.ph31
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %128 = call ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @_ZN12_GLOBAL__N_15worldE, i64 48)) #8
  store ptr %128, ptr %12, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2ERKSt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %129 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEES7_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  br i1 %129, label %.lr.ph31, label %._crit_edge32, !llvm.loop !26

.lr.ph28:                                         ; preds = %.lr.ph31, %.lr.ph28
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %.lr.ph28 ], [ 0, %.lr.ph31 ]
  %130 = getelementptr inbounds [2 x %struct.Contact], ptr %123, i64 0, i64 %indvars.iv41
  %.sroa.0.0.copyload = load float, ptr %130, align 8, !tbaa !11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %130, i64 4
  %.sroa.4.0.copyload = load float, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !11
  %131 = load ptr, ptr @glad_glVertex2f, align 8, !tbaa !5
  call void %131(float noundef %.sroa.0.0.copyload, float noundef %.sroa.4.0.copyload)
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %132 = load i32, ptr %124, align 8, !tbaa !24
  %133 = sext i32 %132 to i64
  %134 = icmp slt i64 %indvars.iv.next42, %133
  br i1 %134, label %.lr.ph28, label %._crit_edge29, !llvm.loop !27

._crit_edge32:                                    ; preds = %._crit_edge29, %._crit_edge
  %135 = load ptr, ptr @glad_glEnd, align 8, !tbaa !5
  call void %135()
  %136 = load ptr, ptr @glad_glPointSize, align 8, !tbaa !5
  call void %136(float noundef 1.000000e+00)
  call void @_ZN5ImGui6RenderEv()
  %137 = call noundef ptr @_ZN5ImGui11GetDrawDataEv()
  call void @_Z32ImGui_ImplOpenGL2_RenderDrawDataP10ImDrawData(ptr noundef %137)
  call void @glfwPollEvents()
  %138 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  call void @glfwSwapBuffers(ptr noundef %138)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #8
  %139 = load ptr, ptr @_ZN12_GLOBAL__N_110mainWindowE, align 8, !tbaa !5
  %140 = call i32 @glfwWindowShouldClose(ptr noundef %139)
  %.not22 = icmp eq i32 %140, 0
  br i1 %.not22, label %.lr.ph35, label %._crit_edge36, !llvm.loop !28

._crit_edge36:                                    ; preds = %._crit_edge32, %79
  call void @glfwTerminate()
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %141

141:                                              ; preds = %30, %._crit_edge36, %24, %16
  %.1 = phi i32 [ -1, %16 ], [ -1, %24 ], [ -1, %30 ], [ 0, %._crit_edge36 ]
  ret i32 %.1
}

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL17glfwErrorCallbackiPKc(i32 noundef, ptr noundef) #2

declare i32 @glfwInit() local_unnamed_addr #1

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

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

declare void @glfwTerminate() local_unnamed_addr #1

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #1

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

declare i32 @gladLoadGL() local_unnamed_addr #1

declare void @glfwSwapInterval(i32 noundef) local_unnamed_addr #1

declare ptr @glfwSetWindowSizeCallback(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL7ReshapeP10GLFWwindowii(ptr noundef, i32 noundef, i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8KeyboardP10GLFWwindowiiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

declare noundef zeroext i1 @_ZN5ImGui30DebugCheckVersionAndDataLayoutEPKcmmmmm(ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare noundef ptr @_ZN5ImGui13CreateContextEP11ImFontAtlas(ptr noundef) local_unnamed_addr #1

declare void @_ZN5ImGui18StyleColorsClassicEP10ImGuiStyle(ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_Z28ImGui_ImplGlfw_InitForOpenGLP10GLFWwindowb(ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

declare noundef zeroext i1 @_Z22ImGui_ImplOpenGL2_Initv() local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(5448) ptr @_ZN5ImGui5GetIOEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8InitDemoi(i32 noundef) local_unnamed_addr #2

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #1

declare void @_Z26ImGui_ImplOpenGL2_NewFramev() local_unnamed_addr #1

declare void @_Z23ImGui_ImplGlfw_NewFramev() local_unnamed_addr #1

declare void @_ZN5ImGui8NewFrameEv() local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #5 align 2

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

declare noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN5ImGui3EndEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8DrawTextiiPKc(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

declare void @_ZN5World4StepEf(ptr noundef nonnull align 8 dereferenceable(108), float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL8DrawBodyP4Body(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9DrawJointP5Joint(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEEC2ERKSt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIK10ArbiterKey7ArbiterEES7_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapI10ArbiterKey7ArbiterSt4lessIS0_ESaISt4pairIKS0_S1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #5 align 2

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

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

declare void @_ZN5ImGui6RenderEv() local_unnamed_addr #1

declare void @_Z32ImGui_ImplOpenGL2_RenderDrawDataP10ImDrawData(ptr noundef) local_unnamed_addr #1

declare noundef ptr @_ZN5ImGui11GetDrawDataEv() local_unnamed_addr #1

declare void @glfwPollEvents() local_unnamed_addr #1

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #1

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !12, i64 160}
!14 = !{!"_ZTS7ImGuiIO", !10, i64 0, !10, i64 4, !15, i64 8, !12, i64 16, !12, i64 20, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !7, i64 52, !12, i64 136, !12, i64 140, !6, i64 144, !6, i64 152, !12, i64 160, !16, i64 164, !6, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !16, i64 200, !16, i64 201, !16, i64 202, !16, i64 203, !16, i64 204, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !15, i64 296, !7, i64 304, !12, i64 312, !12, i64 316, !16, i64 320, !16, i64 321, !16, i64 322, !16, i64 323, !7, i64 324, !7, i64 836, !16, i64 920, !16, i64 921, !16, i64 922, !16, i64 923, !16, i64 924, !16, i64 925, !16, i64 926, !12, i64 928, !10, i64 932, !10, i64 936, !10, i64 940, !10, i64 944, !10, i64 948, !15, i64 952, !15, i64 960, !7, i64 968, !7, i64 1008, !7, i64 1048, !7, i64 1053, !7, i64 1058, !7, i64 1063, !7, i64 1068, !7, i64 1088, !7, i64 1108, !7, i64 1148, !7, i64 1168, !7, i64 3216, !7, i64 5264, !7, i64 5348, !17, i64 5432}
!15 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !6, i64 8}
!18 = !{!16, !16, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!25, !10, i64 128}
!25 = !{!"_ZTS7Arbiter", !7, i64 0, !10, i64 128, !6, i64 136, !6, i64 144, !12, i64 152}
!26 = distinct !{!26, !22}
!27 = distinct !{!27, !22}
!28 = distinct !{!28, !22}


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