#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 */
unsigned int inb_p(int);
int /*<<< orphan*/ init();
int /*<<< orphan*/ outb_p(int, int);
int /*<<< orphan*/ printf(char *, ...);
void lb_group_show() {
  init();
  unsigned int data;
  unsigned int val;
  unsigned int gdata;
  outb_p(0xF0, 0x2E);
  data = inb_p(0x2F);
  printf("GPIO 10-17: 0x:%x\n", data);
  outb_p(0xF1, 0x2E);
  val = inb_p(0x2F);
  if (((data >> 7) & 1) > 0) {
    printf("LAN 1-2 bypass : disable\n");
  } else {
    if (((val >> 7) & 1) > 0) {
      printf("LAN 1-2 bypass : disable\n");
    } else {
      printf("LAN 1-2 bypass : enable\n");
    }
  }
  if (((data >> 6) & 1) > 0) {
    printf("LAN 3-4 bypass : disable\n");
  } else {
    if (((val >> 6) & 1) > 0) {
      printf("LAN 3-4 bypass : disable\n");
    } else {
      printf("LAN 3-4 bypass : enable\n");
    }
  }
  gdata = inb_p(0x480 + 0x0E);
  gdata = gdata & 1;
  if (gdata > 0) {
    printf("LAN 5-6 bypass : disable\n");
  } else {
    printf("LAN 5-6 bypass : enable\n");
  }
  if (((data >> 5) & 1) > 0) {
    printf("Power On/Off bypass : enable\n");
  } else {
    printf("Power On/Off bypass : disable\n");
  }
}


x86 assembly (clang, -O0):
<lb_group_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <init@plt>
mov    $0xf0,%edi
mov    $0x2e,%esi
call   1050 <outb_p@plt>
mov    $0x2f,%edi
call   1060 <inb_p@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xf1,%edi
mov    $0x2e,%esi
call   1050 <outb_p@plt>
mov    $0x2f,%edi
call   1060 <inb_p@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x7,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jbe    11bd <lb_group_show+0x7d>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f5 <lb_group_show+0xb5>
mov    -0x8(%rbp),%eax
shr    $0x7,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jbe    11e2 <lb_group_show+0xa2>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f0 <lb_group_show+0xb0>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f5 <lb_group_show+0xb5>
mov    -0x4(%rbp),%eax
shr    $0x6,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jbe    121a <lb_group_show+0xda>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <lb_group_show+0x112>
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jbe    123f <lb_group_show+0xff>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <lb_group_show+0x10d>
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <lb_group_show+0x112>
mov    $0x48e,%edi
call   1060 <inb_p@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1285 <lb_group_show+0x145>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1293 <lb_group_show+0x153>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jbe    12b8 <lb_group_show+0x178>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c6 <lb_group_show+0x186>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lb_group_show>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
mov    $0xf0,%edi
mov    $0x2e,%esi
call   1060 <outb_p@plt>
mov    $0x2f,%edi
call   1070 <inb_p@plt>
mov    %eax,%ebx
lea    0xe84(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xf1,%edi
mov    $0x2e,%esi
call   1060 <outb_p@plt>
mov    $0x2f,%edi
call   1070 <inb_p@plt>
mov    %eax,%ebp
lea    0xe6c(%rip),%rax
lea    0xf1a(%rip),%rdi
or     %ebx,%ebp
test   $0x80,%bpl
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xe67(%rip),%rax
lea    0xee4(%rip),%rdi
test   $0x40,%bpl
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    $0x48e,%edi
call   1070 <inb_p@plt>
test   $0x1,%al
lea    0xe58(%rip),%rax
lea    0xea4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
test   $0x20,%bl
lea    0xe56(%rip),%rax
lea    0xe6d(%rip),%rdi
cmove  %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"GPIO 10-17: 0x:%x\0A\00"
@.str.1 = [26 x i8] c"LAN 1-2 bypass : disable\0A\00"
@.str.2 = [25 x i8] c"LAN 1-2 bypass : enable\0A\00"
@.str.3 = [26 x i8] c"LAN 3-4 bypass : disable\0A\00"
@.str.4 = [25 x i8] c"LAN 3-4 bypass : enable\0A\00"
@.str.5 = [26 x i8] c"LAN 5-6 bypass : disable\0A\00"
@.str.6 = [25 x i8] c"LAN 5-6 bypass : enable\0A\00"
@.str.7 = [30 x i8] c"Power On/Off bypass : enable\0A\00"
@.str.8 = [31 x i8] c"Power On/Off bypass : disable\0A\00"
define void @lb_group_show() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @init()
%5 = call i32 @outb_p(i32 240, i32 46)
%6 = call i32 @inb_p(i32 47)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @outb_p(i32 241, i32 46)
%10 = call i32 @inb_p(i32 47)
store i32 %10, i32* %2
%11 = load i32, i32* %1
%12 = lshr i32 %11, 7
%13 = and i32 %12, 1
%14 = icmp ugt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %27
17: ; preds = %0
%18 = load i32, i32* %2
%19 = lshr i32 %18, 7
%20 = and i32 %19, 1
%21 = icmp ugt i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %26
24: ; preds = %17
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
br label %27
27: ; preds = %26, %15
%28 = load i32, i32* %1
%29 = lshr i32 %28, 6
%30 = and i32 %29, 1
%31 = icmp ugt i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %44
34: ; preds = %27
%35 = load i32, i32* %2
%36 = lshr i32 %35, 6
%37 = and i32 %36, 1
%38 = icmp ugt i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %43
41: ; preds = %34
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
br label %44
44: ; preds = %43, %32
%45 = call i32 @inb_p(i32 1166)
store i32 %45, i32* %3
%46 = load i32, i32* %3
%47 = and i32 %46, 1
store i32 %47, i32* %3
%48 = load i32, i32* %3
%49 = icmp ugt i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %44
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %54
52: ; preds = %44
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %54
54: ; preds = %52, %50
%55 = load i32, i32* %1
%56 = lshr i32 %55, 5
%57 = and i32 %56, 1
%58 = icmp ugt i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
br label %63
61: ; preds = %54
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
br label %63
63: ; preds = %61, %59
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"GPIO 10-17: 0x:%x\0A\00"
@str = [24 x i8] c"LAN 1-2 bypass : enable\00"
@str.9 = [24 x i8] c"LAN 3-4 bypass : enable\00"
@str.10 = [24 x i8] c"LAN 5-6 bypass : enable\00"
@str.11 = [30 x i8] c"Power On/Off bypass : disable\00"
@str.12 = [29 x i8] c"Power On/Off bypass : enable\00"
@str.13 = [25 x i8] c"LAN 5-6 bypass : disable\00"
@str.15 = [25 x i8] c"LAN 3-4 bypass : disable\00"
@str.17 = [25 x i8] c"LAN 1-2 bypass : disable\00"
define void @lb_group_show() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 @outb_p(i32 240, i32 46)
%3 = tail call i32 @inb_p(i32 47)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @outb_p(i32 241, i32 46)
%6 = tail call i32 @inb_p(i32 47)
%7 = and i32 %3, 128
%8 = icmp eq i32 %7, 0
%9 = and i32 %6, 128
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.17, i64 0, i64 0)
%12 = select i1 %8, i8* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.17, i64 0, i64 0)
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = and i32 %3, 64
%15 = icmp eq i32 %14, 0
%16 = and i32 %6, 64
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0)
%19 = select i1 %15, i8* %18, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0)
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
%21 = tail call i32 @inb_p(i32 1166)
%22 = and i32 %21, 1
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0)
%25 = tail call i32 @puts(i8* dereferenceable(1) %24)
%26 = and i32 %3, 32
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.12, i64 0, i64 0)
%29 = tail call i32 @puts(i8* dereferenceable(1) %28)
ret void
}