	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function doit
_doit:                                  ## @doit
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %rcx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	_doit.fd(%rip), %edi
	testl	%edi, %edi
	jne	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdx
	leaq	-96(%rbp), %r15
	movq	%r15, %rdi
	movl	$64, %esi
	callq	_snprintf
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_open
	movl	%eax, %edi
	movl	%eax, _doit.fd(%rip)
	testl	%eax, %eax
	js	LBB0_2
LBB0_3:
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_ioctl
	sarq	$63, %rax
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_6
## %bb.5:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	$-1, %eax
	jmp	LBB0_4
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_doit.fd,4,2     ## @doit.fd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/%s"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.no_dead_strip	_doit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doit
_doit:                                  ; @doit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x2
	mov	x20, x1
	mov	x3, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	adrp	x21, _doit.fd@PAGE
	ldr	w0, [x21, _doit.fd@PAGEOFF]
	cbnz	w0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #64
	bl	_snprintf
Lloh5:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_open
	str	w0, [x21, _doit.fd@PAGEOFF]
	tbnz	w0, #31, LBB0_5
LBB0_2:
	mov	x1, x20
	mov	x2, x19
	bl	_ioctl
	asr	x0, x0, #63
LBB0_3:
	ldur	x8, [x29, #-40]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.4:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_5:
	mov	w0, #-1
	b	LBB0_3
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_doit.fd,4,2     ; @doit.fd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/%s"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.no_dead_strip	_doit
.subsections_via_symbols
