getmem(sym) char *sym;
{
  if ((sym[9] != 3) & (sym[10] == 1)) {
    ot("LDA ");
    outstr(sym + 0);
    nl();
    call("ccsxt");
  } else {
    ot("LHLD ");
    outstr(sym + 0);
    nl();
  }
}


x86 assembly (clang, -O0):
<getmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x9(%rax),%eax
cmp    $0x3,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%rcx
movsbl 0xa(%rcx),%ecx
cmp    $0x1,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     11b1 <getmem+0x71>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1060 <call@plt>
jmp    11d1 <getmem+0x91>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@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
cmpb   $0x3,0x9(%rdi)
je     117f <getmem+0x3f>
cmpb   $0x1,0xa(%rbx)
jne    117f <getmem+0x3f>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
call   1030 <nl@plt>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1060 <call@plt>
pop    %rbx
ret
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
call   1030 <nl@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"LDA \00"
@.str.1 = [6 x i8] c"ccsxt\00"
@.str.2 = [6 x i8] c"LHLD \00"
define i32 @getmem(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 9
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 10
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 1
%8 = and i1 %4, %7
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%12 = tail call i32 (...) @nl()
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @call to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %18
14: ; preds = %1
%15 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%17 = tail call i32 (...) @nl()
br label %18
18: ; preds = %14, %9
ret i32 undef
}