	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_port_map_set              ## -- Begin function mlx4_port_map_set
	.p2align	4, 0x90
_mlx4_port_map_set:                     ## @mlx4_port_map_set
	.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, %r15
	movl	(%rsi), %r13d
	movl	4(%rsi), %r12d
	callq	_mlx4_priv
	movq	%rax, %r14
	movq	_MLX4_DEV_CAP_FLAG2_PORT_REMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_mutex_lock
	testl	%r13d, %r13d
	je	LBB0_3
## %bb.4:
	testl	%r12d, %r12d
	je	LBB0_5
LBB0_6:
	testl	%r13d, %r13d
	jg	LBB0_7
	jmp	LBB0_12
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_3:
	movl	4(%r14), %r13d
	testl	%r12d, %r12d
	jne	LBB0_6
LBB0_5:
	movl	8(%r14), %r12d
	testl	%r13d, %r13d
	jle	LBB0_12
LBB0_7:
	movq	_MLX4_MAX_PORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	jg	LBB0_12
## %bb.8:
	testl	%r12d, %r12d
	jle	LBB0_12
## %bb.9:
	cmpl	%eax, %r12d
	jg	LBB0_12
## %bb.10:
	cmpl	$2, %r13d
	jne	LBB0_13
## %bb.11:
	cmpl	$1, %r12d
	jne	LBB0_13
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	cmpl	4(%r14), %r13d
	jne	LBB0_15
## %bb.14:
	xorl	%ebx, %ebx
	cmpl	8(%r14), %r12d
	je	LBB0_18
LBB0_15:
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_mlx4_virt2phy_port_map
	testl	%eax, %eax
	je	LBB0_16
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_mlx4_err
	jmp	LBB0_18
LBB0_16:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_mlx4_dbg
	movl	%r13d, 4(%r14)
	movl	%r12d, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_DEV_CAP_FLAG2_PORT_REMAP,4,2 ## @MLX4_DEV_CAP_FLAG2_PORT_REMAP
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_MLX4_MAX_PORTS,4,2             ## @MLX4_MAX_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"port map changed: [%d][%d]\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to change port mape: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_port_map_set              ; -- Begin function mlx4_port_map_set
	.p2align	2
_mlx4_port_map_set:                     ; @mlx4_port_map_set
	.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
	ldp	w21, w22, [x1]
	bl	_mlx4_priv
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MLX4_DEV_CAP_FLAG2_PORT_REMAP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MLX4_DEV_CAP_FLAG2_PORT_REMAP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	mov	x19, x0
	bl	_mutex_lock
	cbz	w21, LBB0_5
; %bb.2:
	cbz	w22, LBB0_6
LBB0_3:
	cmp	w21, #1
	b.ge	LBB0_7
	b	LBB0_10
LBB0_4:
Lloh3:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_5:
	ldr	w21, [x19, #4]
	cbnz	w22, LBB0_3
LBB0_6:
	ldr	w22, [x19, #8]
	cmp	w21, #1
	b.lt	LBB0_10
LBB0_7:
Lloh6:
	adrp	x8, _MLX4_MAX_PORTS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX4_MAX_PORTS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w21, w8
	ccmp	w22, #1, #8, le
	ccmp	w22, w8, #0, ge
	b.gt	LBB0_10
; %bb.8:
	cmp	w21, #2
	b.ne	LBB0_13
; %bb.9:
	cmp	w22, #1
	b.ne	LBB0_13
LBB0_10:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_12:
	mov	x0, x23
	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:
	ldr	w8, [x19, #4]
	cmp	w21, w8
	b.ne	LBB0_16
; %bb.14:
	ldr	w8, [x19, #8]
	cmp	w22, w8
	b.ne	LBB0_16
; %bb.15:
	mov	w23, #0
	b	LBB0_11
LBB0_16:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_mlx4_virt2phy_port_map
	mov	x23, x0
	cbz	w0, LBB0_18
; %bb.17:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x23
	bl	_mlx4_err
	b	LBB0_11
LBB0_18:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	mov	x3, x22
	bl	_mlx4_dbg
	stp	w21, w22, [x19, #4]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_DEV_CAP_FLAG2_PORT_REMAP,4,2 ; @MLX4_DEV_CAP_FLAG2_PORT_REMAP
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_MLX4_MAX_PORTS,4,2             ; @MLX4_MAX_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port map changed: [%d][%d]\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to change port mape: %d\n"

.subsections_via_symbols
