#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ StringAppend(char *);
void AddCfgFLags(uint32_t opcode) {
  StringAppend("[");
  if (opcode & (1 << (15)))
    StringAppend("I");
  if (opcode & (1 << (16)))
    StringAppend("F");
  if (opcode & (1 << (17)))
    StringAppend("M");
  if (opcode & (1 << (18)))
    StringAppend("C");
  StringAppend("]");
}


x86 assembly (clang, -O0):
<AddCfgFLags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <StringAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1144 <AddCfgFLags+0x34>
lea    0xec3(%rip),%rdi
call   1030 <StringAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1161 <AddCfgFLags+0x51>
lea    0xea8(%rip),%rdi
call   1030 <StringAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     117e <AddCfgFLags+0x6e>
lea    0xe8d(%rip),%rdi
call   1030 <StringAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x40000,%eax
cmp    $0x0,%eax
je     119b <AddCfgFLags+0x8b>
lea    0xe72(%rip),%rdi
call   1030 <StringAppend@plt>
lea    0xe68(%rip),%rdi
call   1030 <StringAppend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddCfgFLags>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <StringAppend@plt>
test   $0x8000,%ebx
jne    1158 <AddCfgFLags+0x48>
test   $0x10000,%ebx
jne    116c <AddCfgFLags+0x5c>
test   $0x20000,%ebx
jne    1180 <AddCfgFLags+0x70>
test   $0x40000,%ebx
je     114b <AddCfgFLags+0x3b>
lea    0xec2(%rip),%rdi
call   1030 <StringAppend@plt>
lea    0xeb8(%rip),%rdi
pop    %rbx
jmp    1030 <StringAppend@plt>
lea    0xea3(%rip),%rdi
call   1030 <StringAppend@plt>
test   $0x10000,%ebx
je     112f <AddCfgFLags+0x1f>
lea    0xe91(%rip),%rdi
call   1030 <StringAppend@plt>
test   $0x20000,%ebx
je     1137 <AddCfgFLags+0x27>
lea    0xe7f(%rip),%rdi
call   1030 <StringAppend@plt>
test   $0x40000,%ebx
jne    113f <AddCfgFLags+0x2f>
jmp    114b <AddCfgFLags+0x3b>

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

LLVM IR (-O2):
@.str = [2 x i8] c"[\00"
@.str.1 = [2 x i8] c"I\00"
@.str.2 = [2 x i8] c"F\00"
@.str.3 = [2 x i8] c"M\00"
@.str.4 = [2 x i8] c"C\00"
@.str.5 = [2 x i8] c"]\00"
define void @AddCfgFLags(i32 %0) {
%2 = tail call i32 @StringAppend(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = and i32 %0, 32768
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @StringAppend(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = and i32 %0, 65536
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @StringAppend(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %0, 131072
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @StringAppend(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %0, 262144
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @StringAppend(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = tail call i32 @StringAppend(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}