getmem(sym) char *sym;
{
  debug_ol("; getmem");
  if ((sym[11] != 3) & (sym[12] == 1)) {
    ot("ldab	");
    outname(sym + 0);
    nl();
    callrts("ccsex");
  } else {
    ot("ldd	");
    outname(sym + 0);
    nl();
  }
}


x86 assembly (clang, -O0):
<getmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1070 <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     11cf <getmem+0x7f>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1060 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <outname@plt>
mov    $0x0,%al
call   1030 <nl@plt>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1040 <callrts@plt>
jmp    11ef <getmem+0x9f>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1060 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <outname@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmem>:
push   %rbx
mov    %rdi,%rbx
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1070 <debug_ol@plt>
cmpb   $0x3,0xb(%rbx)
je     119d <getmem+0x4d>
cmpb   $0x1,0xc(%rbx)
jne    119d <getmem+0x4d>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1060 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <outname@plt>
xor    %eax,%eax
call   1030 <nl@plt>
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1040 <callrts@plt>
pop    %rbx
ret
lea    0xe71(%rip),%rdi
xor    %eax,%eax
call   1060 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <outname@plt>
xor    %eax,%eax
call   1030 <nl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"; getmem\00"
@.str.1 = [6 x i8] c"ldab\09\00"
@.str.2 = [6 x i8] c"ccsex\00"
@.str.3 = [5 x i8] c"ldd\09\00"
define i32 @getmem(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 %26
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)
%24 = call i32 (...) @nl()
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %32
26: ; preds = %1
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %29)
%31 = call i32 (...) @nl()
br label %32
32: ; preds = %26, %19
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
@.str = [9 x i8] c"; getmem\00"
@.str.1 = [6 x i8] c"ldab\09\00"
@.str.2 = [6 x i8] c"ccsex\00"
@.str.3 = [5 x i8] c"ldd\09\00"
define i32 @getmem(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
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%13 = tail call i32 (...) @nl()
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %19
15: ; preds = %1
%16 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%18 = tail call i32 (...) @nl()
br label %19
19: ; preds = %15, %10
ret i32 undef
}