// File: /workspace/github_c_makefile_star2_O0/STMicroelectronics[P]STMems_Android_Sensor_HAL_Input/AccelSensor.cpp
// Function: AccelSensor::AccelSensor()
AccelSensor::AccelSensor()
	: SensorBase(NULL, SENSOR_DATANAME_ACCELEROMETER),
	mInputReader(6),
	mHasPendingEvent(false)
{
	pthread_mutex_init(&dataMutex, NULL);

	memset(mPendingEvents, 0, sizeof(mPendingEvents));

	mPendingEvents[Acceleration].version = sizeof(sensors_event_t);
	mPendingEvents[Acceleration].sensor = ID_ACCELEROMETER;
	mPendingEvents[Acceleration].type = SENSOR_TYPE_ACCELEROMETER;
	mPendingEvents[Acceleration].acceleration.status = SENSOR_STATUS_ACCURACY_HIGH;

#if (SENSORS_UNCALIB_ACCELEROMETER_ENABLE == 1)
	mPendingEvents[AccelUncalib].version = sizeof(sensors_event_t);
	mPendingEvents[AccelUncalib].sensor = ID_UNCALIB_ACCELEROMETER;
	mPendingEvents[AccelUncalib].type = SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED;
	memset(mPendingEvents[AccelUncalib].data, 0, sizeof(mPendingEvents[AccelUncalib].data));
	mPendingEvents[AccelUncalib].acceleration.status = SENSOR_STATUS_ACCURACY_HIGH;
#endif

#if (SENSORS_SIGNIFICANT_MOTION_ENABLE == 1)
	mPendingEvents[SignificantMotion].version = sizeof(sensors_event_t);
	mPendingEvents[SignificantMotion].sensor = ID_SIGNIFICANT_MOTION;
	mPendingEvents[SignificantMotion].type = SENSOR_TYPE_SIGNIFICANT_MOTION;
	mPendingEvents[SignificantMotion].acceleration.status = SENSOR_STATUS_ACCURACY_HIGH;
#endif

#if (SENSORS_ACTIVITY_RECOGNIZER_ENABLE == 1)
	mPendingEvents[ActivityReco].version = sizeof(sensors_event_t);
	mPendingEvents[ActivityReco].sensor = ID_ACTIVITY_RECOGNIZER;
	mPendingEvents[ActivityReco].type = SENSOR_TYPE_ACTIVITY;
	mPendingEvents[ActivityReco].data[0] = 1.0f;
#endif

	if (data_fd) {
		STLOGI("%s: accel_device_sysfs_path:(%s)",
		       __func__, sysfs_device_path);
	} else {
		STLOGE("%s: accel_device_sysfs_path:(%s) not found",
		       sysfs_device_path);
	}

	data_raw[0] = data_raw[1] = data_raw[2] = 0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
leaq 0x3b75(%rip), %rdx      # 0xa600
xorl %eax, %eax
movl %eax, %esi
callq 0x5060
movq -0x20(%rbp), %rdi
movq 0x7479(%rip), %rax      # 0xdf18
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x1028, %rdi           # imm = 0x1028
movl $0x6, %esi
callq 0x5120
jmp 0x6ab9
movq -0x20(%rbp), %rax
movb $0x0, 0x1538(%rax)
movq 0x740d(%rip), %rdi      # 0xded8
xorl %eax, %eax
movl %eax, %esi
callq 0x5360
movq -0x20(%rbp), %rdi
addq $0x1058, %rdi           # imm = 0x1058
xorl %esi, %esi
movl $0x4e0, %edx            # imm = 0x4E0
callq 0x5130
movq -0x20(%rbp), %rdi
movl $0x68, 0x1058(%rdi)
movl $0x1, 0x105c(%rdi)
movl $0x1, 0x1060(%rdi)
movb $0x3, 0x107c(%rdi)
movl $0x68, 0x10c0(%rdi)
movl $0x1a, 0x10c4(%rdi)
movl $0x23, 0x10c8(%rdi)
addq $0x1058, %rdi           # imm = 0x1058
addq $0x68, %rdi
addq $0x18, %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x5130
movq -0x20(%rbp), %rax
movb $0x3, 0x10e4(%rax)
cmpl $0x0, 0x1020(%rax)
je 0x6b7a
jmp 0x6b7c
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x5160
jmp 0x6ba7
jmp 0x6b7c
movq -0x20(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1544(%rax)
xorps %xmm0, %xmm0
movss %xmm0, 0x1540(%rax)
xorps %xmm0, %xmm0
movss %xmm0, 0x153c(%rax)
addq $0x20, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x53d0