	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msgqueue_handle_init_msg
_msgqueue_handle_init_msg:              ## @msgqueue_handle_init_msg
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	8(%rdi), %rbx
	movq	(%rbx), %r13
	movslq	(%r13), %rax
	cmpq	$128, %rax
	je	LBB0_1
## %bb.2:
	cmpl	$129, %eax
	jne	LBB0_7
## %bb.3:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	$2612, %esi                     ## imm = 0xA34
	jmp	LBB0_4
LBB0_1:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	$1228, %esi                     ## imm = 0x4CC
LBB0_4:
	movq	%rbx, %rdi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	callq	_nvkm_falcon_rd32
	movl	%eax, %r12d
	movq	_HDR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movl	%r12d, %esi
	xorl	%ecx, %ecx
	movq	%r15, %r8
	callq	_nvkm_falcon_read_dmem
	movl	(%r15), %edx
	movq	_MSG_BUF_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jle	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_nvkm_error
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_nvkm_subdev_name@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_nvkm_error
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_8:
	subl	(%rax), %r14d
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_HDR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subl	%esi, %edx
	addl	%r12d, %esi
	leaq	4(%r15), %r8
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_nvkm_falcon_read_dmem
	movl	(%r15), %edi
	movq	_QUEUE_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ALIGN
	addl	%eax, %r12d
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	callq	_nvkm_falcon_wr32
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	%r15, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"falcon %s unsupported for msgqueue!\n"

	.comm	_nvkm_subdev_name,8,3           ## @nvkm_subdev_name
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HDR_SIZE,4,2                   ## @HDR_SIZE
	.comm	_MSG_BUF_SIZE,4,2               ## @MSG_BUF_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"message too big (%d bytes)\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_QUEUE_ALIGNMENT,4,2            ## @QUEUE_ALIGNMENT
	.no_dead_strip	_msgqueue_handle_init_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msgqueue_handle_init_msg
_msgqueue_handle_init_msg:              ; @msgqueue_handle_init_msg
	.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, x1
	mov	x20, x0
	ldr	x21, [x0, #8]
	ldr	x23, [x21]
	ldr	w8, [x23]
	cmp	w8, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #129
	b.ne	LBB0_6
; %bb.2:
	mov	w22, #2612
	b	LBB0_4
LBB0_3:
	mov	w22, #1228
LBB0_4:
	mov	x0, x21
	mov	x1, x22
	bl	_nvkm_falcon_rd32
	mov	x24, x0
Lloh0:
	adrp	x25, _HDR_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _HDR_SIZE@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x21
	mov	x1, x24
	mov	w3, #0
	mov	x4, x19
	bl	_nvkm_falcon_read_dmem
	ldr	w2, [x19]
Lloh2:
	adrp	x8, _MSG_BUF_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MSG_BUF_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w2, w8
	b.le	LBB0_8
; %bb.5:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_nvkm_error
Lloh7:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	sxtw	x8, w8
Lloh9:
	adrp	x9, _nvkm_subdev_name@GOTPAGE
Lloh10:
	ldr	x9, [x9, _nvkm_subdev_name@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	w2, [x9, x8, lsl #2]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_nvkm_error
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
	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
LBB0_8:
	ldr	w8, [x25]
	add	w1, w8, w24
	sub	w2, w2, w8
	add	x4, x19, #4
	mov	x0, x21
	mov	w3, #0
	bl	_nvkm_falcon_read_dmem
	ldr	w0, [x19]
Lloh16:
	adrp	x8, _QUEUE_ALIGNMENT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _QUEUE_ALIGNMENT@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_ALIGN
	add	w2, w0, w24
	mov	x0, x21
	mov	x1, x22
	bl	_nvkm_falcon_wr32
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x2, [x8]
	mov	x0, x20
	mov	x1, x19
	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
	br	x2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"falcon %s unsupported for msgqueue!\n"

	.comm	_nvkm_subdev_name,8,3           ; @nvkm_subdev_name
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HDR_SIZE,4,2                   ; @HDR_SIZE
	.comm	_MSG_BUF_SIZE,4,2               ; @MSG_BUF_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"message too big (%d bytes)\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_QUEUE_ALIGNMENT,4,2            ; @QUEUE_ALIGNMENT
	.no_dead_strip	_msgqueue_handle_init_msg
.subsections_via_symbols
