char *mkline(n)
register int n;
{
  static char lbuf[9];
  register int i = 2;
  strcpy(lbuf, "        ");
  lbuf[i++] = (n % 10) + '0';
  n /= 10;
  if (n != 0) {
    lbuf[i++] = (n % 10) + '0';
    n /= 10;
  }
  if (n != 0) {
    lbuf[i++] = (n % 10) + '0';
    n /= 10;
  }
  if (n != 0) {
    lbuf[i++] = (n % 10) + '0';
    n /= 10;
  }
  if (n != 0) {
    lbuf[i++] = (n % 10) + '0';
    n /= 10;
  }
  return lbuf;
}


x86 assembly (clang, -O0):
<mkline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    0x2f00(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
movslq %eax,%rcx
lea    0x2ed1(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11a7 <mkline+0x97>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
movslq %eax,%rcx
lea    0x2e93(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11e5 <mkline+0xd5>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
movslq %eax,%rcx
lea    0x2e55(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1223 <mkline+0x113>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
movslq %eax,%rcx
lea    0x2e17(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1261 <mkline+0x151>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
movslq %eax,%rcx
lea    0x2dd9(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
lea    0x2dc1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkline>:
movabs $0x2020202020202020,%rax
20 20 20
mov    %rax,0x2f10(%rip)
movb   $0x0,0x2f11(%rip)
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %eax,%esi
sub    %edx,%esi
add    $0x30,%sil
mov    %sil,0x2edf(%rip)
lea    0x9(%rax),%edx
cmp    $0x13,%edx
jb     1255 <mkline+0x155>
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
add    $0x30,%cl
mov    %cl,0x2ead(%rip)
lea    0x63(%rdi),%ecx
cmp    $0xc7,%ecx
jb     1255 <mkline+0x155>
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
add    $0x30,%cl
mov    %cl,0x2e64(%rip)
lea    0x3e7(%rdi),%ecx
cmp    $0x7cf,%ecx
jb     1255 <mkline+0x155>
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
add    $0x30,%cl
mov    %cl,0x2e18(%rip)
add    $0x270f,%edi
cmp    $0x4e1f,%edi
jb     1255 <mkline+0x155>
imul   $0x68db8bad,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,0x2dd2(%rip)
lea    0x2dc5(%rip),%rax
ret

LLVM IR (-O0):
@mkline.lbuf = internal global [9 x i8] zeroinitializer
@.str = [9 x i8] c" \00"
define i8* @mkline(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = call i8* @strcpy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = srem i32 %5, 10
%7 = add nsw i32 %6, 48
%8 = trunc i32 %7 to i8
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds [9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 %11
store i8 %8, i8* %12
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %1
%18 = load i32, i32* %2
%19 = srem i32 %18, 10
%20 = add nsw i32 %19, 48
%21 = trunc i32 %20 to i8
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
%24 = sext i32 %22 to i64
%25 = getelementptr inbounds [9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 %24
store i8 %21, i8* %25
%26 = load i32, i32* %2
%27 = sdiv i32 %26, 10
store i32 %27, i32* %2
br label %28
28: ; preds = %17, %1
%29 = load i32, i32* %2
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %42
31: ; preds = %28
%32 = load i32, i32* %2
%33 = srem i32 %32, 10
%34 = add nsw i32 %33, 48
%35 = trunc i32 %34 to i8
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
%38 = sext i32 %36 to i64
%39 = getelementptr inbounds [9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 %38
store i8 %35, i8* %39
%40 = load i32, i32* %2
%41 = sdiv i32 %40, 10
store i32 %41, i32* %2
br label %42
42: ; preds = %31, %28
%43 = load i32, i32* %2
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %56
45: ; preds = %42
%46 = load i32, i32* %2
%47 = srem i32 %46, 10
%48 = add nsw i32 %47, 48
%49 = trunc i32 %48 to i8
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 1
store i32 %51, i32* %3
%52 = sext i32 %50 to i64
%53 = getelementptr inbounds [9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 %52
store i8 %49, i8* %53
%54 = load i32, i32* %2
%55 = sdiv i32 %54, 10
store i32 %55, i32* %2
br label %56
56: ; preds = %45, %42
%57 = load i32, i32* %2
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %70
59: ; preds = %56
%60 = load i32, i32* %2
%61 = srem i32 %60, 10
%62 = add nsw i32 %61, 48
%63 = trunc i32 %62 to i8
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
%66 = sext i32 %64 to i64
%67 = getelementptr inbounds [9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 %66
store i8 %63, i8* %67
%68 = load i32, i32* %2
%69 = sdiv i32 %68, 10
store i32 %69, i32* %2
br label %70
70: ; preds = %59, %56
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@mkline.lbuf = internal global [9 x i8] zeroinitializer
@.str = [9 x i8] c" \00"
define i8* @mkline(i32 %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 0), i8* align 1 dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9, i1 false)
%2 = srem i32 %0, 10
%3 = sdiv i32 %0, 10
%4 = trunc i32 %2 to i8
%5 = add nsw i8 %4, 48
store i8 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 2)
%6 = add i32 %0, 9
%7 = icmp ult i32 %6, 19
br i1 %7, label %33, label %8
8: ; preds = %1
%9 = srem i32 %3, 10
%10 = trunc i32 %9 to i8
%11 = add nsw i8 %10, 48
store i8 %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 3)
%12 = add i32 %0, 99
%13 = icmp ult i32 %12, 199
br i1 %13, label %33, label %14
14: ; preds = %8
%15 = sdiv i32 %0, 100
%16 = srem i32 %15, 10
%17 = trunc i32 %16 to i8
%18 = add nsw i8 %17, 48
store i8 %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 4)
%19 = add i32 %0, 999
%20 = icmp ult i32 %19, 1999
br i1 %20, label %33, label %21
21: ; preds = %14
%22 = sdiv i32 %0, 1000
%23 = srem i32 %22, 10
%24 = trunc i32 %23 to i8
%25 = add nsw i8 %24, 48
store i8 %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 5)
%26 = add i32 %0, 9999
%27 = icmp ult i32 %26, 19999
br i1 %27, label %33, label %28
28: ; preds = %21
%29 = sdiv i32 %0, 10000
%30 = srem i32 %29, 10
%31 = trunc i32 %30 to i8
%32 = add nsw i8 %31, 48
store i8 %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 6)
br label %33
33: ; preds = %1, %8, %14, %28, %21
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @mkline.lbuf, i64 0, i64 0)
}