putmem(sym) char *sym;
{
  if ((sym[11] != 3) & (sym[12] == 1)) {
    ot("MOV  [");
    outstr(sym + 0);
    ot("],AL");
    nl();
  } else {
    ot("MOV  [");
    outstr(sym + 0);
    ot("],AX");
    nl();
  }
}


x86 assembly (clang, -O0):
<putmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
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     11a1 <putmem+0x71>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    $0x0,%al
call   1030 <nl@plt>
jmp    11cf <putmem+0x9f>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putmem>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0xb(%rdi),%bpl
mov    0xc(%rdi),%r14b
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
cmp    $0x1,%r14b
lea    0xea5(%rip),%rdi
lea    0xea3(%rip),%rax
cmovne %rax,%rdi
cmp    $0x3,%bpl
cmove  %rax,%rdi
xor    %eax,%eax
call   1050 <ot@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"MOV [\00"
@.str.1 = [5 x i8] c"],AL\00"
@.str.2 = [5 x i8] c"],AX\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 11
%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 12
%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 ([7 x i8], [7 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 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 (...) @nl()
br label %32
25: ; preds = %1
%26 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, 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 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, 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 = [7 x i8] c"MOV [\00"
@.str.1 = [5 x i8] c"],AL\00"
@.str.2 = [5 x i8] c"],AX\00"
define i32 @putmem(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 11
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 12
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 1
%8 = and i1 %4, %7
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%11 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %11)
%13 = tail call i32 (...) @nl()
ret i32 undef
}