putmem(sym) char *sym;
{
  debug_ol("; putmem");
  if ((sym[11] != 3) & (sym[12] == 1)) {
    ot("stab	");
    outname(sym + 0);
  } else {
    ot("std	");
    outname(sym + 0);
  }
  nl();
}


x86 assembly (clang, -O0):
<putmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1060 <debug_ol@plt>
mov    -0x10(%rbp),%rax
movsbl 0xb(%rax),%eax
cmp    $0x3,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%rcx
movsbl 0xc(%rcx),%ecx
cmp    $0x1,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     11aa <putmem+0x6a>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outname@plt>
jmp    11c3 <putmem+0x83>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outname@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putmem>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1060 <debug_ol@plt>
cmpb   $0x1,0xc(%rbx)
lea    0xeac(%rip),%rdi
lea    0xeab(%rip),%rax
cmovne %rax,%rdi
cmpb   $0x3,0xb(%rbx)
cmove  %rax,%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outname@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"; putmem\00"
@.str.1 = [6 x i8] c"stab\09\00"
@.str.2 = [5 x i8] c"std\09\00"
define i32 @putmem(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 11
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 3
%10 = zext i1 %9 to i32
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 12
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 1
%16 = zext i1 %15 to i32
%17 = and i32 %10, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %1
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %22)
br label %29
24: ; preds = %1
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %27)
br label %29
29: ; preds = %24, %19
%30 = call i32 (...) @nl()
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@.str = [9 x i8] c"; putmem\00"
@.str.1 = [6 x i8] c"stab\09\00"
@.str.2 = [5 x i8] c"std\09\00"
define i32 @putmem(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 11
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 3
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 1
%9 = and i1 %5, %8
%10 = select i1 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %10)
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%13 = tail call i32 (...) @nl()
ret i32 undef
}