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

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void dump_flags(const int flags, FILE *fp) {
  fputc(' ', fp);
  if (flags & 0x40)
    fputs(" insignificant", fp);
  if (flags & 0x01)
    fputs(" C", fp);
  if (flags & 0x02)
    fputs(" shell", fp);
}


x86 assembly (clang, -O0):
<dump_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1040 <fputc@plt>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     115c <dump_flags+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117b <dump_flags+0x5b>
mov    -0x10(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     119a <dump_flags+0x7a>
mov    -0x10(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_flags>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x20,%edi
call   1030 <fputc@plt>
test   $0x40,%bpl
jne    114b <dump_flags+0x2b>
test   $0x1,%bpl
jne    116a <dump_flags+0x4a>
test   $0x2,%bpl
jne    1189 <dump_flags+0x69>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeae(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   $0x1,%bpl
je     113e <dump_flags+0x1e>
lea    0xe9e(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   $0x2,%bpl
je     1144 <dump_flags+0x24>
lea    0xe82(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" insignificant\00"
@.str.1 = [3 x i8] c" C\00"
@.str.2 = [7 x i8] c" shell\00"
define void @dump_flags(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fputc(i8 signext 32, i32* %5)
%7 = load i32, i32* %3
%8 = and i32 %7, 64
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32*, i32** %4
%12 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %11)
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %3
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32*, i32** %4
%19 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %3
%22 = and i32 %21, 2
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32*, i32** %4
%26 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %25)
br label %27
27: ; preds = %24, %20
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c" insignificant\00"
@.str.1 = [3 x i8] c" C\00"
@.str.2 = [7 x i8] c" shell\00"
define void @dump_flags(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i8 signext 32, i32* %1)
%4 = and i32 %0, 64
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 14, i64 1, i32* %1)
br label %8
8: ; preds = %6, %2
%9 = and i32 %0, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %1)
br label %13
13: ; preds = %11, %8
%14 = and i32 %0, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 6, i64 1, i32* %1)
br label %18
18: ; preds = %16, %13
ret void
}