#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int, int);
int mpu_reset_fifo();
int /*<<< orphan*/ mpu_write_mem(int, int, unsigned char *);
int dmp_enable_6x_lp_quat(unsigned char enable) {
  unsigned char regs[4];
  if (enable) {
    regs[0] = 0x20;
    regs[1] = 0x28;
    regs[2] = 0x30;
    regs[3] = 0x38;
  } else
    memset(regs, 0xA3, 4);
  mpu_write_mem((2718), 4, regs);
  return mpu_reset_fifo();
}


x86 assembly (clang, -O0):
<dmp_enable_6x_lp_quat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     115d <dmp_enable_6x_lp_quat+0x2d>
movb   $0x20,-0x5(%rbp)
movb   $0x28,-0x4(%rbp)
movb   $0x30,-0x3(%rbp)
movb   $0x38,-0x2(%rbp)
jmp    1170 <dmp_enable_6x_lp_quat+0x40>
lea    -0x5(%rbp),%rdi
mov    $0xa3,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x5(%rbp),%rdx
mov    $0xa9e,%edi
mov    $0x4,%esi
call   1050 <mpu_write_mem@plt>
mov    $0x0,%al
call   1040 <mpu_reset_fifo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmp_enable_6x_lp_quat>:
push   %rax
test   %edi,%edi
je     113f <dmp_enable_6x_lp_quat+0xf>
movl   $0x38302820,0x4(%rsp)
38
jmp    1153 <dmp_enable_6x_lp_quat+0x23>
lea    0x4(%rsp),%rdi
mov    $0xa3,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    0x4(%rsp),%rdx
mov    $0xa9e,%edi
mov    $0x4,%esi
call   1050 <mpu_write_mem@plt>
xor    %eax,%eax
call   1040 <mpu_reset_fifo@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dmp_enable_6x_lp_quat(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [4 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 32, i8* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 40, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 48, i8* %9
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 56, i8* %10
br label %14
11: ; preds = %1
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%13 = call i32 @memset(i8* %12, i32 163, i32 4)
br label %14
14: ; preds = %11, %6
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%16 = call i32 @mpu_write_mem(i32 2718, i32 4, i8* %15)
%17 = call i32 (...) @mpu_reset_fifo()
ret i32 %17
}

LLVM IR (-O2):
define i32 @dmp_enable_6x_lp_quat(i8 zeroext %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %1
store i8 32, i8* %3
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 40, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 48, i8* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 56, i8* %8
br label %11
9: ; preds = %1
%10 = call i32 @memset(i8* %3, i32 163, i32 4)
br label %11
11: ; preds = %9, %5
%12 = call i32 @mpu_write_mem(i32 2718, i32 4, i8* %3)
%13 = call i32 (...) @mpu_reset_fifo()
ret i32 %13
}