#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 Getc();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ skip(int);
extern void features(int len) {
  int c = Getc();
  if (c & 0x01)
    printf("\t\tFlag - Modification detection (packets 18 and 19)\n");
  if ((c & ~0xfe) == 0)
    printf("\t\tFlag - undefined\n");
  skip(len - 1);
}


x86 assembly (clang, -O0):
<features>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <Getc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1160 <features+0x30>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0xffffff01,%eax
cmp    $0x0,%eax
jne    117d <features+0x4d>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <skip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<features>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <Getc@plt>
mov    %eax,%ebp
test   $0x1,%bpl
je     1150 <features+0x20>
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
test   $0xffffff01,%ebp
jne    1164 <features+0x34>
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
add    $0xffffffff,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <skip@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"\09\09Flag - Modification detection (packets 18 and 19)\0A\00"
@.str.1 = [20 x i8] c"\09\09Flag - undefined\0A\00"
define void @features(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @Getc()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
%12 = and i32 %11, -255
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 1
%19 = call i32 @skip(i32 %18)
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"\09\09Flag - undefined\00"
@str.2 = [52 x i8] c"\09\09Flag - Modification detection (packets 18 and 19)\00"
define void @features(i32 %0) {
%2 = tail call i32 (...) @Getc()
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = and i32 %2, -255
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = add nsw i32 %0, -1
%14 = tail call i32 @skip(i32 %13)
ret void
}