	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_set_disk_chs
_ide_set_disk_chs:                      ## @ide_set_disk_chs
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	$0, -32(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$1, -28(%rbp)
	leaq	-20(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	L_.str(%rip), %rsi
	leaq	-40(%rbp), %rdx
	leaq	-36(%rbp), %rcx
	leaq	-32(%rbp), %r8
	leaq	-24(%rbp), %r9
	xorl	%eax, %eax
	callq	_sscanf
	movl	$1, %edx
	cmpl	$5, %eax
	je	LBB0_3
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	leaq	-40(%rbp), %rdx
	leaq	-36(%rbp), %rcx
	leaq	-28(%rbp), %r8
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_sscanf
	cmpl	$3, %eax
	jne	LBB0_15
## %bb.2:
	movl	-28(%rbp), %edx
LBB0_3:
	movslq	-40(%rbp), %rax
	movq	_MAX_DRIVES@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rsi
	imulq	%rsi, %rax
	movslq	-36(%rbp), %rcx
	addq	%rax, %rcx
	movq	_MAX_HWIFS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%esi, %eax
	cmpl	%eax, %ecx
	jge	LBB0_6
## %bb.4:
	testl	%edx, %edx
	js	LBB0_6
## %bb.5:
	cmpl	$2, %edx
	jge	LBB0_6
## %bb.7:
	movl	-32(%rbp), %eax
	movq	_INT_MAX@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %eax
	jg	LBB0_6
## %bb.8:
	cmpl	$255, -24(%rbp)
	jg	LBB0_6
## %bb.9:
	cmpl	$256, -20(%rbp)                 ## imm = 0x100
	jge	LBB0_6
## %bb.10:
	movl	$1, %esi
	shll	%cl, %esi
	testl	%edx, %edx
	je	LBB0_12
## %bb.11:
	movq	_ide_disks@GOTPCREL(%rip), %rdx
	orl	(%rdx), %esi
	jmp	LBB0_13
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_12:
	notl	%esi
	movq	_ide_disks@GOTPCREL(%rip), %rdx
	andl	(%rdx), %esi
LBB0_13:
	movq	_ide_disks@GOTPCREL(%rip), %rdx
	movl	%esi, (%rdx)
	movq	_ide_disks_chs@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	(%rcx,%rcx,2), %rcx
	movl	%eax, (%rdx,%rcx,4)
	movl	-24(%rbp), %eax
	movl	%eax, 4(%rdx,%rcx,4)
	movl	-20(%rbp), %eax
	movl	%eax, 8(%rdx,%rcx,4)
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d.%d:%d,%d,%d"

L_.str.1:                               ## @.str.1
	.asciz	"%d.%d:%d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_DRIVES,4,2                 ## @MAX_DRIVES
	.comm	_MAX_HWIFS,4,2                  ## @MAX_HWIFS
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_ide_disks,4,2                  ## @ide_disks
	.comm	_ide_disks_chs,8,3              ## @ide_disks_chs
	.no_dead_strip	_ide_set_disk_chs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_set_disk_chs
_ide_set_disk_chs:                      ; @ide_set_disk_chs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	stur	wzr, [x29, #-28]
	stp	wzr, wzr, [sp, #28]
	mov	w20, #1
	str	w20, [sp, #24]
	add	x8, sp, #28
	add	x9, sp, #32
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	stp	x9, x8, [sp]
	sub	x2, x29, #20
	sub	x3, x29, #24
	sub	x4, x29, #28
	bl	_sscanf
	cmp	w0, #5
	b.eq	LBB0_3
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	sub	x2, x29, #20
	sub	x3, x29, #24
	add	x4, sp, #24
	mov	x0, x19
	bl	_sscanf
	cmp	w0, #3
	b.ne	LBB0_11
; %bb.2:
	ldr	w20, [sp, #24]
LBB0_3:
	ldp	w10, w8, [x29, #-24]
Lloh4:
	adrp	x9, _MAX_DRIVES@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MAX_DRIVES@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	madd	w8, w9, w8, w10
Lloh7:
	adrp	x10, _MAX_HWIFS@GOTPAGE
Lloh8:
	ldr	x10, [x10, _MAX_HWIFS@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	mul	w9, w10, w9
	cmp	w8, w9
	b.ge	LBB0_11
; %bb.4:
	tbnz	w20, #31, LBB0_11
; %bb.5:
	cmp	w20, #2
	b.ge	LBB0_11
; %bb.6:
	ldur	w9, [x29, #-28]
Lloh10:
	adrp	x10, _INT_MAX@GOTPAGE
Lloh11:
	ldr	x10, [x10, _INT_MAX@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	cmp	w9, w10
	b.gt	LBB0_11
; %bb.7:
	ldr	w10, [sp, #32]
	cmp	w10, #255
	b.gt	LBB0_11
; %bb.8:
	ldr	w10, [sp, #28]
	cmp	w10, #256
	b.ge	LBB0_11
; %bb.9:
	mov	w10, #1
	lsl	w11, w10, w8
Lloh13:
	adrp	x10, _ide_disks@GOTPAGE
Lloh14:
	ldr	x10, [x10, _ide_disks@GOTPAGEOFF]
	cbz	w20, LBB0_13
; %bb.10:
	ldr	w12, [x10]
	orr	w11, w12, w11
	b	LBB0_14
LBB0_11:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_13:
	ldr	w12, [x10]
	bic	w11, w12, w11
LBB0_14:
	mov	w0, #0
	str	w11, [x10]
Lloh18:
	adrp	x10, _ide_disks_chs@GOTPAGE
Lloh19:
	ldr	x10, [x10, _ide_disks_chs@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	mov	w11, #12
	smaddl	x8, w8, w11, x10
	str	w9, [x8]
	ldr	w9, [sp, #32]
	str	w9, [x8, #4]
	ldr	w9, [sp, #28]
	str	w9, [x8, #8]
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d.%d:%d,%d,%d"

l_.str.1:                               ; @.str.1
	.asciz	"%d.%d:%d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_DRIVES,4,2                 ; @MAX_DRIVES
	.comm	_MAX_HWIFS,4,2                  ; @MAX_HWIFS
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_ide_disks,4,2                  ; @ide_disks
	.comm	_ide_disks_chs,8,3              ; @ide_disks_chs
	.no_dead_strip	_ide_set_disk_chs
.subsections_via_symbols
