	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ilk_wm_merge
_ilk_wm_merge:                          ## @ilk_wm_merge
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_ilk_wm_max_level
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	cmpl	$7, %eax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jl	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_IS_IVYBRIDGE
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	xorl	%r15d, %r15d
	cmpl	$2, (%r14)
	cmovll	%r12d, %r15d
LBB0_4:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	xorl	%ecx, %ecx
	cmpl	$6, %eax
	setge	%cl
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	testl	%r12d, %r12d
	jle	LBB0_14
## %bb.5:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	$1, %ebx
	movl	$24, %r13d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	$0, (%r12,%r13)
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	addq	$16, %r13
	cmpq	%rbx, -80(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_14
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r12
	leaq	(%r12,%r13), %rdx
	addq	$-8, %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	callq	_ilk_merge_wm_level
	movslq	%r15d, %rax
	cmpq	%rax, %rbx
	movl	%r15d, %r14d
	jle	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$0, -8(%r12,%r13)
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	%ebx, %edi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	_ilk_validate_wm_level
	leal	-1(%rbx), %ecx
	testl	%eax, %eax
	cmovel	%ecx, %r14d
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r12,%r13), %rax
	cmpq	(%r15), %rax
	movl	%r14d, %r15d
	jle	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$0, -8(%r12,%r13)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	jmp	LBB0_12
LBB0_14:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$5, %esi
	callq	_IS_GEN
	testq	%rax, %rax
	je	LBB0_24
## %bb.15:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, (%rax)
	je	LBB0_16
LBB0_24:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%rbx, %rdi
	callq	_intel_fbc_is_active
	testq	%rax, %rax
	je	LBB0_24
## %bb.17:
	cmpl	$2, -56(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_24
## %bb.18:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	leaq	-1(%rdi), %rdx
	addq	$-2, %rdi
	movl	%edx, %ecx
	andl	$3, %ecx
	movl	$2, %esi
	cmpq	$3, %rdi
	jb	LBB0_21
## %bb.19:
	leaq	80(%rax), %rdi
	andq	$-4, %rdx
	negq	%rdx
	movl	$2, %esi
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	$0, -48(%rdi)
	movl	$0, -32(%rdi)
	movl	$0, -16(%rdi)
	movl	$0, (%rdi)
	addq	$64, %rdi
	leaq	(%rdx,%rsi), %rbx
	addq	$4, %rbx
	addq	$4, %rsi
	cmpq	$2, %rbx
	jne	LBB0_20
LBB0_21:
	testq	%rcx, %rcx
	je	LBB0_24
## %bb.22:
	shlq	$4, %rsi
	addq	%rsi, %rax
	shlq	$4, %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	$0, (%rax,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_23
	jmp	LBB0_24
LBB0_2:
	movl	%r12d, %r15d
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ilk_wm_merge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ilk_wm_merge
_ilk_wm_merge:                          ; @ilk_wm_merge
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	bl	_ilk_wm_max_level
	mov	x20, x0
	mov	x0, x21
	bl	_INTEL_GEN
	cmp	w0, #7
	b.lt	LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_IS_IVYBRIDGE
	cbz	x0, LBB0_20
LBB0_2:
	ldr	w8, [x23]
	cmp	w8, #1
	csel	w25, wzr, w20, gt
LBB0_3:
	mov	x0, x21
	bl	_INTEL_GEN
	cmp	w0, #5
	cset	w8, gt
	str	w8, [x19]
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	cmp	w20, #1
	b.lt	LBB0_13
; %bb.4:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w26, w8, #1
	mov	w23, #1
	mov	w27, #24
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	str	xzr, [x28, x27]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x23, x23, #1
	add	x27, x27, #16
	cmp	x26, x23
	b.eq	LBB0_13
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x19, #8]
	add	x20, x28, x27
	sub	x24, x20, #8
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	bl	_ilk_merge_wm_level
	cmp	x23, w25, sxtw
	b.le	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	stur	wzr, [x20, #-8]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	mov	x1, x22
	mov	x2, x24
	bl	_ilk_validate_wm_level
	sub	w8, w23, #1
	cmp	w0, #0
	csel	w25, w8, w25, eq
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x28, x27]
	ldr	x9, [x22]
	cmp	x8, x9
	b.le	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x28, x27
	ldur	w8, [x8, #-8]
	cbz	w8, LBB0_5
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	str	wzr, [x19]
	b	LBB0_5
LBB0_13:
	mov	x0, x21
	mov	w1, #5
	bl	_IS_GEN
	cbz	x0, LBB0_15
; %bb.14:
	ldr	w8, [x19]
	cbz	w8, LBB0_16
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	mov	x0, x21
	bl	_intel_fbc_is_active
	cbz	x0, LBB0_15
; %bb.17:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w8, #2
	b.lt	LBB0_15
; %bb.18:
	ldr	x9, [x19, #8]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w8, w8, #1
	sub	x11, x8, #2
	cmp	x11, #4
	b.hs	LBB0_21
; %bb.19:
	mov	w10, #2
	b	LBB0_24
LBB0_20:
	mov	x25, x20
	b	LBB0_3
LBB0_21:
	and	x12, x11, #0xfffffffffffffffc
	orr	x10, x12, #0x2
	add	x13, x9, #80
	mov	x14, x12
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	stur	wzr, [x13, #-48]
	stur	wzr, [x13, #-32]
	stur	wzr, [x13, #-16]
	str	wzr, [x13], #64
	subs	x14, x14, #4
	b.ne	LBB0_22
; %bb.23:
	cmp	x11, x12
	b.eq	LBB0_15
LBB0_24:
	add	x9, x9, x10, lsl #4
	sub	x8, x8, x10
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	str	wzr, [x9], #16
	subs	x8, x8, #1
	b.ne	LBB0_25
	b	LBB0_15
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ilk_wm_merge
.subsections_via_symbols
