	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_cmd_use_events            ## -- Begin function mlx4_cmd_use_events
	.p2align	4, 0x90
_mlx4_cmd_use_events:                   ## @mlx4_cmd_use_events
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_mlx4_priv
	movq	%rax, %r12
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kmalloc_array
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_mlx4_is_mfunc
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	12(%r12), %rdi
	callq	_mutex_lock
LBB0_4:
	leaq	16(%r12), %r15
	movq	%r15, %rdi
	callq	_down_write
	movl	(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_7
## %bb.5:
	movl	$8, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	40(%r12), %rax
	leaq	(%rax,%r13), %rdi
	movl	%ebx, -8(%rax,%r13)
	incq	%rbx
	movl	%ebx, -4(%rax,%r13)
	callq	_init_completion
	movslq	(%r12), %rsi
	addq	$12, %r13
	cmpq	%rsi, %rbx
	jl	LBB0_6
LBB0_7:
	movq	40(%r12), %rax
	leal	-1(%rsi), %ecx
	movslq	%ecx, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	$-1, 4(%rax,%rcx,4)
	movq	$0, 32(%r12)
	leaq	24(%r12), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_sema_init
	movl	(%r12), %eax
	movl	$1, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edx, %ecx
	leal	(%rcx,%rcx), %edx
	cmpl	%eax, %ecx
	jl	LBB0_8
## %bb.9:
	decl	%ecx
	movl	%ecx, 4(%r12)
	leaq	20(%r12), %rdi
	callq	_down
	movl	$1, 8(%r12)
	movq	%r15, %rdi
	callq	_up_write
	movq	%r14, %rdi
	callq	_mlx4_is_mfunc
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	addq	$12, %r12
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_11
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_cmd_use_events            ; -- Begin function mlx4_cmd_use_events
	.p2align	2
_mlx4_cmd_use_events:                   ; @mlx4_cmd_use_events
	.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
	mov	x20, x0
	bl	_mlx4_priv
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kmalloc_array
	str	x0, [x19, #40]
	cbz	x0, LBB0_10
; %bb.1:
	mov	x0, x20
	bl	_mlx4_is_mfunc
	cbz	x0, LBB0_3
; %bb.2:
	add	x0, x19, #12
	bl	_mutex_lock
LBB0_3:
	add	x21, x19, #16
	mov	x0, x21
	bl	_down_write
	ldr	w1, [x19]
	cmp	w1, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x22, #0
	mov	x23, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #40]
	add	x8, x8, x22
	str	w23, [x8]
	add	x23, x23, #1
	str	w23, [x8, #4]
	add	x0, x8, #8
	bl	_init_completion
	ldrsw	x1, [x19]
	add	x22, x22, #12
	cmp	x23, x1
	b.lt	LBB0_5
LBB0_6:
	ldr	x8, [x19, #40]
	mov	w9, #12
	smaddl	x8, w1, w9, x8
	mov	w9, #-1
	stur	w9, [x8, #-8]
	str	xzr, [x19, #32]
	add	x0, x19, #24
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_sema_init
	ldr	w8, [x19]
	mov	w9, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x10, x9
	lsl	w9, w9, #1
	cmp	w10, w8
	b.lt	LBB0_7
; %bb.8:
	sub	w8, w10, #1
	str	w8, [x19, #4]
	add	x0, x19, #20
	bl	_down
	mov	w8, #1
	str	w8, [x19, #8]
	mov	x0, x21
	bl	_up_write
	mov	x0, x20
	bl	_mlx4_is_mfunc
	cbz	x0, LBB0_11
; %bb.9:
	add	x0, x19, #12
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
