char *gsstring(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 ");
  }
  return (string);
}


x86 assembly (clang, -O0):
<gsstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    1152 <gsstring+0x32>
lea    0x2eff(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11a4 <gsstring+0x84>
lea    0x2ee7(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     118c <gsstring+0x6c>
lea    0x2ec5(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcat@plt>
jmp    119f <gsstring+0x7f>
lea    0x2ead(%rip),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcat@plt>
jmp    11a4 <gsstring+0x84>
lea    0x2e95(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsstring>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   $0x8,%bl
jne    112e <gsstring+0x1e>
movb   $0x0,0x2f22(%rip)
movl   $0x20646e75,0x2f14(%rip)
6e 64 20
jmp    116c <gsstring+0x5c>
movb   $0x0,0x2f0f(%rip)
movl   $0x20666564,0x2f01(%rip)
65 66 20
lea    0x2efa(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %r14,%rax
test   $0x20,%bl
jne    1162 <gsstring+0x52>
movb   $0x0,0x4(%rax)
movl   $0x20736261,(%rax)
jmp    116c <gsstring+0x5c>
movb   $0x0,0x4(%rax)
movl   $0x206c6572,(%rax)
lea    0x2ecd(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@gsstring.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"
define i8* @gsstring(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]* @gsstring.string, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %18
8: ; preds = %1
%9 = call i8* @strcpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gsstring.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]* @gsstring.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]* @gsstring.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
br label %18
18: ; preds = %17, %6
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gsstring.string, i64 0, i64 0)
}

LLVM IR (-O2):
@gsstring.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"
define i8* @gsstring(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]* @gsstring.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 %12
5: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(5) getelementptr inbounds ([50 x i8], [50 x i8]* @gsstring.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]* @gsstring.string, i64 0, i64 0))
%9 = getelementptr [50 x i8], [50 x i8]* @gsstring.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 = %10, %11, %4
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gsstring.string, i64 0, i64 0)
}