	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_calc_timestamping_constants ## -- Begin function drm_calc_timestamping_constants
	.p2align	4, 0x90
_drm_calc_timestamping_constants:       ## @drm_calc_timestamping_constants
	.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, %rbx
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rdi)
	movl	$1000, %eax                     ## imm = 0x3E8
	movl	$2000, %r14d                    ## imm = 0x7D0
	cmovel	%eax, %r14d
	imull	24(%rdi), %r14d
	testl	%r14d, %r14d
	jle	LBB0_2
## %bb.1:
	movl	$1000000000, %edi               ## imm = 0x3B9ACA00
	movl	%r14d, %esi
	callq	_div64_u64
	movq	%rax, %r15
	imull	$1000000000, 12(%rbx), %edi     ## imm = 0x3B9ACA00
	movl	%r14d, %esi
	callq	_div64_u64
	movq	%rax, %r12
	movl	12(%rbx), %eax
	imull	16(%rbx), %eax
	imull	$1000000000, %eax, %edi         ## imm = 0x3B9ACA00
	movl	%r14d, %esi
	callq	_div64_u64
	movq	%rax, %r13
	jmp	LBB0_3
LBB0_2:
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
LBB0_3:
	movq	%r15, 48(%rbx)
	movq	%r12, 40(%rbx)
	movq	%r13, 32(%rbx)
	movl	(%rbx), %esi
	movl	12(%rbx), %edx
	movl	16(%rbx), %ecx
	movl	20(%rbx), %r8d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movl	(%rbx), %esi
	movslq	%r14d, %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r13d, %ecx
	movl	%r12d, %r8d
	movl	%r15d, %r9d
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_DEBUG                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"crtc %d: Can't calculate constants, dotclock = 0!\n"

L_.str.1:                               ## @.str.1
	.asciz	"crtc %d: hwmode: htotal %d, vtotal %d, vdisplay %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"crtc %d: clock %d kHz framedur %d linedur %d, pixeldur %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_calc_timestamping_constants ; -- Begin function drm_calc_timestamping_constants
	.p2align	2
_drm_calc_timestamping_constants:       ; @drm_calc_timestamping_constants
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	w8, [x0, #24]
	ldr	w9, [x0, #8]
Lloh0:
	adrp	x10, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	mov	w9, #2000
	mov	w10, #1000
	csel	w9, w10, w9, eq
	mul	w20, w9, w8
	cmp	w20, #1
	b.lt	LBB0_2
; %bb.1:
	mov	w23, #51712
	movk	w23, #15258, lsl #16
	mov	w0, #51712
	movk	w0, #15258, lsl #16
	mov	x1, x20
	bl	_div64_u64
	mov	x21, x0
	ldr	w8, [x19, #12]
	mul	w0, w8, w23
	mov	x1, x20
	bl	_div64_u64
	mov	x22, x0
	ldp	w8, w9, [x19, #12]
	mul	w8, w8, w9
	mul	w0, w8, w23
	mov	x1, x20
	bl	_div64_u64
	mov	x23, x0
	b	LBB0_3
LBB0_2:
	ldr	w1, [x19]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	x21, #0
	mov	x23, #0
	mov	x22, #0
LBB0_3:
	stp	x22, x21, [x19, #40]
	str	x23, [x19, #32]
	ldr	w1, [x19]
	ldp	w2, w3, [x19, #12]
	ldr	w4, [x19, #20]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG
	ldr	w1, [x19]
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w20, w8
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w2, w8, w9, asr #6
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	str	x21, [sp]
	mov	x3, x23
	mov	x4, x22
	bl	_DRM_DEBUG
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"crtc %d: Can't calculate constants, dotclock = 0!\n"

l_.str.1:                               ; @.str.1
	.asciz	"crtc %d: hwmode: htotal %d, vtotal %d, vdisplay %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"crtc %d: clock %d kHz framedur %d linedur %d, pixeldur %d\n"

.subsections_via_symbols
