void ltstr(minwidth, val, dest) const int minwidth;
const long val;
char *dest;
{
  if (val < 0) {
    *dest = ' ';
    ultstr(minwidth - 1, -val, dest + 1);
    while (*++dest == ' ')
      ;
    dest[-1] = '-';
  } else
    ultstr(minwidth, val, dest);
}


x86 assembly (clang, -O0):
<ltstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1180 <ltstr+0x70>
mov    -0x18(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
sub    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
mov    $0x0,%al
call   1030 <ultstr@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
jne    1173 <ltstr+0x63>
jmp    1152 <ltstr+0x42>
mov    -0x18(%rbp),%rax
movb   $0x2d,-0x1(%rax)
jmp    1192 <ltstr+0x82>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <ultstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltstr>:
push   %rbx
mov    %rdx,%rbx
test   %rsi,%rsi
js     1124 <ltstr+0x14>
mov    %rbx,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <ultstr@plt>
movb   $0x20,(%rbx)
add    $0xffffffff,%edi
neg    %rsi
add    $0x1,%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <ultstr@plt>
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,(%rbx)
lea    0x1(%rbx),%rbx
je     1140 <ltstr+0x30>
movb   $0x2d,-0x2(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ltstr(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %28
9: ; preds = %3
%10 = load i8*, i8** %6
store i8 32, i8* %10
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = load i64, i64* %5
%14 = sub nsw i64 0, %13
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 (i32, i64, i8*, ...) bitcast (i32 (...)* @ultstr to i32 (i32, i64, i8*, ...)*)(i32 %12, i64 %14, i8* %16)
br label %18
18: ; preds = %24, %9
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %6
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 32
br i1 %23, label %24, label %25
24: ; preds = %18
br label %18
25: ; preds = %18
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i64 -1
store i8 45, i8* %27
br label %33
28: ; preds = %3
%29 = load i32, i32* %4
%30 = load i64, i64* %5
%31 = load i8*, i8** %6
%32 = call i32 (i32, i64, i8*, ...) bitcast (i32 (...)* @ultstr to i32 (i32, i64, i8*, ...)*)(i32 %29, i64 %30, i8* %31)
br label %33
33: ; preds = %28, %25
ret void
}

LLVM IR (-O2):
define void @ltstr(i32 %0, i64 %1, i8* %2) {
%4 = icmp slt i64 %1, 0
br i1 %4, label %5, label %16
5: ; preds = %3
store i8 32, i8* %2
%6 = add nsw i32 %0, -1
%7 = sub nsw i64 0, %1
%8 = getelementptr inbounds i8, i8* %2, i64 1
%9 = tail call i32 (i32, i64, i8*, ...) bitcast (i32 (...)* @ultstr to i32 (i32, i64, i8*, ...)*)(i32 %6, i64 %7, i8* %8)
br label %10
10: ; preds = %10, %5
%11 = phi i8* [ %2, %5 ], [ %12, %10 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 32
br i1 %14, label %10, label %15
15: ; preds = %10
store i8 45, i8* %11
br label %18
16: ; preds = %3
%17 = tail call i32 (i32, i64, i8*, ...) bitcast (i32 (...)* @ultstr to i32 (i32, i64, i8*, ...)*)(i32 %0, i64 %1, i8* %2)
br label %18
18: ; preds = %16, %15
ret void
}