	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_alloc_ucontext
_mthca_alloc_ucontext:                  ## @mthca_alloc_ucontext
	.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, %r15
	movq	%rdi, %r13
	callq	_to_mdev
	cmpl	$0, 12(%rax)
	je	LBB0_16
## %bb.1:
	leaq	-56(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r13, %rdi
	callq	_to_mdev
	movl	8(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	%r13, %rdi
	callq	_to_mdev
	movq	%rax, %rdi
	callq	_mthca_is_memfree
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	callq	_to_mdev
	movq	(%rax), %rbx
LBB0_3:
	movq	%rbx, -56(%rbp)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_to_mdev
	movq	%r14, %r12
	addq	$16, %r12
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_mthca_uar_alloc
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_16:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_6
LBB0_10:
	movq	%r13, %rdi
	callq	_to_mdev
	movq	%rax, %rdi
	callq	_mthca_init_user_db_tab
	movl	%eax, 20(%r14)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movl	20(%r14), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_to_mdev
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_mthca_uar_free
LBB0_9:
	movq	%r14, %rdi
	callq	_kfree
	movl	%ebx, %edi
LBB0_6:
	callq	_ERR_PTR
	movq	%rax, %r14
LBB0_15:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_ib_copy_to_udata
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%r13, %rdi
	callq	_to_mdev
	movl	20(%r14), %edx
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_mthca_cleanup_user_db_tab
	movq	%r13, %rdi
	callq	_to_mdev
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_mthca_uar_free
	movq	%r14, %rdi
	callq	_kfree
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_14:
	movq	$0, 8(%r14)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_mthca_alloc_ucontext
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_alloc_ucontext
_mthca_alloc_ucontext:                  ; @mthca_alloc_ucontext
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x19, x0
	bl	_to_mdev
	ldr	w8, [x0, #12]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	x0, x19
	bl	_to_mdev
	ldr	w8, [x0, #8]
	str	w8, [sp, #8]
	mov	x0, x19
	bl	_to_mdev
	bl	_mthca_is_memfree
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_to_mdev
	ldr	x8, [x0]
	b	LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_ERR_PTR
LBB0_4:
	mov	x8, #0
LBB0_5:
	str	x8, [sp]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.6:
	mov	x20, x0
	mov	x0, x19
	bl	_to_mdev
	add	x22, x20, #16
	mov	x1, x22
	bl	_mthca_uar_alloc
	cbz	w0, LBB0_10
; %bb.7:
	mov	x23, x0
	mov	x0, x20
	bl	_kfree
	mov	x0, x23
	b	LBB0_12
LBB0_8:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	bl	_to_mdev
	bl	_mthca_init_user_db_tab
	str	w0, [x20, #20]
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.11:
	ldr	w0, [x20, #20]
	bl	_PTR_ERR
	mov	x21, x0
	mov	x0, x19
	bl	_to_mdev
	mov	x1, x22
	bl	_mthca_uar_free
	mov	x0, x20
	bl	_kfree
	mov	x0, x21
LBB0_12:
	bl	_ERR_PTR
	mov	x20, x0
LBB0_13:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_14:
	mov	x1, sp
	mov	x0, x21
	mov	w2, #16
	bl	_ib_copy_to_udata
	cbz	x0, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_to_mdev
	ldr	w2, [x20, #20]
	mov	x1, x22
	bl	_mthca_cleanup_user_db_tab
	mov	x0, x19
	bl	_to_mdev
	mov	x1, x22
	bl	_mthca_uar_free
	mov	x0, x20
	bl	_kfree
Lloh8:
	adrp	x8, _EFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_9
LBB0_16:
	str	xzr, [x20, #8]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_mthca_alloc_ucontext
.subsections_via_symbols
