#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*/ strcat(char *, char *);
char *SMB_AtrToStr(int attribs, int verbose) {
  static char SMB_Attrib_Temp[128];
  SMB_Attrib_Temp[0] = 0;
  if (attribs & 0x01)
    strcat(SMB_Attrib_Temp, (verbose ? "Read Only " : "R"));
  if (attribs & 0x02)
    strcat(SMB_Attrib_Temp, (verbose ? "Hidden " : "H"));
  if (attribs & 0x04)
    strcat(SMB_Attrib_Temp, (verbose ? "System " : "S"));
  if (attribs & 0x08)
    strcat(SMB_Attrib_Temp, (verbose ? "Volume " : "V"));
  if (attribs & 0x10)
    strcat(SMB_Attrib_Temp, (verbose ? "Directory " : "D"));
  if (attribs & 0x20)
    strcat(SMB_Attrib_Temp, (verbose ? "Archive " : "A"));
  return (SMB_Attrib_Temp);
}


x86 assembly (clang, -O0):
<SMB_AtrToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x0,0x2f1b(%rip)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1158 <SMB_AtrToStr+0x48>
mov    -0x8(%rbp),%ecx
lea    0xecd(%rip),%rsi
lea    0xebb(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x2eed(%rip),%rdi
call   1030 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     118b <SMB_AtrToStr+0x7b>
mov    -0x8(%rbp),%ecx
lea    0xea4(%rip),%rsi
lea    0xe95(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x2eba(%rip),%rdi
call   1030 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11be <SMB_AtrToStr+0xae>
mov    -0x8(%rbp),%ecx
lea    0xe7b(%rip),%rsi
lea    0xe6c(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x2e87(%rip),%rdi
call   1030 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11f1 <SMB_AtrToStr+0xe1>
mov    -0x8(%rbp),%ecx
lea    0xe52(%rip),%rsi
lea    0xe43(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x2e54(%rip),%rdi
call   1030 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1224 <SMB_AtrToStr+0x114>
mov    -0x8(%rbp),%ecx
lea    0xe2c(%rip),%rsi
lea    0xe1a(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x2e21(%rip),%rdi
call   1030 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1257 <SMB_AtrToStr+0x147>
mov    -0x8(%rbp),%ecx
lea    0xe04(%rip),%rsi
lea    0xdf4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x2dee(%rip),%rdi
call   1030 <strcat@plt>
lea    0x2de2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMB_AtrToStr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movb   $0x0,0x2f22(%rip)
test   $0x1,%bpl
jne    117c <SMB_AtrToStr+0x6c>
test   $0x2,%bpl
jne    11a2 <SMB_AtrToStr+0x92>
test   $0x4,%bpl
jne    11cc <SMB_AtrToStr+0xbc>
test   $0x8,%bpl
jne    11f6 <SMB_AtrToStr+0xe6>
test   $0x10,%bpl
jne    1220 <SMB_AtrToStr+0x110>
test   $0x20,%bpl
je     116e <SMB_AtrToStr+0x5e>
test   %ebx,%ebx
lea    0xeea(%rip),%rax
lea    0xeda(%rip),%rsi
cmove  %rax,%rsi
lea    0x2ed7(%rip),%rdi
call   1030 <strcat@plt>
lea    0x2ecb(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
test   %ebx,%ebx
lea    0xe86(%rip),%rax
lea    0xe74(%rip),%rsi
cmove  %rax,%rsi
lea    0x2ea9(%rip),%rdi
call   1030 <strcat@plt>
test   $0x2,%bpl
je     112a <SMB_AtrToStr+0x1a>
test   %ebx,%ebx
lea    0xe6a(%rip),%rax
lea    0xe5b(%rip),%rsi
cmove  %rax,%rsi
lea    0x2e83(%rip),%rdi
call   1030 <strcat@plt>
test   $0x4,%bpl
je     1134 <SMB_AtrToStr+0x24>
test   %ebx,%ebx
lea    0xe4a(%rip),%rax
lea    0xe3b(%rip),%rsi
cmove  %rax,%rsi
lea    0x2e59(%rip),%rdi
call   1030 <strcat@plt>
test   $0x8,%bpl
je     113e <SMB_AtrToStr+0x2e>
test   %ebx,%ebx
lea    0xe2a(%rip),%rax
lea    0xe1b(%rip),%rsi
cmove  %rax,%rsi
lea    0x2e2f(%rip),%rdi
call   1030 <strcat@plt>
test   $0x10,%bpl
je     1148 <SMB_AtrToStr+0x38>
test   %ebx,%ebx
lea    0xe0d(%rip),%rax
lea    0xdfb(%rip),%rsi
cmove  %rax,%rsi
lea    0x2e05(%rip),%rdi
call   1030 <strcat@plt>
test   $0x20,%bpl
jne    114e <SMB_AtrToStr+0x3e>
jmp    116e <SMB_AtrToStr+0x5e>

LLVM IR (-O0):
@SMB_AtrToStr.SMB_Attrib_Temp = internal global [128 x i8] zeroinitializer
@.str = [11 x i8] c"Read Only \00"
@.str.1 = [2 x i8] c"R\00"
@.str.2 = [8 x i8] c"Hidden \00"
@.str.3 = [2 x i8] c"H\00"
@.str.4 = [8 x i8] c"System \00"
@.str.5 = [2 x i8] c"S\00"
@.str.6 = [8 x i8] c"Volume \00"
@.str.7 = [2 x i8] c"V\00"
@.str.8 = [11 x i8] c"Directory \00"
@.str.9 = [2 x i8] c"D\00"
@.str.10 = [9 x i8] c"Archive \00"
@.str.11 = [2 x i8] c"A\00"
define i8* @SMB_AtrToStr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0)
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%13 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %8, %2
%15 = load i32, i32* %3
%16 = and i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%23 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %18, %14
%25 = load i32, i32* %3
%26 = and i32 %25, 4
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = load i32, i32* %4
%30 = icmp ne i32 %29, 0
%31 = zext i1 %30 to i64
%32 = select i1 %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0)
%33 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %28, %24
%35 = load i32, i32* %3
%36 = and i32 %35, 8
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %34
%39 = load i32, i32* %4
%40 = icmp ne i32 %39, 0
%41 = zext i1 %40 to i64
%42 = select i1 %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0)
%43 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %38, %34
%45 = load i32, i32* %3
%46 = and i32 %45, 16
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %54
48: ; preds = %44
%49 = load i32, i32* %4
%50 = icmp ne i32 %49, 0
%51 = zext i1 %50 to i64
%52 = select i1 %50, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%53 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %48, %44
%55 = load i32, i32* %3
%56 = and i32 %55, 32
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %54
%59 = load i32, i32* %4
%60 = icmp ne i32 %59, 0
%61 = zext i1 %60 to i64
%62 = select i1 %60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0)
%63 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %62)
br label %64
64: ; preds = %58, %54
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0)
}

LLVM IR (-O2):
@SMB_AtrToStr.SMB_Attrib_Temp = internal global [128 x i8] zeroinitializer
@.str = [11 x i8] c"Read Only \00"
@.str.1 = [2 x i8] c"R\00"
@.str.2 = [8 x i8] c"Hidden \00"
@.str.3 = [2 x i8] c"H\00"
@.str.4 = [8 x i8] c"System \00"
@.str.5 = [2 x i8] c"S\00"
@.str.6 = [8 x i8] c"Volume \00"
@.str.7 = [2 x i8] c"V\00"
@.str.8 = [11 x i8] c"Directory \00"
@.str.9 = [2 x i8] c"D\00"
@.str.10 = [9 x i8] c"Archive \00"
@.str.11 = [2 x i8] c"A\00"
define i8* @SMB_AtrToStr(i32 %0, i32 %1) {
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0)
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
%8 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %2
%10 = and i32 %0, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = icmp eq i32 %1, 0
%14 = select i1 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%15 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %9
%17 = and i32 %0, 4
%18 = icmp eq i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = icmp eq i32 %1, 0
%21 = select i1 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0)
%22 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %19, %16
%24 = and i32 %0, 8
%25 = icmp eq i32 %24, 0
br i1 %25, label %30, label %26
26: ; preds = %23
%27 = icmp eq i32 %1, 0
%28 = select i1 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%29 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %26, %23
%31 = and i32 %0, 16
%32 = icmp eq i32 %31, 0
br i1 %32, label %37, label %33
33: ; preds = %30
%34 = icmp eq i32 %1, 0
%35 = select i1 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0)
%36 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %33, %30
%38 = and i32 %0, 32
%39 = icmp eq i32 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %37
%41 = icmp eq i32 %1, 0
%42 = select i1 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0)
%43 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %40, %37
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMB_AtrToStr.SMB_Attrib_Temp, i64 0, i64 0)
}