	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function am2315_read_data
_am2315_read_data:                      ## @am2315_read_data
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_AM2315_FUNCTION_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	_AM2315_REG_HUM_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movl	$4, -36(%rbp)
	movq	8(%rdi), %rdi
	callq	_am2315_ping
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	8(%rbx), %rdi
	leaq	-44(%rbp), %rsi
	movl	$12, %edx
	callq	_i2c_master_send
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movl	$2000, %edi                     ## imm = 0x7D0
	movl	$3000, %esi                     ## imm = 0xBB8
	callq	_usleep_range
	movq	8(%rbx), %rdi
	leaq	-80(%rbp), %rsi
	movl	$32, %edx
	callq	_i2c_master_recv
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	leaq	-80(%rbp), %rdi
	movl	$30, %esi
	callq	_am2315_crc
	movzbl	%al, %ecx
	cmpl	-56(%rbp), %ecx
	jne	LBB0_7
## %bb.6:
	sarl	$8, %eax
	cmpl	-52(%rbp), %eax
	jne	LBB0_7
## %bb.8:
	movq	_AM2315_HUM_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-80(%rbp,%rax,4), %ecx
	shll	$8, %ecx
	orl	-76(%rbp,%rax,4), %ecx
	movl	%ecx, (%r14)
	movq	_AM2315_TEMP_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-80(%rbp,%rax,4), %ecx
	shll	$8, %ecx
	orl	-76(%rbp,%rax,4), %ecx
	movl	%ecx, 4(%r14)
	jmp	LBB0_9
LBB0_1:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_7:
	movq	8(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	8(%rbx), %rdi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AM2315_FUNCTION_READ,4,2       ## @AM2315_FUNCTION_READ
	.comm	_AM2315_REG_HUM_MSB,4,2         ## @AM2315_REG_HUM_MSB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to send read request\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to read sensor data\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to verify sensor data\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_AM2315_HUM_OFFSET,8,3          ## @AM2315_HUM_OFFSET
	.comm	_AM2315_TEMP_OFFSET,8,3         ## @AM2315_TEMP_OFFSET
	.no_dead_strip	_am2315_read_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function am2315_read_data
_am2315_read_data:                      ; @am2315_read_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _AM2315_FUNCTION_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AM2315_FUNCTION_READ@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _AM2315_REG_HUM_MSB@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AM2315_REG_HUM_MSB@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #44]
	mov	w8, #4
	str	w8, [sp, #52]
	ldr	x0, [x0, #8]
	bl	_am2315_ping
	mov	x0, x19
	bl	_mutex_lock
	ldr	x0, [x19, #8]
	add	x1, sp, #44
	mov	w2, #12
	bl	_i2c_master_send
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	w0, #2000
	mov	w1, #3000
	bl	_usleep_range
	ldr	x0, [x19, #8]
	add	x1, sp, #12
	mov	w2, #32
	bl	_i2c_master_recv
	mov	x21, x0
	tbnz	w0, #31, LBB0_7
; %bb.2:
	mov	x0, x19
	bl	_mutex_unlock
	add	x0, sp, #12
	mov	w1, #30
	bl	_am2315_crc
	ldr	w8, [sp, #36]
	cmp	w8, w0, uxtb
	b.ne	LBB0_6
; %bb.3:
	ldr	w8, [sp, #40]
	cmp	w8, w0, asr #8
	b.ne	LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _AM2315_HUM_OFFSET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AM2315_HUM_OFFSET@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x9, sp, #12
	add	x8, x9, x8, lsl #2
	ldp	w10, w8, [x8]
	orr	w8, w8, w10, lsl #8
	str	w8, [x20]
Lloh12:
	adrp	x8, _AM2315_TEMP_OFFSET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AM2315_TEMP_OFFSET@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x8, x9, x8, lsl #2
	ldp	w9, w8, [x8]
	orr	w8, w8, w9, lsl #8
	str	w8, [x20, #4]
	b	LBB0_9
LBB0_5:
	mov	x21, x0
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_8
LBB0_6:
	ldr	x0, [x19, #8]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_7:
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	ldr	x0, [x19, #8]
	bl	_dev_err
	mov	x0, x19
	bl	_mutex_unlock
LBB0_9:
	ldur	x8, [x29, #-40]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_AM2315_FUNCTION_READ,4,2       ; @AM2315_FUNCTION_READ
	.comm	_AM2315_REG_HUM_MSB,4,2         ; @AM2315_REG_HUM_MSB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to send read request\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to read sensor data\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to verify sensor data\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_AM2315_HUM_OFFSET,8,3          ; @AM2315_HUM_OFFSET
	.comm	_AM2315_TEMP_OFFSET,8,3         ; @AM2315_TEMP_OFFSET
	.no_dead_strip	_am2315_read_data
.subsections_via_symbols
