LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/sensor.c
// Function: GetYawPitchRoll(float*, Quaternion*, VectorFloat*)
uint8_t GetYawPitchRoll(float *data, Quaternion *q, VectorFloat *gravity) {
	// yaw: (about Z axis)
	data[0] = atan2(2*q -> x*q -> y - 2*q -> w*q -> z, 2*q -> w*q -> w + 2*q -> x*q -> x - 1);
	// pitch: (nose up/down, about Y axis)
	data[1] = atan(gravity -> x / sqrt(gravity -> y*gravity -> y + gravity -> z*gravity -> z));
	// roll: (tilt left/right, about X axis)
	data[2] = atan(gravity -> y / sqrt(gravity -> x*gravity -> x + gravity -> z*gravity -> z));
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movss (%rsi), %xmm2
movss 0x4(%rsi), %xmm3
movaps %xmm3, %xmm0
addss %xmm3, %xmm0
movaps %xmm2, %xmm1
addss %xmm2, %xmm1
movss 0xc(%rsi), %xmm4
mulss %xmm1, %xmm4
mulss %xmm0, %xmm3
mulss 0x8(%rsi), %xmm0
subss %xmm4, %xmm0
mulss %xmm2, %xmm1
addss %xmm3, %xmm1
addss 0x3835(%rip), %xmm1     # 0x5074
callq 0x10c0
movss %xmm0, (%rbx)
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
movss 0x8(%r14), %xmm2
mulss %xmm2, %xmm2
mulss %xmm1, %xmm1
addss %xmm2, %xmm1
sqrtss %xmm1, %xmm1
divss %xmm1, %xmm0
callq 0x1090
movss %xmm0, 0x4(%rbx)
movss (%r14), %xmm1
movss 0x4(%r14), %xmm0
movss 0x8(%r14), %xmm2
mulss %xmm2, %xmm2
mulss %xmm1, %xmm1
addss %xmm2, %xmm1
sqrtss %xmm1, %xmm1
divss %xmm1, %xmm0
callq 0x1090
movss %xmm0, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_reg_dump()
uint8_t mpu_reg_dump(void)
{
	uint8_t ii;
	uint8_t data;

	for (ii = 0; ii < st.hw->num_reg; ii++)
	{
		if (ii == st.reg->fifo_r_w || ii == st.reg->mem_r_w)
			continue;
		if (i2c_read(st.hw->addr, ii, 1, &data))
			return 1;
#if defined MPU_DEBUG
		printf_P("%#5x: %#5x\r\r\n", ii, data);
#endif
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x7939(%rip), %rax      # 0x9210
xorl %ebp, %ebp
pushq $0x1
popq %rbx
leaq 0xf(%rsp), %r14
cmpb 0x4(%rax), %bpl
jae 0x191b
movq 0x791a(%rip), %rcx      # 0x9208
cmpb 0xd(%rcx), %bpl
je 0x1916
cmpb 0x18(%rcx), %bpl
je 0x1916
movzbl (%rax), %edi
movzbl %bpl, %esi
movl %ebx, %edx
movq %r14, %rcx
callq 0x4847
cmpb $-0x1, %al
je 0x1926
movq 0x78fa(%rip), %rax      # 0x9210
incb %bpl
jmp 0x18e1
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movb $0x1, %al
jmp 0x191d
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_gyro_fsr(unsigned short)
uint8_t mpu_set_gyro_fsr(uint16_t fsr)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	switch (fsr)
	{
	case 250:
		data = INV_FSR_250DPS << 3;
		break;
	case 500:
		data = INV_FSR_500DPS << 3;
		break;
	case 1000:
		data = INV_FSR_1000DPS << 3;
		break;
	case 2000:
		data = INV_FSR_2000DPS << 3;
		break;
	default:
		return 1;
	}

	if (st.chip_cfg.gyro_fsr == (data >> 3))
		return 0;
	if (i2c_write(st.hw->addr, st.reg->gyro_cfg, 1, &data))
		return 1;
	st.chip_cfg.gyro_fsr = data >> 3;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movb $0x1, %bl
cmpb $0x0, 0x761b(%rip)      # 0x9222
je 0x1c87
cmpw $0x7d0, %di             # imm = 0x7D0
je 0x1c43
movzwl %di, %eax
cmpl $0x1f4, %eax            # imm = 0x1F4
je 0x1c31
cmpl $0x3e8, %eax            # imm = 0x3E8
je 0x1c3a
cmpl $0xfa, %eax
jne 0x1c87
movb $0x0, 0xf(%rsp)
xorl %eax, %eax
jmp 0x1c4a
movb $0x8, 0xf(%rsp)
movb $0x1, %al
jmp 0x1c4a
movb $0x10, 0xf(%rsp)
movb $0x2, %al
jmp 0x1c4a
movb $0x18, 0xf(%rsp)
movb $0x3, %al
cmpb %al, 0x75d0(%rip)       # 0x9220
je 0x1c85
movq 0x75b7(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x75a5(%rip), %rax      # 0x9208
movzbl 0x6(%rax), %esi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x4b0e
testl %eax, %eax
jne 0x1c87
movb 0xf(%rsp), %al
shrb $0x3, %al
movb %al, 0x759b(%rip)       # 0x9220
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_accel_fsr(unsigned char)
uint8_t mpu_set_accel_fsr(uint8_t fsr)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	switch (fsr)
	{
	case 2:
		data = INV_FSR_2G << 3;
		break;
	case 4:
		data = INV_FSR_4G << 3;
		break;
	case 8:
		data = INV_FSR_8G << 3;
		break;
	case 16:
		data = INV_FSR_16G << 3;
		break;
	default:
		return 1;
	}

	if (st.chip_cfg.accel_fsr == (data >> 3))
		return 0;
	if (i2c_write(st.hw->addr, st.reg->accel_cfg, 1, &data))
		return 1;
	st.chip_cfg.accel_fsr = data >> 3;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movb $0x1, %bl
cmpb $0x0, 0x7585(%rip)      # 0x9222
je 0x1d1c
movzbl %dil, %eax
addl $-0x2, %eax
rorl %eax
cmpl $0x7, %eax
ja 0x1d1c
leaq 0x380c(%rip), %rcx      # 0x54c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0xf(%rsp)
xorl %eax, %eax
jmp 0x1cdf
movb $0x10, 0xf(%rsp)
movb $0x2, %al
jmp 0x1cdf
movb $0x8, 0xf(%rsp)
movb $0x1, %al
jmp 0x1cdf
movb $0x18, 0xf(%rsp)
movb $0x3, %al
cmpb %al, 0x753c(%rip)       # 0x9221
je 0x1d1a
movq 0x7522(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x7510(%rip), %rax      # 0x9208
movzbl 0x7(%rax), %esi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x4b0e
testl %eax, %eax
jne 0x1d1c
movb 0xf(%rsp), %al
shrb $0x3, %al
movb %al, 0x7507(%rip)       # 0x9221
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_lpf(unsigned short)
uint8_t mpu_set_lpf(uint16_t lpf)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	if (lpf >= 188)
		data = INV_FILTER_188HZ;
	else if (lpf >= 98)
		data = INV_FILTER_98HZ;
	else if (lpf >= 42)
		data = INV_FILTER_42HZ;
	else if (lpf >= 20)
		data = INV_FILTER_20HZ;
	else if (lpf >= 10)
		data = INV_FILTER_10HZ;
	else
		data = INV_FILTER_5HZ;

	if (st.chip_cfg.lpf == data)
		return 0;
	if (i2c_write(st.hw->addr, st.reg->lpf, 1, &data))
		return 1;
	st.chip_cfg.lpf = data;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movb $0x1, %bl
cmpb $0x0, 0x74f0(%rip)      # 0x9222
je 0x1dc5
cmpw $0xbc, %di
jb 0x1d48
movb $0x1, 0xf(%rsp)
movb $0x1, %al
jmp 0x1d8b
cmpw $0x62, %di
jb 0x1d57
movb $0x2, 0xf(%rsp)
movb $0x2, %al
jmp 0x1d8b
cmpw $0x2a, %di
jb 0x1d66
movb $0x3, 0xf(%rsp)
movb $0x3, %al
jmp 0x1d8b
cmpw $0x14, %di
jb 0x1d75
movb $0x4, 0xf(%rsp)
movb $0x4, %al
jmp 0x1d8b
cmpw $0xa, %di
jb 0x1d84
movb $0x5, 0xf(%rsp)
movb $0x5, %al
jmp 0x1d8b
movb $0x6, 0xf(%rsp)
movb $0x6, %al
cmpb %al, 0x7492(%rip)       # 0x9223
je 0x1dc3
movq 0x7476(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x7464(%rip), %rax      # 0x9208
movzbl 0x2(%rax), %esi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x4b0e
testl %eax, %eax
jne 0x1dc5
movb 0xf(%rsp), %al
movb %al, 0x7460(%rip)       # 0x9223
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_sample_rate(unsigned short)
uint8_t mpu_set_sample_rate(uint16_t rate)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	if (st.chip_cfg.dmp_on)
		return 1;
	else
	{
		if (st.chip_cfg.lp_accel_mode)
		{
			if (rate && (rate <= 40))
			{
				/* Just stay in low-power accel mode. */
				mpu_lp_accel_mode(rate);
				return 0;
			}
			/* Requested rate exceeds the allowed frequencies in LP accel mode,
			 * switch back to full-power mode.
			 */
			mpu_lp_accel_mode(0);
		}
		if (rate < 4)
			rate = 4;
		else if (rate > 1000)
			rate = 1000;

		data = 1000 / rate - 1;
		if (i2c_write(st.hw->addr, st.reg->rate_div, 1, &data))
			return 1;

		st.chip_cfg.sample_rate = 1000 / (1 + data);

#ifdef AK89xx_SECONDARY
		mpu_set_compass_sample_rate(min(st.chip_cfg.compass_sample_rate, MAX_COMPASS_SAMPLE_RATE));
#endif

		/* Automatically set LPF to 1/2 sampling rate. */
		mpu_set_lpf(st.chip_cfg.sample_rate >> 1);
		return 0;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x744a(%rip)      # 0x9222
movb $0x1, %bl
je 0x1e86
cmpb $0x0, 0x7455(%rip)      # 0x923c
jne 0x1e86
movl %edi, %r14d
cmpb $0x0, 0x7435(%rip)      # 0x922c
je 0x1e17
leal -0x1(%r14), %eax
cmpw $0x27, %ax
ja 0x1e10
movzbl %r14b, %edi
callq 0x2129
xorl %ebx, %ebx
jmp 0x1e86
xorl %edi, %edi
callq 0x2129
cmpw $0x3e8, %r14w           # imm = 0x3E8
movl $0x3e8, %eax            # imm = 0x3E8
cmovbl %r14d, %eax
cmpw $0x5, %ax
pushq $0x4
popq %rcx
cmovael %eax, %ecx
movw $0x3e8, %ax             # imm = 0x3E8
xorl %edx, %edx
divw %cx
decb %al
leaq 0x7(%rsp), %rcx
movb %al, (%rcx)
movq 0x73c7(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x73b5(%rip), %rax      # 0x9208
movzbl 0x1(%rax), %esi
pushq $0x1
popq %rdx
callq 0x4b0e
testl %eax, %eax
jne 0x1e86
movzbl 0x7(%rsp), %ecx
incl %ecx
xorl %ebx, %ebx
movw $0x3e8, %ax             # imm = 0x3E8
xorl %edx, %edx
divw %cx
movzwl %ax, %edi
movw %di, 0x73a7(%rip)       # 0x9226
shrl %edi
callq 0x1d24
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_configure_fifo(unsigned char)
uint8_t mpu_configure_fifo(uint8_t sensors)
{
	uint8_t prev;
	int result = 0;

	/* Compass data isn't going into the FIFO. Stop trying. */
	sensors &= ~INV_XYZ_COMPASS;

	if (st.chip_cfg.dmp_on)
		return 0;
	else
	{
		if (!(st.chip_cfg.sensors))
			return 1;
		prev = st.chip_cfg.fifo_enable;
		st.chip_cfg.fifo_enable = sensors & st.chip_cfg.sensors;
		if (st.chip_cfg.fifo_enable != sensors)
			/* You're not getting what you asked for. Some sensors are
			 * asleep.
			 */
			result = -1;
		else
			result = 0;
		if (sensors || st.chip_cfg.lp_accel_mode)
			set_int_enable(1);
		else
			set_int_enable(0);
		if (sensors)
		{
			if (mpu_reset_fifo())
			{
				st.chip_cfg.fifo_enable = prev;
				return 1;
			}
		}
	}

	return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x73a1(%rip)      # 0x923c
je 0x1ea6
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movb 0x7376(%rip), %al       # 0x9222
movb $0x1, %bl
testb %al, %al
je 0x1e9f
movl %edi, %ebp
andb $-0x2, %bpl
movb 0x7369(%rip), %r14b     # 0x9228
andb %bpl, %al
movb %al, 0x7360(%rip)       # 0x9228
cmpb %bpl, %al
setne %bl
negb %bl
movb 0x7356(%rip), %al       # 0x922c
orb %bpl, %al
je 0x1efc
pushq $0x1
popq %rdi
callq 0x287d
testb %bpl, %bpl
je 0x1e9f
callq 0x2526
testb %al, %al
je 0x1e9f
movb %r14b, 0x7330(%rip)     # 0x9228
movb $0x1, %bl
jmp 0x1e9f
xorl %edi, %edi
callq 0x287d
jmp 0x1e9f
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_bypass(unsigned char)
uint8_t mpu_set_bypass(uint8_t bypass_on)
{
	uint8_t tmp;

	if (st.chip_cfg.bypass_mode == bypass_on)
		return 0;

	if (bypass_on)
	{
		if (i2c_read(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		tmp &= ~BIT_AUX_IF_EN;
		if (i2c_write(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		delay_ms(3);
		tmp = BIT_BYPASS_EN;
		if (st.chip_cfg.active_low_int)
			tmp |= BIT_ACTL;
		if (st.chip_cfg.latched_int)
			tmp |= BIT_LATCH_EN | BIT_ANY_RD_CLR;
		if (i2c_write(st.hw->addr, st.reg->int_pin_cfg, 1, &tmp))
			return 1;
	}
	else
	{
		/* Enable I2C master mode if compass is being used. */
		if (i2c_read(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		if (st.chip_cfg.sensors & INV_XYZ_COMPASS)
			tmp |= BIT_AUX_IF_EN;
		else
			tmp &= ~BIT_AUX_IF_EN;
		if (i2c_write(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		delay_ms(3);
		if (st.chip_cfg.active_low_int)
			tmp = BIT_ACTL;
		else
			tmp = 0;
		if (st.chip_cfg.latched_int)
			tmp |= BIT_LATCH_EN | BIT_ANY_RD_CLR;
		if (i2c_write(st.hw->addr, st.reg->int_pin_cfg, 1, &tmp))
			return 1;
	}
	st.chip_cfg.bypass_mode = bypass_on;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
cmpb %bl, 0x731a(%rip)       # 0x922a
jne 0x1f1d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x72ec(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x72da(%rip), %rax      # 0x9208
movzbl 0x4(%rax), %esi
pushq $0x1
popq %rdx
leaq 0x7(%rsp), %rcx
callq 0x4847
movb $0x1, %bpl
testb %bl, %bl
je 0x1fa4
cmpb $-0x1, %al
je 0x1f14
leaq 0x7(%rsp), %rcx
andb $-0x21, (%rcx)
movq 0x72b7(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x72a5(%rip), %rax      # 0x9208
movzbl 0x4(%rax), %esi
pushq $0x1
popq %rdx
callq 0x4b0e
testl %eax, %eax
jne 0x1f14
movl $0xbb8, %edi            # imm = 0xBB8
callq 0x10e0
cmpb $0x0, 0x72b6(%rip)      # 0x923a
pushq $0x2
popq %rcx
movl $0x82, %eax
cmovel %ecx, %eax
movb %al, 0x7(%rsp)
cmpb $0x0, 0x72a1(%rip)      # 0x923b
je 0x2014
orb $0x30, %al
movb %al, 0x7(%rsp)
jmp 0x2014
cmpb $-0x1, %al
je 0x1f14
movb 0x7270(%rip), %al       # 0x9222
leaq 0x7(%rsp), %rcx
movb (%rcx), %dl
andb $-0x21, %dl
shlb $0x5, %al
andb $0x20, %al
orb %dl, %al
movb %al, (%rcx)
movq 0x7244(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x7232(%rip), %rax      # 0x9208
movzbl 0x4(%rax), %esi
pushq $0x1
popq %rdx
callq 0x4b0e
testl %eax, %eax
jne 0x1f14
movl $0xbb8, %edi            # imm = 0xBB8
callq 0x10e0
cmpb $0x0, 0x723f(%rip)      # 0x923a
setne %al
shlb $0x7, %al
movb %al, 0x7(%rsp)
cmpb $0x0, 0x722f(%rip)      # 0x923b
je 0x2014
orb $0x30, %al
movb %al, 0x7(%rsp)
movq 0x71f5(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x71e3(%rip), %rax      # 0x9208
movzbl 0x17(%rax), %esi
pushq $0x1
popq %rdx
leaq 0x7(%rsp), %rcx
callq 0x4b0e
testl %eax, %eax
jne 0x1f14
movb %bl, 0x71e6(%rip)       # 0x922a
jmp 0x1f12
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_int_latched(unsigned char)
uint8_t mpu_set_int_latched(uint8_t enable)
{
	uint8_t tmp;
	if (st.chip_cfg.latched_int == enable)
		return 0;

	if (enable)
		tmp = BIT_LATCH_EN | BIT_ANY_RD_CLR;
	else
		tmp = 0;
	if (st.chip_cfg.bypass_mode)
		tmp |= BIT_BYPASS_EN;
	if (st.chip_cfg.active_low_int)
		tmp |= BIT_ACTL;
	if (i2c_write(st.hw->addr, st.reg->int_pin_cfg, 1, &tmp))
		return 1;
	st.chip_cfg.latched_int = enable;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
xorl %eax, %eax
cmpb %bl, 0x7010(%rip)       # 0x923b
je 0x228b
testb %bl, %bl
pushq $0x30
popq %rcx
cmovel %eax, %ecx
movb %cl, 0xf(%rsp)
cmpb $0x0, 0x6fea(%rip)      # 0x922a
je 0x2249
orb $0x2, %cl
movb %cl, 0xf(%rsp)
cmpb $0x0, 0x6fea(%rip)      # 0x923a
je 0x2259
orb $-0x80, %cl
movb %cl, 0xf(%rsp)
movq 0x6fb0(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x6f9e(%rip), %rax      # 0x9208
movzbl 0x17(%rax), %esi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x4b0e
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
jne 0x228b
movb %bl, 0x6fb2(%rip)       # 0x923b
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_get_gyro_reg(short*)
uint8_t mpu_get_gyro_reg(int16_t *data)
{
	uint8_t tmp[6];

	if (!(st.chip_cfg.sensors & INV_XYZ_GYRO))
		return 1;

	if (i2c_read(st.hw->addr, st.reg->raw_gyro, 6, tmp))
		return 1;
	data[0] = (tmp[0] << 8) | tmp[1];
	data[1] = (tmp[2] << 8) | tmp[3];
	data[2] = (tmp[4] << 8) | tmp[5];
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb $0x1, %bpl
testb $0x70, 0x6f84(%rip)     # 0x9222
je 0x22f1
movq %rdi, %rbx
movq 0x6f66(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x6f54(%rip), %rax      # 0x9208
movzbl 0xe(%rax), %esi
pushq $0x6
popq %rdx
leaq 0x2(%rsp), %rcx
callq 0x4847
cmpb $-0x1, %al
je 0x22f1
movzwl 0x2(%rsp), %eax
rolw $0x8, %ax
movw %ax, (%rbx)
movzwl 0x4(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x2(%rbx)
movzwl 0x6(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x4(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_get_accel_reg(short*)
uint8_t mpu_get_accel_reg(int16_t *data)
{
	uint8_t tmp[6];

	if (!(st.chip_cfg.sensors & INV_XYZ_ACCEL))
		return 1;

	if (i2c_read(st.hw->addr, st.reg->raw_accel, 6, tmp))
		return 1;
	data[0] = (tmp[0] << 8) | tmp[1];
	data[1] = (tmp[2] << 8) | tmp[3];
	data[2] = (tmp[4] << 8) | tmp[5];
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb $0x1, %bpl
testb $0x8, 0x6f1b(%rip)      # 0x9222
je 0x235a
movq %rdi, %rbx
movq 0x6efd(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x6eeb(%rip), %rax      # 0x9208
movzbl 0xf(%rax), %esi
pushq $0x6
popq %rdx
leaq 0x2(%rsp), %rcx
callq 0x4847
cmpb $-0x1, %al
je 0x235a
movzwl 0x2(%rsp), %eax
rolw $0x8, %ax
movw %ax, (%rbx)
movzwl 0x4(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x2(%rbx)
movzwl 0x6(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x4(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_get_temperature(int*)
uint8_t mpu_get_temperature(int32_t *data)
{
	uint8_t tmp[2];
	int16_t raw;

	if (!(st.chip_cfg.sensors))
		return 1;

	if (i2c_read(st.hw->addr, st.reg->temp, 2, tmp))
		return 1;
	raw = (tmp[0] << 8) | tmp[1];

	data[0] = (int32_t)((35 + ((raw - (float)st.hw->temp_offset) / st.hw->temp_sens)) * 65536L);
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb $0x1, %bpl
cmpb $0x0, 0x6eb2(%rip)      # 0x9222
je 0x23e0
movq %rdi, %rbx
movq 0x6e94(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x6e82(%rip), %rax      # 0x9208
movzbl 0x10(%rax), %esi
pushq $0x2
popq %rdx
leaq 0x6(%rsp), %rcx
callq 0x4847
cmpb $-0x1, %al
je 0x23e0
movzwl 0x6(%rsp), %eax
rolw $0x8, %ax
cwtl
cvtsi2ss %eax, %xmm0
movq 0x6e60(%rip), %rax      # 0x9210
movswl 0x8(%rax), %ecx
cvtsi2ss %ecx, %xmm1
subss %xmm1, %xmm0
movzwl 0x6(%rax), %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
addss 0x311c(%rip), %xmm0     # 0x54ec
mulss 0x3118(%rip), %xmm0     # 0x54f0
cvttss2si %xmm0, %eax
movl %eax, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_accel_bias(int const*)
uint8_t mpu_set_accel_bias(const int32_t *accel_bias)
{
	uint8_t data[6];
	int16_t accel_hw[3];
	int16_t got_accel[3];
	int16_t fg[3];

	if (!accel_bias)
		return 1;
	if (!accel_bias[0] && !accel_bias[1] && !accel_bias[2])
		return 0;

	if (i2c_read(st.hw->addr, 3, 3, data))
		return 1;
	fg[0] = ((data[0] >> 4) + 8) & 0xf;
	fg[1] = ((data[1] >> 4) + 8) & 0xf;
	fg[2] = ((data[2] >> 4) + 8) & 0xf;

	accel_hw[0] = (int16_t)(accel_bias[0] * 2 / (64 + fg[0]));
	accel_hw[1] = (int16_t)(accel_bias[1] * 2 / (64 + fg[1]));
	accel_hw[2] = (int16_t)(accel_bias[2] * 2 / (64 + fg[2]));

	if (i2c_read(st.hw->addr, 0x06, 6, data))
		return 1;

	got_accel[0] = ((int16_t)data[0] << 8) | data[1];
	got_accel[1] = ((int16_t)data[2] << 8) | data[3];
	got_accel[2] = ((int16_t)data[4] << 8) | data[5];

	accel_hw[0] += got_accel[0];
	accel_hw[1] += got_accel[1];
	accel_hw[2] += got_accel[2];

	data[0] = (accel_hw[0] >> 8) & 0xff;
	data[1] = (accel_hw[0]) & 0xff;
	data[2] = (accel_hw[1] >> 8) & 0xff;
	data[3] = (accel_hw[1]) & 0xff;
	data[4] = (accel_hw[2] >> 8) & 0xff;
	data[5] = (accel_hw[2]) & 0xff;

	if (i2c_write(st.hw->addr, 0x06, 6, data))
		return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movb $0x1, %bl
testq %rdi, %rdi
je 0x2511
movq %rdi, %r14
cmpl $0x0, (%rdi)
jne 0x241c
cmpl $0x0, 0x4(%r14)
jne 0x241c
cmpl $0x0, 0x8(%r14)
je 0x2522
movq 0x6ded(%rip), %rax      # 0x9210
movzbl (%rax), %edi
pushq $0x3
popq %rdx
leaq 0xe(%rsp), %rcx
movl %edx, %esi
callq 0x4847
cmpb $-0x1, %al
je 0x2511
leaq 0xe(%rsp), %rcx
movzbl (%rcx), %r12d
movzbl 0x1(%rcx), %r13d
movzbl 0x2(%rcx), %ebp
movl (%r14), %eax
movl %eax, 0x14(%rsp)
movl 0x4(%r14), %r15d
movl 0x8(%r14), %r14d
movq 0x6dab(%rip), %rax      # 0x9210
movzbl (%rax), %edi
pushq $0x6
popq %rdx
movl %edx, %esi
callq 0x4847
cmpb $-0x1, %al
je 0x2511
addl %r14d, %r14d
shrl $0x4, %ebp
xorl $0x48, %ebp
movl %r14d, %eax
cltd
idivl %ebp
movl %eax, %esi
addl %r15d, %r15d
shrl $0x4, %r13d
xorl $0x48, %r13d
movl %r15d, %eax
cltd
idivl %r13d
movl %eax, %edi
movl 0x14(%rsp), %eax
addl %eax, %eax
shrl $0x4, %r12d
xorl $0x48, %r12d
cltd
idivl %r12d
movl %eax, %r8d
leaq 0xe(%rsp), %rcx
movzwl (%rcx), %eax
movzwl 0x2(%rcx), %edx
rolw $0x8, %ax
movzwl %ax, %eax
rolw $0x8, %dx
movzwl %dx, %edx
movzwl 0x4(%rcx), %r9d
rolw $0x8, %r9w
movzwl %r9w, %ebx
addl %r8d, %eax
addl %edi, %edx
addl %esi, %ebx
movb %ah, 0xe(%rsp)
movb %al, 0x1(%rcx)
movb %dh, 0x10(%rsp)
movb %dl, 0x3(%rcx)
movb %bh, 0x12(%rsp)
movb %bl, 0x5(%rcx)
movq 0x6d11(%rip), %rax      # 0x9210
movzbl (%rax), %edi
pushq $0x6
popq %rdx
movl %edx, %esi
callq 0x4b0e
testl %eax, %eax
setne %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x2511
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: set_int_enable(unsigned char)
static int set_int_enable(uint8_t enable)
{
	uint8_t tmp;

	if (st.chip_cfg.dmp_on)
	{
		if (enable)
			tmp = BIT_DMP_INT_EN;
		else
			tmp = 0x00;
		if (i2c_write(st.hw->addr, st.reg->int_enable, 1, &tmp))
			return 1;
		st.chip_cfg.int_enable = tmp;
	}
	else
	{
		if (!st.chip_cfg.sensors)
			return 1;
		if (enable && st.chip_cfg.int_enable)
			return 0;
		if (enable)
			tmp = BIT_DATA_RDY_EN;
		else
			tmp = 0x00;
		if (i2c_write(st.hw->addr, st.reg->int_enable, 1, &tmp))
			return 1;
		st.chip_cfg.int_enable = tmp;
	}
	return 0;
}

// Assembly:
pushq %rax
cmpb $0x0, 0x69b7(%rip)      # 0x923c
je 0x28c3
testb %dil, %dil
setne %al
addb %al, %al
leaq 0x7(%rsp), %rcx
movb %al, (%rcx)
movq 0x6973(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x6961(%rip), %rax      # 0x9208
movzbl 0x11(%rax), %esi
pushq $0x1
popq %rdx
callq 0x4b0e
testl %eax, %eax
jne 0x28da
movb 0x7(%rsp), %al
movb %al, 0x6968(%rip)       # 0x9229
jmp 0x28da
cmpb $0x0, 0x6958(%rip)      # 0x9222
je 0x28da
testb %dil, %dil
je 0x28dc
cmpb $0x0, 0x6951(%rip)      # 0x9229
je 0x28dc
popq %rax
retq
testb %dil, %dil
leaq 0x7(%rsp), %rcx
setne (%rcx)
jmp 0x2896
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_read_fifo_stream(unsigned short, unsigned char*, unsigned char*)
uint8_t mpu_read_fifo_stream(uint16_t length, uint8_t *data,
														 uint8_t *more)
{
	uint8_t tmp[2];
	uint16_t fifo_count;
	if (!st.chip_cfg.dmp_on)
    {
		return 1;
    }
	if (!st.chip_cfg.sensors)
    {
		return 1;
    }

	if (i2c_read(st.hw->addr, st.reg->fifo_count_h, 2, tmp))
		return 1;
	fifo_count = (tmp[0] << 8) | tmp[1];
	if (fifo_count < length)
	{
		more[0] = 0;
		return 1;
	}
	if (fifo_count > (st.hw->max_fifo >> 1))
	{
		/* FIFO is 50% full, better check overflow bit. */
		if (i2c_read(st.hw->addr, st.reg->int_status, 1, tmp))
			return 1;
		if (tmp[0] & BIT_FIFO_OVERFLOW)
		{
			mpu_reset_fifo();
			return 2;
		}
	}
#if defined MPU_DEBUG
    printf_P("FIFO count: %hd\r\n", fifo_count);
#endif

	if (i2c_read(st.hw->addr, st.reg->fifo_r_w, length, data))
		return 1;
	more[0] = fifo_count / length - 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, 0x66b7(%rip)      # 0x923c
movb $0x1, %bl
je 0x2c5c
cmpb $0x0, 0x668e(%rip)      # 0x9222
je 0x2c5c
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movq 0x6667(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x6655(%rip), %rax      # 0x9208
movzbl 0xc(%rax), %esi
pushq $0x2
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x4847
cmpb $-0x1, %al
je 0x2c5c
movzwl 0xe(%rsp), %r12d
rolw $0x8, %r12w
movzwl %r12w, %ecx
movzwl %bp, %eax
cmpl %eax, %ecx
jae 0x2be8
movb $0x0, (%r14)
jmp 0x2c5c
movq 0x6621(%rip), %rax      # 0x9210
movzwl 0x2(%rax), %edx
shrl %edx
cmpl %edx, %ecx
jbe 0x2c26
movzbl (%rax), %edi
movq 0x6605(%rip), %rax      # 0x9208
movzbl 0x13(%rax), %esi
pushq $0x1
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x4847
cmpb $-0x1, %al
je 0x2c5c
testb $0x10, 0xe(%rsp)
jne 0x2c55
movq 0x65ea(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x65d8(%rip), %rax      # 0x9208
movzbl 0xd(%rax), %esi
movzbl %bpl, %edx
movq %r15, %rcx
callq 0x4847
cmpb $-0x1, %al
je 0x2c5c
xorl %ebx, %ebx
movl %r12d, %eax
xorl %edx, %edx
divw %bp
decb %al
movb %al, (%r14)
jmp 0x2c5c
callq 0x2526
movb $0x2, %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_dmp_state(unsigned char)
uint8_t mpu_set_dmp_state(uint8_t enable)
{
	uint8_t tmp;
	if (st.chip_cfg.dmp_on == enable)
		return 0;

	if (enable)
	{
		if (!st.chip_cfg.dmp_loaded)
			return 1;
		/* Disable data ready interrupt. */
		set_int_enable(0);
		/* Disable bypass mode. */
		mpu_set_bypass(0);
		/* Keep constant sample rate, FIFO rate controlled by DMP. */
		mpu_set_sample_rate(st.chip_cfg.dmp_sample_rate);
		/* Remove FIFO elements. */
		tmp = 0;
		i2c_write(st.hw->addr, 0x23, 1, &tmp);
		st.chip_cfg.dmp_on = 1;
		/* Enable DMP interrupt. */
		set_int_enable(1);
		mpu_reset_fifo();
	}
	else
	{
		/* Disable DMP interrupt. */
		set_int_enable(0);
		/* Restore FIFO settings. */
		tmp = st.chip_cfg.fifo_enable;
		i2c_write(st.hw->addr, 0x23, 1, &tmp);
		st.chip_cfg.dmp_on = 0;
		mpu_reset_fifo();
	}
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpb %dil, 0x6231(%rip)      # 0x923c
je 0x30a1
testb %dil, %dil
je 0x306c
cmpb $0x0, 0x6220(%rip)      # 0x923d
je 0x30a9
xorl %edi, %edi
callq 0x287d
xorl %edi, %edi
callq 0x1f05
movzwl 0x6206(%rip), %edi      # 0x923e
callq 0x1dcd
leaq 0xf(%rsp), %rcx
movb $0x0, (%rcx)
movq 0x61c4(%rip), %rax      # 0x9210
movzbl (%rax), %edi
pushq $0x23
popq %rsi
pushq $0x1
popq %rbx
movl %ebx, %edx
callq 0x4b0e
movb $0x1, 0x61d9(%rip)      # 0x923c
movl %ebx, %edi
callq 0x287d
jmp 0x309c
xorl %edi, %edi
callq 0x287d
movb 0x61af(%rip), %al       # 0x9228
leaq 0xf(%rsp), %rcx
movb %al, (%rcx)
movq 0x6189(%rip), %rax      # 0x9210
movzbl (%rax), %edi
pushq $0x23
popq %rsi
pushq $0x1
popq %rdx
callq 0x4b0e
movb $0x0, 0x61a0(%rip)      # 0x923c
callq 0x2526
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
movb $0x1, %al
jmp 0x30a3
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_write_mem(unsigned short, unsigned short, unsigned char*)
uint8_t mpu_write_mem(uint16_t mem_addr, uint16_t length,
											uint8_t *data)
{
	uint8_t tmp[2];

	if (!data)
		return 1;
	if (!st.chip_cfg.sensors)
		return 1;

	tmp[0] = (uint8_t)(mem_addr >> 8);
	tmp[1] = (uint8_t)(mem_addr & 0xFF);

	/* Check bank boundaries. */
	if (tmp[1] + length > st.hw->bank_size)
		return 1;

	if (i2c_write(st.hw->addr, st.reg->bank_sel, 2, tmp))
		return 1;
	if (i2c_write(st.hw->addr, st.reg->mem_r_w, length, data))
		return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x1, %bpl
testq %rdx, %rdx
je 0x361f
cmpb $0x0, 0x5c75(%rip)      # 0x9222
je 0x361f
movq %rdx, %rbx
movl %esi, %r14d
movl %edi, %eax
rolw $0x8, %ax
movw %ax, 0xe(%rsp)
movzbl %dil, %eax
movzwl %r14w, %ecx
addl %eax, %ecx
movq 0x5c3f(%rip), %rax      # 0x9210
movzwl 0xa(%rax), %edx
cmpl %edx, %ecx
ja 0x361f
movzbl (%rax), %edi
movq 0x5c25(%rip), %rax      # 0x9208
movzbl 0x1b(%rax), %esi
pushq $0x2
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x4b0e
testl %eax, %eax
jne 0x361f
movq 0x5c11(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x5bff(%rip), %rax      # 0x9208
movzbl 0x18(%rax), %esi
movzbl %r14b, %edx
movq %rbx, %rcx
callq 0x4b0e
testl %eax, %eax
setne %bpl
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_load_firmware(unsigned short, unsigned char const*, unsigned short, unsigned short)
uint8_t mpu_load_firmware(uint16_t length, const uint8_t *firmware,
													uint16_t start_addr, uint16_t sample_rate)
{
	uint16_t ii;
	uint16_t this_write;
	uint8_t *pgm_buf;
	uint8_t jj;
	/* Must divide evenly into st.hw->bank_size to avoid bank crossings. */
#define LOAD_CHUNK  (16)
	uint8_t cur[LOAD_CHUNK], tmp[2];
	pgm_buf = (uint8_t *)malloc(LOAD_CHUNK);

	if (st.chip_cfg.dmp_loaded)
		/* DMP should only be loaded once. */
		return 1;

	if (!firmware)
		return 1;
	for (ii = 0; ii < length; ii += this_write)
	{
		this_write = min(LOAD_CHUNK, length - ii);		
		for (jj = 0; jj < LOAD_CHUNK; jj++) pgm_buf[jj] = firmware[ii+jj];//pgm_read_byte(firmware + ii + jj);
		if (mpu_write_mem(ii, this_write, pgm_buf))
			return 1;
		if (mpu_read_mem(ii, this_write, cur))
			return 1;
		if (memcmp(pgm_buf, cur, this_write))
			return 2;
	}

	/* Set program start address. */
	tmp[0] = start_addr >> 8;
	tmp[1] = start_addr & 0xFF;
	if (i2c_write(st.hw->addr, st.reg->prgm_start_h, 2, tmp))
		return 1;

	st.chip_cfg.dmp_loaded = 1;
	st.chip_cfg.dmp_sample_rate = sample_rate;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r15
movl %edi, 0xc(%rsp)
pushq $0x10
popq %rdi
callq 0x10b0
movq %rax, %r13
movb $0x1, %al
testq %r15, %r15
je 0x37d2
cmpb $0x0, 0x5b49(%rip)      # 0x923d
jne 0x37d2
movl %ebp, 0x14(%rsp)
movl %ebx, 0x10(%rsp)
movzwl 0xc(%rsp), %eax
movl %eax, 0x18(%rsp)
xorl %ebp, %ebp
leaq 0x20(%rsp), %r12
cmpw 0xc(%rsp), %bp
jae 0x378b
movzwl %bp, %ebp
movl 0x18(%rsp), %r14d
subl %ebp, %r14d
cmpl $0x10, %r14d
pushq $0x10
popq %rax
cmovgel %eax, %r14d
movl %ebp, %eax
addq %r15, %rax
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x3749
movb (%rax,%rcx), %dl
movb %dl, (%r13,%rcx)
incq %rcx
jmp 0x3736
movzwl %r14w, %ebx
movl %ebp, %edi
movl %ebx, %esi
movq %r13, %rdx
callq 0x3596
testb %al, %al
jne 0x3787
movl %ebp, %edi
movl %ebx, %esi
movq %r12, %rdx
callq 0x362a
testb %al, %al
jne 0x3787
movzwl %r14w, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x10a0
addl %r14d, %ebp
testl %eax, %eax
je 0x3712
movb $0x2, %al
jmp 0x37d2
movb $0x1, %al
jmp 0x37d2
movl 0x14(%rsp), %eax
rolw $0x8, %ax
leaq 0x1e(%rsp), %rcx
movw %ax, (%rcx)
movq 0x5a6e(%rip), %rax      # 0x9210
movzbl (%rax), %edi
movq 0x5a5c(%rip), %rax      # 0x9208
movzbl 0x1d(%rax), %esi
pushq $0x2
popq %rdx
callq 0x4b0e
testl %eax, %eax
movb $0x1, %al
jne 0x37d2
movb $0x1, 0x5a78(%rip)      # 0x923d
movl 0x10(%rsp), %eax
movw %ax, 0x5a6e(%rip)       # 0x923e
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_orientation(unsigned short)
uint8_t dmp_set_orientation(uint16_t orient)
{
	uint8_t gyro_regs[3], accel_regs[3];
	const uint8_t gyro_axes[3] = {DINA4C, DINACD, DINA6C};
	const uint8_t accel_axes[3] = {DINA0C, DINAC9, DINA2C};
	const uint8_t gyro_sign[3] = {DINA36, DINA56, DINA76};
	const uint8_t accel_sign[3] = {DINA26, DINA46, DINA66};

	gyro_regs[0] = gyro_axes[orient & 3];
	gyro_regs[1] = gyro_axes[(orient >> 3) & 3];
	gyro_regs[2] = gyro_axes[(orient >> 6) & 3];
	accel_regs[0] = accel_axes[orient & 3];
	accel_regs[1] = accel_axes[(orient >> 3) & 3];
	accel_regs[2] = accel_axes[(orient >> 6) & 3];

	/* Chip-to-body, axes only. */
	if (mpu_write_mem(FCFG_1, 3, gyro_regs))
		return 1;
	if (mpu_write_mem(FCFG_2, 3, accel_regs))
		return 1;

	memcpy(gyro_regs, gyro_sign, 3);
	memcpy(accel_regs, accel_sign, 3);
	if (orient & 4)
	{
		gyro_regs[0] |= 1;
		accel_regs[0] |= 1;
	}
	if (orient & 0x20)
	{
		gyro_regs[1] |= 1;
		accel_regs[1] |= 1;
	}
	if (orient & 0x100)
	{
		gyro_regs[2] |= 1;
		accel_regs[2] |= 1;
	}

	/* Chip-to-body, sign only. */
	if (mpu_write_mem(FCFG_3, 3, gyro_regs))
		return 1;
	if (mpu_write_mem(FCFG_7, 3, accel_regs))
		return 1;
	dmp.orient = orient;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %eax
andl $0x3, %eax
leaq 0x26b2(%rip), %rcx      # 0x6196
movb (%rax,%rcx), %sil
leaq 0x4(%rsp), %rdx
movb %sil, (%rdx)
movl %edi, %esi
shrl $0x3, %esi
andl $0x3, %esi
movb (%rsi,%rcx), %dil
movb %dil, 0x1(%rdx)
movl %ebx, %edi
shrl $0x6, %edi
andl $0x3, %edi
movb (%rdi,%rcx), %cl
movb %cl, 0x2(%rdx)
leaq 0x2684(%rip), %rcx      # 0x6199
movb (%rax,%rcx), %al
movb %al, (%rsp)
movb (%rsi,%rcx), %al
movb %al, 0x1(%rsp)
movb (%rdi,%rcx), %al
movb %al, 0x2(%rsp)
pushq $0x3
popq %rsi
movl $0x426, %edi            # imm = 0x426
callq 0x3596
movb $0x1, %bpl
testb %al, %al
jne 0x3bcc
pushq $0x3
popq %rsi
movq %rsp, %rdx
movl $0x42a, %edi            # imm = 0x42A
callq 0x3596
testb %al, %al
jne 0x3bcc
movb $0x76, 0x6(%rsp)
movw $0x5636, 0x4(%rsp)      # imm = 0x5636
movw $0x4626, (%rsp)         # imm = 0x4626
movb $0x66, 0x2(%rsp)
testb $0x4, %bl
je 0x3b7a
movb $0x37, 0x4(%rsp)
movb $0x27, (%rsp)
testb $0x20, %bl
je 0x3b89
movb $0x57, 0x5(%rsp)
movb $0x47, 0x1(%rsp)
btl $0x8, %ebx
jae 0x3b99
movb $0x77, 0x6(%rsp)
movb $0x67, 0x2(%rsp)
pushq $0x3
popq %rsi
leaq 0x4(%rsp), %rdx
movl $0x440, %edi            # imm = 0x440
callq 0x3596
testb %al, %al
jne 0x3bcc
pushq $0x3
popq %rsi
movq %rsp, %rdx
movl $0x431, %edi            # imm = 0x431
callq 0x3596
testb %al, %al
jne 0x3bcc
movw %bx, 0x5686(%rip)       # 0x9250
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_fifo_rate(unsigned short)
uint8_t dmp_set_fifo_rate(uint16_t rate)
{
	const uint8_t regs_end[12] = {DINAFE, DINAF2, DINAAB,
																0xc4, DINAAA, DINAF1, DINADF, DINADF, 0xBB, 0xAF, DINADF, DINADF
															 };
	uint16_t div;
	uint8_t tmp[8];

	if (rate > DMP_SAMPLE_RATE)
		return 1;
	div = DMP_SAMPLE_RATE / rate - 1;
	tmp[0] = (uint8_t)((div >> 8) & 0xFF);
	tmp[1] = (uint8_t)(div & 0xFF);
	if (mpu_write_mem(D_0_22, 2, tmp))
		return 1;
	if (mpu_write_mem(CFG_6, 12, (uint8_t*)regs_end))
		return 1;

	dmp.fifo_rate = rate;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebp
movabsq $-0x20200e553b540d02, %rax # imm = 0xDFDFF1AAC4ABF2FE
movq %rax, (%rsp)
movl $0xdfdfafbb, 0x8(%rsp)  # imm = 0xDFDFAFBB
movb $0x1, %bl
cmpw $0xc8, %bp
ja 0x3e81
movb $-0x38, %al
movzbl %al, %eax
divb %bpl
leaq 0x10(%rsp), %rdx
movb $0x0, (%rdx)
decb %al
movb %al, 0x1(%rdx)
pushq $0x2
popq %rsi
movl $0x216, %edi            # imm = 0x216
callq 0x3596
testb %al, %al
jne 0x3e81
pushq $0xc
popq %rsi
movq %rsp, %rdx
movl $0xac1, %edi            # imm = 0xAC1
callq 0x3596
testb %al, %al
jne 0x3e81
movw %bp, 0x53dd(%rip)       # 0x925c
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_tap_axes(unsigned char)
uint8_t dmp_set_tap_axes(uint8_t axis)
{
	uint8_t tmp = 0;

	if (axis & TAP_X)
		tmp |= 0x30;
	if (axis & TAP_Y)
		tmp |= 0x0C;
	if (axis & TAP_Z)
		tmp |= 0x03;
	return mpu_write_mem(D_1_72, 1, &tmp);
}

// Assembly:
pushq %rax
movl %edi, %eax
andl $0x1, %eax
pushq $0x30
popq %rcx
cmovel %eax, %ecx
leal 0xc(%rcx), %eax
testb $0x2, %dil
movzbl %al, %eax
cmovel %ecx, %eax
movl %eax, %ecx
orb $0x3, %cl
testb $0x4, %dil
movzbl %cl, %ecx
cmovel %eax, %ecx
leaq 0x7(%rsp), %rdx
movb %cl, (%rdx)
pushq $0x1
popq %rsi
movl $0x148, %edi            # imm = 0x148
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_tap_count(unsigned char)
uint8_t dmp_set_tap_count(uint8_t min_taps)
{
	uint8_t tmp;

	if (min_taps < 1)
		min_taps = 1;
	else if (min_taps > 4)
		min_taps = 4;

	tmp = min_taps - 1;
	return mpu_write_mem(D_1_79, 1, &tmp);
}

// Assembly:
testl %edi, %edi
je 0x4034
movzbl %dil, %ecx
cmpb $0x4, %cl
pushq $0x4
popq %rax
cmovbl %ecx, %eax
decb %al
jmp 0x4036
xorl %eax, %eax
pushq %rax
leaq 0x7(%rsp), %rdx
movb %al, (%rdx)
pushq $0x1
popq %rsi
movl $0x14f, %edi            # imm = 0x14F
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_tap_time(unsigned short)
uint8_t dmp_set_tap_time(uint16_t time)
{
	uint16_t dmp_time;
	uint8_t tmp[2];

	dmp_time = time / (1000 / DMP_SAMPLE_RATE);
	tmp[0] = (uint8_t)(dmp_time >> 8);
	tmp[1] = (uint8_t)(dmp_time & 0xFF);
	return mpu_write_mem(DMP_TAPW_MIN, 2, tmp);
}

// Assembly:
pushq %rax
movl %edi, %eax
movw $0x5, %cx
xorl %edx, %edx
divw %cx
rolw $0x8, %ax
leaq 0x6(%rsp), %rdx
movw %ax, (%rdx)
pushq $0x2
popq %rsi
movl $0x1de, %edi            # imm = 0x1DE
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_tap_time_multi(unsigned short)
uint8_t dmp_set_tap_time_multi(uint16_t time)
{
	uint16_t dmp_time;
	uint8_t tmp[2];

	dmp_time = time / (1000 / DMP_SAMPLE_RATE);
	tmp[0] = (uint8_t)(dmp_time >> 8);
	tmp[1] = (uint8_t)(dmp_time & 0xFF);
	return mpu_write_mem(D_1_218, 2, tmp);
}

// Assembly:
pushq %rax
movl %edi, %eax
movw $0x5, %cx
xorl %edx, %edx
divw %cx
rolw $0x8, %ax
leaq 0x6(%rsp), %rdx
movw %ax, (%rdx)
pushq $0x2
popq %rsi
movl $0x1da, %edi            # imm = 0x1DA
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_shake_reject_thresh(int, unsigned short)
uint8_t dmp_set_shake_reject_thresh(int32_t sf, uint16_t thresh)
{
	uint8_t tmp[4];
	int32_t thresh_scaled = sf / 1000 * thresh;
	tmp[0] = (uint8_t)(((int32_t)thresh_scaled >> 24) & 0xFF);
	tmp[1] = (uint8_t)(((int32_t)thresh_scaled >> 16) & 0xFF);
	tmp[2] = (uint8_t)(((int32_t)thresh_scaled >> 8) & 0xFF);
	tmp[3] = (uint8_t)((int32_t)thresh_scaled & 0xFF);
	return mpu_write_mem(D_1_92, 4, tmp);
}

// Assembly:
pushq %rax
movl %edi, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
imull %esi, %eax
bswapl %eax
leaq 0x4(%rsp), %rdx
movl %eax, (%rdx)
pushq $0x4
popq %rsi
movl $0x15c, %edi            # imm = 0x15C
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_shake_reject_time(unsigned short)
uint8_t dmp_set_shake_reject_time(uint16_t time)
{
	uint8_t tmp[2];

	time /= (1000 / DMP_SAMPLE_RATE);
	tmp[0] = time >> 8;
	tmp[1] = time & 0xFF;
	return mpu_write_mem(D_1_90,2,tmp);
}

// Assembly:
pushq %rax
movl %edi, %eax
movw $0x5, %cx
xorl %edx, %edx
divw %cx
rolw $0x8, %ax
leaq 0x6(%rsp), %rdx
movw %ax, (%rdx)
pushq $0x2
popq %rsi
movl $0x15a, %edi            # imm = 0x15A
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_shake_reject_timeout(unsigned short)
uint8_t dmp_set_shake_reject_timeout(uint16_t time)
{
	uint8_t tmp[2];

	time /= (1000 / DMP_SAMPLE_RATE);
	tmp[0] = time >> 8;
	tmp[1] = time & 0xFF;
	return mpu_write_mem(D_1_88,2,tmp);
}

// Assembly:
pushq %rax
movl %edi, %eax
movw $0x5, %cx
xorl %edx, %edx
divw %cx
rolw $0x8, %ax
leaq 0x6(%rsp), %rdx
movw %ax, (%rdx)
pushq $0x2
popq %rsi
movl $0x158, %edi            # imm = 0x158
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_get_pedometer_step_count(unsigned int*)
uint8_t dmp_get_pedometer_step_count(uint32_t *count)
{
	uint8_t tmp[4];
	if (!count)
		return 1;

	if (mpu_read_mem(D_PEDSTD_STEPCTR, 4, tmp))
		return 1;

	count[0] = ((uint32_t)tmp[0] << 24) | ((uint32_t)tmp[1] << 16) |
						 ((uint32_t)tmp[2] << 8) | tmp[3];
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movb $0x1, %bl
testq %rdi, %rdi
je 0x413e
movq %rdi, %r14
pushq $0x4
popq %rsi
leaq 0x4(%rsp), %rdx
movl $0x360, %edi            # imm = 0x360
callq 0x362a
testb %al, %al
jne 0x413e
movl 0x4(%rsp), %eax
bswapl %eax
movl %eax, (%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_get_pedometer_walk_time(unsigned int*)
uint8_t dmp_get_pedometer_walk_time(uint32_t *time)
{
	uint8_t tmp[4];
	if (!time)
		return 1;

	if (mpu_read_mem(D_PEDSTD_TIMECTR, 4, tmp))
		return 1;

	time[0] = (((uint32_t)tmp[0] << 24) | ((uint32_t)tmp[1] << 16) |
						 ((uint32_t)tmp[2] << 8) | tmp[3]) * 20;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movb $0x1, %bl
testq %rdi, %rdi
je 0x4193
movq %rdi, %r14
pushq $0x4
popq %rsi
leaq 0x4(%rsp), %rdx
movl $0x3c4, %edi            # imm = 0x3C4
callq 0x362a
testb %al, %al
jne 0x4193
movl 0x4(%rsp), %eax
bswapl %eax
imull $0x14, %eax, %eax
movl %eax, (%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_pedometer_walk_time(unsigned int)
uint8_t dmp_set_pedometer_walk_time(uint32_t time)
{
	uint8_t tmp[4];

	time /= 20;

	tmp[0] = (uint8_t)((time >> 24) & 0xFF);
	tmp[1] = (uint8_t)((time >> 16) & 0xFF);
	tmp[2] = (uint8_t)((time >> 8) & 0xFF);
	tmp[3] = (uint8_t)(time & 0xFF);
	return mpu_write_mem(D_PEDSTD_TIMECTR, 4, tmp);
}

// Assembly:
pushq %rax
movl %edi, %eax
pushq $0x14
popq %rcx
xorl %edx, %edx
divl %ecx
bswapl %eax
leaq 0x4(%rsp), %rdx
movl %eax, (%rdx)
pushq $0x4
popq %rsi
movl $0x3c4, %edi            # imm = 0x3C4
callq 0x3596
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu_dmp_motion_driver.c
// Function: dmp_set_interrupt_mode(unsigned char)
uint8_t dmp_set_interrupt_mode(uint8_t mode)
{
	const uint8_t regs_continuous[11] =
	{0xd8, 0xb1, 0xb9, 0xf3, 0x8b, 0xa3, 0x91, 0xb6, 0x09, 0xb4, 0xd9};
	const uint8_t regs_gesture[11] =
	{0xda, 0xb1, 0xb9, 0xf3, 0x8b, 0xa3, 0x91, 0xb6, 0xda, 0xb4, 0xda};

	switch (mode)
	{
	case DMP_INT_CONTINUOUS:
		return mpu_write_mem(CFG_FIFO_ON_EVENT, 11,
												 (uint8_t*)regs_continuous);
	case DMP_INT_GESTURE:
		return mpu_write_mem(CFG_FIFO_ON_EVENT, 11,
												 (uint8_t*)regs_gesture);
	default:
		return 1;
	}
}

// Assembly:
subq $0x28, %rsp
movabsq $-0x496e5c740c464e28, %rax # imm = 0xB691A38BF3B9B1D8
movq %rax, 0x18(%rsp)
movl $0xd9b409b6, 0x1f(%rsp) # imm = 0xD9B409B6
movabsq $-0x496e5c740c464e26, %rax # imm = 0xB691A38BF3B9B1DA
movq %rax, 0x8(%rsp)
movl $0xdab4dab6, 0xf(%rsp)  # imm = 0xDAB4DAB6
cmpl $0x2, %edi
je 0x4549
movb $0x1, %al
cmpl $0x1, %edi
jne 0x455b
leaq 0x8(%rsp), %rdx
jmp 0x454e
leaq 0x18(%rsp), %rdx
pushq $0xb
popq %rsi
movl $0xa82, %edi            # imm = 0xA82
callq 0x3596
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/libs/I2Cdev/I2Cdev.c
// Function: readBit(unsigned char, unsigned char, unsigned char, unsigned char*)
int8_t readBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t *data) {
    uint8_t b;
    uint8_t count = readByte(devAddr, regAddr, &b);
    *data = b & (1 << bitNum);
    return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movl %edx, %ebp
leaq 0xf(%rsp), %r14
movq %r14, %rdx
callq 0x47af
pushq $0x1
popq %rdx
movl %ebp, %ecx
shll %cl, %edx
andb (%r14), %dl
movb %dl, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/libs/I2Cdev/I2Cdev.c
// Function: readBitW(unsigned char, unsigned char, unsigned char, unsigned short*)
int8_t readBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t *data) {
    uint16_t b;
    uint8_t count = readWord(devAddr, regAddr, &b);
    *data = b & (1 << bitNum);
    return count;
}

// Assembly:
pushq %rbx
movq %rcx, %rbx
leaq 0x1b81(%rip), %rdi      # 0x6346
callq 0x1110
andw $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/libs/I2Cdev/I2Cdev.c
// Function: readBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*)
int8_t readBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t *data) {
    // 01101001 read byte
    // 76543210 bit numbers
    //    xxx   args: bitStart=4, length=3
    //    010   masked
    //   -> 010 shifted
    uint8_t count, b;
    if ((count = readByte(devAddr, regAddr, &b)) != 0) {
        uint8_t mask = ((1 << length) - 1) << (bitStart - length + 1);
        b &= mask;
        b >>= (bitStart - length + 1);
        *data = b;
    }
    return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movl %ecx, %r14d
movl %edx, %ebp
leaq 0xf(%rsp), %rdx
callq 0x47af
testb %al, %al
je 0x482d
movzbl %r14b, %ecx
pushq $-0x1
popq %rsi
shll %cl, %esi
notl %esi
movzbl %bpl, %edx
subl %ecx, %edx
incb %dl
movl %edx, %ecx
shll %cl, %esi
andb 0xf(%rsp), %sil
movzbl %sil, %esi
shrl %cl, %esi
movb %sil, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq