	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3cmci_probe_pdata
_s3cmci_probe_pdata:                    ## @s3cmci_probe_pdata
	.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, %r14
	movq	(%rdi), %r15
	movq	16(%rdi), %r12
	movq	%r12, %rdi
	callq	_platform_get_device_id
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movl	$5, %edi
	callq	_S3C2410_GPE
	movl	%eax, %ebx
	movl	$10, %edi
	callq	_S3C2410_GPE
	cmpl	%eax, %ebx
	jg	LBB0_6
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_dev_name
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_gpio_request
	testl	%eax, %eax
	jne	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rbx), %r13d
	movl	$10, %edi
	callq	_S3C2410_GPE
	cmpl	%eax, %ebx
	movl	%r13d, %ebx
	jl	LBB0_1
LBB0_6:
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	cmpq	$0, 16(%rax)
	je	LBB0_10
LBB0_9:
	movq	_MMC_CAP2_NO_WRITE_PROTECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%r15)
LBB0_10:
	cmpq	$0, 8(%rax)
	je	LBB0_12
## %bb.11:
	movq	_MMC_CAP_NEEDS_POLL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 4(%r15)
LBB0_12:
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.13:
	movq	_MMC_CAP2_RO_ACTIVE_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
LBB0_14:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_mmc_gpiod_request_cd
	movl	%eax, %ebx
	movq	_ENOENT@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	addl	%ebx, %eax
	jne	LBB0_15
## %bb.16:
	movq	(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_mmc_gpiod_request_ro
	movl	%eax, %ebx
	movl	(%r15), %eax
	addl	%ebx, %eax
	je	LBB0_19
## %bb.17:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_18
LBB0_15:
	leaq	L_.str.2(%rip), %rsi
LBB0_18:
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_dev_err
	movl	%ebx, %r13d
LBB0_19:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_s3cmci_def_pdata@GOTPCREL(%rip), %rax
	movq	%rax, (%r12)
	cmpq	$0, 16(%rax)
	jne	LBB0_9
	jmp	LBB0_10
LBB0_2:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_dev_err
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$5, %edi
	callq	_S3C2410_GPE
	cmpl	%eax, %ebx
	jle	LBB0_19
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	decl	%ebx
	movl	%ebx, %edi
	callq	_gpio_free
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get gpio %d\n"

	.comm	_s3cmci_def_pdata,24,3          ## @s3cmci_def_pdata
	.comm	_MMC_CAP2_NO_WRITE_PROTECT,4,2  ## @MMC_CAP2_NO_WRITE_PROTECT
	.comm	_MMC_CAP_NEEDS_POLL,4,2         ## @MMC_CAP_NEEDS_POLL
	.comm	_MMC_CAP2_RO_ACTIVE_HIGH,4,2    ## @MMC_CAP2_RO_ACTIVE_HIGH
L_.str.1:                               ## @.str.1
	.asciz	"cd"

	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.2:                               ## @.str.2
	.asciz	"error requesting GPIO for CD %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"wp"

L_.str.4:                               ## @.str.4
	.asciz	"error requesting GPIO for WP %d\n"

	.no_dead_strip	_s3cmci_probe_pdata
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3cmci_probe_pdata
_s3cmci_probe_pdata:                    ; @s3cmci_probe_pdata
	.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
	ldr	x19, [x0, #16]
	ldr	x21, [x0]
	mov	x0, x19
	bl	_platform_get_device_id
	ldr	w8, [x0]
	str	w8, [x20, #8]
	mov	w0, #5
	bl	_S3C2410_GPE
	mov	x22, x0
	mov	w0, #10
	bl	_S3C2410_GPE
	cmp	w22, w0
	b.gt	LBB0_3
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_dev_name
	mov	x1, x0
	mov	x0, x22
	bl	_gpio_request
	cbnz	w0, LBB0_16
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w23, w22, #1
	mov	w0, #10
	bl	_S3C2410_GPE
	cmp	w22, w0
	mov	x22, x23
	b.lt	LBB0_1
LBB0_3:
	ldr	x8, [x19]
	cbz	x8, LBB0_15
; %bb.4:
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_6
LBB0_5:
Lloh0:
	adrp	x9, _MMC_CAP2_NO_WRITE_PROTECT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_CAP2_NO_WRITE_PROTECT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ldr	w10, [x21]
	orr	w9, w10, w9
	str	w9, [x21]
LBB0_6:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_8
; %bb.7:
Lloh3:
	adrp	x9, _MMC_CAP_NEEDS_POLL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMC_CAP_NEEDS_POLL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	ldr	w10, [x21, #4]
	orr	w9, w10, w9
	str	w9, [x21, #4]
LBB0_8:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:
Lloh6:
	adrp	x8, _MMC_CAP2_RO_ACTIVE_HIGH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MMC_CAP2_RO_ACTIVE_HIGH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
LBB0_10:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_mmc_gpiod_request_cd
Lloh11:
	adrp	x21, _ENOENT@GOTPAGE
Lloh12:
	ldr	x21, [x21, _ENOENT@GOTPAGEOFF]
	ldr	w8, [x21]
	cmn	w0, w8
	b.ne	LBB0_13
; %bb.11:
	ldr	x0, [x20]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w2, #0
	mov	w3, #0
	mov	x4, #0
	bl	_mmc_gpiod_request_ro
	mov	w23, #0
	ldr	w8, [x21]
	cmn	w0, w8
	b.eq	LBB0_14
; %bb.12:
	mov	x20, x0
Lloh15:
	adrp	x1, l_.str.4@PAGE
Lloh16:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
	mov	x23, x20
	b	LBB0_14
LBB0_13:
	mov	x23, x0
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x23
	bl	_dev_err
LBB0_14:
	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_15:
Lloh19:
	adrp	x8, _s3cmci_def_pdata@GOTPAGE
Lloh20:
	ldr	x8, [x8, _s3cmci_def_pdata@GOTPAGEOFF]
	str	x8, [x19]
	ldr	x9, [x8, #16]
	cbnz	x9, LBB0_5
	b	LBB0_6
LBB0_16:
	mov	x23, x0
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	bl	_dev_err
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #5
	bl	_S3C2410_GPE
	cmp	w22, w0
	b.le	LBB0_14
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	w22, w22, #1
	mov	x0, x22
	bl	_gpio_free
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get gpio %d\n"

	.comm	_s3cmci_def_pdata,24,3          ; @s3cmci_def_pdata
	.comm	_MMC_CAP2_NO_WRITE_PROTECT,4,2  ; @MMC_CAP2_NO_WRITE_PROTECT
	.comm	_MMC_CAP_NEEDS_POLL,4,2         ; @MMC_CAP_NEEDS_POLL
	.comm	_MMC_CAP2_RO_ACTIVE_HIGH,4,2    ; @MMC_CAP2_RO_ACTIVE_HIGH
l_.str.1:                               ; @.str.1
	.asciz	"cd"

	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.2:                               ; @.str.2
	.asciz	"error requesting GPIO for CD %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"wp"

l_.str.4:                               ; @.str.4
	.asciz	"error requesting GPIO for WP %d\n"

	.no_dead_strip	_s3cmci_probe_pdata
.subsections_via_symbols
