#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 */
typedef int startAddress;
typedef int length;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void ReadUserFlash(unsigned long startAddress, unsigned short int length) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x88) & 0xFF);
  SendChar((((startAddress) >> 16) >> 8) & 0xFF);
  SendChar(((startAddress) >> 16) & 0xFF);
  SendChar((((startAddress)&0xFFFF) >> 8) & 0xFF);
  SendChar(((startAddress)&0xFFFF) & 0xFF);
  SendChar(((length) >> 8) & 0xFF);
  SendChar((length)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<ReadUserFlash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x88,%edi
call   1030 <SendChar@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <SendChar@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <SendChar@plt>
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <SendChar@plt>
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <SendChar@plt>
movzwl -0xa(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0xa(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadUserFlash>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x88,%edi
call   1030 <SendChar@plt>
mov    %ebx,%eax
shr    $0x18,%eax
mov    %eax,%edi
call   1030 <SendChar@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <SendChar@plt>
movzbl %bh,%edi
call   1030 <SendChar@plt>
movzbl %bl,%edi
call   1030 <SendChar@plt>
mov    %ebp,%edi
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bpl,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @ReadUserFlash(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = call i32 @SendChar(i32 238)
%6 = call i32 @SendChar(i32 136)
%7 = load i64, i64* %3
%8 = lshr i64 %7, 16
%9 = lshr i64 %8, 8
%10 = and i64 %9, 255
%11 = trunc i64 %10 to i32
%12 = call i32 @SendChar(i32 %11)
%13 = load i64, i64* %3
%14 = lshr i64 %13, 16
%15 = and i64 %14, 255
%16 = trunc i64 %15 to i32
%17 = call i32 @SendChar(i32 %16)
%18 = load i64, i64* %3
%19 = and i64 %18, 65535
%20 = lshr i64 %19, 8
%21 = and i64 %20, 255
%22 = trunc i64 %21 to i32
%23 = call i32 @SendChar(i32 %22)
%24 = load i64, i64* %3
%25 = and i64 %24, 65535
%26 = and i64 %25, 255
%27 = trunc i64 %26 to i32
%28 = call i32 @SendChar(i32 %27)
%29 = load i16, i16* %4
%30 = zext i16 %29 to i32
%31 = ashr i32 %30, 8
%32 = and i32 %31, 255
%33 = call i32 @SendChar(i32 %32)
%34 = load i16, i16* %4
%35 = zext i16 %34 to i32
%36 = and i32 %35, 255
%37 = call i32 @SendChar(i32 %36)
%38 = call i32 @SendChar(i32 255)
%39 = call i32 @SendChar(i32 252)
%40 = call i32 @SendChar(i32 255)
%41 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @ReadUserFlash(i64 %0, i16 zeroext %1) {
%3 = tail call i32 @SendChar(i32 238)
%4 = tail call i32 @SendChar(i32 136)
%5 = trunc i64 %0 to i32
%6 = lshr i32 %5, 24
%7 = tail call i32 @SendChar(i32 %6)
%8 = lshr i32 %5, 16
%9 = and i32 %8, 255
%10 = tail call i32 @SendChar(i32 %9)
%11 = lshr i32 %5, 8
%12 = and i32 %11, 255
%13 = tail call i32 @SendChar(i32 %12)
%14 = and i32 %5, 255
%15 = tail call i32 @SendChar(i32 %14)
%16 = zext i16 %1 to i32
%17 = lshr i32 %16, 8
%18 = tail call i32 @SendChar(i32 %17)
%19 = and i32 %16, 255
%20 = tail call i32 @SendChar(i32 %19)
%21 = tail call i32 @SendChar(i32 255)
%22 = tail call i32 @SendChar(i32 252)
%23 = tail call i32 @SendChar(i32 255)
%24 = tail call i32 @SendChar(i32 255)
ret void
}