#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*/ lprintf(int, char *);
void netrom_flags(int flags) {
  if (flags & 0x80)
    lprintf(7, " CHOKE");
  if (flags & 0x40)
    lprintf(7, " NAK");
  if (flags & 0x20)
    lprintf(7, " MORE");
  lprintf(7, "\n");
}


x86 assembly (clang, -O0):
<netrom_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     113d <netrom_flags+0x2d>
mov    $0x7,%edi
lea    0xec8(%rip),%rsi
call   1030 <lprintf@plt>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     115d <netrom_flags+0x4d>
mov    $0x7,%edi
lea    0xeaf(%rip),%rsi
call   1030 <lprintf@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     117d <netrom_flags+0x6d>
mov    $0x7,%edi
lea    0xe94(%rip),%rsi
call   1030 <lprintf@plt>
mov    $0x7,%edi
lea    0xe89(%rip),%rsi
call   1030 <lprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netrom_flags>:
push   %rbx
mov    %edi,%ebx
test   $0x80,%bl
jne    1145 <netrom_flags+0x35>
test   $0x40,%bl
jne    115b <netrom_flags+0x4b>
test   $0x20,%bl
je     1133 <netrom_flags+0x23>
lea    0xee3(%rip),%rsi
mov    $0x7,%edi
call   1030 <lprintf@plt>
lea    0xed8(%rip),%rsi
mov    $0x7,%edi
pop    %rbx
jmp    1030 <lprintf@plt>
lea    0xeb4(%rip),%rsi
mov    $0x7,%edi
call   1030 <lprintf@plt>
test   $0x40,%bl
je     111d <netrom_flags+0xd>
lea    0xea5(%rip),%rsi
mov    $0x7,%edi
call   1030 <lprintf@plt>
test   $0x20,%bl
jne    1122 <netrom_flags+0x12>
jmp    1133 <netrom_flags+0x23>

LLVM IR (-O0):
@.str = [7 x i8] c" CHOKE\00"
@.str.1 = [5 x i8] c" NAK\00"
@.str.2 = [6 x i8] c" MORE\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @netrom_flags(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @lprintf(i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 64
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @lprintf(i32 7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
%16 = and i32 %15, 32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @lprintf(i32 7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = call i32 @lprintf(i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" CHOKE\00"
@.str.1 = [5 x i8] c" NAK\00"
@.str.2 = [6 x i8] c" MORE\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @netrom_flags(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @lprintf(i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = and i32 %0, 64
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @lprintf(i32 7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = and i32 %0, 32
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @lprintf(i32 7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
%17 = tail call i32 @lprintf(i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}