; 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 }

@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [81 x i8], align 1
@__PRETTY_FUNCTION__.sg_setup = external hidden unnamed_addr constant [31 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [101 x i8], align 1
@_sg = external hidden global %struct._sg_state_t, align 8

; 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 void @sg_setup(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.sg_desc, align 8
  %4 = alloca %struct.sg_context, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = icmp ne ptr %5, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %1
  br label %9

8:                                                ; preds = %1
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.16, i32 noundef 15764, ptr noundef @__PRETTY_FUNCTION__.sg_setup) #5
  unreachable

9:                                                ; preds = %7
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.sg_desc, ptr %10, i32 0, i32 0
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %20

14:                                               ; preds = %9
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.sg_desc, ptr %15, i32 0, i32 15
  %17 = load i32, ptr %16, align 8, !tbaa !20
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %14
  br label %21

20:                                               ; preds = %14, %9
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.16, i32 noundef 15765, ptr noundef @__PRETTY_FUNCTION__.sg_setup) #5
  unreachable

21:                                               ; preds = %19
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.sg_desc, ptr %22, i32 0, i32 12
  %24 = getelementptr inbounds %struct.sg_allocator, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %33

27:                                               ; preds = %21
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.sg_desc, ptr %28, i32 0, i32 12
  %30 = getelementptr inbounds %struct.sg_allocator, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !22
  %32 = icmp ne ptr %31, null
  br i1 %32, label %45, label %33

33:                                               ; preds = %27, %21
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.sg_desc, ptr %34, i32 0, i32 12
  %36 = getelementptr inbounds %struct.sg_allocator, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !21
  %38 = icmp ne ptr %37, null
  br i1 %38, label %46, label %39

39:                                               ; preds = %33
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.sg_desc, ptr %40, i32 0, i32 12
  %42 = getelementptr inbounds %struct.sg_allocator, ptr %41, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !22
  %44 = icmp ne ptr %43, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %39, %27
  br label %47

46:                                               ; preds = %39, %33
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.16, i32 noundef 15766, ptr noundef @__PRETTY_FUNCTION__.sg_setup) #5
  unreachable

47:                                               ; preds = %45
  call void @_sg_clear(ptr noundef @_sg, i64 noundef 1632)
  call void @llvm.lifetime.start.p0(i64 280, ptr %3) #6
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_sg_desc_defaults(ptr dead_on_unwind writable sret(%struct.sg_desc) align 8 %3, ptr noundef %48)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 1), ptr align 8 %3, i64 280, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 280, ptr %3) #6
  call void @_sg_setup_pools(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 10), ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 1))
  call void @_sg_setup_commit_listeners(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 1))
  store i32 1, ptr getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 2), align 8, !tbaa !26
  call void @_sg_setup_backend(ptr noundef getelementptr inbounds (%struct._sg_state_t, ptr @_sg, i32 0, i32 1))
  store i8 1, ptr @_sg, align 8, !tbaa !45
  %49 = call i32 @sg_setup_context()
  %50 = getelementptr inbounds %struct.sg_context, ptr %4, i32 0, i32 0
  store i32 %49, ptr %50, align 4
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @_sg_clear(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @_sg_desc_defaults(ptr dead_on_unwind noalias writable sret(%struct.sg_desc) align 8, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @_sg_setup_commit_listeners(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @sg_setup_context() #3

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, !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 = !{!"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, !12, i64 44, !13, i64 48, !14, i64 72, !15, i64 88, !11, i64 272}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"sg_allocator", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = !{!"sg_logger", !6, i64 0, !6, 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", !12, i64 0}
!17 = !{!"sg_metal_context_desc", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!18 = !{!"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}
!19 = !{!"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}
!20 = !{!10, !11, i64 272}
!21 = !{!10, !6, i64 48}
!22 = !{!10, !6, i64 56}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 12, i64 4, !24, i64 16, i64 4, !24, i64 20, i64 4, !24, i64 24, i64 4, !24, i64 28, i64 4, !24, i64 32, i64 4, !24, i64 36, i64 4, !24, i64 40, i64 4, !24, i64 44, i64 1, !25, i64 48, i64 8, !5, i64 56, i64 8, !5, i64 64, i64 8, !5, i64 72, i64 8, !5, i64 80, i64 8, !5, i64 88, i64 4, !24, i64 92, i64 4, !24, i64 96, i64 4, !24, i64 100, i64 1, !25, i64 104, i64 8, !5, i64 112, i64 8, !5, i64 120, i64 8, !5, i64 128, i64 8, !5, i64 136, i64 8, !5, i64 144, i64 8, !5, i64 152, i64 8, !5, i64 160, i64 8, !5, i64 168, i64 8, !5, i64 176, i64 8, !5, i64 184, i64 8, !5, i64 192, i64 8, !5, i64 200, i64 8, !5, i64 208, i64 8, !5, i64 216, i64 8, !5, i64 224, i64 8, !5, i64 232, i64 8, !5, i64 240, i64 8, !5, i64 248, i64 8, !5, i64 256, i64 8, !5, i64 264, i64 8, !5, i64 272, i64 4, !24}
!24 = !{!11, !11, i64 0}
!25 = !{!12, !12, i64 0}
!26 = !{!27, !11, i64 288}
!27 = !{!"", !12, i64 0, !10, i64 8, !11, i64 288, !28, i64 292, !29, i64 296, !30, i64 300, !12, i64 304, !12, i64 305, !12, i64 306, !11, i64 308, !31, i64 312, !11, i64 504, !33, i64 508, !34, i64 520, !7, i64 548, !35, i64 936, !44, i64 1616}
!28 = !{!"sg_context", !11, i64 0}
!29 = !{!"sg_pass", !11, i64 0}
!30 = !{!"sg_pipeline", !11, i64 0}
!31 = !{!"", !32, i64 0, !32, i64 24, !32, i64 48, !32, i64 72, !32, i64 96, !32, i64 120, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184}
!32 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!33 = !{!"sg_features", !12, i64 0, !12, i64 1, !12, i64 2, !12, i64 3, !12, i64 4, !12, i64 5, !12, i64 6, !12, i64 7, !12, i64 8}
!34 = !{!"sg_limits", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!35 = !{!"", !12, i64 0, !12, i64 1, !12, i64 2, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !29, i64 32, !36, i64 40, !12, i64 664, !11, i64 668, !11, i64 672}
!36 = !{!"", !37, i64 0, !39, i64 24, !41, i64 64, !7, i64 92, !11, i64 108, !11, i64 112, !12, i64 116, !11, i64 120, !42, i64 124, !12, i64 140, !7, i64 144, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !7, i64 484, !43, i64 580, !11, i64 588, !11, i64 592, !11, i64 596, !11, i64 600, !6, i64 608, !30, i64 616}
!37 = !{!"sg_depth_state", !11, i64 0, !11, i64 4, !12, i64 8, !38, i64 12, !38, i64 16, !38, i64 20}
!38 = !{!"float", !7, i64 0}
!39 = !{!"sg_stencil_state", !12, i64 0, !40, i64 4, !40, i64 20, !7, i64 36, !7, i64 37, !7, i64 38}
!40 = !{!"sg_stencil_face_state", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!41 = !{!"sg_blend_state", !12, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!42 = !{!"sg_color", !38, i64 0, !38, i64 4, !38, i64 8, !38, i64 12}
!43 = !{!"", !11, i64 0, !11, i64 4}
!44 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8}
!45 = !{!27, !12, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._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.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [81 x i8], align 1
@__PRETTY_FUNCTION__.sg_setup = external hidden unnamed_addr constant [31 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [101 x i8], align 1
@_sg = external hidden global %struct._sg_state_t, align 8

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

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

; Function Attrs: mustprogress 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) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @sg_setup(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca %struct.sg_desc, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.16, i32 noundef 15764, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_setup) #5
  unreachable

4:                                                ; preds = %1
  %5 = load i32, ptr %0, align 8, !tbaa !5
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %7, label %11

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %0, i64 272
  %9 = load i32, ptr %8, align 8, !tbaa !19
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %12, label %11

11:                                               ; preds = %7, %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.16, i32 noundef 15765, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_setup) #5
  unreachable

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !20
  %.not8 = icmp eq ptr %14, null
  %15 = getelementptr inbounds i8, ptr %0, i64 56
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  %.not11 = icmp eq ptr %16, null
  %17 = xor i1 %.not8, %.not11
  br i1 %17, label %18, label %19

18:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.16, i32 noundef 15766, ptr noundef nonnull @__PRETTY_FUNCTION__.sg_setup) #5
  unreachable

19:                                               ; preds = %12
  tail call void @_sg_clear(ptr noundef nonnull @_sg, i64 noundef 1632)
  call void @llvm.lifetime.start.p0(i64 280, ptr nonnull %2) #6
  call void @_sg_desc_defaults(ptr dead_on_unwind nonnull writable sret(%struct.sg_desc) align 8 %2, ptr noundef nonnull %0)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(280) getelementptr inbounds (i8, ptr @_sg, i64 8), ptr noundef nonnull align 8 dereferenceable(280) %2, i64 280, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 280, ptr nonnull %2) #6
  call void @_sg_setup_pools(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 312), ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 8))
  call void @_sg_setup_commit_listeners(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 8))
  store i32 1, ptr getelementptr inbounds (i8, ptr @_sg, i64 288), align 8, !tbaa !26
  call void @_sg_setup_backend(ptr noundef nonnull getelementptr inbounds (i8, ptr @_sg, i64 8))
  store i8 1, ptr @_sg, align 8, !tbaa !45
  %20 = call i32 @sg_setup_context()
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @_sg_clear(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @_sg_desc_defaults(ptr dead_on_unwind noalias writable sret(%struct.sg_desc) align 8, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @_sg_setup_pools(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @_sg_setup_commit_listeners(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @sg_setup_context() local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = !{!"sg_desc", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !10, i64 44, !11, i64 48, !13, i64 72, !14, i64 88, !7, i64 272}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!"sg_allocator", !12, i64 0, !12, i64 8, !12, i64 16}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"sg_logger", !12, i64 0, !12, i64 8}
!14 = !{!"sg_context_desc", !7, i64 0, !7, i64 4, !7, i64 8, !15, i64 12, !16, i64 16, !17, i64 64, !18, i64 120}
!15 = !{!"sg_gl_context_desc", !10, i64 0}
!16 = !{!"sg_metal_context_desc", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!17 = !{!"sg_d3d11_context_desc", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48}
!18 = !{!"sg_wgpu_context_desc", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56}
!19 = !{!6, !7, i64 272}
!20 = !{!6, !12, i64 48}
!21 = !{!6, !12, i64 56}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !23, i64 8, i64 4, !23, i64 12, i64 4, !23, i64 16, i64 4, !23, i64 20, i64 4, !23, i64 24, i64 4, !23, i64 28, i64 4, !23, i64 32, i64 4, !23, i64 36, i64 4, !23, i64 40, i64 4, !23, i64 44, i64 1, !24, i64 48, i64 8, !25, i64 56, i64 8, !25, i64 64, i64 8, !25, i64 72, i64 8, !25, i64 80, i64 8, !25, i64 88, i64 4, !23, i64 92, i64 4, !23, i64 96, i64 4, !23, i64 100, i64 1, !24, i64 104, i64 8, !25, i64 112, i64 8, !25, i64 120, i64 8, !25, i64 128, i64 8, !25, i64 136, i64 8, !25, i64 144, i64 8, !25, i64 152, i64 8, !25, i64 160, i64 8, !25, i64 168, i64 8, !25, i64 176, i64 8, !25, i64 184, i64 8, !25, i64 192, i64 8, !25, i64 200, i64 8, !25, i64 208, i64 8, !25, i64 216, i64 8, !25, i64 224, i64 8, !25, i64 232, i64 8, !25, i64 240, i64 8, !25, i64 248, i64 8, !25, i64 256, i64 8, !25, i64 264, i64 8, !25, i64 272, i64 4, !23}
!23 = !{!7, !7, i64 0}
!24 = !{!10, !10, i64 0}
!25 = !{!12, !12, i64 0}
!26 = !{!27, !7, i64 288}
!27 = !{!"", !10, i64 0, !6, i64 8, !7, i64 288, !28, i64 292, !29, i64 296, !30, i64 300, !10, i64 304, !10, i64 305, !10, i64 306, !7, i64 308, !31, i64 312, !7, i64 504, !33, i64 508, !34, i64 520, !8, i64 548, !35, i64 936, !44, i64 1616}
!28 = !{!"sg_context", !7, i64 0}
!29 = !{!"sg_pass", !7, i64 0}
!30 = !{!"sg_pipeline", !7, i64 0}
!31 = !{!"", !32, i64 0, !32, i64 24, !32, i64 48, !32, i64 72, !32, i64 96, !32, i64 120, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184}
!32 = !{!"", !7, i64 0, !7, i64 4, !12, i64 8, !12, i64 16}
!33 = !{!"sg_features", !10, i64 0, !10, i64 1, !10, i64 2, !10, i64 3, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7, !10, i64 8}
!34 = !{!"sg_limits", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!35 = !{!"", !10, i64 0, !10, i64 1, !10, i64 2, !7, i64 4, !7, i64 8, !12, i64 16, !12, i64 24, !29, i64 32, !36, i64 40, !10, i64 664, !7, i64 668, !7, i64 672}
!36 = !{!"", !37, i64 0, !39, i64 24, !41, i64 64, !8, i64 92, !7, i64 108, !7, i64 112, !10, i64 116, !7, i64 120, !42, i64 124, !10, i64 140, !8, i64 144, !7, i64 464, !7, i64 468, !7, i64 472, !7, i64 476, !7, i64 480, !8, i64 484, !43, i64 580, !7, i64 588, !7, i64 592, !7, i64 596, !7, i64 600, !12, i64 608, !30, i64 616}
!37 = !{!"sg_depth_state", !7, i64 0, !7, i64 4, !10, i64 8, !38, i64 12, !38, i64 16, !38, i64 20}
!38 = !{!"float", !8, i64 0}
!39 = !{!"sg_stencil_state", !10, i64 0, !40, i64 4, !40, i64 20, !8, i64 36, !8, i64 37, !8, i64 38}
!40 = !{!"sg_stencil_face_state", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!41 = !{!"sg_blend_state", !10, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!42 = !{!"sg_color", !38, i64 0, !38, i64 4, !38, i64 8, !38, i64 12}
!43 = !{!"", !7, i64 0, !7, i64 4}
!44 = !{!"", !7, i64 0, !7, i64 4, !12, i64 8}
!45 = !{!27, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass