	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max31785_get_pwm_mode
_max31785_get_pwm_mode:                 ## @max31785_get_pwm_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_PMBUS_FAN_CONFIG_12@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_pmbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movq	_PMBUS_FAN_COMMAND_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_pmbus_read_word_data
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	_PB_FAN_1_RPM@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_5
## %bb.4:
	xorl	%ebx, %ebx
	cmpl	$32768, %eax                    ## imm = 0x8000
	setae	%bl
	orl	$2, %ebx
	jmp	LBB0_7
LBB0_2:
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_5:
	movl	$3, %ebx
	cmpl	$32767, %eax                    ## imm = 0x7FFF
	ja	LBB0_7
## %bb.6:
	xorl	%ebx, %ebx
	cmpl	$10001, %eax                    ## imm = 0x2711
	setb	%bl
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PMBUS_FAN_CONFIG_12,4,2        ## @PMBUS_FAN_CONFIG_12
	.comm	_PMBUS_FAN_COMMAND_1,4,2        ## @PMBUS_FAN_COMMAND_1
	.comm	_PB_FAN_1_RPM,4,2               ## @PB_FAN_1_RPM
	.no_dead_strip	_max31785_get_pwm_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max31785_get_pwm_mode
_max31785_get_pwm_mode:                 ; @max31785_get_pwm_mode
	.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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _PMBUS_FAN_CONFIG_12@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMBUS_FAN_CONFIG_12@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_pmbus_read_byte_data
	mov	x19, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _PMBUS_FAN_COMMAND_1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PMBUS_FAN_COMMAND_1@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x20
	bl	_pmbus_read_word_data
	tbnz	w0, #31, LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _PB_FAN_1_RPM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PB_FAN_1_RPM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	w9, #3
	lsr	w10, w0, #15
	mov	w11, #10001
	cmp	w0, w11
	cset	w11, lo
	cmp	w10, #0
	csel	w9, w9, w11, ne
	cmp	w10, #0
	mov	w10, #2
	cinc	w10, w10, ne
	tst	w8, w19
	csel	w19, w9, w10, eq
	b	LBB0_4
LBB0_3:
	mov	x19, x0
LBB0_4:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PMBUS_FAN_CONFIG_12,4,2        ; @PMBUS_FAN_CONFIG_12
	.comm	_PMBUS_FAN_COMMAND_1,4,2        ; @PMBUS_FAN_COMMAND_1
	.comm	_PB_FAN_1_RPM,4,2               ; @PB_FAN_1_RPM
	.no_dead_strip	_max31785_get_pwm_mode
.subsections_via_symbols
