	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sgx_linux_ioctl
_sgx_linux_ioctl:                       ## @sgx_linux_ioctl
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SGX_IOCTL_MAX_DATA_LEN@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	16(%r12), %ebx
	movq	_CAP_IOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-60(%rbp), %rdi
	callq	_cap_rights_init
	leaq	-56(%rbp), %rcx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_fget
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movl	(%r12), %ebx
	movq	_LINUX_IOC_IN@GOTPCREL(%rip), %rdx
	movq	_LINUX_IOC_OUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	orl	(%rdx), %eax
	notl	%eax
	andl	%ebx, %eax
	movl	%eax, (%r12)
	testl	%ebx, (%rdx)
	je	LBB0_3
## %bb.2:
	movq	_IOC_IN@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, (%r12)
LBB0_3:
	testl	%ebx, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	_IOC_OUT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r12)
LBB0_5:
	movl	%ebx, %edi
	callq	_IOCPARM_LEN
	cmpl	(%r13), %eax
	jle	LBB0_7
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_7:
	movq	_LINUX_IOC_IN@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_9
## %bb.8:
	movq	8(%r12), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_copyin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
LBB0_9:
	movq	-56(%rbp), %rdi
	movl	(%r12), %esi
	movl	(%r14), %ecx
	movl	%r15d, %edx
	movq	%r14, %r8
	callq	_fo_ioctl
	movl	%eax, %ebx
LBB0_10:
	movq	-56(%rbp), %rdi
	movq	%r14, %rsi
	callq	_fdrop
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SGX_IOCTL_MAX_DATA_LEN,4,2     ## @SGX_IOCTL_MAX_DATA_LEN
	.comm	_CAP_IOCTL,4,2                  ## @CAP_IOCTL
	.comm	_LINUX_IOC_IN,4,2               ## @LINUX_IOC_IN
	.comm	_LINUX_IOC_OUT,4,2              ## @LINUX_IOC_OUT
	.comm	_IOC_IN,4,2                     ## @IOC_IN
	.comm	_IOC_OUT,4,2                    ## @IOC_OUT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sgx_linux_ioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sgx_linux_ioctl
_sgx_linux_ioctl:                       ; @sgx_linux_ioctl
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #32
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x23, _SGX_IOCTL_MAX_DATA_LEN@GOTPAGE
Lloh4:
	ldr	x23, [x23, _SGX_IOCTL_MAX_DATA_LEN@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	w22, [x1, #16]
Lloh7:
	adrp	x8, _CAP_IOCTL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CAP_IOCTL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	sub	x0, x29, #60
	bl	_cap_rights_init
	mov	x2, x0
	sub	x3, x29, #72
	mov	x0, x19
	mov	x1, x22
	bl	_fget
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.1:
	ldr	w22, [x20]
Lloh10:
	adrp	x24, _LINUX_IOC_IN@GOTPAGE
Lloh11:
	ldr	x24, [x24, _LINUX_IOC_IN@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh12:
	adrp	x9, _LINUX_IOC_OUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _LINUX_IOC_OUT@GOTPAGEOFF]
	ldr	w10, [x9]
	orr	w8, w10, w8
	bic	w8, w22, w8
	str	w8, [x20]
	ldr	w10, [x24]
	tst	w10, w22
	b.eq	LBB0_3
; %bb.2:
Lloh14:
	adrp	x10, _IOC_IN@GOTPAGE
Lloh15:
	ldr	x10, [x10, _IOC_IN@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w8, [x20]
LBB0_3:
	ldr	w9, [x9]
	tst	w9, w22
	b.eq	LBB0_5
; %bb.4:
Lloh17:
	adrp	x9, _IOC_OUT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _IOC_OUT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x20]
LBB0_5:
	mov	x0, x22
	bl	_IOCPARM_LEN
	ldr	w8, [x23]
	cmp	w0, w8
	b.le	LBB0_7
; %bb.6:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w22, [x8]
	b	LBB0_10
LBB0_7:
	ldr	w8, [x24]
	tst	w8, w22
	b.eq	LBB0_9
; %bb.8:
	mov	x2, x0
	ldr	x0, [x20, #8]
	mov	x1, x21
	bl	_copyin
	mov	x22, x0
	cbnz	w0, LBB0_10
LBB0_9:
	ldur	x0, [x29, #-72]
	ldr	w1, [x20]
	ldr	w3, [x19]
	mov	x2, x21
	mov	x4, x19
	bl	_fo_ioctl
	mov	x22, x0
LBB0_10:
	ldur	x0, [x29, #-72]
	mov	x1, x19
	bl	_fdrop
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x22
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_SGX_IOCTL_MAX_DATA_LEN,4,2     ; @SGX_IOCTL_MAX_DATA_LEN
	.comm	_CAP_IOCTL,4,2                  ; @CAP_IOCTL
	.comm	_LINUX_IOC_IN,4,2               ; @LINUX_IOC_IN
	.comm	_LINUX_IOC_OUT,4,2              ; @LINUX_IOC_OUT
	.comm	_IOC_IN,4,2                     ; @IOC_IN
	.comm	_IOC_OUT,4,2                    ; @IOC_OUT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sgx_linux_ioctl
.subsections_via_symbols
