#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*/ printf(char *);
void print_cntlflags(unsigned char cntl_field) {
  if (cntl_field & 0x20)
    printf("URG ");
  if (cntl_field & 0x10)
    printf("ACK ");
  if (cntl_field & 0x8)
    printf("PSH ");
  if (cntl_field & 0x4)
    printf("RST ");
  if (cntl_field & 0x2)
    printf("SYN ");
  if (cntl_field & 0x1)
    printf("FIN ");
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print_cntlflags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     113a <print_cntlflags+0x2a>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1156 <print_cntlflags+0x46>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1172 <print_cntlflags+0x62>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     118e <print_cntlflags+0x7e>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11aa <print_cntlflags+0x9a>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11c6 <print_cntlflags+0xb6>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cntlflags>:
push   %rbx
mov    %edi,%ebx
test   $0x20,%bl
jne    1158 <print_cntlflags+0x38>
test   $0x10,%bl
jne    1169 <print_cntlflags+0x49>
test   $0x8,%bl
jne    117a <print_cntlflags+0x5a>
test   $0x4,%bl
jne    118b <print_cntlflags+0x6b>
test   $0x2,%bl
jne    119c <print_cntlflags+0x7c>
test   $0x1,%bl
je     114d <print_cntlflags+0x2d>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
test   $0x10,%bl
je     112d <print_cntlflags+0xd>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
test   $0x8,%bl
je     1132 <print_cntlflags+0x12>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
test   $0x4,%bl
je     1137 <print_cntlflags+0x17>
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
test   $0x2,%bl
je     113c <print_cntlflags+0x1c>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
test   $0x1,%bl
jne    1141 <print_cntlflags+0x21>
jmp    114d <print_cntlflags+0x2d>

LLVM IR (-O0):
@.str = [5 x i8] c"URG \00"
@.str.1 = [5 x i8] c"ACK \00"
@.str.2 = [5 x i8] c"PSH \00"
@.str.3 = [5 x i8] c"RST \00"
@.str.4 = [5 x i8] c"SYN \00"
@.str.5 = [5 x i8] c"FIN \00"
@.str.6 = [2 x i8] c"\0A\00"
define void @print_cntlflags(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 16
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = and i32 %18, 8
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %16
%24 = load i8, i8* %2
%25 = zext i8 %24 to i32
%26 = and i32 %25, 4
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %23
%31 = load i8, i8* %2
%32 = zext i8 %31 to i32
%33 = and i32 %32, 2
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %35, %30
%38 = load i8, i8* %2
%39 = zext i8 %38 to i32
%40 = and i32 %39, 1
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %37
%45 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"URG \00"
@.str.1 = [5 x i8] c"ACK \00"
@.str.2 = [5 x i8] c"PSH \00"
@.str.3 = [5 x i8] c"RST \00"
@.str.4 = [5 x i8] c"SYN \00"
@.str.5 = [5 x i8] c"FIN \00"
define void @print_cntlflags(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = and i32 %2, 16
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %2, 8
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %2, 4
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = and i32 %2, 2
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = and i32 %2, 1
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
%33 = tail call i32 @putchar(i32 10)
ret void
}