int dump_interface(const char *name) {
  unsigned addr, mask, flags;
  if (ifc_get_info(name, &addr, &mask, &flags)) {
    return 0;
  }
  printf("%-8s %s  ", name, flags & 1 ? "UP  " : "DOWN");
  printf("%-16s", ipaddr(addr));
  printf("%-16s", ipaddr(mask));
  printf("0x%08x\n", flags);
  return 0;
}


x86 assembly (clang, -O0):
<dump_interface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x0,%al
call   1050 <ifc_get_info@plt>
cmp    $0x0,%eax
je     1168 <dump_interface+0x38>
movl   $0x0,-0x4(%rbp)
jmp    11e1 <dump_interface+0xb1>
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
and    $0x1,%ecx
lea    0xe96(%rip),%rdx
lea    0xe8a(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1040 <ipaddr@plt>
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%edi
mov    $0x0,%al
call   1040 <ipaddr@plt>
mov    %eax,%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_interface>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
xor    %eax,%eax
call   1050 <ifc_get_info@plt>
test   %eax,%eax
jne    11c1 <dump_interface+0x91>
testb  $0x1,0x4(%rsp)
lea    0xeb1(%rip),%rax
lea    0xea5(%rip),%rdx
cmove  %rax,%rdx
lea    0xe90(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%edi
xor    %eax,%eax
call   1040 <ipaddr@plt>
lea    0xe88(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edi
xor    %eax,%eax
call   1040 <ipaddr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%-8s %s \00"
@.str.1 = [5 x i8] c"UP \00"
@.str.2 = [5 x i8] c"DOWN\00"
@.str.3 = [6 x i8] c"%-16s\00"
@.str.4 = [8 x i8] c"0x%08x\0A\00"
define i32 @dump_interface(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 (i8*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @ifc_get_info to i32 (i8*, i32*, i32*, i32*, ...)*)(i8* %7, i32* %4, i32* %5, i32* %6)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %27
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i32, i32* %6
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %17)
%19 = load i32, i32* %4
%20 = call i32 (i32, ...) bitcast (i32 (...)* @ipaddr to i32 (i32, ...)*)(i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %5
%23 = call i32 (i32, ...) bitcast (i32 (...)* @ipaddr to i32 (i32, ...)*)(i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %25)
store i32 0, i32* %2
br label %27
27: ; preds = %11, %10
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@.str = [10 x i8] c"%-8s %s \00"
@.str.1 = [5 x i8] c"UP \00"
@.str.2 = [5 x i8] c"DOWN\00"
@.str.3 = [6 x i8] c"%-16s\00"
@.str.4 = [8 x i8] c"0x%08x\0A\00"
define i32 @dump_interface(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 (i8*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @ifc_get_info to i32 (i8*, i32*, i32*, i32*, ...)*)(i8* %0, i32* %2, i32* %3, i32* %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %1
%11 = load i32, i32* %4
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %14)
%16 = load i32, i32* %2
%17 = call i32 (i32, ...) bitcast (i32 (...)* @ipaddr to i32 (i32, ...)*)(i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %3
%20 = call i32 (i32, ...) bitcast (i32 (...)* @ipaddr to i32 (i32, ...)*)(i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %1, %10
ret i32 0
}