	.file	"extr_ibmpex.c_ibmpex_find_sensors.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ibmpex_find_sensors, @function
ibmpex_find_sensors:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	call	ibmpex_query_sensor_count@PLT
	test	eax, eax
	jle	.L35
	mov	DWORD PTR [r15], eax
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	sal	eax, 4
	mov	edi, eax
	call	kzalloc@PLT
	mov	QWORD PTR 8[r15], rax
	test	rax, rax
	je	.L4
	mov	esi, DWORD PTR [r15]
	mov	DWORD PTR 20[rsp], 0
	mov	QWORD PTR 8[rsp], 0
	mov	DWORD PTR 24[rsp], 0
	test	esi, esi
	jg	.L5
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	add	QWORD PTR 8[rsp], 1
	mov	rax, QWORD PTR 8[rsp]
	cmp	DWORD PTR [r15], eax
	jle	.L12
.L5:
	mov	rax, QWORD PTR 8[rsp]
	mov	rdi, r15
	mov	esi, eax
	mov	ebp, eax
	call	ibmpex_query_sensor_name@PLT
	mov	ebx, eax
	test	eax, eax
	jne	.L8
	mov	esi, DWORD PTR 20[r15]
	mov	edi, DWORD PTR 24[r15]
	call	is_power_sensor@PLT
	test	rax, rax
	jne	.L36
	mov	esi, DWORD PTR 20[r15]
	mov	edi, DWORD PTR 24[r15]
	call	is_temp_sensor@PLT
	test	rax, rax
	je	.L8
	mov	r13d, DWORD PTR 20[rsp]
	mov	rax, QWORD PTR 8[rsp]
	mov	r14d, DWORD PTR TEMP_SENSOR[rip]
	add	r13d, 1
	sal	rax, 4
	add	rax, QWORD PTR 8[r15]
	mov	DWORD PTR [rax], 1000
	mov	DWORD PTR 20[rsp], r13d
.L10:
	mov	ecx, DWORD PTR PEX_NUM_SENSOR_FUNCS[rip]
	mov	DWORD PTR 4[rax], 1
	test	ecx, ecx
	jg	.L11
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L37:
	add	ebx, 1
	cmp	DWORD PTR PEX_NUM_SENSOR_FUNCS[rip], ebx
	jle	.L8
.L11:
	mov	r8d, ebx
	mov	ecx, ebp
	mov	edx, r13d
	mov	esi, r14d
	mov	rdi, r15
	call	create_sensor@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L37
.L6:
	mov	edi, DWORD PTR 16[r15]
	lea	rsi, sensor_dev_attr_reset_high_low[rip]
	call	device_remove_file@PLT
	mov	edi, DWORD PTR 16[r15]
	lea	rsi, sensor_dev_attr_name[rip]
	call	device_remove_file@PLT
	mov	edx, DWORD PTR [r15]
	mov	rdi, QWORD PTR 8[r15]
	test	edx, edx
	jle	.L17
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L14:
	mov	eax, DWORD PTR PEX_NUM_SENSOR_FUNCS[rip]
	mov	r13, rbp
	xor	ebx, ebx
	sal	r13, 4
	test	eax, eax
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rax, QWORD PTR 8[rdi+r13]
	lea	rsi, [rax+rbx*8]
	cmp	QWORD PTR [rsi], 0
	je	.L15
	mov	edi, DWORD PTR 16[r15]
	call	device_remove_file@PLT
	mov	rax, QWORD PTR 8[r15]
	mov	rax, QWORD PTR 8[rax+r13]
	mov	rdi, QWORD PTR [rax+rbx*8]
	call	kfree@PLT
	mov	rdi, QWORD PTR 8[r15]
.L15:
	add	rbx, 1
	cmp	DWORD PTR PEX_NUM_SENSOR_FUNCS[rip], ebx
	jg	.L16
.L19:
	add	rbp, 1
	cmp	DWORD PTR [r15], ebp
	jg	.L14
.L17:
	call	kfree@PLT
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	mov	r12d, DWORD PTR ENOENT[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L36:
	mov	r12, QWORD PTR 8[rsp]
	mov	rcx, QWORD PTR 8[r15]
	mov	rdi, r15
	mov	edx, DWORD PTR 20[r15]
	mov	esi, DWORD PTR 24[r15]
	sal	r12, 4
	mov	r13d, DWORD PTR 24[rsp]
	mov	r14d, DWORD PTR POWER_SENSOR[rip]
	add	rcx, r12
	mov	QWORD PTR 24[rsp], rcx
	add	r13d, 1
	call	power_sensor_multiplier@PLT
	mov	rcx, QWORD PTR 24[rsp]
	mov	DWORD PTR 24[rsp], r13d
	mov	DWORD PTR [rcx], eax
	mov	rax, QWORD PTR 8[r15]
	add	rax, r12
	jmp	.L10
.L4:
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
.L12:
	mov	edi, DWORD PTR 16[r15]
	lea	rsi, sensor_dev_attr_reset_high_low[rip]
	call	device_create_file@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L6
	mov	edi, DWORD PTR 16[r15]
	lea	rsi, sensor_dev_attr_name[rip]
	call	device_create_file@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L1
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	ibmpex_find_sensors, .-ibmpex_find_sensors
	.comm	sensor_dev_attr_reset_high_low,8,8
	.comm	sensor_dev_attr_name,8,8
	.comm	TEMP_SENSOR,4,4
	.comm	POWER_SENSOR,4,4
	.comm	PEX_NUM_SENSOR_FUNCS,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	ENOENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ibmpex.c_ibmpex_find_sensors.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ibmpex_find_sensors, %function
ibmpex_find_sensors:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	mov	r4, r0
	bl	ibmpex_query_sensor_count
	cmp	r0, #0
	ble	.L38
	ldr	r3, .L41
	add	r2, r0, r0, lsl #1
	str	r0, [r4]
	ldr	r1, [r3]
	lsl	r0, r2, #2
	bl	kzalloc
	cmp	r0, #0
	str	r0, [r4, #4]
	beq	.L4
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L12
	mov	r9, #0
	ldr	r7, .L41+4
	mov	fp, r9
	str	r9, [sp, #12]
	b	.L5
.L8:
	ldr	r3, [r4]
	add	fp, fp, #1
	cmp	r3, fp
	ble	.L12
.L5:
	mov	r1, fp
	mov	r0, r4
	bl	ibmpex_query_sensor_name
	subs	r5, r0, #0
	bne	.L8
	ldr	r1, [r4, #12]
	ldr	r0, [r4, #16]
	bl	is_power_sensor
	cmp	r0, #0
	bne	.L39
	ldr	r1, [r4, #12]
	ldr	r0, [r4, #16]
	bl	is_temp_sensor
	cmp	r0, #0
	beq	.L8
	mov	r1, #1000
	add	r6, r9, #1
	mov	r9, r6
	ldr	r2, [r4, #4]
	ldr	r0, .L41+8
	add	r3, fp, fp, lsl #1
	ldr	r8, [r0]
	str	r1, [r2, r3, lsl #2]
	add	r3, r2, r3, lsl #2
.L10:
	mov	r1, #1
	ldr	r2, [r7]
	str	r1, [r3, #4]
	cmp	r2, #0
	bgt	.L11
	b	.L8
.L40:
	ldr	r3, [r7]
	cmp	r3, r5
	ble	.L8
.L11:
	str	r5, [sp]
	mov	r3, fp
	mov	r2, r6
	mov	r1, r8
	mov	r0, r4
	bl	create_sensor
	cmp	r0, #0
	add	r5, r5, #1
	beq	.L40
	mov	r6, r0
.L6:
	ldr	r1, .L41+12
	ldr	r0, [r4, #8]
	bl	device_remove_file
	ldr	r1, .L41+16
	ldr	r0, [r4, #8]
	bl	device_remove_file
	ldr	r3, [r4]
	ldr	r0, [r4, #4]
	cmp	r3, #0
	ble	.L17
	mov	r8, #0
	ldr	r9, .L41+4
.L14:
	ldr	r2, [r9]
	cmp	r2, #0
	addgt	r7, r8, r8, lsl #1
	movgt	r5, #0
	lslgt	r7, r7, #2
	ble	.L19
.L16:
	add	r3, r0, r7
	ldr	r1, [r3, #8]
	ldr	r3, [r1, r5, lsl #2]
	add	r1, r1, r5, lsl #2
	cmp	r3, #0
	beq	.L15
	ldr	r0, [r4, #8]
	bl	device_remove_file
	ldr	r3, [r4, #4]
	add	r3, r3, r7
	ldr	r3, [r3, #8]
	ldr	r0, [r3, r5, lsl #2]
	bl	kfree
	ldr	r0, [r4, #4]
.L15:
	ldr	r3, [r9]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L16
	ldr	r3, [r4]
.L19:
	add	r8, r8, #1
	cmp	r3, r8
	bgt	.L14
.L17:
	bl	kfree
.L1:
	mov	r0, r6
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L38:
	ldr	r3, .L41+20
	ldr	r6, [r3]
	rsb	r6, r6, #0
	mov	r0, r6
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L39:
	ldr	r3, .L41+24
	ldr	r2, [r4, #12]
	ldr	r1, [r4, #16]
	mov	r0, r4
	ldr	r8, [r3]
	ldr	r10, [r4, #4]
	bl	power_sensor_multiplier
	ldr	r1, [sp, #12]
	ldr	r3, [r4, #4]
	add	r2, fp, fp, lsl #1
	add	r6, r1, #1
	lsl	r1, r2, #2
	str	r0, [r10, r2, lsl #2]
	add	r3, r3, r1
	str	r6, [sp, #12]
	b	.L10
.L4:
	ldr	r3, .L41+28
	ldr	r6, [r3]
	rsb	r6, r6, #0
	mov	r0, r6
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	ldr	r1, .L41+12
	ldr	r0, [r4, #8]
	bl	device_create_file
	subs	r6, r0, #0
	bne	.L6
	ldr	r1, .L41+16
	ldr	r0, [r4, #8]
	bl	device_create_file
	subs	r6, r0, #0
	beq	.L1
	b	.L6
.L42:
	.align	2
.L41:
	.word	GFP_KERNEL
	.word	PEX_NUM_SENSOR_FUNCS
	.word	TEMP_SENSOR
	.word	sensor_dev_attr_reset_high_low
	.word	sensor_dev_attr_name
	.word	ENOENT
	.word	POWER_SENSOR
	.word	ENOMEM
	.size	ibmpex_find_sensors, .-ibmpex_find_sensors
	.comm	sensor_dev_attr_reset_high_low,4,4
	.comm	sensor_dev_attr_name,4,4
	.comm	TEMP_SENSOR,4,4
	.comm	POWER_SENSOR,4,4
	.comm	PEX_NUM_SENSOR_FUNCS,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	ENOENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
