#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pic_send_cmd(int);
int /*<<< orphan*/ pic_write_data(int);
void pic_goto_mem_location(uint32_t data) {
  data = data & 0x00FFFFFF;
  pic_send_cmd(0x00);
  pic_write_data(0x0E00 | ((data >> 16) & 0x000000FF));
  pic_send_cmd(0x00);
  pic_write_data(0x6EF8);
  pic_send_cmd(0x00);
  pic_write_data(0x0E00 | ((data >> 8) & 0x000000FF));
  pic_send_cmd(0x00);
  pic_write_data(0x6EF7);
  pic_send_cmd(0x00);
  pic_write_data(0x0E00 | (data & 0x000000FF));
  pic_send_cmd(0x00);
  pic_write_data(0x6EF6);
}


x86 assembly (clang, -O0):
<pic_goto_mem_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
or     $0xe00,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    $0x6ef8,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
or     $0xe00,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    $0x6ef7,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
or     $0xe00,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    $0x6ef6,%edi
call   1030 <pic_write_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_goto_mem_location>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
or     $0xe00,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    $0x6ef8,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
movzbl %bh,%edi
or     $0xe00,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    $0x6ef7,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
movzbl %bl,%edi
or     $0xe00,%edi
call   1030 <pic_write_data@plt>
xor    %edi,%edi
call   1040 <pic_send_cmd@plt>
mov    $0x6ef6,%edi
pop    %rbx
jmp    1030 <pic_write_data@plt>

LLVM IR (-O0):
define void @pic_goto_mem_location(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16777215
store i32 %4, i32* %2
%5 = call i32 @pic_send_cmd(i32 0)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = and i32 %7, 255
%9 = or i32 3584, %8
%10 = call i32 @pic_write_data(i32 %9)
%11 = call i32 @pic_send_cmd(i32 0)
%12 = call i32 @pic_write_data(i32 28408)
%13 = call i32 @pic_send_cmd(i32 0)
%14 = load i32, i32* %2
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = or i32 3584, %16
%18 = call i32 @pic_write_data(i32 %17)
%19 = call i32 @pic_send_cmd(i32 0)
%20 = call i32 @pic_write_data(i32 28407)
%21 = call i32 @pic_send_cmd(i32 0)
%22 = load i32, i32* %2
%23 = and i32 %22, 255
%24 = or i32 3584, %23
%25 = call i32 @pic_write_data(i32 %24)
%26 = call i32 @pic_send_cmd(i32 0)
%27 = call i32 @pic_write_data(i32 28406)
ret void
}

LLVM IR (-O2):
define void @pic_goto_mem_location(i32 %0) {
%2 = tail call i32 @pic_send_cmd(i32 0)
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
%5 = or i32 %4, 3584
%6 = tail call i32 @pic_write_data(i32 %5)
%7 = tail call i32 @pic_send_cmd(i32 0)
%8 = tail call i32 @pic_write_data(i32 28408)
%9 = tail call i32 @pic_send_cmd(i32 0)
%10 = lshr i32 %0, 8
%11 = and i32 %10, 255
%12 = or i32 %11, 3584
%13 = tail call i32 @pic_write_data(i32 %12)
%14 = tail call i32 @pic_send_cmd(i32 0)
%15 = tail call i32 @pic_write_data(i32 28407)
%16 = tail call i32 @pic_send_cmd(i32 0)
%17 = and i32 %0, 255
%18 = or i32 %17, 3584
%19 = tail call i32 @pic_write_data(i32 %18)
%20 = tail call i32 @pic_send_cmd(i32 0)
%21 = tail call i32 @pic_write_data(i32 28406)
ret void
}