	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_key_beholdm6xx
_get_key_beholdm6xx:                    ## @get_key_beholdm6xx
	.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	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SAA7134_GPIO_GPMODE3@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_SAA7134_GPIO_GPRESCAN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_saa_clearb
	movl	(%r14), %edi
	movl	(%rbx), %esi
	callq	_saa_setb
	movq	_SAA7134_GPIO_GPSTATUS0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	sarl	$2, %edi
	callq	_saa_readl
	xorl	%ebx, %ebx
	testl	$4194304, %eax                  ## imm = 0x400000
	je	LBB0_7
## %bb.1:
	movq	(%r13), %rdi
	movl	$45, (%rdi)
	leaq	-60(%rbp), %rsi
	movl	$12, %edx
	callq	_i2c_master_recv
	cmpl	$12, %eax
	jne	LBB0_2
## %bb.5:
	movb	-52(%rbp), %cl
	movb	-51(%rbp), %al
	notb	%cl
	cmpb	%cl, %al
	jne	LBB0_7
## %bb.6:
	movq	_RC_PROTO_NECX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r12)
	movzbl	-50(%rbp), %edi
	movzbl	%al, %esi
	callq	_RC_SCANCODE_NECX
	movl	%eax, (%r15)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movl	$1, %ebx
	jmp	LBB0_7
LBB0_2:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_ir_dbg
	testl	%r14d, %r14d
	js	LBB0_3
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_3:
	movl	%r14d, %ebx
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SAA7134_GPIO_GPMODE3,4,2       ## @SAA7134_GPIO_GPMODE3
	.comm	_SAA7134_GPIO_GPRESCAN,4,2      ## @SAA7134_GPIO_GPRESCAN
	.comm	_SAA7134_GPIO_GPSTATUS0,4,2     ## @SAA7134_GPIO_GPSTATUS0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read error\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_RC_PROTO_NECX,4,2              ## @RC_PROTO_NECX
	.no_dead_strip	_get_key_beholdm6xx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_key_beholdm6xx
_get_key_beholdm6xx:                    ; @get_key_beholdm6xx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x23, _SAA7134_GPIO_GPMODE3@GOTPAGE
Lloh4:
	ldr	x23, [x23, _SAA7134_GPIO_GPMODE3@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh5:
	adrp	x24, _SAA7134_GPIO_GPRESCAN@GOTPAGE
Lloh6:
	ldr	x24, [x24, _SAA7134_GPIO_GPRESCAN@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_saa_clearb
	ldr	w0, [x23]
	ldr	w1, [x24]
	bl	_saa_setb
Lloh7:
	adrp	x8, _SAA7134_GPIO_GPSTATUS0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SAA7134_GPIO_GPSTATUS0@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	asr	w0, w8, #2
	bl	_saa_readl
	tbz	w0, #22, LBB0_4
; %bb.1:
	ldr	x0, [x22]
	mov	w8, #45
	str	w8, [x0]
	add	x1, sp, #12
	mov	w2, #12
	bl	_i2c_master_recv
	cmp	w0, #12
	b.ne	LBB0_7
; %bb.2:
	ldrb	w1, [sp, #21]
	ldrb	w8, [sp, #20]
	eor	w8, w8, #0xff
	cmp	w1, w8
	b.ne	LBB0_4
; %bb.3:
Lloh10:
	adrp	x8, _RC_PROTO_NECX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RC_PROTO_NECX@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x21]
	ldrb	w0, [sp, #22]
	bl	_RC_SCANCODE_NECX
	str	w0, [x20]
	str	xzr, [x19]
	mov	w23, #1
	b	LBB0_5
LBB0_4:
	mov	w23, #0
LBB0_5:
	ldr	x8, [sp, #24]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.6:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
	mov	x23, x0
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ir_dbg
	tbnz	w23, #31, LBB0_5
; %bb.8:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_5
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SAA7134_GPIO_GPMODE3,4,2       ; @SAA7134_GPIO_GPMODE3
	.comm	_SAA7134_GPIO_GPRESCAN,4,2      ; @SAA7134_GPIO_GPRESCAN
	.comm	_SAA7134_GPIO_GPSTATUS0,4,2     ; @SAA7134_GPIO_GPSTATUS0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read error\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_RC_PROTO_NECX,4,2              ; @RC_PROTO_NECX
	.no_dead_strip	_get_key_beholdm6xx
.subsections_via_symbols
