	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib3000mc_set_timing
_dib3000mc_set_timing:                  ## @dib3000mc_set_timing
	.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
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.4:
	movslq	%r12d, %rax
	imulq	$274877907, %rax, %r12          ## imm = 0x10624DD3
	movq	%r12, %rax
	shrq	$63, %rax
	sarq	$38, %r12
	addl	%eax, %r12d
	imull	%r12d, %ebx
	testq	%rcx, %rcx
	jne	LBB0_5
	jmp	LBB0_6
LBB0_1:
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.3:
	movl	$200, %edi
	callq	_msleep
	movslq	%r12d, %rax
	imulq	$274877907, %rax, %r12          ## imm = 0x10624DD3
	movq	%r12, %rax
	shrq	$63, %rax
	sarq	$38, %r12
	addl	%eax, %r12d
	imull	$1384402, %r12d, %ebx           ## imm = 0x151FD2
LBB0_5:
	movq	%r14, %rdi
	movl	$416, %esi                      ## imm = 0x1A0
	callq	_dib3000mc_read_word
                                        ## kill: def $eax killed $eax def $rax
	leal	-16384(%rax), %ecx
	testl	$8192, %eax                     ## imm = 0x2000
	cmovel	%eax, %ecx
	movq	_TRANSMISSION_MODE_2K@GOTPCREL(%rip), %rax
	leal	(,%rcx,4), %edx
	cmpl	%r15d, (%rax)
	cmovnel	%ecx, %edx
	addl	%edx, %ebx
	movl	%ebx, %eax
	cltd
	idivl	%r12d
	movl	%eax, (%r14)
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_dprintk
	movl	%ebx, %edx
	sarl	$16, %edx
	movq	%r14, %rdi
	movl	$23, %esi
	callq	_dib3000mc_write_word
	movzwl	%bx, %edx
	movq	%r14, %rdi
	movl	$24, %esi
	callq	_dib3000mc_write_word
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movslq	%r12d, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	imull	$1384402, %eax, %ebx            ## imm = 0x151FD2
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_TRANSMISSION_MODE_2K,4,2       ## @TRANSMISSION_MODE_2K
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timf: %d\n"

	.no_dead_strip	_dib3000mc_set_timing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib3000mc_set_timing
_dib3000mc_set_timing:                  ; @dib3000mc_set_timing
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x9, w21, w9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w22, w9, w10
	mul	w21, w8, w22
	cbnz	x3, LBB0_4
	b	LBB0_5
LBB0_2:
	mov	w23, #8146
	movk	w23, #21, lsl #16
	cbz	x3, LBB0_6
; %bb.3:
	mov	w0, #200
	bl	_msleep
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w21, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w22, w8, w9
	mul	w21, w22, w23
LBB0_4:
	mov	x0, x19
	mov	w1, #416
	bl	_dib3000mc_read_word
	sub	w8, w0, #4, lsl #12             ; =16384
	tst	w0, #0x2000
	csel	w8, w0, w8, eq
Lloh0:
	adrp	x9, _TRANSMISSION_MODE_2K@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TRANSMISSION_MODE_2K@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsl	w10, w8, #2
	cmp	w9, w20
	csel	w8, w10, w8, eq
	add	w21, w8, w21
	sdiv	w8, w21, w22
	str	w8, [x19]
LBB0_5:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_dprintk
	asr	w2, w21, #16
	mov	x0, x19
	mov	w1, #23
	bl	_dib3000mc_write_word
	and	w2, w21, #0xffff
	mov	x0, x19
	mov	w1, #24
	bl	_dib3000mc_write_word
	mov	w0, #0
	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_6:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w21, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	mul	w21, w8, w23
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_TRANSMISSION_MODE_2K,4,2       ; @TRANSMISSION_MODE_2K
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timf: %d\n"

	.no_dead_strip	_dib3000mc_set_timing
.subsections_via_symbols
