	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bme680_read_gas
_bme680_read_gas:                       ## @bme680_read_gas
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	(%rdi), %edi
	callq	_regmap_get_device
	movq	%rax, %r15
	movq	$0, -48(%rbp)
	movq	%r12, %rdi
	callq	_bme680_gas_config
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_bme680_set_mode
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	(%r12), %edi
	movq	_BME680_REG_MEAS_STAT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	movq	_BME680_GAS_MEAS_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_2:
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_15
LBB0_4:
	movl	%eax, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r12), %edi
	movq	_BME680_REG_GAS_R_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movq	_BME680_GAS_STAB_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_11
## %bb.12:
	movl	(%r12), %edi
	movq	_BME680_REG_GAS_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movl	$2, %ecx
	callq	_regmap_bulk_read
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	movq	_BME680_GAS_RANGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	-36(%rbp), %ebx
	movq	-48(%rbp), %rdi
	callq	_be16_to_cpu
	movq	_BME680_ADC_GAS_RES_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_bme680_compensate_gas
	movl	%eax, (%r14)
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_9:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_11:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_13:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set gas config\n"

	.comm	_BME680_REG_MEAS_STAT_0,4,2     ## @BME680_REG_MEAS_STAT_0
	.comm	_BME680_GAS_MEAS_BIT,4,2        ## @BME680_GAS_MEAS_BIT
L_.str.1:                               ## @.str.1
	.asciz	"gas measurement incomplete\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_BME680_REG_GAS_R_LSB,4,2       ## @BME680_REG_GAS_R_LSB
L_.str.2:                               ## @.str.2
	.asciz	"failed to read gas_r_lsb register\n"

	.comm	_BME680_GAS_STAB_BIT,4,2        ## @BME680_GAS_STAB_BIT
L_.str.3:                               ## @.str.3
	.asciz	"heater failed to reach the target temperature\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BME680_REG_GAS_MSB,4,2         ## @BME680_REG_GAS_MSB
L_.str.4:                               ## @.str.4
	.asciz	"failed to read gas resistance\n"

	.comm	_BME680_GAS_RANGE_MASK,4,2      ## @BME680_GAS_RANGE_MASK
	.comm	_BME680_ADC_GAS_RES_SHIFT,4,2   ## @BME680_ADC_GAS_RES_SHIFT
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.no_dead_strip	_bme680_read_gas
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bme680_read_gas
_bme680_read_gas:                       ; @bme680_read_gas
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_regmap_get_device
	mov	x21, x0
	str	xzr, [sp, #8]
	mov	x0, x20
	bl	_bme680_gas_config
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	x0, x20
	mov	w1, #1
	bl	_bme680_set_mode
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	w0, [x20]
Lloh0:
	adrp	x8, _BME680_REG_MEAS_STAT_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BME680_REG_MEAS_STAT_0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #4
	bl	_regmap_read
	ldr	w8, [sp, #4]
Lloh3:
	adrp	x9, _BME680_GAS_MEAS_BIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BME680_GAS_MEAS_BIT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.3:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_8
LBB0_5:
	mov	x22, x0
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
LBB0_6:
	mov	x0, x21
	bl	_dev_err
	b	LBB0_8
LBB0_7:
	mov	x22, x0
LBB0_8:
	mov	x0, x22
	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
	add	sp, sp, #64
	ret
LBB0_9:
	ldr	w0, [x20]
Lloh12:
	adrp	x8, _BME680_REG_GAS_R_LSB@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BME680_REG_GAS_R_LSB@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #4
	bl	_regmap_read
	tbnz	w0, #31, LBB0_13
; %bb.10:
	ldr	w8, [sp, #4]
Lloh15:
	adrp	x9, _BME680_GAS_STAB_BIT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _BME680_GAS_STAB_BIT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.11:
	ldr	w0, [x20]
Lloh18:
	adrp	x8, _BME680_REG_GAS_MSB@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BME680_REG_GAS_MSB@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	w3, #2
	bl	_regmap_bulk_read
	tbnz	w0, #31, LBB0_15
; %bb.12:
	ldr	w8, [sp, #4]
Lloh21:
	adrp	x9, _BME680_GAS_RANGE_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _BME680_GAS_RANGE_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	and	w21, w9, w8
	ldr	x0, [sp, #8]
	bl	_be16_to_cpu
Lloh24:
	adrp	x8, _BME680_ADC_GAS_RES_SHIFT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BME680_ADC_GAS_RES_SHIFT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	asr	w1, w0, w8
	mov	x0, x20
	mov	x2, x21
	bl	_bme680_compensate_gas
	str	w0, [x19]
Lloh27:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh29:
	ldr	w22, [x8]
	b	LBB0_8
LBB0_13:
	mov	x22, x0
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_14:
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh34:
	adrp	x8, _EINVAL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_15:
	mov	x22, x0
Lloh36:
	adrp	x1, l_.str.4@PAGE
Lloh37:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set gas config\n"

	.comm	_BME680_REG_MEAS_STAT_0,4,2     ; @BME680_REG_MEAS_STAT_0
	.comm	_BME680_GAS_MEAS_BIT,4,2        ; @BME680_GAS_MEAS_BIT
l_.str.1:                               ; @.str.1
	.asciz	"gas measurement incomplete\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_BME680_REG_GAS_R_LSB,4,2       ; @BME680_REG_GAS_R_LSB
l_.str.2:                               ; @.str.2
	.asciz	"failed to read gas_r_lsb register\n"

	.comm	_BME680_GAS_STAB_BIT,4,2        ; @BME680_GAS_STAB_BIT
l_.str.3:                               ; @.str.3
	.asciz	"heater failed to reach the target temperature\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BME680_REG_GAS_MSB,4,2         ; @BME680_REG_GAS_MSB
l_.str.4:                               ; @.str.4
	.asciz	"failed to read gas resistance\n"

	.comm	_BME680_GAS_RANGE_MASK,4,2      ; @BME680_GAS_RANGE_MASK
	.comm	_BME680_ADC_GAS_RES_SHIFT,4,2   ; @BME680_ADC_GAS_RES_SHIFT
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.no_dead_strip	_bme680_read_gas
.subsections_via_symbols
