getmem(sym) char *sym;
{
  if ((sym[9] != 3) & (sym[10] == 1)) {
    ot("LDA ");
    outname(sym + 0);
    nl();
    callrts("ccsxt");
  } else {
    ot("movl ");
    outname(sym + 0);
    outasm(", %eax");
    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     11c1 <getmem+0x71>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1070 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <outname@plt>
mov    $0x0,%al
call   1030 <nl@plt>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1050 <callrts@plt>
jmp    11ef <getmem+0x9f>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1070 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <outname@plt>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <outasm@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     118f <getmem+0x3f>
cmpb   $0x1,0xa(%rbx)
jne    118f <getmem+0x3f>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1070 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <outname@plt>
xor    %eax,%eax
call   1030 <nl@plt>
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1050 <callrts@plt>
pop    %rbx
ret
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1070 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <outname@plt>
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1040 <outasm@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"movl \00"
@.str.3 = [7 x i8] c", %eax\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 (...)* @outname to i32 (i8*, ...)*)(i8* %21)
%23 = call i32 (...) @nl()
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %32
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 (...)* @outname to i32 (i8*, ...)*)(i8* %28)
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 (...) @nl()
br label %32
32: ; preds = %25, %18
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
@.str = [5 x i8] c"LDA \00"
@.str.1 = [6 x i8] c"ccsxt\00"
@.str.2 = [6 x i8] c"movl \00"
@.str.3 = [7 x i8] c", %eax\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 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%12 = tail call i32 (...) @nl()
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %19
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 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%17 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%18 = tail call i32 (...) @nl()
br label %19
19: ; preds = %14, %9
ret i32 undef
}