putx(n, c) {
  switch (c) {
  case 001:
    pre(6);
    putn(n, 8, 6);
    break;
  case 002:
    pre(5);
    putn(n, 10, 5);
    break;
  case 004:
    pre(4);
    putop(n);
    break;
  case 010:
    pre(4);
    putn(n, 16, 4);
    break;
  case 020:
    pre(5);
    putc(n);
    putchar(' ');
    putc(n >> 8);
    break;
  case 040:
    pre(7);
    putn(n & 0377, 8, 3);
    putchar(' ');
    putn((n >> 8) & 0377, 8, 3);
    break;
  }
}


x86 assembly (clang, -O0):
<putx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x1f,%eax
ja     1294 <putx+0x144>
mov    -0x18(%rbp),%rax
lea    0xe82(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x6,%edi
mov    $0x0,%al
call   1070 <pre@plt>
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
mov    $0x6,%edx
mov    $0x0,%al
call   1040 <putn@plt>
jmp    1294 <putx+0x144>
mov    $0x5,%edi
mov    $0x0,%al
call   1070 <pre@plt>
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
mov    $0x5,%edx
mov    $0x0,%al
call   1040 <putn@plt>
jmp    1294 <putx+0x144>
mov    $0x4,%edi
mov    $0x0,%al
call   1070 <pre@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1060 <putop@plt>
jmp    1294 <putx+0x144>
mov    $0x4,%edi
mov    $0x0,%al
call   1070 <pre@plt>
mov    -0x8(%rbp),%edi
mov    $0x10,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <putn@plt>
jmp    1294 <putx+0x144>
mov    $0x5,%edi
mov    $0x0,%al
call   1070 <pre@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <putc@plt>
mov    $0x20,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
sar    $0x8,%edi
mov    $0x0,%al
call   1050 <putc@plt>
jmp    1294 <putx+0x144>
mov    $0x7,%edi
mov    $0x0,%al
call   1070 <pre@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
mov    $0x8,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <putn@plt>
mov    $0x20,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    $0x8,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <putn@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putx>:
push   %rbx
add    $0xffffffff,%esi
cmp    $0x1f,%esi
ja     1249 <putx+0xf9>
mov    %edi,%ebx
lea    0xe9a(%rip),%rax
movslq (%rax,%rsi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1070 <pre@plt>
mov    %ebx,%edi
mov    $0x8,%esi
mov    $0x6,%edx
jmp    1242 <putx+0xf2>
mov    $0x5,%edi
xor    %eax,%eax
call   1070 <pre@plt>
mov    %ebx,%edi
mov    $0xa,%esi
mov    $0x5,%edx
jmp    1242 <putx+0xf2>
mov    $0x4,%edi
xor    %eax,%eax
call   1070 <pre@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1060 <putop@plt>
pop    %rbx
ret
mov    $0x4,%edi
xor    %eax,%eax
call   1070 <pre@plt>
mov    %ebx,%edi
mov    $0x10,%esi
mov    $0x4,%edx
jmp    1242 <putx+0xf2>
mov    $0x5,%edi
xor    %eax,%eax
call   1070 <pre@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <putc@plt>
mov    $0x20,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <putc@plt>
pop    %rbx
ret
mov    $0x7,%edi
xor    %eax,%eax
call   1070 <pre@plt>
movzbl %bl,%edi
mov    $0x8,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <putn@plt>
mov    $0x20,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl %bh,%edi
mov    $0x8,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <putn@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %41 [
i32 1, label %7
i32 2, label %11
i32 4, label %15
i32 8, label %19
i32 16, label %23
i32 32, label %31
]
7: ; preds = %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 6)
%9 = load i32, i32* %4
%10 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %9, i32 8, i32 6)
br label %41
11: ; preds = %2
%12 = call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 5)
%13 = load i32, i32* %4
%14 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %13, i32 10, i32 5)
br label %41
15: ; preds = %2
%16 = call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 4)
%17 = load i32, i32* %4
%18 = call i32 (i32, ...) bitcast (i32 (...)* @putop to i32 (i32, ...)*)(i32 %17)
br label %41
19: ; preds = %2
%20 = call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 4)
%21 = load i32, i32* %4
%22 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %21, i32 16, i32 4)
br label %41
23: ; preds = %2
%24 = call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 5)
%25 = load i32, i32* %4
%26 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %25)
%27 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 32)
%28 = load i32, i32* %4
%29 = ashr i32 %28, 8
%30 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %29)
br label %41
31: ; preds = %2
%32 = call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 7)
%33 = load i32, i32* %4
%34 = and i32 %33, 255
%35 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %34, i32 8, i32 3)
%36 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 32)
%37 = load i32, i32* %4
%38 = ashr i32 %37, 8
%39 = and i32 %38, 255
%40 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %39, i32 8, i32 3)
br label %41
41: ; preds = %2, %31, %23, %19, %15, %11, %7
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @putx(i32 %0, i32 %1) {
switch i32 %1, label %29 [
i32 1, label %3
i32 2, label %6
i32 4, label %9
i32 8, label %12
i32 16, label %15
i32 32, label %21
]
3: ; preds = %2
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 6)
%5 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %0, i32 8, i32 6)
br label %29
6: ; preds = %2
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 5)
%8 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %0, i32 10, i32 5)
br label %29
9: ; preds = %2
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 4)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @putop to i32 (i32, ...)*)(i32 %0)
br label %29
12: ; preds = %2
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 4)
%14 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %0, i32 16, i32 4)
br label %29
15: ; preds = %2
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 5)
%17 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %0)
%18 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 32)
%19 = ashr i32 %0, 8
%20 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %19)
br label %29
21: ; preds = %2
%22 = tail call i32 (i32, ...) bitcast (i32 (...)* @pre to i32 (i32, ...)*)(i32 7)
%23 = and i32 %0, 255
%24 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %23, i32 8, i32 3)
%25 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 32)
%26 = lshr i32 %0, 8
%27 = and i32 %26, 255
%28 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putn to i32 (i32, i32, i32, ...)*)(i32 %27, i32 8, i32 3)
br label %29
29: ; preds = %2, %21, %15, %12, %9, %6, %3
ret i32 undef
}