putmem(sym) char *sym;
{
  if ((sym[9] != 3) & (sym[10] == 1)) {
    ol("MOV A,L");
    ot("STA ");
  } else
    ot("SHLD ");
  outstr(sym + 0);
  nl();
}


x86 assembly (clang, -O0):
<putmem>:
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     119f <putmem+0x5f>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1060 <ol@plt>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
jmp    11ad <putmem+0x6d>
lea    0xe67(%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):
<putmem>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x3,0x9(%rdi)
lea    0xebe(%rip),%rdi
je     116c <putmem+0x2c>
cmpb   $0x1,0xa(%rbx)
jne    116c <putmem+0x2c>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1060 <ol@plt>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"MOV A,L\00"
@.str.1 = [5 x i8] c"STA \00"
@.str.2 = [6 x i8] c"SHLD \00"
define i32 @putmem(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 %21
18: ; preds = %1
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %23
21: ; preds = %1
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %25)
%27 = call i32 (...) @nl()
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@.str = [8 x i8] c"MOV A,L\00"
@.str.1 = [5 x i8] c"STA \00"
@.str.2 = [6 x i8] c"SHLD \00"
define i32 @putmem(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 %11
9: ; preds = %1
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %1, %9
%12 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %1 ]
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %12)
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%15 = tail call i32 (...) @nl()
ret i32 undef
}