	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qxl_surface_id_alloc           ## -- Begin function qxl_surface_id_alloc
	.p2align	4, 0x90
_qxl_surface_id_alloc:                  ## @qxl_surface_id_alloc
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	leaq	16(%rdi), %r15
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %r13
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_idr_preload
	movq	%r12, %rdi
	callq	_spin_lock
	movl	(%r14), %r8d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_idr_alloc
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_spin_unlock
	xorl	%eax, %eax
	callq	_idr_preload_end
	testl	%ebx, %ebx
	js	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %ebx
	movq	24(%r12), %rax
	cmpq	%rbx, (%rax)
	ja	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	callq	_spin_lock
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_idr_remove
	movq	%r12, %rdi
	callq	_spin_unlock
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_qxl_reap_surface_id
	jmp	LBB0_1
LBB0_4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	movq	%r12, %rdi
	callq	_spin_lock
	movq	%rbx, 8(%r12)
	movq	%r12, %rdi
	callq	_spin_unlock
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qxl_surface_id_alloc           ; -- Begin function qxl_surface_id_alloc
	.p2align	2
_qxl_surface_id_alloc:                  ; @qxl_surface_id_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	add	x21, x0, #16
Lloh0:
	adrp	x23, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	adrp	x24, _GFP_NOWAIT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GFP_NOWAIT@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_idr_preload
	mov	x0, x19
	bl	_spin_lock
	ldr	w4, [x24]
	mov	x0, x21
	mov	x1, #0
	mov	w2, #1
	mov	w3, #0
	bl	_idr_alloc
	mov	x22, x0
	mov	x0, x19
	bl	_spin_unlock
	bl	_idr_preload_end
	tbnz	w22, #31, LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w22, w22
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cmp	x8, x22
	b.hi	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_spin_lock
	mov	x0, x21
	mov	x1, x22
	bl	_idr_remove
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x19
	mov	w1, #2
	bl	_qxl_reap_surface_id
	b	LBB0_1
LBB0_4:
	str	x22, [x20]
	mov	x0, x19
	bl	_spin_lock
	str	x22, [x19, #8]
	mov	x0, x19
	bl	_spin_unlock
	mov	w22, #0
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
.subsections_via_symbols
