#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void inspect_fw_phexdef(char *label, uint32_t val, uint32_t defval) {
  printf("%-23s: 0x%08x                  ", label, val);
  if (val == defval) {
    printf("(== OpenWrt default)\n");
  } else {
    printf("(OpenWrt default: 0x%08x)\n", defval);
  }
}


x86 assembly (clang, -O0):
<inspect_fw_phexdef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1156 <inspect_fw_phexdef+0x46>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1167 <inspect_fw_phexdef+0x57>
mov    -0x10(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inspect_fw_phexdef>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%rsi
lea    0xecf(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%ebp
jne    1150 <inspect_fw_phexdef+0x30>
lea    0xef6(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"%-23s: 0x%08x \00"
@.str.1 = [22 x i8] c"(== OpenWrt default)\0A\00"
@.str.2 = [27 x i8] c"(OpenWrt default: 0x%08x)\0A\00"
define void @inspect_fw_phexdef(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %18
15: ; preds = %3
%16 = load i32, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %13
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"%-23s: 0x%08x \00"
@.str.2 = [27 x i8] c"(OpenWrt default: 0x%08x)\0A\00"
@str = [21 x i8] c"(== OpenWrt default)\00"
define void @inspect_fw_phexdef(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = icmp eq i32 %1, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %2)
br label %10
10: ; preds = %8, %6
ret void
}