	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcmcia_reset_card              ## -- Begin function pcmcia_reset_card
	.p2align	4, 0x90
_pcmcia_reset_card:                     ## @pcmcia_reset_card
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	20(%rdi), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	leaq	4(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r15), %eax
	movq	_SOCKET_PRESENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.3:
	movq	_SOCKET_SUSPEND@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	_SOCKET_CARDBUS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	callq	*8(%rax)
LBB0_9:
	leaq	16(%r15), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_socket_reset
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	jne	LBB0_12
## %bb.10:
	movq	8(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	*(%rcx)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"resetting socket\n"

	.comm	_SOCKET_PRESENT,4,2             ## @SOCKET_PRESENT
L_.str.1:                               ## @.str.1
	.asciz	"can't reset, not present\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_SOCKET_SUSPEND,4,2             ## @SOCKET_SUSPEND
L_.str.2:                               ## @.str.2
	.asciz	"can't reset, suspended\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_SOCKET_CARDBUS,4,2             ## @SOCKET_CARDBUS
L_.str.3:                               ## @.str.3
	.asciz	"can't reset, is cardbus\n"

	.comm	_EPERM,4,2                      ## @EPERM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcmcia_reset_card              ; -- Begin function pcmcia_reset_card
	.p2align	2
_pcmcia_reset_card:                     ; @pcmcia_reset_card
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
	add	x21, x0, #20
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	add	x19, x20, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _SOCKET_PRESENT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SOCKET_PRESENT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh5:
	adrp	x9, _SOCKET_SUSPEND@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SOCKET_SUSPEND@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh16:
	adrp	x9, _SOCKET_CARDBUS@GOTPAGE
Lloh17:
	ldr	x9, [x9, _SOCKET_CARDBUS@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
Lloh21:
	adrp	x8, _EPERM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	x8, [x8, #8]
	mov	x0, x20
	blr	x8
LBB0_10:
	add	x21, x20, #16
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x20
	bl	_socket_reset
	mov	x22, x0
	mov	x0, x21
	bl	_mutex_unlock
	cbnz	w22, LBB0_13
; %bb.11:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_13
; %bb.12:
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
LBB0_13:
	mov	w20, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"resetting socket\n"

	.comm	_SOCKET_PRESENT,4,2             ; @SOCKET_PRESENT
l_.str.1:                               ; @.str.1
	.asciz	"can't reset, not present\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_SOCKET_SUSPEND,4,2             ; @SOCKET_SUSPEND
l_.str.2:                               ; @.str.2
	.asciz	"can't reset, suspended\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_SOCKET_CARDBUS,4,2             ; @SOCKET_CARDBUS
l_.str.3:                               ; @.str.3
	.asciz	"can't reset, is cardbus\n"

	.comm	_EPERM,4,2                      ; @EPERM
.subsections_via_symbols
