#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 mpu_write_mem(int, int, unsigned char *);
int dmp_enable_gyro_cal(unsigned char enable) {
  if (enable) {
    unsigned char regs[9] = {0xb8, 0xaa, 0xb3, 0x8d, 0xb4,
                             0x98, 0x0d, 0x35, 0x5d};
    return mpu_write_mem((1208), 9, regs);
  } else {
    unsigned char regs[9] = {0xb8, 0xaa, 0xaa, 0xaa, 0xb0,
                             0x88, 0xc3, 0xc5, 0xc7};
    return mpu_write_mem((1208), 9, regs);
  }
}


x86 assembly (clang, -O0):
<dmp_enable_gyro_cal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
je     1157 <dmp_enable_gyro_cal+0x47>
mov    0xed1(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x6(%rbp)
lea    -0xe(%rbp),%rdx
mov    $0x4b8,%edi
mov    $0x9,%esi
call   1030 <mpu_write_mem@plt>
mov    %eax,-0x4(%rbp)
jmp    1181 <dmp_enable_gyro_cal+0x71>
mov    0xeab(%rip),%rax
mov    %rax,-0x17(%rbp)
mov    0xea9(%rip),%al
mov    %al,-0xf(%rbp)
lea    -0x17(%rbp),%rdx
mov    $0x4b8,%edi
mov    $0x9,%esi
call   1030 <mpu_write_mem@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmp_enable_gyro_cal>:
sub    $0x18,%rsp
test   %edi,%edi
je     112e <dmp_enable_gyro_cal+0x1e>
movabs $0x350d98b48db3aab8,%rax
98 0d 35
mov    %rax,0x8(%rsp)
movb   $0x5d,0x10(%rsp)
jmp    1142 <dmp_enable_gyro_cal+0x32>
movabs $0xc5c388b0aaaaaab8,%rax
88 c3 c5
mov    %rax,0x8(%rsp)
movb   $0xc7,0x10(%rsp)
lea    0x8(%rsp),%rdx
mov    $0x4b8,%edi
mov    $0x9,%esi
call   1030 <mpu_write_mem@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.dmp_enable_gyro_cal.regs = [9 x i8] c"\B8\AA\B3\8D\B4\98\0D5]"
@__const.dmp_enable_gyro_cal.regs.1 = [9 x i8] c"\B8\AA\AA\AA\B0\88\C3\C5\C7"
define i32 @dmp_enable_gyro_cal(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [9 x i8]
%5 = alloca [9 x i8]
store i8 %0, i8* %3
%6 = load i8, i8* %3
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = bitcast [9 x i8]* %4 to i8*
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%11 = call i32 @mpu_write_mem(i32 1208, i32 9, i8* %10)
store i32 %11, i32* %2
br label %16
12: ; preds = %1
%13 = bitcast [9 x i8]* %5 to i8*
%14 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%15 = call i32 @mpu_write_mem(i32 1208, i32 9, i8* %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@__const.dmp_enable_gyro_cal.regs = [9 x i8] c"\B8\AA\B3\8D\B4\98\0D5]"
@__const.dmp_enable_gyro_cal.regs.1 = [9 x i8] c"\B8\AA\AA\AA\B0\88\C3\C5\C7"
define i32 @dmp_enable_gyro_cal(i8 zeroext %0) {
%2 = alloca [9 x i8]
%3 = alloca [9 x i8]
%4 = icmp eq i8 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = call i32 @mpu_write_mem(i32 1208, i32 9, i8* %6)
br label %11
8: ; preds = %1
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%10 = call i32 @mpu_write_mem(i32 1208, i32 9, i8* %9)
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
ret i32 %12
}