#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*/ EE_Off(void *);
int /*<<< orphan*/ EE_WriteByte(void *, unsigned char);
int /*<<< orphan*/ usleep(int);
int wan_plxctrl_write8(void *info, unsigned char addr, unsigned char data) {
  EE_WriteByte(info, 0x06);
  EE_Off(info);
  EE_WriteByte(info, 0x02);
  EE_WriteByte(info, (unsigned char)(addr & 0xFF));
  EE_WriteByte(info, data & 0xFF);
  EE_Off(info);
  usleep(10000);
  return 0;
}


x86 assembly (clang, -O0):
<wan_plxctrl_write8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <EE_WriteByte@plt>
mov    -0x8(%rbp),%rdi
call   1040 <EE_Off@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <EE_WriteByte@plt>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
and    $0xff,%eax
movzbl %al,%esi
call   1030 <EE_WriteByte@plt>
mov    -0x8(%rbp),%rdi
movzbl -0xa(%rbp),%eax
and    $0xff,%eax
movzbl %al,%esi
call   1030 <EE_WriteByte@plt>
mov    -0x8(%rbp),%rdi
call   1040 <EE_Off@plt>
mov    $0x2710,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wan_plxctrl_write8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x6,%esi
call   1030 <EE_WriteByte@plt>
mov    %rbx,%rdi
call   1040 <EE_Off@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <EE_WriteByte@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <EE_WriteByte@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <EE_WriteByte@plt>
mov    %rbx,%rdi
call   1040 <EE_Off@plt>
mov    $0x2710,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wan_plxctrl_write8(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = call i32 @EE_WriteByte(i8* %7, i8 zeroext 6)
%9 = load i8*, i8** %4
%10 = call i32 @EE_Off(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @EE_WriteByte(i8* %11, i8 zeroext 2)
%13 = load i8*, i8** %4
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = call i32 @EE_WriteByte(i8* %13, i8 zeroext %17)
%19 = load i8*, i8** %4
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = call i32 @EE_WriteByte(i8* %19, i8 zeroext %23)
%25 = load i8*, i8** %4
%26 = call i32 @EE_Off(i8* %25)
%27 = call i32 @usleep(i32 10000)
ret i32 0
}

LLVM IR (-O2):
define i32 @wan_plxctrl_write8(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @EE_WriteByte(i8* %0, i8 zeroext 6)
%5 = tail call i32 @EE_Off(i8* %0)
%6 = tail call i32 @EE_WriteByte(i8* %0, i8 zeroext 2)
%7 = tail call i32 @EE_WriteByte(i8* %0, i8 zeroext %1)
%8 = tail call i32 @EE_WriteByte(i8* %0, i8 zeroext %2)
%9 = tail call i32 @EE_Off(i8* %0)
%10 = tail call i32 @usleep(i32 10000)
ret i32 0
}