void tmodes(incap, outcap, instr, outstr, def_instr, def_outstr,
            spp) char *incap;
char *outcap;
char **instr;
char **outstr;
char *def_instr;
char *def_outstr;
char **spp;
{
  *instr = ltgetstr(incap, spp);
  if (*instr == 0) {
    *instr = def_instr;
    *outstr = def_outstr;
    return;
  }
  *outstr = ltgetstr(outcap, spp);
  if (*outstr == 0)
    *outstr = ltgetstr("me", spp);
  if (*outstr == 0)
    *outstr = "";
}


x86 assembly (clang, -O0):
<tmodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <ltgetstr@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1176 <tmodes+0x66>
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    11d5 <tmodes+0xc5>
mov    -0x10(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <ltgetstr@plt>
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11b9 <tmodes+0xa9>
mov    0x10(%rbp),%rsi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <ltgetstr@plt>
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11d5 <tmodes+0xc5>
mov    -0x20(%rbp),%rax
lea    0xe30(%rip),%rcx
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmodes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r12
mov    %r8,%r13
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    0x40(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <ltgetstr@plt>
cltq
mov    %rax,0x0(%rbp)
test   %eax,%eax
je     1160 <tmodes+0x50>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <ltgetstr@plt>
cltq
mov    %rax,(%r15)
test   %eax,%eax
je     1166 <tmodes+0x56>
test   %rax,%rax
jne    118b <tmodes+0x7b>
jmp    1181 <tmodes+0x71>
mov    %r13,0x0(%rbp)
jmp    1188 <tmodes+0x78>
lea    0xe93(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <ltgetstr@plt>
cltq
mov    %rax,(%r15)
test   %rax,%rax
jne    118b <tmodes+0x7b>
lea    0xe7a(%rip),%r12
mov    %r12,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"me\00"
@.str.1 = [1 x i8] zeroinitializer
define void @tmodes(i8* %0, i8* %1, i8** %2, i8** %3, i8* %4, i8* %5, i8** %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i8**
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8**
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8** %2, i8*** %10
store i8** %3, i8*** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8** %6, i8*** %14
%15 = load i8*, i8** %8
%16 = load i8**, i8*** %14
%17 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ltgetstr to i32 (i8*, i8**, ...)*)(i8* %15, i8** %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
%20 = load i8**, i8*** %10
store i8* %19, i8** %20
%21 = load i8**, i8*** %10
%22 = load i8*, i8** %21
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %29
24: ; preds = %7
%25 = load i8*, i8** %12
%26 = load i8**, i8*** %10
store i8* %25, i8** %26
%27 = load i8*, i8** %13
%28 = load i8**, i8*** %11
store i8* %27, i8** %28
br label %51
29: ; preds = %7
%30 = load i8*, i8** %9
%31 = load i8**, i8*** %14
%32 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ltgetstr to i32 (i8*, i8**, ...)*)(i8* %30, i8** %31)
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to i8*
%35 = load i8**, i8*** %11
store i8* %34, i8** %35
%36 = load i8**, i8*** %11
%37 = load i8*, i8** %36
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %45
39: ; preds = %29
%40 = load i8**, i8*** %14
%41 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ltgetstr to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %40)
%42 = sext i32 %41 to i64
%43 = inttoptr i64 %42 to i8*
%44 = load i8**, i8*** %11
store i8* %43, i8** %44
br label %45
45: ; preds = %39, %29
%46 = load i8**, i8*** %11
%47 = load i8*, i8** %46
%48 = icmp eq i8* %47, null
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = load i8**, i8*** %11
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %50
br label %51
51: ; preds = %24, %49, %45
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"me\00"
@.str.1 = [1 x i8] zeroinitializer
define void @tmodes(i8* %0, i8* %1, i8** nocapture writeonly %2, i8** nocapture %3, i8* %4, i8* %5, i8** %6) {
%8 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ltgetstr to i32 (i8*, i8**, ...)*)(i8* %0, i8** %6)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %2
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i8* %4, i8** %2
br label %25
13: ; preds = %7
%14 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ltgetstr to i32 (i8*, i8**, ...)*)(i8* %1, i8** %6)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %3
%17 = icmp eq i32 %14, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @ltgetstr to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %6)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %3
br label %22
22: ; preds = %18, %13
%23 = phi i8* [ %21, %18 ], [ %16, %13 ]
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %27
25: ; preds = %22, %12
%26 = phi i8* [ %5, %12 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %22 ]
store i8* %26, i8** %3
br label %27
27: ; preds = %25, %22
ret void
}