int x_xtree(c)
int c;
{
  int num;
  char **sel = xtree_get_selection(&num);
  int ind;
  for (ind = 0; ind < num; ind++) {
    char *qsel = x_quotify(sel[ind], 0);
    x_ins(qsel);
    free(qsel);
    x_ins(" ");
  }
  free(sel);
  x_redraw(-1);
  return 0;
}


x86 assembly (clang, -O0):
<x_xtree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <xtree_get_selection@plt>
cltq
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ca <x_xtree+0x7a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <x_quotify@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1060 <x_ins@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1060 <x_ins@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <x_xtree+0x23>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0xffffffff,%edi
mov    $0x0,%al
call   1070 <x_redraw@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_xtree>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1050 <xtree_get_selection@plt>
movslq %eax,%r15
cmpl   $0x0,0x4(%rsp)
jle    11ba <x_xtree+0x6a>
lea    0xe8b(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <x_quotify@plt>
movslq %eax,%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <x_ins@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <x_ins@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
cmp    %rax,%rbx
jl     1180 <x_xtree+0x30>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%edi
xor    %eax,%eax
call   1070 <x_redraw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @x_xtree(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %2
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @xtree_get_selection to i32 (i32*, ...)*)(i32* %3)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %4
store i32 0, i32* %5
br label %10
10: ; preds = %27, %1
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %30
14: ; preds = %10
%15 = load i8**, i8*** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @x_quotify to i32 (i8*, i32, ...)*)(i8* %19, i32 0)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %6
%23 = load i8*, i8** %6
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @x_ins to i32 (i8*, ...)*)(i8* %23)
%25 = load i8*, i8** %6
%26 = call i32 (i8*, ...) bitcast (i32 (...)* @x_ins to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %14
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %10
30: ; preds = %10
%31 = load i8**, i8*** %4
%32 = bitcast i8** %31 to i8*
%33 = call i32 (i32, ...) bitcast (i32 (...)* @x_redraw to i32 (i32, ...)*)(i32 -1)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @x_xtree(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @xtree_get_selection to i32 (i32*, ...)*)(i32* %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8**
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %1, %9
%10 = phi i64 [ %18, %9 ], [ 0, %1 ]
%11 = getelementptr inbounds i8*, i8** %6, i64 %10
%12 = load i8*, i8** %11
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @x_quotify to i32 (i8*, i32, ...)*)(i8* %12, i32 0)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @x_ins to i32 (i8*, ...)*)(i8* %15)
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @x_ins to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = add nuw nsw i64 %10, 1
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %9, label %22
22: ; preds = %9, %1
%23 = inttoptr i64 %5 to i8*
%24 = call i32 (i32, ...) bitcast (i32 (...)* @x_redraw to i32 (i32, ...)*)(i32 -1)
ret i32 0
}