	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dfl_fpga_cdev_assign_port      ## -- Begin function dfl_fpga_cdev_assign_port
	.p2align	4, 0x90
_dfl_fpga_cdev_assign_port:             ## @dfl_fpga_cdev_assign_port
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	%esi, -28(%rbp)
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	callq	_mutex_lock
	movq	_dfl_fpga_check_port_id@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rsi
	movq	%r14, %rdi
	callq	___dfl_fpga_cdev_find_port
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_device_is_registered
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_3:
	movq	%r15, %rdi
	callq	_platform_device_add
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_dev_get_platdata
	movl	%eax, %edi
	callq	_dfl_feature_dev_use_end
	decl	4(%r14)
	xorl	%ebx, %ebx
LBB0_5:
	movq	%r15, %rdi
	callq	_put_device
LBB0_6:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_dfl_fpga_check_port_id,4,2     ## @dfl_fpga_check_port_id
	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dfl_fpga_cdev_assign_port      ; -- Begin function dfl_fpga_cdev_assign_port
	.p2align	2
_dfl_fpga_cdev_assign_port:             ; @dfl_fpga_cdev_assign_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	str	w1, [sp, #12]
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_mutex_lock
Lloh3:
	adrp	x8, _dfl_fpga_check_port_id@GOTPAGE
Lloh4:
	ldr	x8, [x8, _dfl_fpga_check_port_id@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x1, sp, #12
	mov	x0, x19
	bl	___dfl_fpga_cdev_find_port
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	bl	_device_is_registered
	cbz	x0, LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_3:
	neg	w21, w21
	b	LBB0_7
LBB0_4:
	mov	x0, x20
	bl	_platform_device_add
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_dev_get_platdata
	bl	_dfl_feature_dev_use_end
	ldr	w8, [x19, #4]
	sub	w8, w8, #1
	str	w8, [x19, #4]
LBB0_6:
	mov	x0, x20
	bl	_put_device
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_dfl_fpga_check_port_id,4,2     ; @dfl_fpga_check_port_id
	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
