do1dump(k, ks, v, vs) char *k, *v;
{
  if (ks == sizeof(long) && (*(long *)k & 0x80000000L))
    printf("0x%08lx", *(long *)k);
  else if (ks) {
    putchar('"');
    do2dump(k, ks);
    putchar('"');
  } else
    printf("<null>");
  putchar('\t');
  if (vs == sizeof(long) &&
      ((*(long *)v & 0x80000000L) || (*(unsigned long *)v < 0xffffff)))
    printf("0x%08lx", *(long *)v);
  else if (vs) {
    putchar('"');
    do2dump(v, vs);
    putchar('"');
  } else
    printf("<null>");
  putchar('\n');
}


x86 assembly (clang, -O0):
<do1dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x8,%rax
jne    1189 <do1dump+0x59>
mov    -0x10(%rbp),%rcx
movabs $0x80000000,%rax
and    (%rcx),%rax
cmp    $0x0,%rax
je     1189 <do1dump+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11d1 <do1dump+0xa1>
cmpl   $0x0,-0x14(%rbp)
je     11be <do1dump+0x8e>
mov    $0x22,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <do2dump@plt>
mov    $0x22,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    11cc <do1dump+0x9c>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11d1 <do1dump+0xa1>
mov    $0x9,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
movslq -0x24(%rbp),%rax
cmp    $0x8,%rax
jne    1231 <do1dump+0x101>
mov    -0x20(%rbp),%rcx
movabs $0x80000000,%rax
and    (%rcx),%rax
cmp    $0x0,%rax
jne    1217 <do1dump+0xe7>
mov    -0x20(%rbp),%rax
cmpq   $0xffffff,(%rax)
jae    1231 <do1dump+0x101>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1279 <do1dump+0x149>
cmpl   $0x0,-0x24(%rbp)
je     1266 <do1dump+0x136>
mov    $0x22,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    $0x0,%al
call   1040 <do2dump@plt>
mov    $0x22,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    1274 <do1dump+0x144>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1279 <do1dump+0x149>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do1dump>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %rdx,%r14
test   %esi,%esi
je     117c <do1dump+0x4c>
mov    %esi,%ebp
mov    %rdi,%rbx
cmp    $0x8,%esi
jne    1156 <do1dump+0x26>
mov    (%rbx),%rsi
test   $0x80000000,%esi
jne    118c <do1dump+0x5c>
mov    $0x22,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <do2dump@plt>
mov    $0x22,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
jmp    119a <do1dump+0x6a>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    119a <do1dump+0x6a>
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x9,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   %r15d,%r15d
je     11f0 <do1dump+0xc0>
cmp    $0x8,%r15d
jne    11c9 <do1dump+0x99>
mov    (%r14),%rsi
cmp    $0xffffff,%rsi
jb     1200 <do1dump+0xd0>
mov    %esi,%eax
and    $0x80000000,%eax
test   %rax,%rax
jne    1200 <do1dump+0xd0>
mov    $0x22,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <do2dump@plt>
mov    $0x22,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
jmp    120e <do1dump+0xde>
lea    0xe11(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    120e <do1dump+0xde>
lea    0xdf9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"0x%08lx\00"
@.str.1 = [7 x i8] c"<null>\00"
define i32 @do1dump(i8* %0, i32 %1, i8* %2, i32 %3) {
switch i32 %1, label %12 [
i32 8, label %5
i32 0, label %16
]
5: ; preds = %4
%6 = bitcast i8* %0 to i64*
%7 = load i64, i64* %6
%8 = and i64 %7, 2147483648
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %7)
br label %18
12: ; preds = %5, %4
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 34)
%14 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do2dump to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 34)
br label %18
16: ; preds = %4
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %12, %16, %10
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 9)
switch i32 %3, label %29 [
i32 8, label %20
i32 0, label %33
]
20: ; preds = %18
%21 = bitcast i8* %2 to i64*
%22 = load i64, i64* %21
%23 = and i64 %22, 2147483648
%24 = icmp ne i64 %23, 0
%25 = icmp ult i64 %22, 16777215
%26 = or i1 %25, %24
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %22)
br label %35
29: ; preds = %20, %18
%30 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 34)
%31 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do2dump to i32 (i8*, i32, ...)*)(i8* %2, i32 %3)
%32 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 34)
br label %35
33: ; preds = %18
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %29, %33, %27
%36 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret i32 undef
}