indirect(typeobj) char typeobj;
{
  if (typeobj == 2) {
    ol("xgdx");
    ol("ldd	0,x");
  } else {
    ol("xgdx");
    ol("ldab	0,x");
    callrts("ccsex");
  }
}


x86 assembly (clang, -O0):
<indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2,%eax
jne    115c <indirect+0x3c>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
jmp    1186 <indirect+0x66>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <ol@plt>
cmp    $0x2,%bl
jne    1146 <indirect+0x26>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <ol@plt>
pop    %rbx
ret
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <ol@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <callrts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"xgdx\00"
@.str.1 = [8 x i8] c"ldd\090,x\00"
@.str.2 = [9 x i8] c"ldab\090,x\00"
@.str.3 = [6 x i8] c"ccsex\00"
define i32 @indirect(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %15
11: ; preds = %1
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %11, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"xgdx\00"
@.str.1 = [8 x i8] c"ldd\090,x\00"
@.str.2 = [9 x i8] c"ldab\090,x\00"
@.str.3 = [6 x i8] c"ccsex\00"
define i32 @indirect(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 2
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br i1 %3, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %7, %5
ret i32 undef
}