	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ddb_init                       ## -- Begin function ddb_init
	.p2align	4, 0x90
_ddb_init:                              ## @ddb_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rdi
	addq	$12, %rdi
	callq	_mutex_init
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	callq	_mutex_init
	movq	_no_init@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_ddb_device_create
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_2:
	movq	%rbx, %rdi
	callq	_ddb_init_boards
	movq	%rbx, %rdi
	callq	_ddb_i2c_init
	testq	%rax, %rax
	js	LBB0_10
## %bb.3:
	movq	%rbx, %rdi
	callq	_ddb_ports_init
	movq	%rbx, %rdi
	callq	_ddb_buffers_alloc
	testq	%rax, %rax
	js	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_ddb_ports_attach
	testq	%rax, %rax
	js	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_ddb_device_create
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	xorl	%r14d, %r14d
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.7:
	movq	_GPIO_DIRECTION@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ddbwritel
	movq	_GPIO_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ddbwritel
	jmp	LBB0_11
LBB0_4:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	jmp	LBB0_9
LBB0_8:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_ddb_ports_detach
	movq	%rbx, %rdi
	callq	_ddb_buffers_free
LBB0_9:
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_ddb_ports_release
	movq	%rbx, %rdi
	callq	_ddb_i2c_release
LBB0_10:
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movl	$-1, %r14d
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_no_init,8,3                    ## @no_init
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not allocate buffer memory\n"

	.comm	_GPIO_DIRECTION,4,2             ## @GPIO_DIRECTION
	.comm	_GPIO_OUTPUT,4,2                ## @GPIO_OUTPUT
L_.str.1:                               ## @.str.1
	.asciz	"fail3\n"

L_.str.2:                               ## @.str.2
	.asciz	"fail2\n"

L_.str.3:                               ## @.str.3
	.asciz	"fail1\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ddb_init                       ; -- Begin function ddb_init
	.p2align	2
_ddb_init:                              ; @ddb_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #8]
	add	x0, x8, #12
	bl	_mutex_init
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_mutex_init
Lloh0:
	adrp	x8, _no_init@GOTPAGE
Lloh1:
	ldr	x8, [x8, _no_init@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_ddb_device_create
	mov	w0, #0
	b	LBB0_11
LBB0_2:
	mov	x0, x19
	bl	_ddb_init_boards
	mov	x0, x19
	bl	_ddb_i2c_init
	tbnz	x0, #63, LBB0_10
; %bb.3:
	mov	x0, x19
	bl	_ddb_ports_init
	mov	x0, x19
	bl	_ddb_buffers_alloc
	tbnz	x0, #63, LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_ddb_ports_attach
	tbnz	x0, #63, LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_ddb_device_create
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_12
; %bb.6:
Lloh3:
	adrp	x8, _GPIO_DIRECTION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPIO_DIRECTION@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #1
	bl	_ddbwritel
Lloh6:
	adrp	x8, _GPIO_OUTPUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GPIO_OUTPUT@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #1
	bl	_ddbwritel
	mov	w0, #0
	b	LBB0_11
LBB0_7:
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	b	LBB0_9
LBB0_8:
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_ddb_ports_detach
	mov	x0, x19
	bl	_ddb_buffers_free
LBB0_9:
	ldr	w0, [x19]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_ddb_ports_release
	mov	x0, x19
	bl	_ddb_i2c_release
LBB0_10:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	mov	w0, #-1
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	w0, #0
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_no_init,8,3                    ; @no_init
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not allocate buffer memory\n"

	.comm	_GPIO_DIRECTION,4,2             ; @GPIO_DIRECTION
	.comm	_GPIO_OUTPUT,4,2                ; @GPIO_OUTPUT
l_.str.1:                               ; @.str.1
	.asciz	"fail3\n"

l_.str.2:                               ; @.str.2
	.asciz	"fail2\n"

l_.str.3:                               ; @.str.3
	.asciz	"fail1\n"

.subsections_via_symbols
