prnum(x) register unsigned x;
{
  static char numbuf[8];
  register char *cp = numbuf + sizeof(numbuf) - 1;
  *cp = '\0';
  while (x >= 10) {
    *--cp = (x % 10) + '0';
    x /= 10;
  }
  *--cp = x + '0';
  prs(cp);
}


x86 assembly (clang, -O0):
<prnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0x2f07(%rip),%rax
add    $0x7,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0xa,-0x8(%rbp)
jb     1172 <prnum+0x62>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
jmp    1131 <prnum+0x21>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <prs@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prnum>:
mov    %edi,%eax
movb   $0x0,0x2f17(%rip)
cmp    $0xa,%edi
jb     1157 <prnum+0x47>
lea    0x2f0b(%rip),%rdi
mov    $0xcccccccd,%r8d
mov    %eax,%ecx
nopl   (%rax)
mov    %ecx,%eax
imul   %r8,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
or     $0x30,%dl
mov    %dl,-0x1(%rdi)
add    $0xffffffffffffffff,%rdi
cmp    $0x63,%ecx
mov    %eax,%ecx
ja     1130 <prnum+0x20>
jmp    115e <prnum+0x4e>
lea    0x2ed2(%rip),%rdi
add    $0x30,%al
mov    %al,-0x1(%rdi)
add    $0xffffffffffffffff,%rdi
xor    %eax,%eax
jmp    1030 <prs@plt>

LLVM IR (-O0):
@prnum.numbuf = internal global [8 x i8] zeroinitializer
define i32 @prnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @prnum.numbuf, i64 1, i64 -1), i8** %4
%5 = load i8*, i8** %4
store i8 0, i8* %5
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %3
%8 = icmp uge i32 %7, 10
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = urem i32 %10, 10
%12 = add i32 %11, 48
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 -1
store i8* %15, i8** %4
store i8 %13, i8* %15
%16 = load i32, i32* %3
%17 = udiv i32 %16, 10
store i32 %17, i32* %3
br label %6
18: ; preds = %6
%19 = load i32, i32* %3
%20 = add i32 %19, 48
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 -1
store i8* %23, i8** %4
store i8 %21, i8* %23
%24 = load i8*, i8** %4
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @prs to i32 (i8*, ...)*)(i8* %24)
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@prnum.numbuf = internal global [8 x i8] zeroinitializer
define i32 @prnum(i32 %0) {
store i8 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @prnum.numbuf, i64 0, i64 7)
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i8* [ %9, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @prnum.numbuf, i64 0, i64 7), %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = trunc i32 %6 to i8
%8 = or i8 %7, 48
%9 = getelementptr inbounds i8, i8* %4, i64 -1
store i8 %8, i8* %9
%10 = udiv i32 %5, 10
%11 = icmp ugt i32 %5, 99
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ %0, %1 ], [ %10, %3 ]
%14 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @prnum.numbuf, i64 0, i64 7), %1 ], [ %9, %3 ]
%15 = trunc i32 %13 to i8
%16 = add nuw nsw i8 %15, 48
%17 = getelementptr inbounds i8, i8* %14, i64 -1
store i8 %16, i8* %17
%18 = tail call i32 (i8*, ...) bitcast (i32 (...)* @prs to i32 (i8*, ...)*)(i8* %17)
ret i32 undef
}