	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cmd_write
_cmd_write:                             ## @cmd_write
	.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	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_msecs_to_jiffies
	movq	%rax, %r15
	addq	%rbx, %r15
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r15, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r13), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_cmd_queue_open
	movl	%eax, %ebx
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	je	LBB0_1
LBB0_3:
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nvkm_error
	jmp	LBB0_9
LBB0_5:
	movl	(%r13), %ecx
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_cmd_queue_push
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nvkm_error
	xorl	%edx, %edx
	jmp	LBB0_8
LBB0_6:
	movl	$1, %edx
LBB0_8:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_cmd_queue_close
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pmu_queue_open_write failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"pmu_queue_push failed\n"

	.no_dead_strip	_cmd_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cmd_write
_cmd_write:                             ; @cmd_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x21, [x8]
Lloh0:
	adrp	x25, _jiffies@GOTPAGE
Lloh1:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
	ldr	x23, [x25]
	mov	w0, #2000
	bl	_msecs_to_jiffies
	add	x24, x0, x23
Lloh2:
	adrp	x26, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x26, [x26, _EAGAIN@GOTPAGEOFF]
	ldr	w23, [x26]
	ldr	x0, [x25]
	mov	x1, x24
	bl	_time_before
	cbz	x0, LBB0_5
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_cmd_queue_open
	mov	x23, x0
	ldr	w8, [x26]
	cmn	w0, w8
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x25]
	mov	x1, x24
	bl	_time_before
	cbnz	x0, LBB0_1
LBB0_3:
	cbz	w23, LBB0_6
LBB0_4:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_nvkm_error
	b	LBB0_10
LBB0_5:
	neg	w23, w23
	cbnz	w23, LBB0_4
LBB0_6:
	ldr	w3, [x22]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_cmd_queue_push
	mov	x23, x0
	cbz	w0, LBB0_8
; %bb.7:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_nvkm_error
	mov	w2, #0
	b	LBB0_9
LBB0_8:
	mov	w2, #1
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	bl	_cmd_queue_close
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pmu_queue_open_write failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"pmu_queue_push failed\n"

	.no_dead_strip	_cmd_write
.subsections_via_symbols
