#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*/ MLDLSetMemoryMPU(int, int, unsigned char *);
unsigned short MPUGetFIFO(unsigned char, unsigned char *);
unsigned short MLDLGetDMPData(unsigned char src, unsigned char *buffer,
                              unsigned char len) {
  unsigned short length;
  unsigned char regs[1] = {1};
  length = MPUGetFIFO(len, buffer);
  if (src == 2) {
  } else {
    if (MLDLSetMemoryMPU(
            (((((((((((((((((((((((((((((((((((((((((0) + 1) + 1) + 1) + 1) +
                                                1) +
                                               1) +
                                              1) +
                                             1) +
                                            1) +
                                           1) +
                                          1) +
                                         1) +
                                        1) +
                                       1) +
                                      1) +
                                     1) +
                                    1) +
                                   1) +
                                  1) +
                                 1) +
                                1) +
                               1) +
                              1) +
                             1) +
                            1) +
                           1) +
                          1) +
                         1) +
                        1) +
                       1) +
                      1) +
                     1) +
                    1) +
                   1) +
                  1) +
                 1) +
                1) +
               1) +
              1) +
             1),
            1, regs) != (0))
      return (1);
  }
  return length;
}


x86 assembly (clang, -O0):
<MLDLGetDMPData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %dil,%cl
mov    %cl,-0x3(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x15(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1040 <MPUGetFIFO@plt>
mov    %ax,-0x14(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x2,%eax
jne    1165 <MLDLGetDMPData+0x45>
jmp    1191 <MLDLGetDMPData+0x71>
lea    -0x15(%rbp),%rdx
mov    $0x28,%edi
mov    $0x1,%esi
call   1030 <MLDLSetMemoryMPU@plt>
cmp    $0x0,%eax
je     118c <MLDLGetDMPData+0x6c>
movw   $0x1,-0x2(%rbp)
jmp    1199 <MLDLGetDMPData+0x79>
jmp    1191 <MLDLGetDMPData+0x71>
mov    -0x14(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MLDLGetDMPData>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movb   $0x1,0x7(%rsp)
mov    %edx,%edi
call   1040 <MPUGetFIFO@plt>
mov    %eax,%ebx
cmp    $0x2,%bpl
je     1157 <MLDLGetDMPData+0x37>
lea    0x7(%rsp),%rdx
mov    $0x28,%edi
mov    $0x1,%esi
call   1030 <MLDLSetMemoryMPU@plt>
mov    %eax,%ecx
mov    $0x1,%ax
test   %ecx,%ecx
jne    1159 <MLDLGetDMPData+0x39>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.MLDLGetDMPData.regs = [1 x i8] c"\01"
define zeroext i16 @MLDLGetDMPData(i8 zeroext %0, i8* %1, i8 zeroext %2) {
%4 = alloca i16
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i16
%9 = alloca [1 x i8]
store i8 %0, i8* %5
store i8* %1, i8** %6
store i8 %2, i8* %7
%10 = bitcast [1 x i8]* %9 to i8*
%11 = load i8, i8* %7
%12 = load i8*, i8** %6
%13 = call zeroext i16 @MPUGetFIFO(i8 zeroext %11, i8* %12)
store i16 %13, i16* %8
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %3
br label %24
18: ; preds = %3
%19 = getelementptr inbounds [1 x i8], [1 x i8]* %9, i64 0, i64 0
%20 = call i32 @MLDLSetMemoryMPU(i32 40, i32 1, i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i16 1, i16* %4
br label %26
23: ; preds = %18
br label %24
24: ; preds = %23, %17
%25 = load i16, i16* %8
store i16 %25, i16* %4
br label %26
26: ; preds = %24, %22
%27 = load i16, i16* %4
ret i16 %27
}

LLVM IR (-O2):
define zeroext i16 @MLDLGetDMPData(i8 zeroext %0, i8* %1, i8 zeroext %2) {
%4 = alloca [1 x i8]
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
store i8 1, i8* %5
%6 = tail call zeroext i16 @MPUGetFIFO(i8 zeroext %2, i8* %1)
%7 = icmp eq i8 %0, 2
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = call i32 @MLDLSetMemoryMPU(i32 40, i32 1, i8* %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %3
br label %12
12: ; preds = %8, %11
%13 = phi i16 [ %6, %11 ], [ 1, %8 ]
ret i16 %13
}