#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 version;
typedef int address;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void FlashRestoreControl(unsigned long version, unsigned long address) {
  SendChar((0XEE) & 0xFF);
  SendChar((0xB1) & 0xFF);
  SendChar((0xAB) & 0xFF);
  SendChar((((version) >> 16) >> 8) & 0xFF);
  SendChar(((version) >> 16) & 0xFF);
  SendChar((((version)&0xFFFF) >> 8) & 0xFF);
  SendChar(((version)&0xFFFF) & 0xFF);
  SendChar((((address) >> 16) >> 8) & 0xFF);
  SendChar(((address) >> 16) & 0xFF);
  SendChar((((address)&0xFFFF) >> 8) & 0xFF);
  SendChar(((address)&0xFFFF) & 0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<FlashRestoreControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb1,%edi
call   1030 <SendChar@plt>
mov    $0xab,%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>
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <SendChar@plt>
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <SendChar@plt>
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <SendChar@plt>
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
and    $0xff,%rax
mov    %eax,%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):
<FlashRestoreControl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb1,%edi
call   1030 <SendChar@plt>
mov    $0xab,%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    %r14,%rbx
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    $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    %r14
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @FlashRestoreControl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @SendChar(i32 238)
%6 = call i32 @SendChar(i32 177)
%7 = call i32 @SendChar(i32 171)
%8 = load i64, i64* %3
%9 = lshr i64 %8, 16
%10 = lshr i64 %9, 8
%11 = and i64 %10, 255
%12 = trunc i64 %11 to i32
%13 = call i32 @SendChar(i32 %12)
%14 = load i64, i64* %3
%15 = lshr i64 %14, 16
%16 = and i64 %15, 255
%17 = trunc i64 %16 to i32
%18 = call i32 @SendChar(i32 %17)
%19 = load i64, i64* %3
%20 = and i64 %19, 65535
%21 = lshr i64 %20, 8
%22 = and i64 %21, 255
%23 = trunc i64 %22 to i32
%24 = call i32 @SendChar(i32 %23)
%25 = load i64, i64* %3
%26 = and i64 %25, 65535
%27 = and i64 %26, 255
%28 = trunc i64 %27 to i32
%29 = call i32 @SendChar(i32 %28)
%30 = load i64, i64* %4
%31 = lshr i64 %30, 16
%32 = lshr i64 %31, 8
%33 = and i64 %32, 255
%34 = trunc i64 %33 to i32
%35 = call i32 @SendChar(i32 %34)
%36 = load i64, i64* %4
%37 = lshr i64 %36, 16
%38 = and i64 %37, 255
%39 = trunc i64 %38 to i32
%40 = call i32 @SendChar(i32 %39)
%41 = load i64, i64* %4
%42 = and i64 %41, 65535
%43 = lshr i64 %42, 8
%44 = and i64 %43, 255
%45 = trunc i64 %44 to i32
%46 = call i32 @SendChar(i32 %45)
%47 = load i64, i64* %4
%48 = and i64 %47, 65535
%49 = and i64 %48, 255
%50 = trunc i64 %49 to i32
%51 = call i32 @SendChar(i32 %50)
%52 = call i32 @SendChar(i32 255)
%53 = call i32 @SendChar(i32 252)
%54 = call i32 @SendChar(i32 255)
%55 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @FlashRestoreControl(i64 %0, i64 %1) {
%3 = tail call i32 @SendChar(i32 238)
%4 = tail call i32 @SendChar(i32 177)
%5 = tail call i32 @SendChar(i32 171)
%6 = trunc i64 %0 to i32
%7 = lshr i32 %6, 24
%8 = tail call i32 @SendChar(i32 %7)
%9 = lshr i32 %6, 16
%10 = and i32 %9, 255
%11 = tail call i32 @SendChar(i32 %10)
%12 = lshr i32 %6, 8
%13 = and i32 %12, 255
%14 = tail call i32 @SendChar(i32 %13)
%15 = and i32 %6, 255
%16 = tail call i32 @SendChar(i32 %15)
%17 = trunc i64 %1 to i32
%18 = lshr i32 %17, 24
%19 = tail call i32 @SendChar(i32 %18)
%20 = lshr i32 %17, 16
%21 = and i32 %20, 255
%22 = tail call i32 @SendChar(i32 %21)
%23 = lshr i32 %17, 8
%24 = and i32 %23, 255
%25 = tail call i32 @SendChar(i32 %24)
%26 = and i32 %17, 255
%27 = tail call i32 @SendChar(i32 %26)
%28 = tail call i32 @SendChar(i32 255)
%29 = tail call i32 @SendChar(i32 252)
%30 = tail call i32 @SendChar(i32 255)
%31 = tail call i32 @SendChar(i32 255)
ret void
}