	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function mlx4_change_port_types
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_mlx4_change_port_types
	.p2align	4, 0x90
_mlx4_change_port_types:                ## @mlx4_change_port_types
	.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
	movl	(%rdi), %r8d
	testl	%r8d, %r8d
	jle	LBB0_1
## %bb.2:
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	8(%rdi), %rcx
	cmpl	$8, %r8d
	jae	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	LBB0_11
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_22
LBB0_4:
	movl	%r8d, %eax
	andl	$-8, %eax
	leaq	-8(%rax), %rsi
	movq	%rsi, %rbx
	shrq	$3, %rbx
	incq	%rbx
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rsi
	andq	$-2, %rsi
	xorps	%xmm5, %xmm5
	xorl	%edi, %edi
	movaps	LCPI0_0(%rip), %xmm8            ## xmm8 = [1,1,1,1]
	xorps	%xmm6, %xmm6
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%r12,%rdi,4), %xmm0
	movdqu	16(%r12,%rdi,4), %xmm1
	movdqu	32(%r12,%rdi,4), %xmm2
	movdqu	48(%r12,%rdi,4), %xmm3
	movdqu	4(%rcx,%rdi,4), %xmm7
	pcmpeqd	%xmm0, %xmm7
	movdqu	20(%rcx,%rdi,4), %xmm4
	pcmpeqd	%xmm1, %xmm4
	movdqu	36(%rcx,%rdi,4), %xmm0
	pcmpeqd	%xmm2, %xmm0
	pand	%xmm7, %xmm0
	movdqu	52(%rcx,%rdi,4), %xmm1
	pcmpeqd	%xmm3, %xmm1
	pand	%xmm4, %xmm1
	movaps	%xmm8, %xmm2
	blendvps	%xmm0, %xmm5, %xmm2
	movaps	%xmm8, %xmm3
	movdqa	%xmm1, %xmm0
	blendvps	%xmm0, %xmm6, %xmm3
	addq	$16, %rdi
	movaps	%xmm2, %xmm5
	movaps	%xmm3, %xmm6
	addq	$-2, %rsi
	jne	LBB0_7
## %bb.8:
	testb	$1, %bl
	je	LBB0_10
LBB0_9:
	leaq	(,%rdi,4), %rsi
	movdqu	(%r12,%rdi,4), %xmm1
	movdqu	16(%r12,%rdi,4), %xmm4
	orq	$4, %rsi
	movdqu	(%rcx,%rsi), %xmm0
	pcmpeqd	%xmm1, %xmm0
	movdqu	16(%rcx,%rsi), %xmm1
	pcmpeqd	%xmm4, %xmm1
	movaps	LCPI0_0(%rip), %xmm4            ## xmm4 = [1,1,1,1]
	movaps	%xmm4, %xmm5
	blendvps	%xmm0, %xmm2, %xmm5
	movdqa	%xmm1, %xmm0
	blendvps	%xmm0, %xmm3, %xmm4
	movaps	%xmm5, %xmm2
	movaps	%xmm4, %xmm3
LBB0_10:
	pxor	%xmm0, %xmm0
	pcmpeqd	%xmm2, %xmm0
	blendvps	%xmm0, %xmm3, %xmm2
	xorl	%esi, %esi
	ptest	%xmm2, %xmm2
	setne	%sil
	cmpq	%r8, %rax
	je	LBB0_13
LBB0_11:
	movl	$1, %edi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%rax,4), %ebx
	cmpl	4(%rcx,%rax,4), %ebx
	leaq	1(%rax), %rdx
	cmovnel	%edi, %esi
	movq	%rdx, %rax
	cmpq	%rdx, %r8
	jne	LBB0_12
LBB0_13:
	xorl	%r15d, %r15d
	testl	%esi, %esi
	je	LBB0_22
## %bb.14:
	movq	%r14, %rdi
	callq	_mlx4_unregister_device
	cmpl	$0, (%r14)
	jle	LBB0_19
## %bb.15:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	leal	1(%rbx), %r13d
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_mlx4_CLOSE_PORT
	movl	(%r12,%rbx,4), %eax
	movq	8(%r14), %rcx
	movl	%eax, 4(%rcx,%rbx,4)
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	$-1, %edx
	callq	_mlx4_SET_PORT
	testl	%eax, %eax
	jne	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movslq	(%r14), %rax
	incq	%rbx
	cmpq	%rax, %rbx
	jl	LBB0_16
LBB0_19:
	movq	%r14, %rdi
	callq	_mlx4_set_port_mask
	movq	%r14, %rdi
	callq	_mlx4_register_device
	testl	%eax, %eax
	je	LBB0_21
## %bb.20:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_mlx4_err
	movl	%ebx, %r15d
	jmp	LBB0_22
LBB0_5:
	xorps	%xmm2, %xmm2
	xorl	%edi, %edi
	xorps	%xmm3, %xmm3
	testb	$1, %bl
	jne	LBB0_9
	jmp	LBB0_10
LBB0_17:
	movl	%eax, %r13d
	incl	%ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_mlx4_err
	movl	%r13d, %r15d
	jmp	LBB0_22
LBB0_21:
	movq	%r14, %rdi
	callq	_mlx4_request_modules
LBB0_22:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set port %d, aborting\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to register device\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_change_port_types         ; -- Begin function mlx4_change_port_types
	.p2align	2
_mlx4_change_port_types:                ; @mlx4_change_port_types
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	x9, [x0, #8]
	cmp	w8, #16
	b.hs	LBB0_3
; %bb.2:
	mov	x10, #0
	mov	w11, #0
	b	LBB0_6
LBB0_3:
	and	x10, x8, #0xfffffff0
	add	x11, x20, #32
	add	x12, x9, #36
	movi.2d	v0, #0000000000000000
	movi.4s	v1, #1
	mov	x13, x10
	movi.2d	v4, #0000000000000000
	movi.2d	v3, #0000000000000000
	movi.2d	v2, #0000000000000000
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q5, q6, [x11, #-32]
	ldp	q7, q16, [x11], #64
	ldp	q17, q18, [x12, #-32]
	ldp	q19, q20, [x12], #64
	cmeq.4s	v5, v5, v17
	cmeq.4s	v6, v6, v18
	cmeq.4s	v7, v7, v19
	cmeq.4s	v16, v16, v20
	bif.16b	v0, v1, v5
	bif.16b	v4, v1, v6
	bif.16b	v3, v1, v7
	bif.16b	v2, v1, v16
	subs	x13, x13, #16
	b.ne	LBB0_4
; %bb.5:
	cmeq.4s	v1, v0, #0
	bit.16b	v0, v4, v1
	cmeq.4s	v1, v0, #0
	bit.16b	v0, v3, v1
	cmeq.4s	v1, v0, #0
	bit.16b	v0, v2, v1
	cmtst.4s	v0, v0, v0
	xtn.4h	v0, v0
	umov.h	w11, v0[0]
	umov.h	w12, v0[1]
	and	w12, w12, #0x1
	bfi	w11, w12, #1, #1
	umov.h	w12, v0[2]
	and	w12, w12, #0x1
	bfi	w11, w12, #2, #1
	umov.h	w12, v0[3]
	bfi	w11, w12, #3, #29
	tst	w11, #0xf
	cset	w11, ne
	cmp	x10, x8
	b.eq	LBB0_8
LBB0_6:
	lsl	x13, x10, #2
	add	x12, x20, x13
	sub	x8, x8, x10
	add	x9, x13, x9
	add	x9, x9, #4
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x12], #4
	ldr	w13, [x9], #4
	cmp	w10, w13
	csinc	w11, w11, wzr, eq
	subs	x8, x8, #1
	b.ne	LBB0_7
LBB0_8:
	cbz	w11, LBB0_15
; %bb.9:
	mov	x0, x19
	bl	_mlx4_unregister_device
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.10:
	mov	x22, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	w21, w22, #1
	mov	x0, x19
	mov	x1, x21
	bl	_mlx4_CLOSE_PORT
	lsl	x8, x22, #2
	ldr	w9, [x20, x8]
	ldr	x10, [x19, #8]
	add	x8, x10, x8
	str	w9, [x8, #4]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #-1
	bl	_mlx4_SET_PORT
	cbnz	w0, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldrsw	x8, [x19]
	add	x22, x22, #1
	cmp	x22, x8
	b.lt	LBB0_11
LBB0_13:
	mov	x0, x19
	bl	_mlx4_set_port_mask
	mov	x0, x19
	bl	_mlx4_register_device
	mov	x21, x0
	cbz	w0, LBB0_18
; %bb.14:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_15:
	mov	w21, #0
	b	LBB0_19
LBB0_16:
	mov	x21, x0
	add	x8, x22, #1
	str	x8, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
LBB0_17:
	mov	x0, x19
	bl	_mlx4_err
	b	LBB0_19
LBB0_18:
	mov	x0, x19
	bl	_mlx4_request_modules
LBB0_19:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set port %d, aborting\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to register device\n"

.subsections_via_symbols
