target triple = "air64_v28-apple-macosx26.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: [] }
%t2 = type [2 x i64]
%t9 = type <4 x half> (<4 x float>, <4 x half>, ptr addrspace(1), ptr addrspace(2))
%t10 = type <4 x half> (<4 x float>, <4 x half>, ptr addrspace(1), ptr addrspace(2), ptr addrspace(1))
%t12 = type i32 (float)
%t13 = type <4 x half> (<4 x float>, <4 x half>, ptr addrspace(2), ptr addrspace(1))
%t14 = type <4 x half> (<4 x float>, ptr addrspace(1), ptr addrspace(2))
%t16 = type void ()
%t17 = type <4 x half> (<4 x half>, <4 x half>, <4 x half>)
%t19 = type { <4 x half>, i8 }
%t23 = type %t19 (ptr addrspace(1), ptr addrspace(2), <2 x float>, i1, <2 x i32>, i1, float, float, i32)
%t25 = type [2 x i32]
c13 = %t2 [34901797601020562, 0]
c15 = %t25 [27, 0]
c26 = <2 x i32> [0, 1]
c27 = <2 x float> [0x3D000000, 0x3D000000]
c35 = <4 x i32> [3, 3, 3, 3]
@g0 "__air_sampler_state" = internal addrspace(2) constant %t2 c13, align 8

define %t9 @f0 "rch_late_discard" convergent "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" %a2( Ref nocapture ) %a3( align 8 dereferenceable(8) Ref nocapture "air-buffer-no-alias"="" ) {
bb0:
  %i0 = shufflevector <2 x float> %a0, <4 x float> poison, <0, 1>
  %i1 = fmul reassoc nnan ninf nsz arcp contract afn <2 x float> %i0, <2 x float> c27
  %i2 = tail call %t19 @f7 [air Texture(Texture { op: Sample { compare: false, lod: Bias, offset: true }, image: ImageShape { dim: D2, array: false, ms: false, depth: false }, texel: Some(Texel { ty: NumTy { elem: F16, lanes: 4 }, sign: None }), coord16: false, form: Current, status: true, access: Some(Sample), states_access: true, device_coherent: false })](%a2, ptr addrspace(2) @g0, %i1, i1 1, <2 x i32> zeroinitializer, i1 0, float 0x0, float 0x0, i32 0) convergent arg0( Ref nocapture ) arg1( Ref nocapture )
  %i3 = extractelement %a1, i64 3
  %i4 = fcmp reassoc nnan ninf nsz arcp contract afn oeq %i3, half 0x0
  br %i4, bb1, bb2
bb1:
  tail call void @f5 [air Fragment(Discard)]()
  br bb2
bb2:
  %i8 = extractvalue <4 x half> %i2, 0
  %i9 = load <4 x half>, %a3, align 8
  %i10 = fmul reassoc nnan ninf nsz arcp contract afn <4 x half> %i9, %i8
  %i11 = shufflevector <4 x half> %i9, <4 x half> undef, <3, 3, 3, 3>
  %i12 = tail call reassoc nnan ninf nsz arcp contract afn <4 x half> @f6 [air Math(Math { f: Mix, precision: Precise, ty: NumTy { elem: F16, lanes: 4 } })](%a1, %i10, %i11)
  ret %i12
}

define %t10 @f1 "rch_late_discard_store" convergent "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" %a2( Ref nocapture ) %a3( align 8 dereferenceable(8) Ref nocapture "air-buffer-no-alias"="" ) %a4( Mod nocapture "air-buffer-no-alias"="" ) {
bb0:
  %i0 = shufflevector <2 x float> %a0, <4 x float> poison, <0, 1>
  %i1 = fmul reassoc nnan ninf nsz arcp contract afn <2 x float> %i0, <2 x float> c27
  %i2 = tail call %t19 @f7 [air Texture(Texture { op: Sample { compare: false, lod: Bias, offset: true }, image: ImageShape { dim: D2, array: false, ms: false, depth: false }, texel: Some(Texel { ty: NumTy { elem: F16, lanes: 4 }, sign: None }), coord16: false, form: Current, status: true, access: Some(Sample), states_access: true, device_coherent: false })](%a2, ptr addrspace(2) @g0, %i1, i1 1, <2 x i32> zeroinitializer, i1 0, float 0x0, float 0x0, i32 0) convergent arg0( Ref nocapture ) arg1( Ref nocapture )
  %i3 = extractelement %a1, i64 3
  %i4 = fcmp reassoc nnan ninf nsz arcp contract afn oeq %i3, half 0x0
  br %i4, bb1, bb2
bb1:
  tail call void @f5 [air Fragment(Discard)]()
  br bb2
bb2:
  %i8 = extractvalue <4 x half> %i2, 0
  %i9 = extractelement %a0, i64 1
  %i10 = tail call i32 @f2 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None, rounding: None, saturate: false })](%i9)
  %i11 = shl i32 %i10, i32 6
  %i12 = extractelement %a0, i64 0
  %i13 = tail call i32 @f2 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None, rounding: None, saturate: false })](%i12)
  %i14 = add i32 %i11, %i13
  %i15 = zext %i14 to i64
  %i16 = getelementptr inbounds i32, %a4, %i15
  store i32 1, %i16, align 4
  %i18 = load <4 x half>, %a3, align 8
  %i19 = fmul reassoc nnan ninf nsz arcp contract afn <4 x half> %i18, %i8
  %i20 = shufflevector <4 x half> %i18, <4 x half> undef, <3, 3, 3, 3>
  %i21 = tail call reassoc nnan ninf nsz arcp contract afn <4 x half> @f6 [air Math(Math { f: Mix, precision: Precise, ty: NumTy { elem: F16, lanes: 4 } })](%a1, %i19, %i20)
  ret %i21
}

declare %t12 @f2 "air.convert.u.i32.f.f32" memory(NoModRef, NoModRef, NoModRef)

define %t13 @f3 "rch_late_discard_store_unsampled" "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" %a2( align 8 dereferenceable(8) Ref nocapture "air-buffer-no-alias"="" ) %a3( Mod nocapture "air-buffer-no-alias"="" ) {
bb0:
  %i0 = extractelement %a1, i64 3
  %i1 = fcmp reassoc nnan ninf nsz arcp contract afn oeq %i0, half 0x0
  br %i1, bb1, bb2
bb1:
  tail call void @f5 [air Fragment(Discard)]()
  br bb2
bb2:
  %i5 = extractelement %a0, i64 1
  %i6 = tail call i32 @f2 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None, rounding: None, saturate: false })](%i5)
  %i7 = shl i32 %i6, i32 6
  %i8 = extractelement %a0, i64 0
  %i9 = tail call i32 @f2 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None, rounding: None, saturate: false })](%i8)
  %i10 = add i32 %i7, %i9
  %i11 = zext %i10 to i64
  %i12 = getelementptr inbounds i32, %a3, %i11
  store i32 1, %i12, align 4
  %i14 = load <4 x half>, %a2, align 8
  %i15 = shufflevector <4 x half> %i14, <4 x half> undef, <3, 3, 3, 3>
  %i16 = tail call reassoc nnan ninf nsz arcp contract afn <4 x half> @f6 [air Math(Math { f: Mix, precision: Precise, ty: NumTy { elem: F16, lanes: 4 } })](%a1, %i14, %i15)
  ret %i16
}

define %t14 @f4 "rch_late_discard_plain" convergent "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( Ref nocapture ) %a2( align 8 dereferenceable(8) Ref nocapture "air-buffer-no-alias"="" ) {
bb0:
  %i0 = shufflevector <2 x float> %a0, <4 x float> poison, <0, 1>
  %i1 = fmul reassoc nnan ninf nsz arcp contract afn <2 x float> %i0, <2 x float> c27
  %i2 = tail call %t19 @f7 [air Texture(Texture { op: Sample { compare: false, lod: Bias, offset: true }, image: ImageShape { dim: D2, array: false, ms: false, depth: false }, texel: Some(Texel { ty: NumTy { elem: F16, lanes: 4 }, sign: None }), coord16: false, form: Current, status: true, access: Some(Sample), states_access: true, device_coherent: false })](%a1, ptr addrspace(2) @g0, %i1, i1 1, <2 x i32> zeroinitializer, i1 0, float 0x0, float 0x0, i32 0) convergent arg0( Ref nocapture ) arg1( Ref nocapture )
  %i3 = extractvalue <4 x half> %i2, 0
  %i4 = extractelement %i3, i64 3
  %i5 = fcmp reassoc nnan ninf nsz arcp contract afn oeq %i4, half 0x0
  br %i5, bb1, bb2
bb1:
  tail call void @f5 [air Fragment(Discard)]()
  br bb2
bb2:
  %i9 = load <4 x half>, %a2, align 8
  %i10 = fmul reassoc nnan ninf nsz arcp contract afn <4 x half> %i9, %i3
  %i11 = shufflevector <4 x half> %i9, <4 x half> undef, <3, 3, 3, 3>
  %i12 = fadd reassoc nnan ninf nsz arcp contract afn <4 x half> %i10, %i11
  ret %i12
}

declare %t16 @f5 "air.discard_fragment"

declare %t17 @f6 "air.mix.v4f16" memory(NoModRef, NoModRef, NoModRef)

declare %t23 @f7 "air.sample_texture_2d.v4f16" convergent memory(Ref, NoModRef, NoModRef) %a0( Ref nocapture ) %a1( 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.render_target"
!md10 = !"air.arg_type_name"
!md11 = !"half4"
!md12 = !"air.position"
!md13 = !"air.center"
!md14 = !"air.no_perspective"
!md15 = !"float4"
!md16 = !"air.arg_name"
!md17 = !"position"
!md18 = !"dest"
!md19 = !"air.texture"
!md20 = !"air.location_index"
!md21 = !"air.sample"
!md22 = !"texture2d<half, sample>"
!md23 = !"noise"
!md24 = !"air.buffer"
!md25 = !"air.buffer_size"
!md26 = !"air.read"
!md27 = !"air.address_space"
!md28 = !"air.arg_type_size"
!md29 = !"air.arg_type_align_size"
!md30 = !"tint"
!md31 = !"air.read_write"
!md32 = !"uint"
!md33 = !"written"
!md34 = !"air.compile.denorms_disable"
!md35 = !"air.compile.fast_math_enable"
!md36 = !"air.compile.framebuffer_fetch_enable"
!md37 = !"air.sampler_state"
!md38 = !"Apple metal version 32023.921 (metalfe-32023.921.6)"
!md39 = !"Metal"
!md40 = !"omnipotent char"
!md41 = !"Simple C++ TBAA"
!md42 = !"air-alias-scope-arg(3)"
!md43 = !"air-alias-scope-textures"
!md44 = !"int"
!md45 = !"air-alias-scope-arg(2)"
!md46 = i32 2
!md47 = %t25 c15
!md48 = i32 1
!md49 = i32 4
!md50 = i32 7
!md51 = i32 31
!md52 = i32 128
!md53 = i32 8
!md54 = i32 16
!md55 = ptr addrspace(0) @f0
!md56 = i32 0
!md57 = i32 3
!md58 = ptr addrspace(0) @f1
!md59 = ptr addrspace(0) @f3
!md60 = ptr addrspace(0) @f4
!md61 = ptr addrspace(2) @g0
!md62 = i64 0
!md63 = !{!md46, !md0, !md47}
!md64 = !{!md48, !md1, !md49}
!md65 = !{!md50, !md2, !md46}
!md66 = !{!md50, !md3, !md51}
!md67 = !{!md50, !md4, !md51}
!md68 = !{!md50, !md5, !md51}
!md69 = !{!md50, !md6, !md52}
!md70 = !{!md50, !md7, !md53}
!md71 = !{!md50, !md8, !md54}
!md72 = !{!md9, !md56, !md56, !md10, !md11}
!md73 = !{!md72}
!md74 = !{!md56, !md12, !md13, !md14, !md10, !md15, !md16, !md17}
!md75 = !{!md48, !md9, !md56, !md10, !md11, !md16, !md18}
!md76 = !{!md46, !md19, !md20, !md56, !md48, !md21, !md10, !md22, !md16, !md23}
!md77 = !{!md57, !md24, !md25, !md53, !md20, !md56, !md48, !md26, !md27, !md46, !md28, !md53, !md29, !md53, !md10, !md11, !md16, !md30}
!md78 = !{!md74, !md75, !md76, !md77}
!md79 = !{!md55, !md73, !md78}
!md80 = !{!md49, !md24, !md20, !md48, !md48, !md31, !md27, !md48, !md28, !md49, !md29, !md49, !md10, !md32, !md16, !md33}
!md81 = !{!md74, !md75, !md76, !md77, !md80}
!md82 = !{!md58, !md73, !md81}
!md83 = !{!md46, !md24, !md25, !md53, !md20, !md56, !md48, !md26, !md27, !md46, !md28, !md53, !md29, !md53, !md10, !md11, !md16, !md30}
!md84 = !{!md57, !md24, !md20, !md48, !md48, !md31, !md27, !md48, !md28, !md49, !md29, !md49, !md10, !md32, !md16, !md33}
!md85 = !{!md74, !md75, !md83, !md84}
!md86 = !{!md59, !md73, !md85}
!md87 = !{!md48, !md19, !md20, !md56, !md48, !md21, !md10, !md22, !md16, !md23}
!md88 = !{!md74, !md87, !md83}
!md89 = !{!md60, !md73, !md88}
!md90 = !{!md34}
!md91 = !{!md35}
!md92 = !{!md36}
!md93 = !{!md37, !md61}
!md94 = !{!md38}
!md95 = !{!md46, !md53, !md56}
!md96 = !{!md39, !md49, !md56, !md56}
!md97 = !{!md41}
!md98 = !{!md40, !md97, !md62}
!md99 = !{!md98, !md98, !md62}
!md100 = !{!md44, !md98, !md62}
!md101 = !{!md100, !md100, !md62}
!"llvm.module.flags" = !{!md63, !md64, !md65, !md66, !md67, !md68, !md69, !md70, !md71}
!"air.fragment" = !{!md79, !md82, !md86, !md89}
!"air.compile_options" = !{!md90, !md91, !md92}
!"air.sampler_states" = !{!md93}
!"llvm.ident" = !{!md94}
!"air.version" = !{!md95}
!"air.language_version" = !{!md96}
