target triple = "air64_v29-apple-macosx27.0.0"
source_filename = "-"
; datalayout DataLayout { endian: Little, pointers: {0: PointerSpec { size_bits: 64, abi_bits: 64, pref_bits: 64, index_bits: 64 }}, ints: {1: AlignSpec { abi_bits: 8, pref_bits: 8 }, 8: AlignSpec { abi_bits: 8, pref_bits: 8 }, 16: AlignSpec { abi_bits: 16, pref_bits: 16 }, 32: AlignSpec { abi_bits: 32, pref_bits: 32 }, 64: AlignSpec { abi_bits: 64, pref_bits: 64 }}, floats: {16: AlignSpec { abi_bits: 16, pref_bits: 16 }, 32: AlignSpec { abi_bits: 32, pref_bits: 32 }, 64: AlignSpec { abi_bits: 64, pref_bits: 64 }, 128: AlignSpec { abi_bits: 128, pref_bits: 128 }}, vectors: {16: AlignSpec { abi_bits: 16, pref_bits: 16 }, 24: AlignSpec { abi_bits: 32, pref_bits: 32 }, 32: AlignSpec { abi_bits: 32, pref_bits: 32 }, 48: AlignSpec { abi_bits: 64, pref_bits: 64 }, 64: AlignSpec { abi_bits: 64, pref_bits: 64 }, 96: AlignSpec { abi_bits: 128, pref_bits: 128 }, 128: AlignSpec { abi_bits: 128, pref_bits: 128 }, 192: AlignSpec { abi_bits: 256, pref_bits: 256 }, 256: AlignSpec { abi_bits: 256, pref_bits: 256 }, 512: AlignSpec { abi_bits: 512, pref_bits: 512 }, 1024: AlignSpec { abi_bits: 1024, pref_bits: 1024 }}, aggregate: AlignSpec { abi_bits: 0, pref_bits: 64 }, native_ints: [8, 16, 32], stack_align_bits: None, alloca_space: 0, program_space: 0, globals_space: 0, mangling: None, fn_ptr_align: None, non_integral: [] }
%t4 = type void (ptr addrspace(1), ptr addrspace(1), ptr addrspace(1), i32, i32)
%t5 = type void (i32, i32, i32)
%t8 = type void (ptr addrspace(1), <2 x i32>, <4 x i32>, i32, i32)
%t10 = type i32 (ptr addrspace(1), i32, i32, i32, i32, i1)
%t11 = type i32 (ptr addrspace(1), i32, i32, i32, i1)
%t13 = type ptr addrspace(2) ()
%t15 = type { <4 x i32>, i8 }
%t16 = type %t15 (ptr addrspace(1), ptr addrspace(2), <2 x i32>, <2 x i32>, i32, i32)
%t18 = type [2 x i32]
%t21 = type { i32 } ; "struct.metal::_atomic"
c10 = %t18 [27, 2]
c23 = <2 x i32> [poison, 0]

define %t4 @f0 "coherent_texture_handoff" "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins"="" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" %a1( nocapture "air-buffer-no-alias"="" ) %a2( Mod nocapture "air-buffer-no-alias"="" ) {
bb0:
  %i0 = insertelement <2 x i32> c23, %a4, i64 0
  %i1 = icmp eq %a3, i32 0
  br %i1, bb2, bb1
bb1:
  %i3 = getelementptr inbounds %t21, %a1, i64 0, i32 0
  br bb4
bb2:
  %i5 = add i32 %a4, i32 1000
  %i6 = insertelement <4 x i32> poison, %i5, i64 0
  %i7 = shufflevector <4 x i32> %i6, <4 x i32> poison, <0, 0, 0, 0>
  tail call void @f3 [air Texture(Texture { op: Write, image: ImageShape { dim: D2, array: false, ms: false, depth: false }, texel: Some(Texel { ty: NumTy { elem: I32, lanes: 4 }, sign: Some(Unsigned) }), coord16: false, form: Current, status: true, access: Some(ReadWrite), states_access: true, device_coherent: true })](%a0, %i0, %i7, i32 0, i32 3) arg0( nocapture )
  tail call void @f2 [air Sync(Fence { flags: MemFlags { device: false, threadgroup: false, texture: true, threadgroup_imageblock: false, object_data: false }, order: Release, scope: Device })](i32 4, i32 3, i32 2)
  %i10 = getelementptr inbounds %t21, %a1, i64 0, i32 0
  %i11 = tail call i32 @f4 [air Atomic(Atomic { space: Global, op: Add, sign: Some(Unsigned), ty: NumTy { elem: I32, lanes: 1 }, order: Relaxed, failure: None, scope: Device, volatile: false, fetch: true, flags: Some(MemFlags { device: false, threadgroup: false, texture: false, threadgroup_imageblock: false, object_data: false }), stated_volatile: true })](%i10, i32 1, i32 0, i32 2, i32 0, i1 0) arg0( nocapture )
  br bb5
bb3:
  tail call void @f2 [air Sync(Fence { flags: MemFlags { device: false, threadgroup: false, texture: true, threadgroup_imageblock: false, object_data: false }, order: Acquire, scope: Device })](i32 4, i32 2, i32 2)
  %i14 = tail call ptr addrspace(2) @f6 [air Sampler(GetReadSampler)]()
  %i15 = tail call %t15 @f7 [air Texture(Texture { op: Read, image: ImageShape { dim: D2, array: false, ms: false, depth: false }, texel: Some(Texel { ty: NumTy { elem: I32, lanes: 4 }, sign: Some(Unsigned) }), coord16: false, form: Current, status: true, access: Some(ReadWrite), states_access: true, device_coherent: true })](%a0, %i14, %i0, <2 x i32> zeroinitializer, i32 0, i32 3) arg0( Ref nocapture )
  %i16 = extractvalue <4 x i32> %i15, 0
  %i17 = extractelement %i16, i64 0
  %i18 = icmp eq %i28, i32 64
  %i19 = add i32 %a4, i32 1000
  %i20 = icmp ne %i17, %i19
  %i21 = select i1 %i18, %i20, i1 0
  %i22 = select i32 %i21, i32 2, i32 1
  %i23 = zext %a4 to i64
  %i24 = getelementptr inbounds i32, %a2, %i23
  store %i22, %i24, align 4
  br bb5
bb4:
  %i27 = phi i32 [i32 0, bb1], [%i29, bb4]
  %i28 = tail call i32 @f5 [air Atomic(Atomic { space: Global, op: Load, sign: None, ty: NumTy { elem: I32, lanes: 1 }, order: Relaxed, failure: None, scope: Device, volatile: false, fetch: true, flags: Some(MemFlags { device: false, threadgroup: false, texture: false, threadgroup_imageblock: false, object_data: false }), stated_volatile: true })](%i3, i32 0, i32 2, i32 0, i1 0) arg0( nocapture )
  %i29 = add nuw nsw i32 %i27, i32 1
  %i30 = icmp ult %i27, i32 4095
  %i31 = icmp ult %i28, i32 64
  %i32 = select i1 %i30, %i31, i1 0
  br %i32, bb4, bb3, !llvm.loop LoopHints { unroll: Default, must_progress: true }
bb5:
  ret void
}

define %t4 @f1 "coherent_texture_handoff_seen" "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins"="" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" %a1( nocapture "air-buffer-no-alias"="" ) %a2( Mod nocapture "air-buffer-no-alias"="" ) {
bb0:
  %i0 = insertelement <2 x i32> c23, %a4, i64 0
  %i1 = icmp eq %a3, i32 0
  br %i1, bb2, bb1
bb1:
  %i3 = getelementptr inbounds %t21, %a1, i64 0, i32 0
  br bb4
bb2:
  %i5 = add i32 %a4, i32 1000
  %i6 = insertelement <4 x i32> poison, %i5, i64 0
  %i7 = shufflevector <4 x i32> %i6, <4 x i32> poison, <0, 0, 0, 0>
  tail call void @f3 [air Texture(Texture { op: Write, image: ImageShape { dim: D2, array: false, ms: false, depth: false }, texel: Some(Texel { ty: NumTy { elem: I32, lanes: 4 }, sign: Some(Unsigned) }), coord16: false, form: Current, status: true, access: Some(ReadWrite), states_access: true, device_coherent: true })](%a0, %i0, %i7, i32 0, i32 3) arg0( nocapture )
  tail call void @f2 [air Sync(Fence { flags: MemFlags { device: false, threadgroup: false, texture: true, threadgroup_imageblock: false, object_data: false }, order: Release, scope: Device })](i32 4, i32 3, i32 2)
  %i10 = getelementptr inbounds %t21, %a1, i64 0, i32 0
  %i11 = tail call i32 @f4 [air Atomic(Atomic { space: Global, op: Add, sign: Some(Unsigned), ty: NumTy { elem: I32, lanes: 1 }, order: Relaxed, failure: None, scope: Device, volatile: false, fetch: true, flags: Some(MemFlags { device: false, threadgroup: false, texture: false, threadgroup_imageblock: false, object_data: false }), stated_volatile: true })](%i10, i32 1, i32 0, i32 2, i32 0, i1 0) arg0( nocapture )
  br bb5
bb3:
  tail call void @f2 [air Sync(Fence { flags: MemFlags { device: false, threadgroup: false, texture: true, threadgroup_imageblock: false, object_data: false }, order: Acquire, scope: Device })](i32 4, i32 2, i32 2)
  %i14 = insertelement <2 x i32> undef, %i25, i64 0
  %i15 = tail call ptr addrspace(2) @f6 [air Sampler(GetReadSampler)]()
  %i16 = tail call %t15 @f7 [air Texture(Texture { op: Read, image: ImageShape { dim: D2, array: false, ms: false, depth: false }, texel: Some(Texel { ty: NumTy { elem: I32, lanes: 4 }, sign: Some(Unsigned) }), coord16: false, form: Current, status: true, access: Some(ReadWrite), states_access: true, device_coherent: true })](%a0, %i15, %i0, <2 x i32> zeroinitializer, i32 0, i32 3) arg0( Ref nocapture )
  %i17 = extractvalue <4 x i32> %i16, 0
  %i18 = extractelement %i17, i64 0
  %i19 = insertelement %i14, %i18, i64 1
  %i20 = zext %a4 to i64
  %i21 = getelementptr inbounds <2 x i32>, %a2, %i20
  store %i19, %i21, align 8
  br bb5
bb4:
  %i24 = phi i32 [i32 0, bb1], [%i26, bb4]
  %i25 = tail call i32 @f5 [air Atomic(Atomic { space: Global, op: Load, sign: None, ty: NumTy { elem: I32, lanes: 1 }, order: Relaxed, failure: None, scope: Device, volatile: false, fetch: true, flags: Some(MemFlags { device: false, threadgroup: false, texture: false, threadgroup_imageblock: false, object_data: false }), stated_volatile: true })](%i3, i32 0, i32 2, i32 0, i1 0) arg0( nocapture )
  %i26 = add nuw nsw i32 %i24, i32 1
  %i27 = icmp ult %i24, i32 4095
  %i28 = icmp ult %i25, i32 64
  %i29 = select i1 %i27, %i28, i1 0
  br %i29, bb4, bb3, !llvm.loop LoopHints { unroll: Default, must_progress: true }
bb5:
  ret void
}

declare %t5 @f2 "air.atomic.fence"

declare %t8 @f3 "air.write_texture_2d.device_coherent.u.v4i32" memory(ModRef, NoModRef, NoModRef) %a0( nocapture )

declare %t10 @f4 "air.atomic.global.add.u.i32" %a0( nocapture )

declare %t11 @f5 "air.atomic.global.load.i32" %a0( nocapture )

declare %t13 @f6 "air.get_read_sampler" memory(NoModRef, Ref, NoModRef)

declare %t16 @f7 "air.read_texture_2d.device_coherent.u.v4i32" memory(Ref, NoModRef, NoModRef) %a0( Ref nocapture )
!md0 = !"SDK Version"
!md1 = !"wchar_size"
!md2 = !"frame-pointer"
!md3 = !"air.max_device_buffers"
!md4 = !"air.max_constant_buffers"
!md5 = !"air.max_threadgroup_buffers"
!md6 = !"air.max_textures"
!md7 = !"air.max_read_write_textures"
!md8 = !"air.max_samplers"
!md9 = !"air.texture"
!md10 = !"air.location_index"
!md11 = !"air.read_write"
!md12 = !"air.arg_type_name"
!md13 = !"texture2d<uint, read_write>"
!md14 = !"air.arg_name"
!md15 = !"tex"
!md16 = !"air.buffer"
!md17 = !"air.address_space"
!md18 = !"air.struct_type_info"
!md19 = !"uint"
!md20 = !"__s"
!md21 = !"air.arg_type_size"
!md22 = !"air.arg_type_align_size"
!md23 = !"metal::_atomic"
!md24 = !"flag"
!md25 = !"out"
!md26 = !"air.threadgroup_position_in_grid"
!md27 = !"group"
!md28 = !"air.thread_position_in_threadgroup"
!md29 = !"i"
!md30 = !"uint2"
!md31 = !"air.compile.denorms_disable"
!md32 = !"air.compile.fast_math_enable"
!md33 = !"air.compile.framebuffer_fetch_enable"
!md34 = !"Apple metal version 32023.922 (metalfe-32023.922.4)"
!md35 = !"Metal"
!md36 = !"air-alias-scope-textures"
!md37 = !"air-alias-scope-arg(2)"
!md38 = !"air-alias-scope-arg(1)"
!md39 = !"int"
!md40 = !"omnipotent char"
!md41 = !"Simple C++ TBAA"
!md42 = !"llvm.loop.mustprogress"
!md43 = i32 2
!md44 = %t18 c10
!md45 = i32 1
!md46 = i32 4
!md47 = i32 7
!md48 = i32 31
!md49 = i32 128
!md50 = i32 8
!md51 = i32 16
!md52 = ptr addrspace(0) @f0
!md53 = i32 0
!md54 = i32 3
!md55 = ptr addrspace(0) @f1
!md56 = i32 9
!md57 = i64 0
!md58 = !{!md43, !md0, !md44}
!md59 = !{!md45, !md1, !md46}
!md60 = !{!md47, !md2, !md43}
!md61 = !{!md47, !md3, !md48}
!md62 = !{!md47, !md4, !md48}
!md63 = !{!md47, !md5, !md48}
!md64 = !{!md47, !md6, !md49}
!md65 = !{!md47, !md7, !md50}
!md66 = !{!md47, !md8, !md51}
!md67 = !{}
!md68 = !{!md53, !md9, !md10, !md53, !md45, !md11, !md12, !md13, !md14, !md15}
!md69 = !{!md53, !md46, !md53, !md19, !md20}
!md70 = !{!md45, !md16, !md10, !md53, !md45, !md11, !md17, !md45, !md18, !md69, !md21, !md46, !md22, !md46, !md12, !md23, !md14, !md24}
!md71 = !{!md43, !md16, !md10, !md45, !md45, !md11, !md17, !md45, !md21, !md46, !md22, !md46, !md12, !md19, !md14, !md25}
!md72 = !{!md54, !md26, !md12, !md19, !md14, !md27}
!md73 = !{!md46, !md28, !md12, !md19, !md14, !md29}
!md74 = !{!md68, !md70, !md71, !md72, !md73}
!md75 = !{!md52, !md67, !md74}
!md76 = !{!md43, !md16, !md10, !md45, !md45, !md11, !md17, !md45, !md21, !md50, !md22, !md50, !md12, !md30, !md14, !md25}
!md77 = !{!md68, !md70, !md76, !md72, !md73}
!md78 = !{!md55, !md67, !md77}
!md79 = !{!md31}
!md80 = !{!md32}
!md81 = !{!md33}
!md82 = !{!md34}
!md83 = !{!md43, !md56, !md53}
!md84 = !{!md35, !md46, !md45, !md53}
!md85 = !{!md41}
!md86 = !{!md40, !md85, !md57}
!md87 = !{!md39, !md86, !md57}
!md88 = !{!md87, !md87, !md57}
!md89 = !{!md42}
!"llvm.module.flags" = !{!md58, !md59, !md60, !md61, !md62, !md63, !md64, !md65, !md66}
!"air.kernel" = !{!md75, !md78}
!"air.compile_options" = !{!md79, !md80, !md81}
!"llvm.ident" = !{!md82}
!"air.version" = !{!md83}
!"air.language_version" = !{!md84}
