#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*/ AbEnd(char *, char const *);
int /*<<< orphan*/ InvArg(char const *, char const *);
int /*<<< orphan*/ SetListBytes(unsigned int);
int sscanf(char const *, char *, unsigned int *, char *);
void OptListBytes(const char *Opt, const char *Arg) {
  unsigned Num;
  char Check;
  if (sscanf(Arg, "%u%c", &Num, &Check) != 1) {
    InvArg(Opt, Arg);
  }
  if (Num != 0 && (Num < 4 || Num > 255)) {
    AbEnd("Argument for option '%s' is out of range", Opt);
  }
  SetListBytes(Num);
}


x86 assembly (clang, -O0):
<OptListBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x15(%rbp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     117e <OptListBytes+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <InvArg@plt>
cmpl   $0x0,-0x14(%rbp)
je     11af <OptListBytes+0x6f>
cmpl   $0x4,-0x14(%rbp)
jb     119f <OptListBytes+0x5f>
cmpl   $0xff,-0x14(%rbp)
jbe    11af <OptListBytes+0x6f>
mov    -0x8(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1060 <AbEnd@plt>
mov    -0x14(%rbp),%edi
call   1030 <SetListBytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OptListBytes>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xeaf(%rip),%rsi
lea    0x4(%rsp),%rdx
lea    0x3(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     1173 <OptListBytes+0x33>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <InvArg@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     119b <OptListBytes+0x5b>
lea    -0x100(%rdi),%eax
cmp    $0xffffff03,%eax
ja     119b <OptListBytes+0x5b>
lea    0xe76(%rip),%rdi
mov    %r14,%rsi
call   1060 <AbEnd@plt>
mov    0x4(%rsp),%edi
call   1030 <SetListBytes@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%u%c\00"
@.str.1 = [41 x i8] c"Argument for option '%s' is out of range\00"
define void @OptListBytes(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %5, i8* %6)
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @InvArg(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = load i32, i32* %5
%19 = icmp ult i32 %18, 4
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %5
%22 = icmp ugt i32 %21, 255
br i1 %22, label %23, label %26
23: ; preds = %20, %17
%24 = load i8*, i8** %3
%25 = call i32 @AbEnd(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %23, %20, %14
%27 = load i32, i32* %5
%28 = call i32 @SetListBytes(i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%u%c\00"
@.str.1 = [41 x i8] c"Argument for option '%s' is out of range\00"
define void @OptListBytes(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i8* %4)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @InvArg(i8* %0, i8* %1)
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
%13 = add i32 %11, -256
%14 = icmp ult i32 %13, -252
%15 = and i1 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = call i32 @AbEnd(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%18 = load i32, i32* %3
br label %19
19: ; preds = %16, %10
%20 = phi i32 [ %18, %16 ], [ %11, %10 ]
%21 = call i32 @SetListBytes(i32 %20)
ret void
}