	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_device
_check_device:                          ## @check_device
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_CORKSCREW_TOTAL_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdx
	callq	_request_region
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	je	LBB0_9
## %bb.1:
	leal	8194(%rbx), %edi
	callq	_inw
	xorl	%ebx, %eax
	testl	$496, %eax                      ## imm = 0x1F0
	jne	LBB0_8
## %bb.2:
	movq	_EEPROM_Read@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	$7, %rdi
	movq	_Wn0EepromCmd@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	addl	%ebx, %esi
	callq	_outw
	movl	$162, %edi
	callq	_udelay
	movl	(%r15), %edi
	addl	%ebx, %edi
	callq	_inw
	testl	$512, %eax                      ## imm = 0x200
	je	LBB0_7
## %bb.3:
	movl	$162, %edi
	callq	_udelay
	movl	(%r15), %edi
	addl	%ebx, %edi
	callq	_inw
	testl	$512, %eax                      ## imm = 0x200
	je	LBB0_7
## %bb.4:
	movl	$162, %edi
	callq	_udelay
	movl	(%r15), %edi
	addl	%ebx, %edi
	callq	_inw
	testl	$512, %eax                      ## imm = 0x200
	je	LBB0_7
## %bb.5:
	movl	$162, %edi
	callq	_udelay
	movl	(%r15), %edi
	addl	%ebx, %edi
	callq	_inw
	testl	$512, %eax                      ## imm = 0x200
	je	LBB0_7
## %bb.6:
	movl	$162, %edi
	callq	_udelay
	movl	(%r15), %edi
	addl	%ebx, %edi
	callq	_inw
LBB0_7:
	movq	_Wn0EepromData@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	%ebx, %edi
	callq	_inw
	movl	%eax, %ecx
	movl	$1, %eax
	cmpl	$27984, %ecx                    ## imm = 0x6D50
	je	LBB0_9
LBB0_8:
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_release_region
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CORKSCREW_TOTAL_SIZE,4,2       ## @CORKSCREW_TOTAL_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"3c515"

	.comm	_EEPROM_Read,8,3                ## @EEPROM_Read
	.comm	_Wn0EepromCmd,4,2               ## @Wn0EepromCmd
	.comm	_Wn0EepromData,4,2              ## @Wn0EepromData
	.no_dead_strip	_check_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_device
_check_device:                          ; @check_device
	.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
Lloh0:
	adrp	x20, _CORKSCREW_TOTAL_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CORKSCREW_TOTAL_SIZE@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	bl	_request_region
	cbz	w0, LBB0_10
; %bb.1:
	mov	w8, #8194
	add	w0, w19, w8
	bl	_inw
	eor	w8, w0, w19
	tst	w8, #0x1f0
	b.ne	LBB0_9
; %bb.2:
Lloh4:
	adrp	x8, _EEPROM_Read@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EEPROM_Read@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	add	x0, x8, #7
Lloh7:
	adrp	x21, _Wn0EepromCmd@GOTPAGE
Lloh8:
	ldr	x21, [x21, _Wn0EepromCmd@GOTPAGEOFF]
	ldr	w8, [x21]
	add	w1, w8, w19
	bl	_outw
	mov	w0, #162
	bl	_udelay
	ldr	w8, [x21]
	add	w0, w8, w19
	bl	_inw
	tbz	w0, #9, LBB0_7
; %bb.3:
	mov	w0, #162
	bl	_udelay
	ldr	w8, [x21]
	add	w0, w8, w19
	bl	_inw
	tbz	w0, #9, LBB0_7
; %bb.4:
	mov	w0, #162
	bl	_udelay
	ldr	w8, [x21]
	add	w0, w8, w19
	bl	_inw
	tbz	w0, #9, LBB0_7
; %bb.5:
	mov	w0, #162
	bl	_udelay
	ldr	w8, [x21]
	add	w0, w8, w19
	bl	_inw
	tbz	w0, #9, LBB0_7
; %bb.6:
	mov	w0, #162
	bl	_udelay
	ldr	w8, [x21]
	add	w0, w8, w19
	bl	_inw
LBB0_7:
Lloh9:
	adrp	x8, _Wn0EepromData@GOTPAGE
Lloh10:
	ldr	x8, [x8, _Wn0EepromData@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	add	w0, w8, w19
	bl	_inw
	mov	w8, #27984
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.8:
	mov	w0, #1
	b	LBB0_10
LBB0_9:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_release_region
	mov	w0, #0
LBB0_10:
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CORKSCREW_TOTAL_SIZE,4,2       ; @CORKSCREW_TOTAL_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"3c515"

	.comm	_EEPROM_Read,8,3                ; @EEPROM_Read
	.comm	_Wn0EepromCmd,4,2               ; @Wn0EepromCmd
	.comm	_Wn0EepromData,4,2              ; @Wn0EepromData
	.no_dead_strip	_check_device
.subsections_via_symbols
