#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 */
struct ethertypeent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __ebt_print_error(char *);
struct ethertypeent *getethertypebynumber(int);
struct ethertypeent *parseethertypebynumber(int type) {
  if (type < 1536)
    __ebt_print_error("Ethernet protocols have values >= 0x0600");
  ;
  if (type > 0xffff)
    __ebt_print_error("Ethernet protocols have values <= 0xffff");
  ;
  return getethertypebynumber(type);
}


x86 assembly (clang, -O0):
<parseethertypebynumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x600,-0x4(%rbp)
jge    1144 <parseethertypebynumber+0x24>
lea    0xec1(%rip),%rdi
call   1040 <__ebt_print_error@plt>
cmpl   $0xffff,-0x4(%rbp)
jle    115d <parseethertypebynumber+0x3d>
lea    0xed1(%rip),%rdi
call   1040 <__ebt_print_error@plt>
mov    -0x4(%rbp),%edi
call   1030 <getethertypebynumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseethertypebynumber>:
push   %rbx
mov    %edi,%ebx
cmp    $0x600,%edi
jge    1134 <parseethertypebynumber+0x14>
lea    0xece(%rip),%rdi
jmp    1143 <parseethertypebynumber+0x23>
cmp    $0x10000,%ebx
jb     1148 <parseethertypebynumber+0x28>
lea    0xee6(%rip),%rdi
call   1040 <__ebt_print_error@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <getethertypebynumber@plt>

LLVM IR (-O0):
%struct.ethertypeent = type { i32 }
@.str = [41 x i8] c"Ethernet protocols have values >= 0x0600\00"
@.str.1 = [41 x i8] c"Ethernet protocols have values <= 0xffff\00"
define %struct.ethertypeent* @parseethertypebynumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1536
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @__ebt_print_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 65535
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @__ebt_print_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = call %struct.ethertypeent* @getethertypebynumber(i32 %13)
ret %struct.ethertypeent* %14
}

LLVM IR (-O2):
%struct.ethertypeent = type { i32 }
@.str = [41 x i8] c"Ethernet protocols have values >= 0x0600\00"
@.str.1 = [41 x i8] c"Ethernet protocols have values <= 0xffff\00"
define %struct.ethertypeent* @parseethertypebynumber(i32 %0) {
%2 = icmp slt i32 %0, 1536
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 65535
br i1 %4, label %5, label %8
5: ; preds = %3, %1
%6 = phi i8* [ getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), %3 ]
%7 = tail call i32 @__ebt_print_error(i8* %6)
br label %8
8: ; preds = %5, %3
%9 = tail call %struct.ethertypeent* @getethertypebynumber(i32 %0)
ret %struct.ethertypeent* %9
}