	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_alloc_icm_table          ## -- Begin function mthca_alloc_icm_table
	.p2align	4, 0x90
_mthca_alloc_icm_table:                 ## @mthca_alloc_icm_table
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_MTHCA_TABLE_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%r12d
	movl	%ecx, %edi
	movl	%eax, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	movq	_icm@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_struct_size
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.1:
	movq	%rax, %r13
	movl	16(%rbp), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 40(%r13)
	movl	%ebx, (%r13)
	movl	%r14d, -68(%rbp)                ## 4-byte Spill
	movl	%r14d, 4(%r13)
	movl	%r12d, 8(%r13)
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 12(%r13)
	movl	%eax, 16(%r13)
	movq	%r13, %rdi
	addq	$32, %rdi
	callq	_mutex_init
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.2:
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	leaq	-1(%rdx), %rcx
	movl	%edx, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_20
## %bb.3:
	xorl	%ecx, %ecx
	jmp	LBB0_4
LBB0_20:
	andl	$-4, %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rsi
	movq	$0, (%rsi,%rcx,8)
	movq	24(%r13), %rsi
	movq	$0, 8(%rsi,%rcx,8)
	movq	24(%r13), %rsi
	movq	$0, 16(%rsi,%rcx,8)
	movq	24(%r13), %rsi
	movq	$0, 24(%rsi,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_21
LBB0_4:
	testq	%rax, %rax
	je	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rdx
	movq	$0, (%rdx,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_5
LBB0_6:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	imull	%r12d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_23
## %bb.7:
	movq	_MTHCA_TABLE_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	imull	%r12d, %ebx
	xorl	%r12d, %r12d
	xorl	%ecx, %ecx
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	leaq	1(%r12), %r14
	movl	%r14d, %edx
	imull	%eax, %edx
	movl	%ebx, %esi
	subl	%ecx, %esi
	cmpl	%ebx, %edx
	cmovlel	%eax, %esi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	shrl	%cl, %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_GFP_HIGHUSER@GOTPCREL(%rip), %rax
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	(%rax), %edx
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	movl	16(%rbp), %ecx
	callq	_mthca_alloc_icm
	movq	24(%r13), %rcx
	movq	%rax, (%rcx,%r12,8)
	movq	24(%r13), %rax
	movq	(%rax,%r12,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %r15d
	movq	_MTHCA_TABLE_CHUNK_SIZE@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rax
	movslq	%r12d, %rdx
	imulq	%rax, %rdx
	addq	-64(%rbp), %rdx                 ## 8-byte Folded Reload
	callq	_mthca_MAP_ICM
	testq	%rax, %rax
	jne	LBB0_12
## %bb.22:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	24(%r13), %rax
	movq	(%rax,%r12,8), %rax
	incl	(%rax)
	movl	(%rbx), %eax
	movl	%r14d, %ecx
	imull	%eax, %ecx
	movq	%r14, %r12
	cmpl	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	%r15d, %ebx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jl	LBB0_8
	jmp	LBB0_23
LBB0_12:
	movq	24(%r13), %rax
	movl	%r12d, %ebx
	shlq	$3, %rbx
	movq	(%rax,%rbx), %rsi
	movl	16(%r13), %edx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_mthca_free_icm
	movq	24(%r13), %rax
	movq	$0, (%rax,%rbx)
LBB0_13:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jle	LBB0_18
## %bb.14:
	movl	%eax, %r14d
	xorl	%ebx, %ebx
	movq	_MTHCA_ICM_PAGE_SIZE@GOTPCREL(%rip), %r12
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	incq	%rbx
	cmpq	%rbx, %r14
	je	LBB0_18
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rax
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	_MTHCA_TABLE_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	imull	%eax, %ecx
	movslq	%ecx, %rsi
	addq	-64(%rbp), %rsi                 ## 8-byte Folded Reload
	cltd
	idivl	(%r12)
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_mthca_UNMAP_ICM
	movq	24(%r13), %rax
	movq	(%rax,%rbx,8), %rsi
	movl	16(%r13), %edx
	movq	%r15, %rdi
	callq	_mthca_free_icm
	jmp	LBB0_17
LBB0_18:
	movq	%r13, %rdi
	callq	_kfree
LBB0_19:
	xorl	%r13d, %r13d
LBB0_23:
	movq	%r13, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_TABLE_CHUNK_SIZE,4,2     ## @MTHCA_TABLE_CHUNK_SIZE
	.comm	_icm,4,2                        ## @icm
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_GFP_HIGHUSER,4,2               ## @GFP_HIGHUSER
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.comm	_MTHCA_ICM_PAGE_SIZE,4,2        ## @MTHCA_ICM_PAGE_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_alloc_icm_table          ; -- Begin function mthca_alloc_icm_table
	.p2align	2
_mthca_alloc_icm_table:                 ; @mthca_alloc_icm_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x6
	mov	x24, x5
	mov	x27, x4
	mov	x25, x3
	mov	x26, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x28, _MTHCA_TABLE_CHUNK_SIZE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _MTHCA_TABLE_CHUNK_SIZE@GOTPAGEOFF]
	ldr	w8, [x28]
	sdiv	w1, w8, w2
	mov	x0, x3
	bl	_DIV_ROUND_UP
	mov	x22, x0
Lloh2:
	adrp	x8, _icm@GOTPAGE
Lloh3:
	ldr	x8, [x8, _icm@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x2, x0
	bl	_struct_size
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kmalloc
	mov	x21, x0
	cbz	x0, LBB0_16
; %bb.1:
	str	x19, [x21, #40]
	stp	w22, w25, [x21]
	stp	w26, w24, [x21, #8]
	add	x0, x21, #32
	str	w23, [x21, #16]
	bl	_mutex_init
	cmp	w22, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x8, #0
	mov	w9, w22
	lsl	x9, x9, #3
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x21, #24]
	str	xzr, [x10, x8]
	add	x8, x8, #8
	cmp	x9, x8
	b.ne	LBB0_3
LBB0_4:
	str	w22, [sp, #12]                  ; 4-byte Folded Spill
	mul	w27, w27, w26
	cmp	w27, #1
	b.lt	LBB0_16
; %bb.5:
	mov	x22, #0
	mov	w9, #0
	ldr	w8, [x28]
	mul	w25, w25, w26
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x26, x22, #1
	mul	w10, w8, w26
	sub	w9, w25, w9
	cmp	w10, w25
	csel	w8, w9, w8, gt
Lloh8:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsr	w1, w8, w9
	cmp	w24, #0
Lloh11:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh13:
	adrp	x9, _GFP_HIGHUSER@GOTPAGE
Lloh14:
	ldr	x9, [x9, _GFP_HIGHUSER@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
Lloh15:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x20
	mov	x3, x23
	bl	_mthca_alloc_icm
	ldr	x8, [x21, #24]
	lsl	x9, x22, #3
	str	x0, [x8, x9]
	ldr	x8, [x21, #24]
	ldr	x1, [x8, x9]
	cbz	x1, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldrsw	x8, [x28]
	sxtw	x9, w22
	madd	x2, x8, x9, x19
	mov	x0, x20
	bl	_mthca_MAP_ICM
	cbnz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x21, #24]
	ldr	x8, [x8, x22, lsl #3]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	ldr	w8, [x28]
	mul	w9, w8, w26
	add	x22, x22, #1
	cmp	w9, w27
	b.lt	LBB0_6
	b	LBB0_16
LBB0_9:
	ldr	x8, [x21, #24]
	ubfiz	x22, x22, #3, #32
	ldr	x1, [x8, x22]
	ldr	w2, [x21, #16]
	mov	x0, x20
	bl	_mthca_free_icm
	ldr	x8, [x21, #24]
	str	xzr, [x8, x22]
LBB0_10:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.11:
	mov	x22, #0
	mov	w23, w8
Lloh18:
	adrp	x24, _MTHCA_ICM_PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x24, [x24, _MTHCA_ICM_PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x22, x22, #1
	cmp	x23, x22
	b.eq	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #24]
	ldr	x8, [x8, x22, lsl #3]
	cbz	x8, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x28]
	mul	w9, w8, w22
	add	x1, x19, w9, sxtw
	ldr	w9, [x24]
	sdiv	w2, w8, w9
	mov	x0, x20
	bl	_mthca_UNMAP_ICM
	ldr	x8, [x21, #24]
	ldr	x1, [x8, x22, lsl #3]
	ldr	w2, [x21, #16]
	mov	x0, x20
	bl	_mthca_free_icm
	b	LBB0_12
LBB0_15:
	mov	x0, x21
	bl	_kfree
	mov	x21, #0
LBB0_16:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_TABLE_CHUNK_SIZE,4,2     ; @MTHCA_TABLE_CHUNK_SIZE
	.comm	_icm,4,2                        ; @icm
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_HIGHUSER,4,2               ; @GFP_HIGHUSER
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.comm	_MTHCA_ICM_PAGE_SIZE,4,2        ; @MTHCA_ICM_PAGE_SIZE
.subsections_via_symbols
