#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*/ mib_get(scalar_t__, void *);
int /*<<< orphan*/ printf(char *, ...);
void showBridgeCfg() {
  unsigned short time;
  unsigned char stp;
  mib_get(0 + 57, (void *)&time);
  printf("Bridge Ageing Time: %d(seconds)\n", time);
  mib_get(0 + 58, (void *)&stp);
  printf("802.1d Spanning Tree: %s\n", stp == 1 ? "Enabled" : "Disabled");
}


x86 assembly (clang, -O0):
<showBridgeCfg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rsi
mov    $0x39,%edi
call   1040 <mib_get@plt>
movzwl -0x2(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3a,%edi
lea    -0x3(%rbp),%rsi
call   1040 <mib_get@plt>
movzbl -0x3(%rbp),%ecx
lea    0xee2(%rip),%rsi
lea    0xed3(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showBridgeCfg>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0x39,%edi
call   1040 <mib_get@plt>
movzwl 0x6(%rsp),%esi
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x5(%rsp),%rsi
mov    $0x3a,%edi
call   1040 <mib_get@plt>
cmpb   $0x1,0x5(%rsp)
lea    0xedd(%rip),%rax
lea    0xede(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Bridge Ageing Time: %d(seconds)\0A\00"
@.str.1 = [26 x i8] c"802.1d Spanning Tree: %s\0A\00"
@.str.2 = [8 x i8] c"Enabled\00"
@.str.3 = [9 x i8] c"Disabled\00"
define void @showBridgeCfg() {
%1 = alloca i16
%2 = alloca i8
%3 = bitcast i16* %1 to i8*
%4 = call i32 @mib_get(i64 57, i8* %3)
%5 = load i16, i16* %1
%6 = zext i16 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @mib_get(i64 58, i8* %2)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Bridge Ageing Time: %d(seconds)\0A\00"
@.str.1 = [26 x i8] c"802.1d Spanning Tree: %s\0A\00"
@.str.2 = [8 x i8] c"Enabled\00"
@.str.3 = [9 x i8] c"Disabled\00"
define void @showBridgeCfg() {
%1 = alloca i16
%2 = alloca i8
%3 = bitcast i16* %1 to i8*
%4 = call i32 @mib_get(i64 57, i8* %3)
%5 = load i16, i16* %1
%6 = zext i16 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @mib_get(i64 58, i8* %2)
%9 = load i8, i8* %2
%10 = icmp eq i8 %9, 1
%11 = select i1 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}