pnum(x) long double *x;
{
  char str[30];
  double d;
  unsigned short *p;
  int i;
  p = (unsigned short *)x;
  for (i = 0; i < 6; i++)
    printf("%04x ", *p++ & 0xffff);
  e64toasc(x, str, 20);
  printf(" = %s\n", str);
}


x86 assembly (clang, -O0):
<pnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jge    1179 <pnum+0x59>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x40(%rbp)
movzwl (%rax),%esi
and    $0xffff,%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    113b <pnum+0x1b>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x14,%edx
mov    $0x0,%al
call   1040 <e64toasc@plt>
lea    -0x30(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnum>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
movzwl (%rdi),%esi
lea    0xecc(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0x2(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0x6(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0xa(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x14,%edx
xor    %eax,%eax
call   1040 <e64toasc@plt>
lea    0xe66(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%04x \00"
@.str.1 = [7 x i8] c" = %s\0A\00"
define i32 @pnum(x86_fp80* %0) {
%2 = alloca i32
%3 = alloca x86_fp80*
%4 = alloca [30 x i8]
%5 = alloca double
%6 = alloca i16*
%7 = alloca i32
store x86_fp80* %0, x86_fp80** %3
%8 = load x86_fp80*, x86_fp80** %3
%9 = bitcast x86_fp80* %8 to i16*
store i16* %9, i16** %6
store i32 0, i32* %7
br label %10
10: ; preds = %20, %1
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 6
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i16*, i16** %6
%15 = getelementptr inbounds i16, i16* %14, i32 1
store i16* %15, i16** %6
%16 = load i16, i16* %14
%17 = zext i16 %16 to i32
%18 = and i32 %17, 65535
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %10
23: ; preds = %10
%24 = load x86_fp80*, x86_fp80** %3
%25 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%26 = call i32 (x86_fp80*, i8*, i32, ...) bitcast (i32 (...)* @e64toasc to i32 (x86_fp80*, i8*, i32, ...)*)(x86_fp80* %24, i8* %25, i32 20)
%27 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@.str = [6 x i8] c"%04x \00"
@.str.1 = [7 x i8] c" = %s\0A\00"
define i32 @pnum(x86_fp80* %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = bitcast x86_fp80* %0 to i16*
%5 = getelementptr inbounds i16, i16* %4, i64 1
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i16, i16* %4, i64 2
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds i16, i16* %4, i64 3
%14 = load i16, i16* %9
%15 = zext i16 %14 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds i16, i16* %4, i64 4
%18 = load i16, i16* %13
%19 = zext i16 %18 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds i16, i16* %4, i64 5
%22 = load i16, i16* %17
%23 = zext i16 %22 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i16, i16* %21
%26 = zext i16 %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = call i32 (x86_fp80*, i8*, i32, ...) bitcast (i32 (...)* @e64toasc to i32 (x86_fp80*, i8*, i32, ...)*)(x86_fp80* %0, i8* %3, i32 20)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 undef
}