	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gb_module_register_interface
_gb_module_register_interface:          ## @gb_module_register_interface
	.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, %rbx
	movq	16(%rdi), %r12
	movl	12(%rdi), %r15d
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_gb_interface_activate
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movq	(%rbx), %rcx
	movq	_GB_INTERFACE_TYPE_DUMMY@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_dev_err
LBB0_3:
	movq	%rbx, %rdi
	callq	_gb_interface_add
	jmp	LBB0_8
LBB0_4:
	movq	%rbx, %rdi
	callq	_gb_interface_add
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	callq	_gb_interface_enable
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_dev_err
LBB0_7:
	movq	%rbx, %rdi
	callq	_gb_interface_deactivate
LBB0_8:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GB_INTERFACE_TYPE_DUMMY,8,3    ## @GB_INTERFACE_TYPE_DUMMY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to activate interface %u: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to enable interface %u: %d\n"

	.no_dead_strip	_gb_module_register_interface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gb_module_register_interface
_gb_module_register_interface:          ; @gb_module_register_interface
	.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
	ldr	x22, [x0, #16]
	ldr	w21, [x0, #12]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_gb_interface_activate
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _GB_INTERFACE_TYPE_DUMMY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GB_INTERFACE_TYPE_DUMMY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
	mov	x3, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_dev_err
LBB0_3:
	mov	x0, x20
	bl	_gb_interface_add
	b	LBB0_8
LBB0_4:
	mov	x0, x20
	bl	_gb_interface_add
	cbnz	w0, LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_gb_interface_enable
	cbz	w0, LBB0_8
; %bb.6:
	mov	x3, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_dev_err
LBB0_7:
	mov	x0, x20
	bl	_gb_interface_deactivate
LBB0_8:
	mov	x0, x19
	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
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_GB_INTERFACE_TYPE_DUMMY,8,3    ; @GB_INTERFACE_TYPE_DUMMY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to activate interface %u: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to enable interface %u: %d\n"

	.no_dead_strip	_gb_module_register_interface
.subsections_via_symbols
