	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ioctl_add_descriptor
_ioctl_add_descriptor:                  ## @ioctl_add_descriptor
	.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	(%rdi), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r15
	movl	(%rsi), %eax
	cmpl	$257, %eax                      ## imm = 0x101
	jl	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	%rdi, %r12
	leal	28(,%rax,4), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r14
	movl	24(%rax), %ebx
	movl	16(%r15), %edi
	callq	_u64_to_uptr
	movl	(%r15), %edx
	shll	$2, %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_copy_from_user
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_14
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	(%r15), %eax
	movq	%r14, %r13
	addq	$8, %r13
	movl	%eax, 8(%r14)
	movl	12(%r15), %eax
	movl	%eax, 20(%r14)
	movl	8(%r15), %eax
	movl	%eax, 16(%r14)
	movl	24(%r14), %eax
	movl	%eax, 12(%r14)
	movq	%r13, %rdi
	callq	_fw_core_add_descriptor
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	_release_descriptor@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_add_client_resource
	testl	%eax, %eax
	js	LBB0_12
## %bb.15:
	movl	(%r14), %eax
	movl	%eax, 4(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_10:
	movl	%eax, %ebx
	jmp	LBB0_13
LBB0_12:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_fw_core_remove_descriptor
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_release_descriptor,4,2         ## @release_descriptor
	.no_dead_strip	_ioctl_add_descriptor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ioctl_add_descriptor
_ioctl_add_descriptor:                  ; @ioctl_add_descriptor
	.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
	ldr	x8, [x0]
	ldr	w8, [x8]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x20, x1
	ldr	w8, [x1]
	cmp	w8, #257
	b.lt	LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_3:
Lloh2:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	mov	x21, x0
	lsl	w8, w8, #2
	add	w0, w8, #28
Lloh4:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.5:
	mov	x19, x0
	ldr	w22, [x0, #24]
	ldr	w0, [x20, #16]
	bl	_u64_to_uptr
	mov	x1, x0
	ldr	w8, [x20]
	lsl	w2, w8, #2
	mov	x0, x22
	bl	_copy_from_user
	cbz	x0, LBB0_11
; %bb.6:
Lloh6:
	adrp	x8, _EFAULT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x19
	bl	_kfree
	b	LBB0_10
LBB0_8:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_10:
	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
LBB0_11:
	ldr	w8, [x20]
	mov	x23, x19
	str	w8, [x23, #8]!
	ldr	d0, [x20, #8]
	str	d0, [x23, #8]
	ldr	w8, [x23, #16]
	str	w8, [x23, #4]
	mov	x0, x23
	bl	_fw_core_add_descriptor
	tbnz	w0, #31, LBB0_14
; %bb.12:
Lloh11:
	adrp	x8, _release_descriptor@GOTPAGE
Lloh12:
	ldr	x8, [x8, _release_descriptor@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	w2, [x24]
	mov	x0, x21
	mov	x1, x19
	bl	_add_client_resource
	tbnz	w0, #31, LBB0_15
; %bb.13:
	mov	w22, #0
	ldr	w8, [x19]
	str	w8, [x20, #4]
	b	LBB0_10
LBB0_14:
	mov	x22, x0
	b	LBB0_7
LBB0_15:
	mov	x22, x0
	mov	x0, x23
	bl	_fw_core_remove_descriptor
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_release_descriptor,4,2         ; @release_descriptor
	.no_dead_strip	_ioctl_add_descriptor
.subsections_via_symbols
