	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IOSUHAX_Open                   ## -- Begin function IOSUHAX_Open
	.p2align	4, 0x90
_IOSUHAX_Open:                          ## @IOSUHAX_Open
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_iosuhaxHandle@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	js	LBB0_1
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	leaq	L_.str(%rip), %rdi
	cmovneq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_IOS_Open
	movl	%eax, (%r14)
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.2:
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:
	movl	$0, -20(%rbp)
	movq	_IOCTL_CHECK_IF_IOSUHAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-20(%rbp), %r8
	movl	%eax, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$4, %r9d
	callq	_IOS_Ioctl
	movl	-20(%rbp), %ecx
	movq	_IOSUHAX_MAGIC_WORD@GOTPCREL(%rip), %rdx
	movl	(%r14), %eax
	cmpl	(%rdx), %ecx
	je	LBB0_5
## %bb.4:
	movl	%eax, %edi
	callq	_IOS_Close
	movl	$-1, (%r14)
	movl	$-1, %eax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_iosuhaxHandle,4,2              ## @iosuhaxHandle
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/iosuhax"

	.comm	_IOCTL_CHECK_IF_IOSUHAX,4,2     ## @IOCTL_CHECK_IF_IOSUHAX
	.comm	_IOSUHAX_MAGIC_WORD,4,2         ## @IOSUHAX_MAGIC_WORD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IOSUHAX_Open                   ; -- Begin function IOSUHAX_Open
	.p2align	2
_IOSUHAX_Open:                          ; @IOSUHAX_Open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _iosuhaxHandle@GOTPAGE
Lloh1:
	ldr	x20, [x20, _iosuhaxHandle@GOTPAGEOFF]
	ldr	w0, [x20]
	tbnz	w0, #31, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_2:
Lloh2:
	adrp	x8, l_.str@PAGE
Lloh3:
	add	x8, x8, l_.str@PAGEOFF
	cmp	x19, #0
	csel	x0, x19, x8, ne
	mov	w1, #0
	bl	_IOS_Open
	str	w0, [x20]
	cbz	x19, LBB0_1
; %bb.3:
	tbnz	w0, #31, LBB0_1
; %bb.4:
	str	wzr, [sp, #12]
Lloh4:
	adrp	x8, _IOCTL_CHECK_IF_IOSUHAX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IOCTL_CHECK_IF_IOSUHAX@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x4, sp, #12
	mov	x2, #0
	mov	w3, #0
	mov	w5, #4
	bl	_IOS_Ioctl
	ldr	w8, [sp, #12]
Lloh7:
	adrp	x9, _IOSUHAX_MAGIC_WORD@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IOSUHAX_MAGIC_WORD@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	ldr	w0, [x20]
	cmp	w8, w9
	b.eq	LBB0_1
; %bb.5:
	bl	_IOS_Close
	mov	w0, #-1
	str	w0, [x20]
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_iosuhaxHandle,4,2              ; @iosuhaxHandle
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/iosuhax"

	.comm	_IOCTL_CHECK_IF_IOSUHAX,4,2     ; @IOCTL_CHECK_IF_IOSUHAX
	.comm	_IOSUHAX_MAGIC_WORD,4,2         ; @IOSUHAX_MAGIC_WORD
.subsections_via_symbols
