; LLVM IR from l1mey112/yr11-physics-applied :: sokol (sokol)

; 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._sg_state_t = type { i8, %struct.sg_desc, i32, %struct.sg_context, %struct.sg_pass, %struct.sg_pipeline, i8, i8, i8, i32, %struct._sg_pools_t, i32, %struct.sg_features, %struct.sg_limits, [64 x %struct.sg_pixelformat_info], %struct._sg_gl_backend_t, %struct._sg_commit_listeners_t }
%struct.sg_desc = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, %struct.sg_allocator, %struct.sg_logger, %struct.sg_context_desc, i32 }
%struct.sg_allocator = type { ptr, ptr, ptr }
%struct.sg_logger = type { ptr, ptr }
%struct.sg_context_desc = type { i32, i32, i32, %struct.sg_gl_context_desc, %struct.sg_metal_context_desc, %struct.sg_d3d11_context_desc, %struct.sg_wgpu_context_desc }
%struct.sg_gl_context_desc = type { i8 }
%struct.sg_metal_context_desc = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sg_d3d11_context_desc = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sg_wgpu_context_desc = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sg_context = type { i32 }
%struct.sg_pass = type { i32 }
%struct.sg_pipeline = type { i32 }
%struct._sg_pools_t = type { %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._sg_pool_t = type { i32, i32, ptr, ptr }
%struct.sg_features = type { i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.sg_limits = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.sg_pixelformat_info = type { i8, i8, i8, i8, i8, i8 }
%struct._sg_gl_backend_t = type { i8, i8, i8, i32, i32, ptr, ptr, %struct.sg_pass, %struct._sg_gl_state_cache_t, i8, i32, i32 }
%struct._sg_gl_state_cache_t = type { %struct.sg_depth_state, %struct.sg_stencil_state, %struct.sg_blend_state, [4 x i32], i32, i32, i8, i32, %struct.sg_color, i8, [16 x %struct._sg_gl_cache_attr_t], i32, i32, i32, i32, i32, [12 x %struct._sg_gl_texture_bind_slot], %struct._sg_gl_texture_bind_slot, i32, i32, i32, i32, ptr, %struct.sg_pipeline }
%struct.sg_depth_state = type { i32, i32, i8, float, float, float }
%struct.sg_stencil_state = type { i8, %struct.sg_stencil_face_state, %struct.sg_stencil_face_state, i8, i8, i8 }
%struct.sg_stencil_face_state = type { i32, i32, i32, i32 }
%struct.sg_blend_state = type { i8, i32, i32, i32, i32, i32, i32 }
%struct.sg_color = type { float, float, float, float }
%struct._sg_gl_cache_attr_t = type { %struct._sg_gl_attr_t, i32 }
%struct._sg_gl_attr_t = type { i8, i8, i8, i8, i8, i32, i32 }
%struct._sg_gl_texture_bind_slot = type { i32, i32 }
%struct._sg_commit_listeners_t = type { i32, i32, ptr }
%struct.sg_bindings = type { i32, [8 x %struct.sg_buffer], [8 x i32], %struct.sg_buffer, i32, [12 x %struct.sg_image], [12 x %struct.sg_image], i32 }
%struct.sg_buffer = type { i32 }
%struct.sg_image = type { i32 }
%struct._sg_gl_buffer_t = type { %struct._sg_slot_t, %struct._sg_buffer_common_t, %struct.anon.0 }
%struct._sg_slot_t = type { i32, i32, i32 }
%struct._sg_buffer_common_t = type { i32, i32, i8, i32, i32, i32, i32, i32, i32 }
%struct.anon.0 = type { [2 x i32], i8 }
%struct._sg_gl_image_t = type { %struct._sg_slot_t, %struct._sg_image_common_t, %struct.anon.1 }
%struct._sg_image_common_t = type { i32, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.1 = type { i32, i32, i32, [2 x i32], i8 }

@.str.16 = external hidden unnamed_addr constant [81 x i8], align 1
@_sg = external hidden global %struct._sg_state_t, align 8
@.str.19 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__.sg_apply_bindings = external hidden unnamed_addr constant [44 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [11 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sg_apply_bindings(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [8 x ptr], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca [12 x ptr], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [12 x ptr], align 16
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %17 = load i8, ptr @_sg, align 8, !tbaa !9, !range !38, !noundef !39
  %18 = trunc i8 %17 to i1
  br i1 %18, label %19, label %20

19:                                               ; preds = %1
  br label %21

20:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.16, i32 noundef 16499, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

21:                                               ; preds = %19
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  br label %26

25:                                               ; preds = %21
  call void @__assert_fail(ptr noundef @.str.48, ptr noundef @.str.16, i32 noundef 16500, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

26:                                               ; preds = %24
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.sg_bindings, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !40
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %37

31:                                               ; preds = %26
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.sg_bindings, ptr %32, i32 0, i32 7
  %34 = load i32, ptr %33, align 4, !tbaa !43
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %31
  br label %38

37:                                               ; preds = %31, %26
  call void @__assert_fail(ptr noundef @.str.49, ptr noundef @.str.16, i32 noundef 16501, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

38:                                               ; preds = %36
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = call zeroext i1 @_sg_validate_apply_bindings(ptr noundef %39)
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  store i8 0, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44
  br label %300

42:                                               ; preds = %38
  store i8 1, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 7), align 1, !tbaa !45
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %43 = load i32, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 5), align 4, !tbaa !46
  %44 = call ptr @_sg_lookup_pipeline(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 noundef %43)
  store ptr %44, ptr %3, align 8, !tbaa !5
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %42
  br label %49

48:                                               ; preds = %42
  call void @__assert_fail(ptr noundef @.str.46, ptr noundef @.str.16, i32 noundef 16510, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 64, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 16 %4, i8 0, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !47
  br label %50

50:                                               ; preds = %116, %49
  %51 = load i32, ptr %6, align 4, !tbaa !47
  %52 = icmp slt i32 %51, 8
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 2, ptr %7, align 4
  br label %121

54:                                               ; preds = %50
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.sg_bindings, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %6, align 4, !tbaa !47
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [8 x %struct.sg_buffer], ptr %56, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.sg_buffer, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 4, !tbaa !48
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %114

63:                                               ; preds = %54
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.sg_bindings, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %6, align 4, !tbaa !47
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [8 x %struct.sg_buffer], ptr %65, i64 0, i64 %67
  %69 = getelementptr inbounds %struct.sg_buffer, ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 4, !tbaa !48
  %71 = call ptr @_sg_lookup_buffer(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 noundef %70)
  %72 = load i32, ptr %6, align 4, !tbaa !47
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [8 x ptr], ptr %4, i64 0, i64 %73
  store ptr %71, ptr %74, align 8, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !47
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [8 x ptr], ptr %4, i64 0, i64 %76
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %81

80:                                               ; preds = %63
  br label %82

81:                                               ; preds = %63
  call void @__assert_fail(ptr noundef @.str.50, ptr noundef @.str.16, i32 noundef 16517, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

82:                                               ; preds = %80
  %83 = load i32, ptr %6, align 4, !tbaa !47
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [8 x ptr], ptr %4, i64 0, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._sg_gl_buffer_t, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %struct._sg_slot_t, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !49
  %90 = icmp eq i32 2, %89
  %91 = zext i1 %90 to i32
  %92 = load i8, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44, !range !38, !noundef !39
  %93 = trunc i8 %92 to i1
  %94 = zext i1 %93 to i32
  %95 = and i32 %94, %91
  %96 = icmp ne i32 %95, 0
  %97 = zext i1 %96 to i8
  store i8 %97, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44
  %98 = load i32, ptr %6, align 4, !tbaa !47
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [8 x ptr], ptr %4, i64 0, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._sg_gl_buffer_t, ptr %101, i32 0, i32 1
  %103 = getelementptr inbounds %struct._sg_buffer_common_t, ptr %102, i32 0, i32 2
  %104 = load i8, ptr %103, align 4, !tbaa !54, !range !38, !noundef !39
  %105 = trunc i8 %104 to i1
  %106 = xor i1 %105, true
  %107 = zext i1 %106 to i32
  %108 = load i8, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44, !range !38, !noundef !39
  %109 = trunc i8 %108 to i1
  %110 = zext i1 %109 to i32
  %111 = and i32 %110, %107
  %112 = icmp ne i32 %111, 0
  %113 = zext i1 %112 to i8
  store i8 %113, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44
  br label %115

114:                                              ; preds = %54
  store i32 2, ptr %7, align 4
  br label %121

115:                                              ; preds = %82
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %6, align 4, !tbaa !47
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %6, align 4, !tbaa !47
  %119 = load i32, ptr %5, align 4, !tbaa !47
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %5, align 4, !tbaa !47
  br label %50, !llvm.loop !55

121:                                              ; preds = %114, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %122

122:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr null, ptr %8, align 8, !tbaa !5
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.sg_bindings, ptr %123, i32 0, i32 3
  %125 = getelementptr inbounds %struct.sg_buffer, ptr %124, i32 0, i32 0
  %126 = load i32, ptr %125, align 4, !tbaa !57
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %164

128:                                              ; preds = %122
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.sg_bindings, ptr %129, i32 0, i32 3
  %131 = getelementptr inbounds %struct.sg_buffer, ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 4, !tbaa !57
  %133 = call ptr @_sg_lookup_buffer(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 noundef %132)
  store ptr %133, ptr %8, align 8, !tbaa !5
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %137

136:                                              ; preds = %128
  br label %138

137:                                              ; preds = %128
  call void @__assert_fail(ptr noundef @.str.51, ptr noundef @.str.16, i32 noundef 16529, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

138:                                              ; preds = %136
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._sg_gl_buffer_t, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds %struct._sg_slot_t, ptr %140, i32 0, i32 2
  %142 = load i32, ptr %141, align 4, !tbaa !49
  %143 = icmp eq i32 2, %142
  %144 = zext i1 %143 to i32
  %145 = load i8, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44, !range !38, !noundef !39
  %146 = trunc i8 %145 to i1
  %147 = zext i1 %146 to i32
  %148 = and i32 %147, %144
  %149 = icmp ne i32 %148, 0
  %150 = zext i1 %149 to i8
  store i8 %150, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._sg_gl_buffer_t, ptr %151, i32 0, i32 1
  %153 = getelementptr inbounds %struct._sg_buffer_common_t, ptr %152, i32 0, i32 2
  %154 = load i8, ptr %153, align 4, !tbaa !54, !range !38, !noundef !39
  %155 = trunc i8 %154 to i1
  %156 = xor i1 %155, true
  %157 = zext i1 %156 to i32
  %158 = load i8, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44, !range !38, !noundef !39
  %159 = trunc i8 %158 to i1
  %160 = zext i1 %159 to i32
  %161 = and i32 %160, %157
  %162 = icmp ne i32 %161, 0
  %163 = zext i1 %162 to i8
  store i8 %163, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44
  br label %164

164:                                              ; preds = %138, %122
  call void @llvm.lifetime.start.p0(i64 96, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 96, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !47
  br label %165

165:                                              ; preds = %215, %164
  %166 = load i32, ptr %11, align 4, !tbaa !47
  %167 = icmp slt i32 %166, 12
  br i1 %167, label %169, label %168

168:                                              ; preds = %165
  store i32 5, ptr %7, align 4
  br label %220

169:                                              ; preds = %165
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.sg_bindings, ptr %170, i32 0, i32 5
  %172 = load i32, ptr %11, align 4, !tbaa !47
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [12 x %struct.sg_image], ptr %171, i64 0, i64 %173
  %175 = getelementptr inbounds %struct.sg_image, ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 4, !tbaa !58
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %213

178:                                              ; preds = %169
  %179 = load ptr, ptr %2, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.sg_bindings, ptr %179, i32 0, i32 5
  %181 = load i32, ptr %11, align 4, !tbaa !47
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [12 x %struct.sg_image], ptr %180, i64 0, i64 %182
  %184 = getelementptr inbounds %struct.sg_image, ptr %183, i32 0, i32 0
  %185 = load i32, ptr %184, align 4, !tbaa !58
  %186 = call ptr @_sg_lookup_image(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 noundef %185)
  %187 = load i32, ptr %11, align 4, !tbaa !47
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [12 x ptr], ptr %9, i64 0, i64 %188
  store ptr %186, ptr %189, align 8, !tbaa !5
  %190 = load i32, ptr %11, align 4, !tbaa !47
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [12 x ptr], ptr %9, i64 0, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  %194 = icmp ne ptr %193, null
  br i1 %194, label %195, label %196

195:                                              ; preds = %178
  br label %197

196:                                              ; preds = %178
  call void @__assert_fail(ptr noundef @.str.52, ptr noundef @.str.16, i32 noundef 16539, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

197:                                              ; preds = %195
  %198 = load i32, ptr %11, align 4, !tbaa !47
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [12 x ptr], ptr %9, i64 0, i64 %199
  %201 = load ptr, ptr %200, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._sg_gl_image_t, ptr %201, i32 0, i32 0
  %203 = getelementptr inbounds %struct._sg_slot_t, ptr %202, i32 0, i32 2
  %204 = load i32, ptr %203, align 4, !tbaa !60
  %205 = icmp eq i32 2, %204
  %206 = zext i1 %205 to i32
  %207 = load i8, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44, !range !38, !noundef !39
  %208 = trunc i8 %207 to i1
  %209 = zext i1 %208 to i32
  %210 = and i32 %209, %206
  %211 = icmp ne i32 %210, 0
  %212 = zext i1 %211 to i8
  store i8 %212, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44
  br label %214

213:                                              ; preds = %169
  store i32 5, ptr %7, align 4
  br label %220

214:                                              ; preds = %197
  br label %215

215:                                              ; preds = %214
  %216 = load i32, ptr %11, align 4, !tbaa !47
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %11, align 4, !tbaa !47
  %218 = load i32, ptr %10, align 4, !tbaa !47
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %10, align 4, !tbaa !47
  br label %165, !llvm.loop !64

220:                                              ; preds = %213, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %221

221:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 96, ptr %12) #6
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 96, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !47
  br label %222

222:                                              ; preds = %272, %221
  %223 = load i32, ptr %14, align 4, !tbaa !47
  %224 = icmp slt i32 %223, 12
  br i1 %224, label %226, label %225

225:                                              ; preds = %222
  store i32 8, ptr %7, align 4
  br label %277

226:                                              ; preds = %222
  %227 = load ptr, ptr %2, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.sg_bindings, ptr %227, i32 0, i32 6
  %229 = load i32, ptr %14, align 4, !tbaa !47
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [12 x %struct.sg_image], ptr %228, i64 0, i64 %230
  %232 = getelementptr inbounds %struct.sg_image, ptr %231, i32 0, i32 0
  %233 = load i32, ptr %232, align 4, !tbaa !58
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %270

235:                                              ; preds = %226
  %236 = load ptr, ptr %2, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.sg_bindings, ptr %236, i32 0, i32 6
  %238 = load i32, ptr %14, align 4, !tbaa !47
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [12 x %struct.sg_image], ptr %237, i64 0, i64 %239
  %241 = getelementptr inbounds %struct.sg_image, ptr %240, i32 0, i32 0
  %242 = load i32, ptr %241, align 4, !tbaa !58
  %243 = call ptr @_sg_lookup_image(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 noundef %242)
  %244 = load i32, ptr %14, align 4, !tbaa !47
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [12 x ptr], ptr %12, i64 0, i64 %245
  store ptr %243, ptr %246, align 8, !tbaa !5
  %247 = load i32, ptr %14, align 4, !tbaa !47
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [12 x ptr], ptr %12, i64 0, i64 %248
  %250 = load ptr, ptr %249, align 8, !tbaa !5
  %251 = icmp ne ptr %250, null
  br i1 %251, label %252, label %253

252:                                              ; preds = %235
  br label %254

253:                                              ; preds = %235
  call void @__assert_fail(ptr noundef @.str.53, ptr noundef @.str.16, i32 noundef 16552, ptr noundef @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

254:                                              ; preds = %252
  %255 = load i32, ptr %14, align 4, !tbaa !47
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [12 x ptr], ptr %12, i64 0, i64 %256
  %258 = load ptr, ptr %257, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct._sg_gl_image_t, ptr %258, i32 0, i32 0
  %260 = getelementptr inbounds %struct._sg_slot_t, ptr %259, i32 0, i32 2
  %261 = load i32, ptr %260, align 4, !tbaa !60
  %262 = icmp eq i32 2, %261
  %263 = zext i1 %262 to i32
  %264 = load i8, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44, !range !38, !noundef !39
  %265 = trunc i8 %264 to i1
  %266 = zext i1 %265 to i32
  %267 = and i32 %266, %263
  %268 = icmp ne i32 %267, 0
  %269 = zext i1 %268 to i8
  store i8 %269, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44
  br label %271

270:                                              ; preds = %226
  store i32 8, ptr %7, align 4
  br label %277

271:                                              ; preds = %254
  br label %272

272:                                              ; preds = %271
  %273 = load i32, ptr %14, align 4, !tbaa !47
  %274 = add nsw i32 %273, 1
  store i32 %274, ptr %14, align 4, !tbaa !47
  %275 = load i32, ptr %13, align 4, !tbaa !47
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %13, align 4, !tbaa !47
  br label %222, !llvm.loop !65

277:                                              ; preds = %270, %225
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %278

278:                                              ; preds = %277
  %279 = load i8, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 8), align 2, !tbaa !44, !range !38, !noundef !39
  %280 = trunc i8 %279 to i1
  br i1 %280, label %281, label %298

281:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %282 = load ptr, ptr %2, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.sg_bindings, ptr %282, i32 0, i32 2
  %284 = getelementptr inbounds [8 x i32], ptr %283, i64 0, i64 0
  store ptr %284, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %285 = load ptr, ptr %2, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.sg_bindings, ptr %285, i32 0, i32 4
  %287 = load i32, ptr %286, align 4, !tbaa !66
  store i32 %287, ptr %16, align 4, !tbaa !47
  %288 = load ptr, ptr %3, align 8, !tbaa !5
  %289 = getelementptr inbounds [8 x ptr], ptr %4, i64 0, i64 0
  %290 = load ptr, ptr %15, align 8, !tbaa !5
  %291 = load i32, ptr %5, align 4, !tbaa !47
  %292 = load ptr, ptr %8, align 8, !tbaa !5
  %293 = load i32, ptr %16, align 4, !tbaa !47
  %294 = getelementptr inbounds [12 x ptr], ptr %9, i64 0, i64 0
  %295 = load i32, ptr %10, align 4, !tbaa !47
  %296 = getelementptr inbounds [12 x ptr], ptr %12, i64 0, i64 0
  %297 = load i32, ptr %13, align 4, !tbaa !47
  call void @_sg_apply_bindings(ptr noundef %288, ptr noundef %289, ptr noundef %290, i32 noundef %291, ptr noundef %292, i32 noundef %293, ptr noundef %294, i32 noundef %295, ptr noundef %296, i32 noundef %297)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %299

298:                                              ; preds = %278
  br label %299

299:                                              ; preds = %298, %281
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %300

300:                                              ; preds = %299, %41
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_sg_validate_apply_bindings(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @_sg_apply_bindings(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8, !13, i64 288, !21, i64 292, !22, i64 296, !23, i64 300, !11, i64 304, !11, i64 305, !11, i64 306, !13, i64 308, !24, i64 312, !13, i64 504, !26, i64 508, !27, i64 520, !7, i64 548, !28, i64 936, !37, i64 1616}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"sg_desc", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !11, i64 44, !14, i64 48, !15, i64 72, !16, i64 88, !13, i64 272}
!13 = !{!"int", !7, i64 0}
!14 = !{!"sg_allocator", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"sg_logger", !6, i64 0, !6, i64 8}
!16 = !{!"sg_context_desc", !13, i64 0, !13, i64 4, !13, i64 8, !17, i64 12, !18, i64 16, !19, i64 64, !20, i64 120}
!17 = !{!"sg_gl_context_desc", !11, i64 0}
!18 = !{!"sg_metal_context_desc", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!19 = !{!"sg_d3d11_context_desc", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!20 = !{!"sg_wgpu_context_desc", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!21 = !{!"sg_context", !13, i64 0}
!22 = !{!"sg_pass", !13, i64 0}
!23 = !{!"sg_pipeline", !13, i64 0}
!24 = !{!"", !25, i64 0, !25, i64 24, !25, i64 48, !25, i64 72, !25, i64 96, !25, i64 120, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184}
!25 = !{!"", !13, i64 0, !13, i64 4, !6, i64 8, !6, i64 16}
!26 = !{!"sg_features", !11, i64 0, !11, i64 1, !11, i64 2, !11, i64 3, !11, i64 4, !11, i64 5, !11, i64 6, !11, i64 7, !11, i64 8}
!27 = !{!"sg_limits", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24}
!28 = !{!"", !11, i64 0, !11, i64 1, !11, i64 2, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !22, i64 32, !29, i64 40, !11, i64 664, !13, i64 668, !13, i64 672}
!29 = !{!"", !30, i64 0, !32, i64 24, !34, i64 64, !7, i64 92, !13, i64 108, !13, i64 112, !11, i64 116, !13, i64 120, !35, i64 124, !11, i64 140, !7, i64 144, !13, i64 464, !13, i64 468, !13, i64 472, !13, i64 476, !13, i64 480, !7, i64 484, !36, i64 580, !13, i64 588, !13, i64 592, !13, i64 596, !13, i64 600, !6, i64 608, !23, i64 616}
!30 = !{!"sg_depth_state", !13, i64 0, !13, i64 4, !11, i64 8, !31, i64 12, !31, i64 16, !31, i64 20}
!31 = !{!"float", !7, i64 0}
!32 = !{!"sg_stencil_state", !11, i64 0, !33, i64 4, !33, i64 20, !7, i64 36, !7, i64 37, !7, i64 38}
!33 = !{!"sg_stencil_face_state", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!34 = !{!"sg_blend_state", !11, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24}
!35 = !{!"sg_color", !31, i64 0, !31, i64 4, !31, i64 8, !31, i64 12}
!36 = !{!"", !13, i64 0, !13, i64 4}
!37 = !{!"", !13, i64 0, !13, i64 4, !6, i64 8}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = !{!41, !13, i64 0}
!41 = !{!"sg_bindings", !13, i64 0, !7, i64 4, !7, i64 36, !42, i64 68, !13, i64 72, !7, i64 76, !7, i64 124, !13, i64 172}
!42 = !{!"sg_buffer", !13, i64 0}
!43 = !{!41, !13, i64 172}
!44 = !{!10, !11, i64 306}
!45 = !{!10, !11, i64 305}
!46 = !{!10, !13, i64 300}
!47 = !{!13, !13, i64 0}
!48 = !{!42, !13, i64 0}
!49 = !{!50, !13, i64 8}
!50 = !{!"", !51, i64 0, !52, i64 12, !53, i64 48}
!51 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8}
!52 = !{!"", !13, i64 0, !13, i64 4, !11, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32}
!53 = !{!"", !7, i64 0, !11, i64 8}
!54 = !{!50, !11, i64 20}
!55 = distinct !{!55, !56}
!56 = !{!"llvm.loop.mustprogress"}
!57 = !{!41, !13, i64 68}
!58 = !{!59, !13, i64 0}
!59 = !{!"sg_image", !13, i64 0}
!60 = !{!61, !13, i64 8}
!61 = !{!"", !51, i64 0, !62, i64 12, !63, i64 88}
!62 = !{!"", !13, i64 0, !11, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72}
!63 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !7, i64 12, !11, i64 20}
!64 = distinct !{!64, !56}
!65 = distinct !{!65, !56}
!66 = !{!41, !13, i64 72}


; 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._sg_state_t = type { i8, %struct.sg_desc, i32, %struct.sg_context, %struct.sg_pass, %struct.sg_pipeline, i8, i8, i8, i32, %struct._sg_pools_t, i32, %struct.sg_features, %struct.sg_limits, [64 x %struct.sg_pixelformat_info], %struct._sg_gl_backend_t, %struct._sg_commit_listeners_t }
%struct.sg_desc = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, %struct.sg_allocator, %struct.sg_logger, %struct.sg_context_desc, i32 }
%struct.sg_allocator = type { ptr, ptr, ptr }
%struct.sg_logger = type { ptr, ptr }
%struct.sg_context_desc = type { i32, i32, i32, %struct.sg_gl_context_desc, %struct.sg_metal_context_desc, %struct.sg_d3d11_context_desc, %struct.sg_wgpu_context_desc }
%struct.sg_gl_context_desc = type { i8 }
%struct.sg_metal_context_desc = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sg_d3d11_context_desc = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sg_wgpu_context_desc = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sg_context = type { i32 }
%struct.sg_pass = type { i32 }
%struct.sg_pipeline = type { i32 }
%struct._sg_pools_t = type { %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, %struct._sg_pool_t, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._sg_pool_t = type { i32, i32, ptr, ptr }
%struct.sg_features = type { i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.sg_limits = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.sg_pixelformat_info = type { i8, i8, i8, i8, i8, i8 }
%struct._sg_gl_backend_t = type { i8, i8, i8, i32, i32, ptr, ptr, %struct.sg_pass, %struct._sg_gl_state_cache_t, i8, i32, i32 }
%struct._sg_gl_state_cache_t = type { %struct.sg_depth_state, %struct.sg_stencil_state, %struct.sg_blend_state, [4 x i32], i32, i32, i8, i32, %struct.sg_color, i8, [16 x %struct._sg_gl_cache_attr_t], i32, i32, i32, i32, i32, [12 x %struct._sg_gl_texture_bind_slot], %struct._sg_gl_texture_bind_slot, i32, i32, i32, i32, ptr, %struct.sg_pipeline }
%struct.sg_depth_state = type { i32, i32, i8, float, float, float }
%struct.sg_stencil_state = type { i8, %struct.sg_stencil_face_state, %struct.sg_stencil_face_state, i8, i8, i8 }
%struct.sg_stencil_face_state = type { i32, i32, i32, i32 }
%struct.sg_blend_state = type { i8, i32, i32, i32, i32, i32, i32 }
%struct.sg_color = type { float, float, float, float }
%struct._sg_gl_cache_attr_t = type { %struct._sg_gl_attr_t, i32 }
%struct._sg_gl_attr_t = type { i8, i8, i8, i8, i8, i32, i32 }
%struct._sg_gl_texture_bind_slot = type { i32, i32 }
%struct._sg_commit_listeners_t = type { i32, i32, ptr }

@.str.16 = external hidden unnamed_addr constant [81 x i8], align 1
@_sg = external hidden global %struct._sg_state_t, align 8
@.str.19 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__.sg_apply_bindings = external hidden unnamed_addr constant [44 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [11 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sg_apply_bindings(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca [8 x ptr], align 16
  %3 = alloca [12 x ptr], align 16
  %4 = alloca [12 x ptr], align 16
  %5 = load i8, ptr @_sg, align 8, !tbaa !5, !range !37, !noundef !38
  %6 = trunc nuw i8 %5 to i1
  br i1 %6, label %8, label %7

7:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.16, i32 noundef 16499, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

8:                                                ; preds = %1
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %9, label %10

9:                                                ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.16, i32 noundef 16500, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

10:                                               ; preds = %8
  %11 = load i32, ptr %0, align 4, !tbaa !39
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %17

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %0, i64 172
  %15 = load i32, ptr %14, align 4, !tbaa !42
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %18, label %17

17:                                               ; preds = %13, %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.49, ptr noundef nonnull @.str.16, i32 noundef 16501, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

18:                                               ; preds = %13
  %19 = tail call zeroext i1 @_sg_validate_apply_bindings(ptr noundef nonnull %0)
  br i1 %19, label %21, label %20

20:                                               ; preds = %18
  store i8 0, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  br label %502

21:                                               ; preds = %18
  store i8 1, ptr getelementptr inbounds (i8, ptr @_sg, i64 305), align 1, !tbaa !44
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @_sg, i64 300), align 4, !tbaa !45
  %23 = tail call ptr @_sg_lookup_pipeline(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %22)
  %.not65 = icmp eq ptr %23, null
  br i1 %.not65, label %24, label %25

24:                                               ; preds = %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.46, ptr noundef nonnull @.str.16, i32 noundef 16510, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %2, i8 0, i64 64, i1 false)
  %26 = getelementptr inbounds i8, ptr %0, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !46
  %.not66 = icmp eq i32 %27, 0
  br i1 %.not66, label %162, label %28

28:                                               ; preds = %25
  %29 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %27)
  store ptr %29, ptr %2, align 16, !tbaa !47
  %.not73 = icmp eq ptr %29, null
  br i1 %.not73, label %30, label %31

30:                                               ; preds = %147, %130, %113, %96, %79, %62, %45, %28
  tail call void @__assert_fail(ptr noundef nonnull @.str.50, ptr noundef nonnull @.str.16, i32 noundef 16517, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %29, i64 8
  %33 = load i32, ptr %32, align 4, !tbaa !48
  %34 = icmp eq i32 %33, 2
  %35 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %36 = icmp ne i8 %35, 0
  %37 = and i1 %34, %36
  %38 = getelementptr inbounds i8, ptr %29, i64 20
  %39 = load i8, ptr %38, align 4, !tbaa !53, !range !37, !noundef !38
  %40 = icmp eq i8 %39, 0
  %41 = and i1 %37, %40
  %42 = zext i1 %41 to i8
  store i8 %42, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %43 = getelementptr inbounds i8, ptr %0, i64 8
  %44 = load i32, ptr %43, align 4, !tbaa !46
  %.not66.1 = icmp eq i32 %44, 0
  br i1 %.not66.1, label %162, label %45

45:                                               ; preds = %31
  %46 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %44)
  %47 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %46, ptr %47, align 8, !tbaa !47
  %.not73.1 = icmp eq ptr %46, null
  br i1 %.not73.1, label %30, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %46, i64 8
  %50 = load i32, ptr %49, align 4, !tbaa !48
  %51 = icmp eq i32 %50, 2
  %52 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %53 = icmp ne i8 %52, 0
  %54 = and i1 %51, %53
  %55 = getelementptr inbounds i8, ptr %46, i64 20
  %56 = load i8, ptr %55, align 4, !tbaa !53, !range !37, !noundef !38
  %57 = icmp eq i8 %56, 0
  %58 = and i1 %54, %57
  %59 = zext i1 %58 to i8
  store i8 %59, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %60 = getelementptr inbounds i8, ptr %0, i64 12
  %61 = load i32, ptr %60, align 4, !tbaa !46
  %.not66.2 = icmp eq i32 %61, 0
  br i1 %.not66.2, label %162, label %62

62:                                               ; preds = %48
  %63 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %61)
  %64 = getelementptr inbounds i8, ptr %2, i64 16
  store ptr %63, ptr %64, align 16, !tbaa !47
  %.not73.2 = icmp eq ptr %63, null
  br i1 %.not73.2, label %30, label %65

65:                                               ; preds = %62
  %66 = getelementptr inbounds i8, ptr %63, i64 8
  %67 = load i32, ptr %66, align 4, !tbaa !48
  %68 = icmp eq i32 %67, 2
  %69 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %70 = icmp ne i8 %69, 0
  %71 = and i1 %68, %70
  %72 = getelementptr inbounds i8, ptr %63, i64 20
  %73 = load i8, ptr %72, align 4, !tbaa !53, !range !37, !noundef !38
  %74 = icmp eq i8 %73, 0
  %75 = and i1 %71, %74
  %76 = zext i1 %75 to i8
  store i8 %76, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %77 = getelementptr inbounds i8, ptr %0, i64 16
  %78 = load i32, ptr %77, align 4, !tbaa !46
  %.not66.3 = icmp eq i32 %78, 0
  br i1 %.not66.3, label %162, label %79

79:                                               ; preds = %65
  %80 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %78)
  %81 = getelementptr inbounds i8, ptr %2, i64 24
  store ptr %80, ptr %81, align 8, !tbaa !47
  %.not73.3 = icmp eq ptr %80, null
  br i1 %.not73.3, label %30, label %82

82:                                               ; preds = %79
  %83 = getelementptr inbounds i8, ptr %80, i64 8
  %84 = load i32, ptr %83, align 4, !tbaa !48
  %85 = icmp eq i32 %84, 2
  %86 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %87 = icmp ne i8 %86, 0
  %88 = and i1 %85, %87
  %89 = getelementptr inbounds i8, ptr %80, i64 20
  %90 = load i8, ptr %89, align 4, !tbaa !53, !range !37, !noundef !38
  %91 = icmp eq i8 %90, 0
  %92 = and i1 %88, %91
  %93 = zext i1 %92 to i8
  store i8 %93, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %94 = getelementptr inbounds i8, ptr %0, i64 20
  %95 = load i32, ptr %94, align 4, !tbaa !46
  %.not66.4 = icmp eq i32 %95, 0
  br i1 %.not66.4, label %162, label %96

96:                                               ; preds = %82
  %97 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %95)
  %98 = getelementptr inbounds i8, ptr %2, i64 32
  store ptr %97, ptr %98, align 16, !tbaa !47
  %.not73.4 = icmp eq ptr %97, null
  br i1 %.not73.4, label %30, label %99

99:                                               ; preds = %96
  %100 = getelementptr inbounds i8, ptr %97, i64 8
  %101 = load i32, ptr %100, align 4, !tbaa !48
  %102 = icmp eq i32 %101, 2
  %103 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %104 = icmp ne i8 %103, 0
  %105 = and i1 %102, %104
  %106 = getelementptr inbounds i8, ptr %97, i64 20
  %107 = load i8, ptr %106, align 4, !tbaa !53, !range !37, !noundef !38
  %108 = icmp eq i8 %107, 0
  %109 = and i1 %105, %108
  %110 = zext i1 %109 to i8
  store i8 %110, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %111 = getelementptr inbounds i8, ptr %0, i64 24
  %112 = load i32, ptr %111, align 4, !tbaa !46
  %.not66.5 = icmp eq i32 %112, 0
  br i1 %.not66.5, label %162, label %113

113:                                              ; preds = %99
  %114 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %112)
  %115 = getelementptr inbounds i8, ptr %2, i64 40
  store ptr %114, ptr %115, align 8, !tbaa !47
  %.not73.5 = icmp eq ptr %114, null
  br i1 %.not73.5, label %30, label %116

116:                                              ; preds = %113
  %117 = getelementptr inbounds i8, ptr %114, i64 8
  %118 = load i32, ptr %117, align 4, !tbaa !48
  %119 = icmp eq i32 %118, 2
  %120 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %121 = icmp ne i8 %120, 0
  %122 = and i1 %119, %121
  %123 = getelementptr inbounds i8, ptr %114, i64 20
  %124 = load i8, ptr %123, align 4, !tbaa !53, !range !37, !noundef !38
  %125 = icmp eq i8 %124, 0
  %126 = and i1 %122, %125
  %127 = zext i1 %126 to i8
  store i8 %127, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %128 = getelementptr inbounds i8, ptr %0, i64 28
  %129 = load i32, ptr %128, align 4, !tbaa !46
  %.not66.6 = icmp eq i32 %129, 0
  br i1 %.not66.6, label %162, label %130

130:                                              ; preds = %116
  %131 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %129)
  %132 = getelementptr inbounds i8, ptr %2, i64 48
  store ptr %131, ptr %132, align 16, !tbaa !47
  %.not73.6 = icmp eq ptr %131, null
  br i1 %.not73.6, label %30, label %133

133:                                              ; preds = %130
  %134 = getelementptr inbounds i8, ptr %131, i64 8
  %135 = load i32, ptr %134, align 4, !tbaa !48
  %136 = icmp eq i32 %135, 2
  %137 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %138 = icmp ne i8 %137, 0
  %139 = and i1 %136, %138
  %140 = getelementptr inbounds i8, ptr %131, i64 20
  %141 = load i8, ptr %140, align 4, !tbaa !53, !range !37, !noundef !38
  %142 = icmp eq i8 %141, 0
  %143 = and i1 %139, %142
  %144 = zext i1 %143 to i8
  store i8 %144, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %145 = getelementptr inbounds i8, ptr %0, i64 32
  %146 = load i32, ptr %145, align 4, !tbaa !46
  %.not66.7 = icmp eq i32 %146, 0
  br i1 %.not66.7, label %162, label %147

147:                                              ; preds = %133
  %148 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %146)
  %149 = getelementptr inbounds i8, ptr %2, i64 56
  store ptr %148, ptr %149, align 8, !tbaa !47
  %.not73.7 = icmp eq ptr %148, null
  br i1 %.not73.7, label %30, label %150

150:                                              ; preds = %147
  %151 = getelementptr inbounds i8, ptr %148, i64 8
  %152 = load i32, ptr %151, align 4, !tbaa !48
  %153 = icmp eq i32 %152, 2
  %154 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %155 = icmp ne i8 %154, 0
  %156 = and i1 %153, %155
  %157 = getelementptr inbounds i8, ptr %148, i64 20
  %158 = load i8, ptr %157, align 4, !tbaa !53, !range !37, !noundef !38
  %159 = icmp eq i8 %158, 0
  %160 = and i1 %156, %159
  %161 = zext i1 %160 to i8
  store i8 %161, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  br label %162

162:                                              ; preds = %150, %133, %116, %99, %82, %65, %48, %31, %25
  %.0.lcssa = phi i32 [ 0, %25 ], [ 1, %31 ], [ 2, %48 ], [ 3, %65 ], [ 4, %82 ], [ 5, %99 ], [ 6, %116 ], [ 7, %133 ], [ 8, %150 ]
  %163 = getelementptr inbounds i8, ptr %0, i64 68
  %164 = load i32, ptr %163, align 4, !tbaa !54
  %.not67 = icmp eq i32 %164, 0
  br i1 %.not67, label %180, label %165

165:                                              ; preds = %162
  %166 = tail call ptr @_sg_lookup_buffer(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %164)
  %.not68 = icmp eq ptr %166, null
  br i1 %.not68, label %167, label %168

167:                                              ; preds = %165
  tail call void @__assert_fail(ptr noundef nonnull @.str.51, ptr noundef nonnull @.str.16, i32 noundef 16529, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

168:                                              ; preds = %165
  %169 = getelementptr inbounds i8, ptr %166, i64 8
  %170 = load i32, ptr %169, align 4, !tbaa !48
  %171 = icmp eq i32 %170, 2
  %172 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %173 = icmp ne i8 %172, 0
  %174 = and i1 %171, %173
  %175 = getelementptr inbounds i8, ptr %166, i64 20
  %176 = load i8, ptr %175, align 4, !tbaa !53, !range !37, !noundef !38
  %177 = icmp eq i8 %176, 0
  %178 = and i1 %174, %177
  %179 = zext i1 %178 to i8
  store i8 %179, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  br label %180

180:                                              ; preds = %168, %162
  %.054 = phi ptr [ %166, %168 ], [ null, %162 ]
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(96) %3, i8 0, i64 96, i1 false)
  %181 = getelementptr inbounds i8, ptr %0, i64 76
  %182 = load i32, ptr %181, align 4, !tbaa !55
  %.not69 = icmp eq i32 %182, 0
  br i1 %.not69, label %337, label %183

183:                                              ; preds = %180
  %184 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %182)
  store ptr %184, ptr %3, align 16, !tbaa !47
  %.not72 = icmp eq ptr %184, null
  br i1 %.not72, label %185, label %186

185:                                              ; preds = %326, %313, %300, %287, %274, %261, %248, %235, %222, %209, %196, %183
  tail call void @__assert_fail(ptr noundef nonnull @.str.52, ptr noundef nonnull @.str.16, i32 noundef 16539, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

186:                                              ; preds = %183
  %187 = getelementptr inbounds i8, ptr %184, i64 8
  %188 = load i32, ptr %187, align 4, !tbaa !57
  %189 = icmp eq i32 %188, 2
  %190 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %191 = icmp ne i8 %190, 0
  %192 = and i1 %189, %191
  %193 = zext i1 %192 to i8
  store i8 %193, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %194 = getelementptr inbounds i8, ptr %0, i64 80
  %195 = load i32, ptr %194, align 4, !tbaa !55
  %.not69.1 = icmp eq i32 %195, 0
  br i1 %.not69.1, label %337, label %196

196:                                              ; preds = %186
  %197 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %195)
  %198 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %197, ptr %198, align 8, !tbaa !47
  %.not72.1 = icmp eq ptr %197, null
  br i1 %.not72.1, label %185, label %199

199:                                              ; preds = %196
  %200 = getelementptr inbounds i8, ptr %197, i64 8
  %201 = load i32, ptr %200, align 4, !tbaa !57
  %202 = icmp eq i32 %201, 2
  %203 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %204 = icmp ne i8 %203, 0
  %205 = and i1 %202, %204
  %206 = zext i1 %205 to i8
  store i8 %206, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %207 = getelementptr inbounds i8, ptr %0, i64 84
  %208 = load i32, ptr %207, align 4, !tbaa !55
  %.not69.2 = icmp eq i32 %208, 0
  br i1 %.not69.2, label %337, label %209

209:                                              ; preds = %199
  %210 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %208)
  %211 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %210, ptr %211, align 16, !tbaa !47
  %.not72.2 = icmp eq ptr %210, null
  br i1 %.not72.2, label %185, label %212

212:                                              ; preds = %209
  %213 = getelementptr inbounds i8, ptr %210, i64 8
  %214 = load i32, ptr %213, align 4, !tbaa !57
  %215 = icmp eq i32 %214, 2
  %216 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %217 = icmp ne i8 %216, 0
  %218 = and i1 %215, %217
  %219 = zext i1 %218 to i8
  store i8 %219, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %220 = getelementptr inbounds i8, ptr %0, i64 88
  %221 = load i32, ptr %220, align 4, !tbaa !55
  %.not69.3 = icmp eq i32 %221, 0
  br i1 %.not69.3, label %337, label %222

222:                                              ; preds = %212
  %223 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %221)
  %224 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %223, ptr %224, align 8, !tbaa !47
  %.not72.3 = icmp eq ptr %223, null
  br i1 %.not72.3, label %185, label %225

225:                                              ; preds = %222
  %226 = getelementptr inbounds i8, ptr %223, i64 8
  %227 = load i32, ptr %226, align 4, !tbaa !57
  %228 = icmp eq i32 %227, 2
  %229 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %230 = icmp ne i8 %229, 0
  %231 = and i1 %228, %230
  %232 = zext i1 %231 to i8
  store i8 %232, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %233 = getelementptr inbounds i8, ptr %0, i64 92
  %234 = load i32, ptr %233, align 4, !tbaa !55
  %.not69.4 = icmp eq i32 %234, 0
  br i1 %.not69.4, label %337, label %235

235:                                              ; preds = %225
  %236 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %234)
  %237 = getelementptr inbounds i8, ptr %3, i64 32
  store ptr %236, ptr %237, align 16, !tbaa !47
  %.not72.4 = icmp eq ptr %236, null
  br i1 %.not72.4, label %185, label %238

238:                                              ; preds = %235
  %239 = getelementptr inbounds i8, ptr %236, i64 8
  %240 = load i32, ptr %239, align 4, !tbaa !57
  %241 = icmp eq i32 %240, 2
  %242 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %243 = icmp ne i8 %242, 0
  %244 = and i1 %241, %243
  %245 = zext i1 %244 to i8
  store i8 %245, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %246 = getelementptr inbounds i8, ptr %0, i64 96
  %247 = load i32, ptr %246, align 4, !tbaa !55
  %.not69.5 = icmp eq i32 %247, 0
  br i1 %.not69.5, label %337, label %248

248:                                              ; preds = %238
  %249 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %247)
  %250 = getelementptr inbounds i8, ptr %3, i64 40
  store ptr %249, ptr %250, align 8, !tbaa !47
  %.not72.5 = icmp eq ptr %249, null
  br i1 %.not72.5, label %185, label %251

251:                                              ; preds = %248
  %252 = getelementptr inbounds i8, ptr %249, i64 8
  %253 = load i32, ptr %252, align 4, !tbaa !57
  %254 = icmp eq i32 %253, 2
  %255 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %256 = icmp ne i8 %255, 0
  %257 = and i1 %254, %256
  %258 = zext i1 %257 to i8
  store i8 %258, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %259 = getelementptr inbounds i8, ptr %0, i64 100
  %260 = load i32, ptr %259, align 4, !tbaa !55
  %.not69.6 = icmp eq i32 %260, 0
  br i1 %.not69.6, label %337, label %261

261:                                              ; preds = %251
  %262 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %260)
  %263 = getelementptr inbounds i8, ptr %3, i64 48
  store ptr %262, ptr %263, align 16, !tbaa !47
  %.not72.6 = icmp eq ptr %262, null
  br i1 %.not72.6, label %185, label %264

264:                                              ; preds = %261
  %265 = getelementptr inbounds i8, ptr %262, i64 8
  %266 = load i32, ptr %265, align 4, !tbaa !57
  %267 = icmp eq i32 %266, 2
  %268 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %269 = icmp ne i8 %268, 0
  %270 = and i1 %267, %269
  %271 = zext i1 %270 to i8
  store i8 %271, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %272 = getelementptr inbounds i8, ptr %0, i64 104
  %273 = load i32, ptr %272, align 4, !tbaa !55
  %.not69.7 = icmp eq i32 %273, 0
  br i1 %.not69.7, label %337, label %274

274:                                              ; preds = %264
  %275 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %273)
  %276 = getelementptr inbounds i8, ptr %3, i64 56
  store ptr %275, ptr %276, align 8, !tbaa !47
  %.not72.7 = icmp eq ptr %275, null
  br i1 %.not72.7, label %185, label %277

277:                                              ; preds = %274
  %278 = getelementptr inbounds i8, ptr %275, i64 8
  %279 = load i32, ptr %278, align 4, !tbaa !57
  %280 = icmp eq i32 %279, 2
  %281 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %282 = icmp ne i8 %281, 0
  %283 = and i1 %280, %282
  %284 = zext i1 %283 to i8
  store i8 %284, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %285 = getelementptr inbounds i8, ptr %0, i64 108
  %286 = load i32, ptr %285, align 4, !tbaa !55
  %.not69.8 = icmp eq i32 %286, 0
  br i1 %.not69.8, label %337, label %287

287:                                              ; preds = %277
  %288 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %286)
  %289 = getelementptr inbounds i8, ptr %3, i64 64
  store ptr %288, ptr %289, align 16, !tbaa !47
  %.not72.8 = icmp eq ptr %288, null
  br i1 %.not72.8, label %185, label %290

290:                                              ; preds = %287
  %291 = getelementptr inbounds i8, ptr %288, i64 8
  %292 = load i32, ptr %291, align 4, !tbaa !57
  %293 = icmp eq i32 %292, 2
  %294 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %295 = icmp ne i8 %294, 0
  %296 = and i1 %293, %295
  %297 = zext i1 %296 to i8
  store i8 %297, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %298 = getelementptr inbounds i8, ptr %0, i64 112
  %299 = load i32, ptr %298, align 4, !tbaa !55
  %.not69.9 = icmp eq i32 %299, 0
  br i1 %.not69.9, label %337, label %300

300:                                              ; preds = %290
  %301 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %299)
  %302 = getelementptr inbounds i8, ptr %3, i64 72
  store ptr %301, ptr %302, align 8, !tbaa !47
  %.not72.9 = icmp eq ptr %301, null
  br i1 %.not72.9, label %185, label %303

303:                                              ; preds = %300
  %304 = getelementptr inbounds i8, ptr %301, i64 8
  %305 = load i32, ptr %304, align 4, !tbaa !57
  %306 = icmp eq i32 %305, 2
  %307 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %308 = icmp ne i8 %307, 0
  %309 = and i1 %306, %308
  %310 = zext i1 %309 to i8
  store i8 %310, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %311 = getelementptr inbounds i8, ptr %0, i64 116
  %312 = load i32, ptr %311, align 4, !tbaa !55
  %.not69.10 = icmp eq i32 %312, 0
  br i1 %.not69.10, label %337, label %313

313:                                              ; preds = %303
  %314 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %312)
  %315 = getelementptr inbounds i8, ptr %3, i64 80
  store ptr %314, ptr %315, align 16, !tbaa !47
  %.not72.10 = icmp eq ptr %314, null
  br i1 %.not72.10, label %185, label %316

316:                                              ; preds = %313
  %317 = getelementptr inbounds i8, ptr %314, i64 8
  %318 = load i32, ptr %317, align 4, !tbaa !57
  %319 = icmp eq i32 %318, 2
  %320 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %321 = icmp ne i8 %320, 0
  %322 = and i1 %319, %321
  %323 = zext i1 %322 to i8
  store i8 %323, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %324 = getelementptr inbounds i8, ptr %0, i64 120
  %325 = load i32, ptr %324, align 4, !tbaa !55
  %.not69.11 = icmp eq i32 %325, 0
  br i1 %.not69.11, label %337, label %326

326:                                              ; preds = %316
  %327 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %325)
  %328 = getelementptr inbounds i8, ptr %3, i64 88
  store ptr %327, ptr %328, align 8, !tbaa !47
  %.not72.11 = icmp eq ptr %327, null
  br i1 %.not72.11, label %185, label %329

329:                                              ; preds = %326
  %330 = getelementptr inbounds i8, ptr %327, i64 8
  %331 = load i32, ptr %330, align 4, !tbaa !57
  %332 = icmp eq i32 %331, 2
  %333 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %334 = icmp ne i8 %333, 0
  %335 = and i1 %332, %334
  %336 = zext i1 %335 to i8
  store i8 %336, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  br label %337

337:                                              ; preds = %329, %316, %303, %290, %277, %264, %251, %238, %225, %212, %199, %186, %180
  %.053.lcssa = phi i32 [ 0, %180 ], [ 1, %186 ], [ 2, %199 ], [ 3, %212 ], [ 4, %225 ], [ 5, %238 ], [ 6, %251 ], [ 7, %264 ], [ 8, %277 ], [ 9, %290 ], [ 10, %303 ], [ 11, %316 ], [ 12, %329 ]
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(96) %4, i8 0, i64 96, i1 false)
  %338 = getelementptr inbounds i8, ptr %0, i64 124
  %339 = load i32, ptr %338, align 4, !tbaa !55
  %.not70 = icmp eq i32 %339, 0
  br i1 %.not70, label %._crit_edge, label %341

._crit_edge:                                      ; preds = %337
  %.pre = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37
  %340 = trunc nuw i8 %.pre to i1
  br i1 %340, label %497, label %501

341:                                              ; preds = %337
  %342 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %339)
  store ptr %342, ptr %4, align 16, !tbaa !47
  %.not71 = icmp eq ptr %342, null
  br i1 %.not71, label %343, label %344

343:                                              ; preds = %484, %471, %458, %445, %432, %419, %406, %393, %380, %367, %354, %341
  tail call void @__assert_fail(ptr noundef nonnull @.str.53, ptr noundef nonnull @.str.16, i32 noundef 16552, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_apply_bindings) #5
  unreachable

344:                                              ; preds = %341
  %345 = getelementptr inbounds i8, ptr %342, i64 8
  %346 = load i32, ptr %345, align 4, !tbaa !57
  %347 = icmp eq i32 %346, 2
  %348 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %349 = icmp ne i8 %348, 0
  %350 = and i1 %347, %349
  %351 = zext i1 %350 to i8
  store i8 %351, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %352 = getelementptr inbounds i8, ptr %0, i64 128
  %353 = load i32, ptr %352, align 4, !tbaa !55
  %.not70.1 = icmp eq i32 %353, 0
  br i1 %.not70.1, label %495, label %354

354:                                              ; preds = %344
  %355 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %353)
  %356 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %355, ptr %356, align 8, !tbaa !47
  %.not71.1 = icmp eq ptr %355, null
  br i1 %.not71.1, label %343, label %357

357:                                              ; preds = %354
  %358 = getelementptr inbounds i8, ptr %355, i64 8
  %359 = load i32, ptr %358, align 4, !tbaa !57
  %360 = icmp eq i32 %359, 2
  %361 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %362 = icmp ne i8 %361, 0
  %363 = and i1 %360, %362
  %364 = zext i1 %363 to i8
  store i8 %364, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %365 = getelementptr inbounds i8, ptr %0, i64 132
  %366 = load i32, ptr %365, align 4, !tbaa !55
  %.not70.2 = icmp eq i32 %366, 0
  br i1 %.not70.2, label %495, label %367

367:                                              ; preds = %357
  %368 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %366)
  %369 = getelementptr inbounds i8, ptr %4, i64 16
  store ptr %368, ptr %369, align 16, !tbaa !47
  %.not71.2 = icmp eq ptr %368, null
  br i1 %.not71.2, label %343, label %370

370:                                              ; preds = %367
  %371 = getelementptr inbounds i8, ptr %368, i64 8
  %372 = load i32, ptr %371, align 4, !tbaa !57
  %373 = icmp eq i32 %372, 2
  %374 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %375 = icmp ne i8 %374, 0
  %376 = and i1 %373, %375
  %377 = zext i1 %376 to i8
  store i8 %377, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %378 = getelementptr inbounds i8, ptr %0, i64 136
  %379 = load i32, ptr %378, align 4, !tbaa !55
  %.not70.3 = icmp eq i32 %379, 0
  br i1 %.not70.3, label %495, label %380

380:                                              ; preds = %370
  %381 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %379)
  %382 = getelementptr inbounds i8, ptr %4, i64 24
  store ptr %381, ptr %382, align 8, !tbaa !47
  %.not71.3 = icmp eq ptr %381, null
  br i1 %.not71.3, label %343, label %383

383:                                              ; preds = %380
  %384 = getelementptr inbounds i8, ptr %381, i64 8
  %385 = load i32, ptr %384, align 4, !tbaa !57
  %386 = icmp eq i32 %385, 2
  %387 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %388 = icmp ne i8 %387, 0
  %389 = and i1 %386, %388
  %390 = zext i1 %389 to i8
  store i8 %390, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %391 = getelementptr inbounds i8, ptr %0, i64 140
  %392 = load i32, ptr %391, align 4, !tbaa !55
  %.not70.4 = icmp eq i32 %392, 0
  br i1 %.not70.4, label %495, label %393

393:                                              ; preds = %383
  %394 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %392)
  %395 = getelementptr inbounds i8, ptr %4, i64 32
  store ptr %394, ptr %395, align 16, !tbaa !47
  %.not71.4 = icmp eq ptr %394, null
  br i1 %.not71.4, label %343, label %396

396:                                              ; preds = %393
  %397 = getelementptr inbounds i8, ptr %394, i64 8
  %398 = load i32, ptr %397, align 4, !tbaa !57
  %399 = icmp eq i32 %398, 2
  %400 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %401 = icmp ne i8 %400, 0
  %402 = and i1 %399, %401
  %403 = zext i1 %402 to i8
  store i8 %403, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %404 = getelementptr inbounds i8, ptr %0, i64 144
  %405 = load i32, ptr %404, align 4, !tbaa !55
  %.not70.5 = icmp eq i32 %405, 0
  br i1 %.not70.5, label %495, label %406

406:                                              ; preds = %396
  %407 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %405)
  %408 = getelementptr inbounds i8, ptr %4, i64 40
  store ptr %407, ptr %408, align 8, !tbaa !47
  %.not71.5 = icmp eq ptr %407, null
  br i1 %.not71.5, label %343, label %409

409:                                              ; preds = %406
  %410 = getelementptr inbounds i8, ptr %407, i64 8
  %411 = load i32, ptr %410, align 4, !tbaa !57
  %412 = icmp eq i32 %411, 2
  %413 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %414 = icmp ne i8 %413, 0
  %415 = and i1 %412, %414
  %416 = zext i1 %415 to i8
  store i8 %416, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %417 = getelementptr inbounds i8, ptr %0, i64 148
  %418 = load i32, ptr %417, align 4, !tbaa !55
  %.not70.6 = icmp eq i32 %418, 0
  br i1 %.not70.6, label %495, label %419

419:                                              ; preds = %409
  %420 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %418)
  %421 = getelementptr inbounds i8, ptr %4, i64 48
  store ptr %420, ptr %421, align 16, !tbaa !47
  %.not71.6 = icmp eq ptr %420, null
  br i1 %.not71.6, label %343, label %422

422:                                              ; preds = %419
  %423 = getelementptr inbounds i8, ptr %420, i64 8
  %424 = load i32, ptr %423, align 4, !tbaa !57
  %425 = icmp eq i32 %424, 2
  %426 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %427 = icmp ne i8 %426, 0
  %428 = and i1 %425, %427
  %429 = zext i1 %428 to i8
  store i8 %429, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %430 = getelementptr inbounds i8, ptr %0, i64 152
  %431 = load i32, ptr %430, align 4, !tbaa !55
  %.not70.7 = icmp eq i32 %431, 0
  br i1 %.not70.7, label %495, label %432

432:                                              ; preds = %422
  %433 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %431)
  %434 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr %433, ptr %434, align 8, !tbaa !47
  %.not71.7 = icmp eq ptr %433, null
  br i1 %.not71.7, label %343, label %435

435:                                              ; preds = %432
  %436 = getelementptr inbounds i8, ptr %433, i64 8
  %437 = load i32, ptr %436, align 4, !tbaa !57
  %438 = icmp eq i32 %437, 2
  %439 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %440 = icmp ne i8 %439, 0
  %441 = and i1 %438, %440
  %442 = zext i1 %441 to i8
  store i8 %442, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %443 = getelementptr inbounds i8, ptr %0, i64 156
  %444 = load i32, ptr %443, align 4, !tbaa !55
  %.not70.8 = icmp eq i32 %444, 0
  br i1 %.not70.8, label %495, label %445

445:                                              ; preds = %435
  %446 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %444)
  %447 = getelementptr inbounds i8, ptr %4, i64 64
  store ptr %446, ptr %447, align 16, !tbaa !47
  %.not71.8 = icmp eq ptr %446, null
  br i1 %.not71.8, label %343, label %448

448:                                              ; preds = %445
  %449 = getelementptr inbounds i8, ptr %446, i64 8
  %450 = load i32, ptr %449, align 4, !tbaa !57
  %451 = icmp eq i32 %450, 2
  %452 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %453 = icmp ne i8 %452, 0
  %454 = and i1 %451, %453
  %455 = zext i1 %454 to i8
  store i8 %455, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %456 = getelementptr inbounds i8, ptr %0, i64 160
  %457 = load i32, ptr %456, align 4, !tbaa !55
  %.not70.9 = icmp eq i32 %457, 0
  br i1 %.not70.9, label %495, label %458

458:                                              ; preds = %448
  %459 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %457)
  %460 = getelementptr inbounds i8, ptr %4, i64 72
  store ptr %459, ptr %460, align 8, !tbaa !47
  %.not71.9 = icmp eq ptr %459, null
  br i1 %.not71.9, label %343, label %461

461:                                              ; preds = %458
  %462 = getelementptr inbounds i8, ptr %459, i64 8
  %463 = load i32, ptr %462, align 4, !tbaa !57
  %464 = icmp eq i32 %463, 2
  %465 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %466 = icmp ne i8 %465, 0
  %467 = and i1 %464, %466
  %468 = zext i1 %467 to i8
  store i8 %468, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %469 = getelementptr inbounds i8, ptr %0, i64 164
  %470 = load i32, ptr %469, align 4, !tbaa !55
  %.not70.10 = icmp eq i32 %470, 0
  br i1 %.not70.10, label %495, label %471

471:                                              ; preds = %461
  %472 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %470)
  %473 = getelementptr inbounds i8, ptr %4, i64 80
  store ptr %472, ptr %473, align 16, !tbaa !47
  %.not71.10 = icmp eq ptr %472, null
  br i1 %.not71.10, label %343, label %474

474:                                              ; preds = %471
  %475 = getelementptr inbounds i8, ptr %472, i64 8
  %476 = load i32, ptr %475, align 4, !tbaa !57
  %477 = icmp eq i32 %476, 2
  %478 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %479 = icmp ne i8 %478, 0
  %480 = and i1 %477, %479
  %481 = zext i1 %480 to i8
  store i8 %481, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  %482 = getelementptr inbounds i8, ptr %0, i64 168
  %483 = load i32, ptr %482, align 4, !tbaa !55
  %.not70.11 = icmp eq i32 %483, 0
  br i1 %.not70.11, label %495, label %484

484:                                              ; preds = %474
  %485 = tail call ptr @_sg_lookup_image(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %483)
  %486 = getelementptr inbounds i8, ptr %4, i64 88
  store ptr %485, ptr %486, align 8, !tbaa !47
  %.not71.11 = icmp eq ptr %485, null
  br i1 %.not71.11, label %343, label %487

487:                                              ; preds = %484
  %488 = getelementptr inbounds i8, ptr %485, i64 8
  %489 = load i32, ptr %488, align 4, !tbaa !57
  %490 = icmp eq i32 %489, 2
  %491 = load i8, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43, !range !37, !noundef !38
  %492 = icmp ne i8 %491, 0
  %493 = and i1 %490, %492
  %494 = zext i1 %493 to i8
  store i8 %494, ptr getelementptr inbounds (i8, ptr @_sg, i64 306), align 2, !tbaa !43
  br i1 %493, label %497, label %501

495:                                              ; preds = %474, %461, %448, %435, %422, %409, %396, %383, %370, %357, %344
  %496 = phi i1 [ %350, %344 ], [ %363, %357 ], [ %376, %370 ], [ %389, %383 ], [ %402, %396 ], [ %415, %409 ], [ %428, %422 ], [ %441, %435 ], [ %454, %448 ], [ %467, %461 ], [ %480, %474 ]
  %.051.lcssa = phi i32 [ 1, %344 ], [ 2, %357 ], [ 3, %370 ], [ 4, %383 ], [ 5, %396 ], [ 6, %409 ], [ 7, %422 ], [ 8, %435 ], [ 9, %448 ], [ 10, %461 ], [ 11, %474 ]
  br i1 %496, label %497, label %501

497:                                              ; preds = %487, %._crit_edge, %495
  %.051.lcssa92 = phi i32 [ 0, %._crit_edge ], [ %.051.lcssa, %495 ], [ 12, %487 ]
  %498 = getelementptr inbounds i8, ptr %0, i64 36
  %499 = getelementptr inbounds i8, ptr %0, i64 72
  %500 = load i32, ptr %499, align 4, !tbaa !61
  call void @_sg_apply_bindings(ptr noundef nonnull %23, ptr noundef nonnull %2, ptr noundef nonnull %498, i32 noundef %.0.lcssa, ptr noundef %.054, i32 noundef %500, ptr noundef nonnull %3, i32 noundef %.053.lcssa, ptr noundef nonnull %4, i32 noundef %.051.lcssa92)
  br label %501

501:                                              ; preds = %487, %._crit_edge, %495, %497
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #6
  br label %502

502:                                              ; preds = %501, %20
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_sg_validate_apply_bindings(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @_sg_apply_bindings(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { inlinehint 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 #5 = { noreturn nounwind }
attributes #6 = { 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 288, !20, i64 292, !21, i64 296, !22, i64 300, !7, i64 304, !7, i64 305, !7, i64 306, !11, i64 308, !23, i64 312, !11, i64 504, !25, i64 508, !26, i64 520, !8, i64 548, !27, i64 936, !36, i64 1616}
!7 = !{!"_Bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"sg_desc", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !7, i64 44, !12, i64 48, !14, i64 72, !15, i64 88, !11, i64 272}
!11 = !{!"int", !8, i64 0}
!12 = !{!"sg_allocator", !13, i64 0, !13, i64 8, !13, i64 16}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"sg_logger", !13, i64 0, !13, i64 8}
!15 = !{!"sg_context_desc", !11, i64 0, !11, i64 4, !11, i64 8, !16, i64 12, !17, i64 16, !18, i64 64, !19, i64 120}
!16 = !{!"sg_gl_context_desc", !7, i64 0}
!17 = !{!"sg_metal_context_desc", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!18 = !{!"sg_d3d11_context_desc", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48}
!19 = !{!"sg_wgpu_context_desc", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56}
!20 = !{!"sg_context", !11, i64 0}
!21 = !{!"sg_pass", !11, i64 0}
!22 = !{!"sg_pipeline", !11, i64 0}
!23 = !{!"", !24, i64 0, !24, i64 24, !24, i64 48, !24, i64 72, !24, i64 96, !24, i64 120, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184}
!24 = !{!"", !11, i64 0, !11, i64 4, !13, i64 8, !13, i64 16}
!25 = !{!"sg_features", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8}
!26 = !{!"sg_limits", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!27 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !11, i64 4, !11, i64 8, !13, i64 16, !13, i64 24, !21, i64 32, !28, i64 40, !7, i64 664, !11, i64 668, !11, i64 672}
!28 = !{!"", !29, i64 0, !31, i64 24, !33, i64 64, !8, i64 92, !11, i64 108, !11, i64 112, !7, i64 116, !11, i64 120, !34, i64 124, !7, i64 140, !8, i64 144, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !8, i64 484, !35, i64 580, !11, i64 588, !11, i64 592, !11, i64 596, !11, i64 600, !13, i64 608, !22, i64 616}
!29 = !{!"sg_depth_state", !11, i64 0, !11, i64 4, !7, i64 8, !30, i64 12, !30, i64 16, !30, i64 20}
!30 = !{!"float", !8, i64 0}
!31 = !{!"sg_stencil_state", !7, i64 0, !32, i64 4, !32, i64 20, !8, i64 36, !8, i64 37, !8, i64 38}
!32 = !{!"sg_stencil_face_state", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!33 = !{!"sg_blend_state", !7, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!34 = !{!"sg_color", !30, i64 0, !30, i64 4, !30, i64 8, !30, i64 12}
!35 = !{!"", !11, i64 0, !11, i64 4}
!36 = !{!"", !11, i64 0, !11, i64 4, !13, i64 8}
!37 = !{i8 0, i8 2}
!38 = !{}
!39 = !{!40, !11, i64 0}
!40 = !{!"sg_bindings", !11, i64 0, !8, i64 4, !8, i64 36, !41, i64 68, !11, i64 72, !8, i64 76, !8, i64 124, !11, i64 172}
!41 = !{!"sg_buffer", !11, i64 0}
!42 = !{!40, !11, i64 172}
!43 = !{!6, !7, i64 306}
!44 = !{!6, !7, i64 305}
!45 = !{!6, !11, i64 300}
!46 = !{!41, !11, i64 0}
!47 = !{!13, !13, i64 0}
!48 = !{!49, !11, i64 8}
!49 = !{!"", !50, i64 0, !51, i64 12, !52, i64 48}
!50 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8}
!51 = !{!"", !11, i64 0, !11, i64 4, !7, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!52 = !{!"", !8, i64 0, !7, i64 8}
!53 = !{!49, !7, i64 20}
!54 = !{!40, !11, i64 68}
!55 = !{!56, !11, i64 0}
!56 = !{!"sg_image", !11, i64 0}
!57 = !{!58, !11, i64 8}
!58 = !{!"", !50, i64 0, !59, i64 12, !60, i64 88}
!59 = !{!"", !11, i64 0, !7, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72}
!60 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !8, i64 12, !7, i64 20}
!61 = !{!40, !11, i64 72}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass