#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*/ delay();
int inb(int);
int /*<<< orphan*/ outb(int, int);
void asix88796_eeprom_send(int ioaddr, int value) {
  if (value)
    outb(inb(ioaddr + 0x14) | 0x20, ioaddr + 0x14);
  else
    outb(inb(ioaddr + 0x14) & 0xdf, ioaddr + 0x14);
  outb(inb(ioaddr + 0x14) & 0x7f, ioaddr + 0x14);
  delay();
  outb(inb(ioaddr + 0x14) | 0x80, ioaddr + 0x14);
  delay();
  outb(inb(ioaddr + 0x14) & 0xdf, ioaddr + 0x14);
}


x86 assembly (clang, -O0):
<asix88796_eeprom_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1168 <asix88796_eeprom_send+0x38>
mov    -0x4(%rbp),%edi
add    $0x14,%edi
call   1050 <inb@plt>
mov    %eax,%edi
or     $0x20,%edi
mov    -0x4(%rbp),%esi
add    $0x14,%esi
call   1030 <outb@plt>
jmp    1186 <asix88796_eeprom_send+0x56>
mov    -0x4(%rbp),%edi
add    $0x14,%edi
call   1050 <inb@plt>
mov    %eax,%edi
and    $0xdf,%edi
mov    -0x4(%rbp),%esi
add    $0x14,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
add    $0x14,%edi
call   1050 <inb@plt>
mov    %eax,%edi
and    $0x7f,%edi
mov    -0x4(%rbp),%esi
add    $0x14,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <delay@plt>
mov    -0x4(%rbp),%edi
add    $0x14,%edi
call   1050 <inb@plt>
mov    %eax,%edi
or     $0x80,%edi
mov    -0x4(%rbp),%esi
add    $0x14,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <delay@plt>
mov    -0x4(%rbp),%edi
add    $0x14,%edi
call   1050 <inb@plt>
mov    %eax,%edi
and    $0xdf,%edi
mov    -0x4(%rbp),%esi
add    $0x14,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asix88796_eeprom_send>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0x14(%rdi),%ebx
mov    %ebx,%edi
call   1050 <inb@plt>
mov    %eax,%edi
and    $0xdf,%edi
or     $0x20,%eax
test   %ebp,%ebp
cmovne %eax,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
call   1050 <inb@plt>
and    $0x7f,%eax
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <delay@plt>
mov    %ebx,%edi
call   1050 <inb@plt>
or     $0x80,%eax
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <delay@plt>
mov    %ebx,%edi
call   1050 <inb@plt>
and    $0xdf,%eax
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @asix88796_eeprom_send(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 20
%10 = call i32 @inb(i32 %9)
%11 = or i32 %10, 32
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 20
%14 = call i32 @outb(i32 %11, i32 %13)
br label %23
15: ; preds = %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 20
%18 = call i32 @inb(i32 %17)
%19 = and i32 %18, 223
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 20
%22 = call i32 @outb(i32 %19, i32 %21)
br label %23
23: ; preds = %15, %7
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 20
%26 = call i32 @inb(i32 %25)
%27 = and i32 %26, 127
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 20
%30 = call i32 @outb(i32 %27, i32 %29)
%31 = call i32 (...) @delay()
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 20
%34 = call i32 @inb(i32 %33)
%35 = or i32 %34, 128
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 20
%38 = call i32 @outb(i32 %35, i32 %37)
%39 = call i32 (...) @delay()
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 20
%42 = call i32 @inb(i32 %41)
%43 = and i32 %42, 223
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 20
%46 = call i32 @outb(i32 %43, i32 %45)
ret void
}

LLVM IR (-O2):
define void @asix88796_eeprom_send(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i32 %0, 20
%5 = tail call i32 @inb(i32 %4)
%6 = and i32 %5, 223
%7 = or i32 %5, 32
%8 = select i1 %3, i32 %6, i32 %7
%9 = tail call i32 @outb(i32 %8, i32 %4)
%10 = tail call i32 @inb(i32 %4)
%11 = and i32 %10, 127
%12 = tail call i32 @outb(i32 %11, i32 %4)
%13 = tail call i32 (...) @delay()
%14 = tail call i32 @inb(i32 %4)
%15 = or i32 %14, 128
%16 = tail call i32 @outb(i32 %15, i32 %4)
%17 = tail call i32 (...) @delay()
%18 = tail call i32 @inb(i32 %4)
%19 = and i32 %18, 223
%20 = tail call i32 @outb(i32 %19, i32 %4)
ret void
}