#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 USBNRead(int);
int /*<<< orphan*/ USBNWrite(int, int);
int /*<<< orphan*/ _USBNCreateConfDescrField();
int /*<<< orphan*/ _USBNCreateStringField();
int /*<<< orphan*/ _USBNInitEP0();
void USBNStart(void) {
  _USBNCreateConfDescrField();
  _USBNCreateStringField();
  _USBNInitEP0();
  USBNWrite(0x00, 0x01);
  while (USBNRead(0x00) & 0x01)
    ;
  USBNWrite(0x01, 0x02);
  USBNWrite(0x0F, 0xFF);
  USBNWrite(0x0F, 0x10);
  USBNWrite(0x04, 0x80 + 0x00);
  USBNWrite(0x20, 0x40);
  USBNWrite(0x23, 0x08);
  USBNWrite(0x27, 0x01 + 0x08);
  USBNWrite(0x0D, 0x01 + 0x02 + 0x04 + 0x08);
  USBNWrite(0x0B, 0x01 + 0x02 + 0x04 + 0x08);
  USBNWrite(0x09, 0x40 + 0x10 + 0x08);
  USBNWrite(0x07, (0x80 + 0x40 + 0x02 + 0x04 + 0x10));
  USBNWrite(0x05, 0x02);
  USBNWrite(0x00, 0x04 + 0x08 + 0xC0);
  return;
}


x86 assembly (clang, -O0):
<USBNStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_USBNCreateConfDescrField@plt>
mov    $0x0,%al
call   1070 <_USBNCreateStringField@plt>
mov    $0x0,%al
call   1050 <_USBNInitEP0@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <USBNWrite@plt>
xor    %edi,%edi
call   1040 <USBNRead@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     118d <USBNStart+0x3d>
jmp    1175 <USBNStart+0x25>
mov    $0x1,%edi
mov    $0x2,%esi
call   1060 <USBNWrite@plt>
mov    $0xf,%edi
mov    $0xff,%esi
call   1060 <USBNWrite@plt>
mov    $0xf,%edi
mov    $0x10,%esi
call   1060 <USBNWrite@plt>
mov    $0x4,%edi
mov    $0x80,%esi
call   1060 <USBNWrite@plt>
mov    $0x20,%edi
mov    $0x40,%esi
call   1060 <USBNWrite@plt>
mov    $0x23,%edi
mov    $0x8,%esi
call   1060 <USBNWrite@plt>
mov    $0x27,%edi
mov    $0x9,%esi
call   1060 <USBNWrite@plt>
mov    $0xd,%edi
mov    $0xf,%esi
call   1060 <USBNWrite@plt>
mov    $0xb,%edi
mov    $0xf,%esi
call   1060 <USBNWrite@plt>
mov    $0x9,%edi
mov    $0x58,%esi
call   1060 <USBNWrite@plt>
mov    $0x7,%edi
mov    $0xd6,%esi
call   1060 <USBNWrite@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1060 <USBNWrite@plt>
xor    %edi,%edi
mov    $0xcc,%esi
call   1060 <USBNWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBNStart>:
push   %rax
xor    %eax,%eax
call   1030 <_USBNCreateConfDescrField@plt>
xor    %eax,%eax
call   1070 <_USBNCreateStringField@plt>
xor    %eax,%eax
call   1050 <_USBNInitEP0@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <USBNWrite@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edi,%edi
call   1040 <USBNRead@plt>
test   $0x1,%al
jne    1180 <USBNStart+0x30>
mov    $0x1,%edi
mov    $0x2,%esi
call   1060 <USBNWrite@plt>
mov    $0xf,%edi
mov    $0xff,%esi
call   1060 <USBNWrite@plt>
mov    $0xf,%edi
mov    $0x10,%esi
call   1060 <USBNWrite@plt>
mov    $0x4,%edi
mov    $0x80,%esi
call   1060 <USBNWrite@plt>
mov    $0x20,%edi
mov    $0x40,%esi
call   1060 <USBNWrite@plt>
mov    $0x23,%edi
mov    $0x8,%esi
call   1060 <USBNWrite@plt>
mov    $0x27,%edi
mov    $0x9,%esi
call   1060 <USBNWrite@plt>
mov    $0xd,%edi
mov    $0xf,%esi
call   1060 <USBNWrite@plt>
mov    $0xb,%edi
mov    $0xf,%esi
call   1060 <USBNWrite@plt>
mov    $0x9,%edi
mov    $0x58,%esi
call   1060 <USBNWrite@plt>
mov    $0x7,%edi
mov    $0xd6,%esi
call   1060 <USBNWrite@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1060 <USBNWrite@plt>
xor    %edi,%edi
mov    $0xcc,%esi
pop    %rax
jmp    1060 <USBNWrite@plt>

LLVM IR (-O0):
define void @USBNStart() {
%1 = call i32 (...) @_USBNCreateConfDescrField()
%2 = call i32 (...) @_USBNCreateStringField()
%3 = call i32 (...) @_USBNInitEP0()
%4 = call i32 @USBNWrite(i32 0, i32 1)
br label %5
5: ; preds = %9, %0
%6 = call i32 @USBNRead(i32 0)
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = call i32 @USBNWrite(i32 1, i32 2)
%12 = call i32 @USBNWrite(i32 15, i32 255)
%13 = call i32 @USBNWrite(i32 15, i32 16)
%14 = call i32 @USBNWrite(i32 4, i32 128)
%15 = call i32 @USBNWrite(i32 32, i32 64)
%16 = call i32 @USBNWrite(i32 35, i32 8)
%17 = call i32 @USBNWrite(i32 39, i32 9)
%18 = call i32 @USBNWrite(i32 13, i32 15)
%19 = call i32 @USBNWrite(i32 11, i32 15)
%20 = call i32 @USBNWrite(i32 9, i32 88)
%21 = call i32 @USBNWrite(i32 7, i32 214)
%22 = call i32 @USBNWrite(i32 5, i32 2)
%23 = call i32 @USBNWrite(i32 0, i32 204)
ret void
}

LLVM IR (-O2):
define void @USBNStart() {
%1 = tail call i32 (...) @_USBNCreateConfDescrField()
%2 = tail call i32 (...) @_USBNCreateStringField()
%3 = tail call i32 (...) @_USBNInitEP0()
%4 = tail call i32 @USBNWrite(i32 0, i32 1)
br label %5
5: ; preds = %5, %0
%6 = tail call i32 @USBNRead(i32 0)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = tail call i32 @USBNWrite(i32 1, i32 2)
%11 = tail call i32 @USBNWrite(i32 15, i32 255)
%12 = tail call i32 @USBNWrite(i32 15, i32 16)
%13 = tail call i32 @USBNWrite(i32 4, i32 128)
%14 = tail call i32 @USBNWrite(i32 32, i32 64)
%15 = tail call i32 @USBNWrite(i32 35, i32 8)
%16 = tail call i32 @USBNWrite(i32 39, i32 9)
%17 = tail call i32 @USBNWrite(i32 13, i32 15)
%18 = tail call i32 @USBNWrite(i32 11, i32 15)
%19 = tail call i32 @USBNWrite(i32 9, i32 88)
%20 = tail call i32 @USBNWrite(i32 7, i32 214)
%21 = tail call i32 @USBNWrite(i32 5, i32 2)
%22 = tail call i32 @USBNWrite(i32 0, i32 204)
ret void
}