	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function socket_insert
_socket_insert:                         ## @socket_insert
	.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, %r12
	leaq	16(%rdi), %r15
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	leaq	4(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r12), %eax
	movq	_SOCKET_INUSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_2:
	orl	%eax, %ecx
	movl	%ecx, (%r12)
	movq	_setup_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_socket_setup
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_socket_shutdown
	jmp	LBB0_7
LBB0_3:
	movq	_SOCKET_PRESENT@GOTPCREL(%rip), %rax
	movl	(%r12), %edx
	movl	20(%r12), %ecx
	orl	(%rax), %edx
	movl	%edx, (%r12)
	movq	_SOCKET_CARDBUS@GOTPCREL(%rip), %rbx
	andl	(%rbx), %edx
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_notice
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	(%rbx), %eax
	xorl	%ebx, %ebx
	testl	%eax, (%r12)
	jne	LBB0_7
## %bb.4:
	movq	8(%r12), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.5:
	movq	%r12, %rdi
	callq	*(%rcx)
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"insert\n"

	.comm	_SOCKET_INUSE,4,2               ## @SOCKET_INUSE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_setup_delay,4,2                ## @setup_delay
	.comm	_SOCKET_PRESENT,4,2             ## @SOCKET_PRESENT
L_.str.1:                               ## @.str.1
	.asciz	"pccard: %s card inserted into slot %d\n"

	.comm	_SOCKET_CARDBUS,4,2             ## @SOCKET_CARDBUS
L_.str.2:                               ## @.str.2
	.asciz	"CardBus"

L_.str.3:                               ## @.str.3
	.asciz	"PCMCIA"

L_.str.4:                               ## @.str.4
	.asciz	"insert done\n"

	.comm	_SOCKET_CARDBUS_CONFIG,4,2      ## @SOCKET_CARDBUS_CONFIG
	.no_dead_strip	_socket_insert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function socket_insert
_socket_insert:                         ; @socket_insert
	.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	x19, x0
	add	x21, x0, #16
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _SOCKET_INUSE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SOCKET_INUSE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_mutex_unlock
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_8
LBB0_2:
	orr	w8, w9, w8
	str	w8, [x19]
Lloh8:
	adrp	x8, _setup_delay@GOTPAGE
Lloh9:
	ldr	x8, [x8, _setup_delay@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_socket_setup
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_socket_shutdown
	b	LBB0_8
LBB0_4:
Lloh11:
	adrp	x8, _SOCKET_PRESENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SOCKET_PRESENT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh14:
	adrp	x22, _SOCKET_CARDBUS@GOTPAGE
Lloh15:
	ldr	x22, [x22, _SOCKET_CARDBUS@GOTPAGEOFF]
Lloh16:
	adrp	x9, l_.str.2@PAGE
Lloh17:
	add	x9, x9, l_.str.2@PAGEOFF
	ldr	w10, [x22]
Lloh18:
	adrp	x11, l_.str.3@PAGE
Lloh19:
	add	x11, x11, l_.str.3@PAGEOFF
	tst	w10, w8
	csel	x2, x11, x9, eq
	ldr	w3, [x19, #20]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_notice
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w8, [x19]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_7:
	mov	w22, #0
LBB0_8:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"insert\n"

	.comm	_SOCKET_INUSE,4,2               ; @SOCKET_INUSE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_setup_delay,4,2                ; @setup_delay
	.comm	_SOCKET_PRESENT,4,2             ; @SOCKET_PRESENT
l_.str.1:                               ; @.str.1
	.asciz	"pccard: %s card inserted into slot %d\n"

	.comm	_SOCKET_CARDBUS,4,2             ; @SOCKET_CARDBUS
l_.str.2:                               ; @.str.2
	.asciz	"CardBus"

l_.str.3:                               ; @.str.3
	.asciz	"PCMCIA"

l_.str.4:                               ; @.str.4
	.asciz	"insert done\n"

	.comm	_SOCKET_CARDBUS_CONFIG,4,2      ; @SOCKET_CARDBUS_CONFIG
	.no_dead_strip	_socket_insert
.subsections_via_symbols
