; 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_gl_context_t = type { %struct._sg_slot_t, i32, i32 }
%struct._sg_slot_t = type { i32, i32, i32 }

@.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
@__PRETTY_FUNCTION__.sg_setup_context = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [42 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: 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) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @sg_setup_context() #3 {
  %1 = alloca %struct.sg_context, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = load i8, ptr @_sg, align 8, !tbaa !5, !range !37, !noundef !38
  %5 = trunc i8 %4 to i1
  br i1 %5, label %6, label %7

6:                                                ; preds = %0
  br label %8

7:                                                ; preds = %0
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.16, i32 noundef 15827, ptr noundef @__PRETTY_FUNCTION__.sg_setup_context) #5
  unreachable

8:                                                ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %9 = call i32 @_sg_pool_alloc_index(ptr noundef getelementptr inbounds (%struct._sg_pools_t, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 0, i32 5))
  store i32 %9, ptr %2, align 4, !tbaa !39
  %10 = load i32, ptr %2, align 4, !tbaa !39
  %11 = icmp ne i32 0, %10
  br i1 %11, label %12, label %38

12:                                               ; preds = %8
  %13 = load ptr, ptr getelementptr inbounds (%struct._sg_pools_t, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 0, i32 11), align 8, !tbaa !40
  %14 = load i32, ptr %2, align 4, !tbaa !39
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds %struct._sg_gl_context_t, ptr %13, i64 %15
  %17 = getelementptr inbounds %struct._sg_gl_context_t, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %2, align 4, !tbaa !39
  %19 = call i32 @_sg_slot_alloc(ptr noundef getelementptr inbounds (%struct._sg_pools_t, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 0, i32 5), ptr noundef %17, i32 noundef %18)
  %20 = getelementptr inbounds %struct.sg_context, ptr %1, i32 0, i32 0
  store i32 %19, ptr %20, align 4, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %21 = getelementptr inbounds %struct.sg_context, ptr %1, i32 0, i32 0
  %22 = load i32, ptr %21, align 4, !tbaa !41
  %23 = call ptr @_sg_context_at(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), i32 noundef %22)
  store ptr %23, ptr %3, align 8, !tbaa !42
  %24 = load ptr, ptr %3, align 8, !tbaa !42
  %25 = call i32 @_sg_create_context(ptr noundef %24)
  %26 = load ptr, ptr %3, align 8, !tbaa !42
  %27 = getelementptr inbounds %struct._sg_gl_context_t, ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds %struct._sg_slot_t, ptr %27, i32 0, i32 2
  store i32 %25, ptr %28, align 4, !tbaa !43
  %29 = load ptr, ptr %3, align 8, !tbaa !42
  %30 = getelementptr inbounds %struct._sg_gl_context_t, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds %struct._sg_slot_t, ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 4, !tbaa !43
  %33 = icmp eq i32 %32, 2
  br i1 %33, label %34, label %35

34:                                               ; preds = %12
  br label %36

35:                                               ; preds = %12
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.16, i32 noundef 15834, ptr noundef @__PRETTY_FUNCTION__.sg_setup_context) #5
  unreachable

36:                                               ; preds = %34
  %37 = load ptr, ptr %3, align 8, !tbaa !42
  call void @_sg_activate_context(ptr noundef %37)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %40

38:                                               ; preds = %8
  %39 = getelementptr inbounds %struct.sg_context, ptr %1, i32 0, i32 0
  store i32 0, ptr %39, align 4, !tbaa !41
  br label %40

40:                                               ; preds = %38, %36
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 3), ptr align 4 %1, i64 4, i1 false), !tbaa.struct !46
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %41 = getelementptr inbounds %struct.sg_context, ptr %1, i32 0, i32 0
  %42 = load i32, ptr %41, align 4
  ret i32 %42
}

; Function Attrs: nounwind uwtable
declare hidden i32 @_sg_pool_alloc_index(ptr noundef) #3

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!11, !11, i64 0}
!40 = !{!6, !13, i64 496}
!41 = !{!20, !11, i64 0}
!42 = !{!13, !13, i64 0}
!43 = !{!44, !11, i64 8}
!44 = !{!"", !45, i64 0, !11, i64 12, !11, i64 16}
!45 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8}
!46 = !{i64 0, i64 4, !39}


; 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 }
%struct._sg_gl_context_t = type { %struct._sg_slot_t, i32, i32 }
%struct._sg_slot_t = type { i32, i32, i32 }

@.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
@__PRETTY_FUNCTION__.sg_setup_context = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @sg_setup_context() local_unnamed_addr #1 {
  %1 = load i8, ptr @_sg, align 8, !tbaa !5, !range !37, !noundef !38
  %2 = trunc nuw i8 %1 to i1
  br i1 %2, label %4, label %3

3:                                                ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.16, i32 noundef 15827, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_setup_context) #3
  unreachable

4:                                                ; preds = %0
  %5 = tail call i32 @_sg_pool_alloc_index(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 432))
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %17, label %6

6:                                                ; preds = %4
  %7 = load ptr, ptr getelementptr inbounds (i8, ptr @_sg, i64 496), align 8, !tbaa !39
  %8 = sext i32 %5 to i64
  %9 = getelementptr inbounds %struct._sg_gl_context_t, ptr %7, i64 %8
  %10 = tail call i32 @_sg_slot_alloc(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 432), ptr noundef nonnull %9, i32 noundef %5)
  %11 = tail call ptr @_sg_context_at(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), i32 noundef %10)
  %12 = tail call i32 @_sg_create_context(ptr noundef %11)
  %13 = getelementptr inbounds i8, ptr %11, i64 8
  store i32 %12, ptr %13, align 4, !tbaa !40
  %14 = icmp eq i32 %12, 2
  br i1 %14, label %16, label %15

15:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.16, i32 noundef 15834, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_setup_context) #3
  unreachable

16:                                               ; preds = %6
  tail call void @_sg_activate_context(ptr noundef nonnull %11)
  br label %17

17:                                               ; preds = %4, %16
  %.sroa.0.0 = phi i32 [ %10, %16 ], [ 0, %4 ]
  store i32 %.sroa.0.0, ptr getelementptr inbounds (i8, ptr @_sg, i64 292), align 4, !tbaa !43
  ret i32 %.sroa.0.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @_sg_pool_alloc_index(ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @_sg_activate_context(ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!6, !13, i64 496}
!40 = !{!41, !11, i64 8}
!41 = !{!"", !42, i64 0, !11, i64 12, !11, i64 16}
!42 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8}
!43 = !{!11, !11, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass