	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_set_current_limit
_sd_set_current_limit:                  ## @sd_set_current_limit
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_SD_SET_CURRENT_NO_CHANGE@GOTPCREL(%rip), %r12
	movl	(%r12), %r15d
	movq	(%rdi), %rax
	movq	_UHS_SDR50_BUS_SPEED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.1:
	movq	_UHS_SDR104_BUS_SPEED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	_UHS_DDR50_BUS_SPEED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
LBB0_3:
	movl	8(%rbx), %edi
	callq	_sd_get_host_max_current
	cmpl	$800, %eax                      ## imm = 0x320
	jl	LBB0_6
## %bb.4:
	movl	12(%rbx), %eax
	movq	_SD_MAX_CURRENT_800@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.5:
	movq	_SD_SET_CURRENT_LIMIT_800@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_6:
	cmpl	$600, %eax                      ## imm = 0x258
	jl	LBB0_10
## %bb.7:
	movl	12(%rbx), %eax
LBB0_8:
	movq	_SD_MAX_CURRENT_600@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.9:
	movq	_SD_SET_CURRENT_LIMIT_600@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_10:
	cmpl	$400, %eax                      ## imm = 0x190
	jl	LBB0_14
## %bb.11:
	movl	12(%rbx), %eax
LBB0_12:
	movq	_SD_MAX_CURRENT_400@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_16
## %bb.13:
	movq	_SD_SET_CURRENT_LIMIT_400@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_14:
	cmpl	$200, %eax
	jl	LBB0_19
## %bb.15:
	movl	12(%rbx), %eax
LBB0_16:
	movq	_SD_MAX_CURRENT_200@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_19
## %bb.17:
	movq	_SD_SET_CURRENT_LIMIT_200@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %r15d
LBB0_19:
	cmpl	(%r12), %r15d
	jne	LBB0_20
LBB0_23:
	xorl	%eax, %eax
LBB0_24:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$3, %edx
	movl	%r15d, %ecx
	movq	%r14, %r8
	callq	_mmc_sd_switch
	testl	%eax, %eax
	jne	LBB0_24
## %bb.21:
	movl	60(%r14), %eax
	shrl	$4, %eax
	andl	$15, %eax
	cmpl	%r15d, %eax
	je	LBB0_23
## %bb.22:
	movl	8(%rbx), %edi
	callq	_mmc_hostname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_warn
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_SD_SET_CURRENT_NO_CHANGE,4,2   ## @SD_SET_CURRENT_NO_CHANGE
	.comm	_UHS_SDR50_BUS_SPEED,8,3        ## @UHS_SDR50_BUS_SPEED
	.comm	_UHS_SDR104_BUS_SPEED,8,3       ## @UHS_SDR104_BUS_SPEED
	.comm	_UHS_DDR50_BUS_SPEED,8,3        ## @UHS_DDR50_BUS_SPEED
	.comm	_SD_MAX_CURRENT_800,4,2         ## @SD_MAX_CURRENT_800
	.comm	_SD_SET_CURRENT_LIMIT_800,4,2   ## @SD_SET_CURRENT_LIMIT_800
	.comm	_SD_MAX_CURRENT_600,4,2         ## @SD_MAX_CURRENT_600
	.comm	_SD_SET_CURRENT_LIMIT_600,4,2   ## @SD_SET_CURRENT_LIMIT_600
	.comm	_SD_MAX_CURRENT_400,4,2         ## @SD_MAX_CURRENT_400
	.comm	_SD_SET_CURRENT_LIMIT_400,4,2   ## @SD_SET_CURRENT_LIMIT_400
	.comm	_SD_MAX_CURRENT_200,4,2         ## @SD_MAX_CURRENT_200
	.comm	_SD_SET_CURRENT_LIMIT_200,4,2   ## @SD_SET_CURRENT_LIMIT_200
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Problem setting current limit!\n"

	.no_dead_strip	_sd_set_current_limit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_set_current_limit
_sd_set_current_limit:                  ; @sd_set_current_limit
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x8, [x0]
Lloh0:
	adrp	x9, _UHS_SDR50_BUS_SPEED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UHS_SDR50_BUS_SPEED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _UHS_SDR104_BUS_SPEED@GOTPAGE
Lloh4:
	ldr	x10, [x10, _UHS_SDR104_BUS_SPEED@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _UHS_DDR50_BUS_SPEED@GOTPAGE
Lloh7:
	ldr	x11, [x11, _UHS_DDR50_BUS_SPEED@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_16
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh9:
	adrp	x22, _SD_SET_CURRENT_NO_CHANGE@GOTPAGE
Lloh10:
	ldr	x22, [x22, _SD_SET_CURRENT_NO_CHANGE@GOTPAGEOFF]
	ldr	w21, [x22]
	ldr	w0, [x0, #8]
	bl	_sd_get_host_max_current
	cmp	w0, #800
	b.lt	LBB0_4
; %bb.2:
	ldr	w8, [x19, #12]
Lloh11:
	adrp	x9, _SD_MAX_CURRENT_800@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SD_MAX_CURRENT_800@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.3:
Lloh14:
	adrp	x8, _SD_SET_CURRENT_LIMIT_800@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SD_SET_CURRENT_LIMIT_800@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
	b	LBB0_15
LBB0_4:
	cmp	w0, #600
	b.lt	LBB0_8
; %bb.5:
	ldr	w8, [x19, #12]
LBB0_6:
Lloh17:
	adrp	x9, _SD_MAX_CURRENT_600@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SD_MAX_CURRENT_600@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.7:
Lloh20:
	adrp	x8, _SD_SET_CURRENT_LIMIT_600@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SD_SET_CURRENT_LIMIT_600@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	b	LBB0_15
LBB0_8:
	cmp	w0, #400
	b.lt	LBB0_12
; %bb.9:
	ldr	w8, [x19, #12]
LBB0_10:
Lloh23:
	adrp	x9, _SD_MAX_CURRENT_400@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SD_MAX_CURRENT_400@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.11:
Lloh26:
	adrp	x8, _SD_SET_CURRENT_LIMIT_400@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SD_SET_CURRENT_LIMIT_400@GOTPAGEOFF]
Lloh28:
	ldr	w21, [x8]
	b	LBB0_15
LBB0_12:
	cmp	w0, #200
	b.lt	LBB0_15
; %bb.13:
	ldr	w8, [x19, #12]
LBB0_14:
Lloh29:
	adrp	x9, _SD_MAX_CURRENT_200@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SD_MAX_CURRENT_200@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
Lloh32:
	adrp	x10, _SD_SET_CURRENT_LIMIT_200@GOTPAGE
Lloh33:
	ldr	x10, [x10, _SD_SET_CURRENT_LIMIT_200@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w21, w21, w10, eq
LBB0_15:
	ldr	w8, [x22]
	cmp	w21, w8
	b.ne	LBB0_18
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_18:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #3
	mov	x3, x21
	mov	x4, x20
	bl	_mmc_sd_switch
	cbnz	w0, LBB0_17
; %bb.19:
	ldr	w8, [x20, #60]
	ubfx	w8, w8, #4, #4
	cmp	w8, w21
	b.eq	LBB0_16
; %bb.20:
	ldr	w0, [x19, #8]
	bl	_mmc_hostname
	mov	x1, x0
Lloh35:
	adrp	x0, l_.str@PAGE
Lloh36:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_SD_SET_CURRENT_NO_CHANGE,4,2   ; @SD_SET_CURRENT_NO_CHANGE
	.comm	_UHS_SDR50_BUS_SPEED,8,3        ; @UHS_SDR50_BUS_SPEED
	.comm	_UHS_SDR104_BUS_SPEED,8,3       ; @UHS_SDR104_BUS_SPEED
	.comm	_UHS_DDR50_BUS_SPEED,8,3        ; @UHS_DDR50_BUS_SPEED
	.comm	_SD_MAX_CURRENT_800,4,2         ; @SD_MAX_CURRENT_800
	.comm	_SD_SET_CURRENT_LIMIT_800,4,2   ; @SD_SET_CURRENT_LIMIT_800
	.comm	_SD_MAX_CURRENT_600,4,2         ; @SD_MAX_CURRENT_600
	.comm	_SD_SET_CURRENT_LIMIT_600,4,2   ; @SD_SET_CURRENT_LIMIT_600
	.comm	_SD_MAX_CURRENT_400,4,2         ; @SD_MAX_CURRENT_400
	.comm	_SD_SET_CURRENT_LIMIT_400,4,2   ; @SD_SET_CURRENT_LIMIT_400
	.comm	_SD_MAX_CURRENT_200,4,2         ; @SD_MAX_CURRENT_200
	.comm	_SD_SET_CURRENT_LIMIT_200,4,2   ; @SD_SET_CURRENT_LIMIT_200
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Problem setting current limit!\n"

	.no_dead_strip	_sd_set_current_limit
.subsections_via_symbols
