	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btuart_config
_btuart_config:                         ## @btuart_config
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	24(%rdi), %r14
	movl	$0, -36(%rbp)
	movq	_btuart_check_config@GOTPCREL(%rip), %r15
	leaq	-36(%rbp), %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_pcmcia_loop_config
	testl	%eax, %eax
	je	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, -36(%rbp)
	testl	%eax, %eax
	jle	LBB0_1
## %bb.3:
	movq	_btuart_check_config_notpicky@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_pcmcia_loop_config
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_BT_ERR
	movq	_RequestIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movq	%r12, %rdi
	movl	%r15d, %edx
	jmp	LBB0_5
LBB0_7:
	leaq	16(%r12), %rsi
	movq	%r12, %rdi
	callq	_pcmcia_request_irq
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	_RequestIRQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_cs_error
	movq	$0, 16(%r12)
LBB0_9:
	leaq	8(%r12), %rsi
	movq	%r12, %rdi
	callq	_pcmcia_request_configuration
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movq	_RequestConfiguration@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
LBB0_5:
	callq	_cs_error
LBB0_6:
	movq	%r12, %rdi
	callq	_btuart_release
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r14, %rdi
	callq	_btuart_open
	testq	%rax, %rax
	jne	LBB0_6
## %bb.12:
	movl	(%r14), %edi
	movq	8(%r14), %rax
	movl	(%rax), %esi
	callq	_strcpy
	movq	%r14, (%r12)
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_btuart_check_config,4,2        ## @btuart_check_config
	.comm	_btuart_check_config_notpicky,4,2 ## @btuart_check_config_notpicky
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No usable port range found"

	.comm	_RequestIO,4,2                  ## @RequestIO
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_RequestIRQ,4,2                 ## @RequestIRQ
	.comm	_RequestConfiguration,4,2       ## @RequestConfiguration
	.no_dead_strip	_btuart_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btuart_config
_btuart_config:                         ; @btuart_config
	.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
	ldr	x20, [x0, #24]
	str	wzr, [sp, #12]
Lloh0:
	adrp	x21, _btuart_check_config@GOTPAGE
Lloh1:
	ldr	x21, [x21, _btuart_check_config@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pcmcia_loop_config
	cbz	w0, LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #12]
	add	w9, w8, #1
	str	w9, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_1
; %bb.3:
Lloh2:
	adrp	x8, _btuart_check_config_notpicky@GOTPAGE
Lloh3:
	ldr	x8, [x8, _btuart_check_config_notpicky@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_pcmcia_loop_config
	cbz	w0, LBB0_5
; %bb.4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_ERR
Lloh7:
	adrp	x8, _RequestIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RequestIO@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w2, w8
	b	LBB0_9
LBB0_5:
	add	x1, x19, #16
	mov	x0, x19
	bl	_pcmcia_request_irq
	cbz	w0, LBB0_7
; %bb.6:
	mov	x2, x0
Lloh13:
	adrp	x8, _RequestIRQ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RequestIRQ@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cs_error
	str	xzr, [x19, #16]
LBB0_7:
	add	x1, x19, #8
	mov	x0, x19
	bl	_pcmcia_request_configuration
	cbz	w0, LBB0_12
; %bb.8:
	mov	x2, x0
Lloh16:
	adrp	x8, _RequestConfiguration@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RequestConfiguration@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
LBB0_9:
	mov	x0, x19
	bl	_cs_error
LBB0_10:
	mov	x0, x19
	bl	_btuart_release
Lloh19:
	adrp	x8, _ENODEV@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
LBB0_12:
	mov	x0, x20
	bl	_btuart_open
	cbnz	x0, LBB0_10
; %bb.13:
	ldr	w0, [x20]
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	bl	_strcpy
	mov	w0, #0
	str	x20, [x19]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_btuart_check_config,4,2        ; @btuart_check_config
	.comm	_btuart_check_config_notpicky,4,2 ; @btuart_check_config_notpicky
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No usable port range found"

	.comm	_RequestIO,4,2                  ; @RequestIO
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_RequestIRQ,4,2                 ; @RequestIRQ
	.comm	_RequestConfiguration,4,2       ; @RequestConfiguration
	.no_dead_strip	_btuart_config
.subsections_via_symbols
