	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function foreign_import
_foreign_import:                        ## @foreign_import
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpl	$3, %edi
	jl	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_25
LBB0_2:
	movq	%rsi, %rbx
	movl	%edi, %r12d
	movq	_mfi_unit@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mfi_open
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%eax, %r14d
	movq	_MFI_DCMD_CFG_FOREIGN_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	$0, (%rsp)
	leaq	-72(%rbp), %rdx
	movl	%r14d, %edi
	movl	$4, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_mfi_dcmd_command
	testq	%rax, %rax
	js	LBB0_5
## %bb.8:
	movl	-72(%rbp), %r13d
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.12:
	cmpl	$1, %r12d
	jne	LBB0_14
## %bb.13:
	movl	(%r15), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	$255, %r13d
	jmp	LBB0_17
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_warn
	jmp	LBB0_25
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	callq	_warn
	jmp	LBB0_7
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
	jmp	LBB0_10
LBB0_14:
	movq	8(%rbx), %rdi
	callq	_atoi
	movl	%eax, %ebx
	cmpl	%r13d, %eax
	jge	LBB0_15
## %bb.16:
	movl	(%r15), %edx
	leaq	L_.str.6(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printf
	movl	%ebx, %r13d
LBB0_17:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_getchar
	andl	$-33, %eax
	cmpl	$89, %eax
	jne	LBB0_18
## %bb.19:
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_bzero
	movl	%r13d, -64(%rbp)
	movq	_MFI_DCMD_CFG_FOREIGN_IMPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	$0, (%rsp)
	movl	%r14d, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rbx, %r8
	movl	$16, %r9d
	callq	_mfi_dcmd_command
	testq	%rax, %rax
	js	LBB0_20
## %bb.21:
	movl	(%r15), %esi
	cmpl	$1, %r12d
	jne	LBB0_23
## %bb.22:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_24
LBB0_18:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_7:
	movl	%r14d, %edi
	callq	_close
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.26:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	decl	%r13d
	leaq	L_.str.5(%rip), %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_warnx
LBB0_10:
	movl	%r14d, %edi
	callq	_close
	jmp	LBB0_11
LBB0_20:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_6
LBB0_23:
	leaq	L_.str.10(%rip), %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_printf
LBB0_24:
	movl	%r14d, %edi
	callq	_close
	xorl	%ebx, %ebx
	jmp	LBB0_25
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"foreign preview: extra arguments"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mfi_unit,4,2                   ## @mfi_unit
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"mfi_open"

	.comm	_MFI_DCMD_CFG_FOREIGN_SCAN,4,2  ## @MFI_DCMD_CFG_FOREIGN_SCAN
L_.str.2:                               ## @.str.2
	.asciz	"Failed to scan foreign configuration"

L_.str.3:                               ## @.str.3
	.asciz	"foreign import: no foreign configs found"

L_.str.4:                               ## @.str.4
	.asciz	"Are you sure you wish to import ALL foreign configurations on mfi%u? [y/N] "

L_.str.5:                               ## @.str.5
	.asciz	"Invalid foreign config %d specified max is %d"

L_.str.6:                               ## @.str.6
	.asciz	"Are you sure you wish to import the foreign configuration %d on mfi%u? [y/N] "

	.comm	_MFI_DCMD_CFG_FOREIGN_IMPORT,4,2 ## @MFI_DCMD_CFG_FOREIGN_IMPORT
L_.str.8:                               ## @.str.8
	.asciz	"Failed to import foreign configuration"

L_.str.9:                               ## @.str.9
	.asciz	"mfi%d: All foreign configurations imported\n"

L_.str.10:                              ## @.str.10
	.asciz	"mfi%d: Foreign configuration %d imported\n"

L_str:                                  ## @str
	.asciz	"\nAborting"

	.no_dead_strip	_foreign_import
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function foreign_import
_foreign_import:                        ; @foreign_import
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	cmp	w0, #3
	b.lt	LBB0_3
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warnx
LBB0_2:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	b	LBB0_25
LBB0_3:
	mov	x21, x1
	mov	x20, x0
Lloh8:
	adrp	x22, _mfi_unit@GOTPAGE
Lloh9:
	ldr	x22, [x22, _mfi_unit@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh10:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_mfi_open
	tbnz	w0, #31, LBB0_8
; %bb.4:
	mov	x19, x0
Lloh13:
	adrp	x8, _MFI_DCMD_CFG_FOREIGN_SCAN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MFI_DCMD_CFG_FOREIGN_SCAN@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	w3, #4
	mov	x4, #0
	mov	w5, #0
	mov	x6, #0
	bl	_mfi_dcmd_command
	tbnz	x0, #63, LBB0_9
; %bb.5:
	ldr	w23, [sp, #16]
	cbz	w23, LBB0_11
; %bb.6:
	cmp	w20, #1
	b.ne	LBB0_12
; %bb.7:
	ldr	w8, [x22]
	str	x8, [sp]
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	mov	w21, #255
	b	LBB0_14
LBB0_8:
Lloh18:
	adrp	x8, _errno@GOTPAGE
Lloh19:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh20:
	ldr	w20, [x8]
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	b	LBB0_25
LBB0_9:
Lloh23:
	adrp	x8, _errno@GOTPAGE
Lloh24:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh25:
	ldr	w20, [x8]
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_10:
	bl	_warn
	mov	x0, x19
	bl	_close
	b	LBB0_25
LBB0_11:
Lloh28:
	adrp	x0, l_.str.3@PAGE
Lloh29:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_12:
	ldr	x0, [x21, #8]
	bl	_atoi
	mov	x21, x0
	cmp	w0, w23
	b.ge	LBB0_19
; %bb.13:
	ldr	w8, [x22]
	mov	x9, x21
	stp	x9, x8, [sp]
Lloh30:
	adrp	x0, l_.str.6@PAGE
Lloh31:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printf
LBB0_14:
	bl	_getchar
	and	w8, w0, #0xffffffdf
	cmp	w8, #89
	b.ne	LBB0_18
; %bb.15:
	add	x0, sp, #24
	mov	w1, #16
	bl	_bzero
	str	w21, [sp, #24]
Lloh32:
	adrp	x8, _MFI_DCMD_CFG_FOREIGN_IMPORT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MFI_DCMD_CFG_FOREIGN_IMPORT@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	add	x4, sp, #24
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	mov	w5, #16
	mov	x6, #0
	bl	_mfi_dcmd_command
	tbnz	x0, #63, LBB0_21
; %bb.16:
	ldr	w8, [x22]
	cmp	w20, #1
	b.ne	LBB0_22
; %bb.17:
	str	x8, [sp]
Lloh35:
	adrp	x0, l_.str.9@PAGE
Lloh36:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_23
LBB0_18:
Lloh37:
	adrp	x0, l_str@PAGE
Lloh38:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	b	LBB0_24
LBB0_19:
	sub	w8, w23, #1
	stp	x21, x8, [sp]
Lloh39:
	adrp	x0, l_.str.5@PAGE
Lloh40:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_20:
	bl	_warnx
	mov	x0, x19
	bl	_close
	b	LBB0_2
LBB0_21:
Lloh41:
	adrp	x8, _errno@GOTPAGE
Lloh42:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh43:
	ldr	w20, [x8]
Lloh44:
	adrp	x0, l_.str.8@PAGE
Lloh45:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_10
LBB0_22:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	stp	x8, x21, [sp]
Lloh46:
	adrp	x0, l_.str.10@PAGE
Lloh47:
	add	x0, x0, l_.str.10@PAGEOFF
LBB0_23:
	bl	_printf
LBB0_24:
	mov	x0, x19
	bl	_close
	mov	w20, #0
LBB0_25:
	ldr	x8, [sp, #40]
Lloh48:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh49:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.26:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"foreign preview: extra arguments"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mfi_unit,4,2                   ; @mfi_unit
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"mfi_open"

	.comm	_MFI_DCMD_CFG_FOREIGN_SCAN,4,2  ; @MFI_DCMD_CFG_FOREIGN_SCAN
l_.str.2:                               ; @.str.2
	.asciz	"Failed to scan foreign configuration"

l_.str.3:                               ; @.str.3
	.asciz	"foreign import: no foreign configs found"

l_.str.4:                               ; @.str.4
	.asciz	"Are you sure you wish to import ALL foreign configurations on mfi%u? [y/N] "

l_.str.5:                               ; @.str.5
	.asciz	"Invalid foreign config %d specified max is %d"

l_.str.6:                               ; @.str.6
	.asciz	"Are you sure you wish to import the foreign configuration %d on mfi%u? [y/N] "

	.comm	_MFI_DCMD_CFG_FOREIGN_IMPORT,4,2 ; @MFI_DCMD_CFG_FOREIGN_IMPORT
l_.str.8:                               ; @.str.8
	.asciz	"Failed to import foreign configuration"

l_.str.9:                               ; @.str.9
	.asciz	"mfi%d: All foreign configurations imported\n"

l_.str.10:                              ; @.str.10
	.asciz	"mfi%d: Foreign configuration %d imported\n"

l_str:                                  ; @str
	.asciz	"\nAborting"

	.no_dead_strip	_foreign_import
.subsections_via_symbols
