	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_query_port                ## -- Begin function mlx4_query_port
	.p2align	4, 0x90
_mlx4_query_port:                       ## @mlx4_query_port
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	leaq	-40(%rbp), %rcx
	movl	$4, %r8d
	callq	_ibv_cmd_query_port
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_1
LBB0_5:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	testq	%rbx, %rbx
	jle	LBB0_5
## %bb.2:
	movq	_MLX4_PORTS_NUM@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jl	LBB0_5
## %bb.3:
	movq	%r12, %rdi
	callq	_to_mctx
	movq	(%rax), %rax
	decq	%rbx
	leaq	(%rbx,%rbx,2), %rcx
	cmpl	$0, (%rax,%rcx,4)
	jne	LBB0_5
## %bb.4:
	leaq	(%rax,%rcx,4), %rdx
	movl	4(%r14), %esi
	movl	%esi, 8(%rax,%rcx,4)
	movl	(%r14), %esi
	movl	%esi, 4(%rax,%rcx,4)
	movl	$1, (%rdx)
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_PORTS_NUM,8,3             ## @MLX4_PORTS_NUM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_query_port                ; -- Begin function mlx4_query_port
	.p2align	2
_mlx4_query_port:                       ; @mlx4_query_port
	.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	x19, x2
	mov	x22, x1
	mov	x21, x0
	add	x3, sp, #8
	mov	w4, #4
	bl	_ibv_cmd_query_port
	mov	x20, x0
	cbz	w0, LBB0_2
LBB0_1:
	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_2:
	subs	x23, x22, #1
	b.lt	LBB0_1
; %bb.3:
Lloh0:
	adrp	x8, _MLX4_PORTS_NUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX4_PORTS_NUM@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x22
	b.lt	LBB0_1
; %bb.4:
	mov	x0, x21
	bl	_to_mctx
	ldr	x9, [x0]
	mov	w8, #12
	madd	x8, x23, x8, x9
	ldr	w10, [x8]
	cbnz	w10, LBB0_1
; %bb.5:
	mov	w10, #12
	madd	x9, x23, x10, x9
	ldr	d0, [x19]
	stur	d0, [x9, #4]
	mov	w9, #1
	str	w9, [x8]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_PORTS_NUM,8,3             ; @MLX4_PORTS_NUM
.subsections_via_symbols
