char *lsstring(attr)
int attr;
{
  static char string[50];
  if (!(attr & 010))
    strcpy(string, "und ");
  else {
    strcpy(string, "def ");
    if (attr & 040)
      strcat(string, "rel ");
    else
      strcat(string, "abs ");
    if (attr & 0100)
      strcat(string, "gbl ");
    if (attr & 001)
      strcat(string, "reg ");
    if (attr & 002)
      strcat(string, "lbl ");
    if (attr & 0200)
      strcat(string, "hkl ");
  }
  return (string);
}


x86 assembly (clang, -O0):
<lsstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    1152 <lsstring+0x32>
lea    0x2eff(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122e <lsstring+0x10e>
lea    0x2ee7(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     118c <lsstring+0x6c>
lea    0x2ec5(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcat@plt>
jmp    119f <lsstring+0x7f>
lea    0x2ead(%rip),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     11c1 <lsstring+0xa1>
lea    0x2e8b(%rip),%rdi
lea    0xe58(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11e3 <lsstring+0xc3>
lea    0x2e69(%rip),%rdi
lea    0xe3b(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1205 <lsstring+0xe5>
lea    0x2e47(%rip),%rdi
lea    0xe1e(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1229 <lsstring+0x109>
lea    0x2e23(%rip),%rdi
lea    0xdff(%rip),%rsi
call   1040 <strcat@plt>
jmp    122e <lsstring+0x10e>
lea    0x2e0b(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsstring>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
test   $0x8,%bpl
jne    1131 <lsstring+0x21>
movb   $0x0,0x2f22(%rip)
movl   $0x20646e75,0x2f14(%rip)
6e 64 20
jmp    11b6 <lsstring+0xa6>
movb   $0x0,0x2f0c(%rip)
movl   $0x20666564,0x2efe(%rip)
65 66 20
lea    0x2ef7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
test   $0x20,%bpl
jne    116c <lsstring+0x5c>
movb   $0x0,0x4(%rax)
movl   $0x20736261,(%rax)
test   $0x40,%bpl
jne    117c <lsstring+0x6c>
jmp    1190 <lsstring+0x80>
movb   $0x0,0x4(%rax)
movl   $0x206c6572,(%rax)
test   $0x40,%bpl
je     1190 <lsstring+0x80>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x206c6267,(%rax,%rbx,1)
movb   $0x0,0x4(%rax,%rbx,1)
test   $0x1,%bpl
jne    11c4 <lsstring+0xb4>
test   $0x2,%bpl
jne    11de <lsstring+0xce>
test   $0x80,%bpl
je     11b6 <lsstring+0xa6>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x206c6b68,(%rax,%rbx,1)
movb   $0x0,0x4(%rax,%rbx,1)
lea    0x2e83(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x20676572,(%rax,%rbx,1)
movb   $0x0,0x4(%rax,%rbx,1)
test   $0x2,%bpl
je     119c <lsstring+0x8c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x206c626c,(%rax,%rbx,1)
movb   $0x0,0x4(%rax,%rbx,1)
test   $0x80,%bpl
jne    11a2 <lsstring+0x92>
jmp    11b6 <lsstring+0xa6>

LLVM IR (-O0):
@lsstring.string = internal global [50 x i8] zeroinitializer
@.str = [5 x i8] c"und \00"
@.str.1 = [5 x i8] c"def \00"
@.str.2 = [5 x i8] c"rel \00"
@.str.3 = [5 x i8] c"abs \00"
@.str.4 = [5 x i8] c"gbl \00"
@.str.5 = [5 x i8] c"reg \00"
@.str.6 = [5 x i8] c"lbl \00"
@.str.7 = [5 x i8] c"hkl \00"
define i8* @lsstring(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i8* @strcpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %42
8: ; preds = %1
%9 = call i8* @strcpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = and i32 %10, 32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i8* @strcat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %17
15: ; preds = %8
%16 = call i8* @strcat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %2
%19 = and i32 %18, 64
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i8* @strcat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %21, %17
%24 = load i32, i32* %2
%25 = and i32 %24, 1
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i8* @strcat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %29
29: ; preds = %27, %23
%30 = load i32, i32* %2
%31 = and i32 %30, 2
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i8* @strcat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %35
35: ; preds = %33, %29
%36 = load i32, i32* %2
%37 = and i32 %36, 128
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i8* @strcat(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %41
41: ; preds = %39, %35
br label %42
42: ; preds = %41, %6
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0)
}

LLVM IR (-O2):
@lsstring.string = internal global [50 x i8] zeroinitializer
@.str = [5 x i8] c"und \00"
@.str.1 = [5 x i8] c"def \00"
@.str.2 = [5 x i8] c"rel \00"
@.str.3 = [5 x i8] c"abs \00"
@.str.4 = [5 x i8] c"gbl \00"
@.str.5 = [5 x i8] c"reg \00"
@.str.6 = [5 x i8] c"lbl \00"
@.str.7 = [5 x i8] c"hkl \00"
define i8* @lsstring(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(5) getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
br label %36
5: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(5) getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0), i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5, i1 false)
%6 = and i32 %0, 32
%7 = icmp eq i32 %6, 0
%8 = tail call i64 @strlen(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0))
%9 = getelementptr [50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 %8
br i1 %7, label %11, label %10
10: ; preds = %5
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %9, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 5, i1 false)
br label %12
11: ; preds = %5
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %9, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 5, i1 false)
br label %12
12: ; preds = %11, %10
%13 = and i32 %0, 64
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = tail call i64 @strlen(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0))
%17 = getelementptr [50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 %16
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %17, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5, i1 false)
br label %18
18: ; preds = %15, %12
%19 = and i32 %0, 1
%20 = icmp eq i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = tail call i64 @strlen(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0))
%23 = getelementptr [50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 %22
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %23, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 5, i1 false)
br label %24
24: ; preds = %21, %18
%25 = and i32 %0, 2
%26 = icmp eq i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = tail call i64 @strlen(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0))
%29 = getelementptr [50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 %28
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %29, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 5, i1 false)
br label %30
30: ; preds = %27, %24
%31 = and i32 %0, 128
%32 = icmp eq i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %30
%34 = tail call i64 @strlen(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0))
%35 = getelementptr [50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 %34
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %35, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 5, i1 false)
br label %36
36: ; preds = %30, %33, %4
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @lsstring.string, i64 0, i64 0)
}