#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 */
typedef int fe_status_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int FE_HAS_CARRIER;
int FE_HAS_LOCK;
int FE_HAS_SIGNAL;
int FE_HAS_SYNC;
int FE_HAS_VITERBI;
int FE_TIMEDOUT;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_status(FILE *fd, fe_status_t festatus) {
  fprintf(fd, "FE_STATUS:");
  if (festatus & FE_HAS_SIGNAL)
    fprintf(fd, " FE_HAS_SIGNAL");
  if (festatus & FE_TIMEDOUT)
    fprintf(fd, " FE_TIMEDOUT");
  if (festatus & FE_HAS_LOCK)
    fprintf(fd, " FE_HAS_LOCK");
  if (festatus & FE_HAS_CARRIER)
    fprintf(fd, " FE_HAS_CARRIER");
  if (festatus & FE_HAS_VITERBI)
    fprintf(fd, " FE_HAS_VITERBI");
  if (festatus & FE_HAS_SYNC)
    fprintf(fd, " FE_HAS_SYNC");
  fprintf(fd, "\n");
}


x86 assembly (clang, -O0):
<print_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    0x2ea7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1154 <print_status+0x44>
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    0x2e6a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1179 <print_status+0x69>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    0x2e55(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     119e <print_status+0x8e>
mov    -0x8(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    0x2e28(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11c3 <print_status+0xb3>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    0x2deb(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11e8 <print_status+0xd8>
mov    -0x8(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    0x2e06(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     120d <print_status+0xfd>
mov    -0x8(%rbp),%rdi
lea    0xe4c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    0x2e98(%rip),%rax
test   %ebp,(%rax)
je     1165 <print_status+0x45>
lea    0xeb8(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    0x2e5c(%rip),%rax
test   %ebp,(%rax)
je     1189 <print_status+0x69>
lea    0xea3(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    0x2e48(%rip),%rax
test   %ebp,(%rax)
je     11ad <print_status+0x8d>
lea    0xe8c(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    0x2e1c(%rip),%rax
test   %ebp,(%rax)
je     11d1 <print_status+0xb1>
lea    0xe75(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    0x2de0(%rip),%rax
test   %ebp,(%rax)
je     11f5 <print_status+0xd5>
lea    0xe61(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    0x2dfc(%rip),%rax
test   %ebp,(%rax)
je     1219 <print_status+0xf9>
lea    0xe4d(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"FE_STATUS:\00"
@FE_HAS_SIGNAL = global i32 0
@.str.1 = [15 x i8] c" FE_HAS_SIGNAL\00"
@FE_TIMEDOUT = global i32 0
@.str.2 = [13 x i8] c" FE_TIMEDOUT\00"
@FE_HAS_LOCK = global i32 0
@.str.3 = [13 x i8] c" FE_HAS_LOCK\00"
@FE_HAS_CARRIER = global i32 0
@.str.4 = [16 x i8] c" FE_HAS_CARRIER\00"
@FE_HAS_VITERBI = global i32 0
@.str.5 = [16 x i8] c" FE_HAS_VITERBI\00"
@FE_HAS_SYNC = global i32 0
@.str.6 = [13 x i8] c" FE_HAS_SYNC\00"
@.str.7 = [2 x i8] c"\0A\00"
define void @print_status(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i32, i32* @FE_HAS_SIGNAL
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %4
%16 = load i32, i32* @FE_TIMEDOUT
%17 = and i32 %15, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32*, i32** %3
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %19, %14
%23 = load i32, i32* %4
%24 = load i32, i32* @FE_HAS_LOCK
%25 = and i32 %23, %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load i32*, i32** %3
%29 = call i32 @fprintf(i32* %28, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %27, %22
%31 = load i32, i32* %4
%32 = load i32, i32* @FE_HAS_CARRIER
%33 = and i32 %31, %32
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %30
%36 = load i32*, i32** %3
%37 = call i32 @fprintf(i32* %36, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %35, %30
%39 = load i32, i32* %4
%40 = load i32, i32* @FE_HAS_VITERBI
%41 = and i32 %39, %40
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %38
%44 = load i32*, i32** %3
%45 = call i32 @fprintf(i32* %44, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %46
46: ; preds = %43, %38
%47 = load i32, i32* %4
%48 = load i32, i32* @FE_HAS_SYNC
%49 = and i32 %47, %48
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %46
%52 = load i32*, i32** %3
%53 = call i32 @fprintf(i32* %52, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %54
54: ; preds = %51, %46
%55 = load i32*, i32** %3
%56 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"FE_STATUS:\00"
@FE_HAS_SIGNAL = global i32 0
@.str.1 = [15 x i8] c" FE_HAS_SIGNAL\00"
@FE_TIMEDOUT = global i32 0
@.str.2 = [13 x i8] c" FE_TIMEDOUT\00"
@FE_HAS_LOCK = global i32 0
@.str.3 = [13 x i8] c" FE_HAS_LOCK\00"
@FE_HAS_CARRIER = global i32 0
@.str.4 = [16 x i8] c" FE_HAS_CARRIER\00"
@FE_HAS_VITERBI = global i32 0
@.str.5 = [16 x i8] c" FE_HAS_VITERBI\00"
@FE_HAS_SYNC = global i32 0
@.str.6 = [13 x i8] c" FE_HAS_SYNC\00"
define void @print_status(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
%4 = load i32, i32* @FE_HAS_SIGNAL
%5 = and i32 %4, %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64 14, i64 1, i32* %0)
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* @FE_TIMEDOUT
%11 = and i32 %10, %1
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %0)
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* @FE_HAS_LOCK
%17 = and i32 %16, %1
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i64 12, i64 1, i32* %0)
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* @FE_HAS_CARRIER
%23 = and i32 %22, %1
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i64 15, i64 1, i32* %0)
br label %27
27: ; preds = %25, %21
%28 = load i32, i32* @FE_HAS_VITERBI
%29 = and i32 %28, %1
%30 = icmp eq i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i64 15, i64 1, i32* %0)
br label %33
33: ; preds = %31, %27
%34 = load i32, i32* @FE_HAS_SYNC
%35 = and i32 %34, %1
%36 = icmp eq i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i64 12, i64 1, i32* %0)
br label %39
39: ; preds = %37, %33
%40 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}