unsigned int iaad_dmp_vint(int log_dmp, unsigned int n, unsigned char *buf,
                           unsigned int len) {
  unsigned int rmv = 0, adj = 0;
  unsigned int lft = len;
  unsigned long vint = 0;
  unsigned int num = buf[0] >> 3;
  adj = 1;
  iaad_adj(&rmv, &buf, &lft, adj);
  adj = iaad_vint_dec(log_dmp, buf, lft, &vint);
  iaad_adj(&rmv, &buf, &lft, adj);
  if (log_dmp) {
    unsigned char str_buf[256] = {0};
    int ctr = 0;
    for (ctr = 0; ctr < n - 1; ctr++)
      strncat(str_buf, "                    ", sizeof(str_buf));
    hu_log(3, "hu_aad", __func__, "%s%1.1d %4x %5ld", str_buf, num, vint, vint);
  }
  return (rmv);
}


x86 assembly (clang, -O0):
<iaad_dmp_vint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
sar    $0x3,%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
lea    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <iaad_adj@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1030 <iaad_vint_dec@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
lea    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <iaad_adj@plt>
cmpl   $0x0,-0x4(%rbp)
je     128a <iaad_dmp_vint+0x13a>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movl   $0x0,-0x134(%rbp)
movl   $0x0,-0x134(%rbp)
mov    -0x134(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    124d <iaad_dmp_vint+0xfd>
lea    -0x130(%rbp),%rdi
lea    0xdd1(%rip),%rsi
mov    $0x100,%edx
call   1050 <strncat@plt>
mov    -0x134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x134(%rbp)
jmp    120d <iaad_dmp_vint+0xbd>
lea    -0x130(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    -0x28(%rbp),%r10
mov    -0x28(%rbp),%rax
mov    $0x3,%edi
lea    0xda9(%rip),%rsi
lea    0xda9(%rip),%rdx
lea    0xdb0(%rip),%rcx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1070 <hu_log@plt>
mov    -0x18(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iaad_dmp_vint>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %esi,%ebp
mov    %edi,%ebx
mov    %rdx,0x18(%rsp)
movl   $0x0,0xc(%rsp)
mov    %ecx,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movzbl (%rdx),%r14d
lea    0xc(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x8(%rsp),%r13
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <iaad_adj@plt>
mov    0x18(%rsp),%rsi
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rcx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <iaad_vint_dec@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <iaad_adj@plt>
test   %ebx,%ebx
je     12b2 <iaad_dmp_vint+0x172>
shr    $0x3,%r14d
xorps  %xmm0,%xmm0
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
add    $0xffffffff,%ebp
je     127e <iaad_dmp_vint+0x13e>
lea    0x20(%rsp),%r15
movabs $0x20202020202020,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rbx,0x2d(%rsp,%rax,1)
movups 0xd8c(%rip),%xmm0
movups %xmm0,0x20(%rsp,%rax,1)
add    $0xffffffff,%ebp
jne    1260 <iaad_dmp_vint+0x120>
mov    0x10(%rsp),%rbp
lea    0xd8b(%rip),%rsi
lea    0xd8b(%rip),%rdx
lea    0xd92(%rip),%rcx
lea    0x20(%rsp),%r8
mov    $0x3,%edi
mov    %r14d,%r9d
xor    %eax,%eax
push   %rbp
push   %rbp
call   1060 <hu_log@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c" \00"
@.str.1 = [7 x i8] c"hu_aad\00"
@__func__.iaad_dmp_vint = [14 x i8] c"iaad_dmp_vint\00"
@.str.2 = [17 x i8] c"%s%1.1d %4x %5ld\00"
define i32 @iaad_dmp_vint(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
%14 = alloca [256 x i8]
%15 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%16 = load i32, i32* %8
store i32 %16, i32* %11
store i64 0, i64* %12
%17 = load i8*, i8** %7
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = ashr i32 %20, 3
store i32 %21, i32* %13
store i32 1, i32* %10
%22 = load i32, i32* %10
%23 = call i32 (i32*, i8**, i32*, i32, ...) bitcast (i32 (...)* @iaad_adj to i32 (i32*, i8**, i32*, i32, ...)*)(i32* %9, i8** %7, i32* %11, i32 %22)
%24 = load i32, i32* %5
%25 = load i8*, i8** %7
%26 = load i32, i32* %11
%27 = call i32 (i32, i8*, i32, i64*, ...) bitcast (i32 (...)* @iaad_vint_dec to i32 (i32, i8*, i32, i64*, ...)*)(i32 %24, i8* %25, i32 %26, i64* %12)
store i32 %27, i32* %10
%28 = load i32, i32* %10
%29 = call i32 (i32*, i8**, i32*, i32, ...) bitcast (i32 (...)* @iaad_adj to i32 (i32*, i8**, i32*, i32, ...)*)(i32* %9, i8** %7, i32* %11, i32 %28)
%30 = load i32, i32* %5
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %51
32: ; preds = %4
%33 = bitcast [256 x i8]* %14 to i8*
store i32 0, i32* %15
store i32 0, i32* %15
br label %34
34: ; preds = %42, %32
%35 = load i32, i32* %15
%36 = load i32, i32* %6
%37 = sub i32 %36, 1
%38 = icmp ult i32 %35, %37
br i1 %38, label %39, label %45
39: ; preds = %34
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%41 = call i8* @strncat(i8* %40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 256)
br label %42
42: ; preds = %39
%43 = load i32, i32* %15
%44 = add nsw i32 %43, 1
store i32 %44, i32* %15
br label %34
45: ; preds = %34
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%47 = load i32, i32* %13
%48 = load i64, i64* %12
%49 = load i64, i64* %12
%50 = call i32 (i32, i8*, i8*, i8*, i8*, i32, i64, i64, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i8*, i32, i64, i64, ...)*)(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.iaad_dmp_vint, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %46, i32 %47, i64 %48, i64 %49)
br label %51
51: ; preds = %45, %4
%52 = load i32, i32* %9
ret i32 %52
}

LLVM IR (-O2):
@.str = [21 x i8] c" \00"
@.str.1 = [7 x i8] c"hu_aad\00"
@__func__.iaad_dmp_vint = [14 x i8] c"iaad_dmp_vint\00"
@.str.2 = [17 x i8] c"%s%1.1d %4x %5ld\00"
define i32 @iaad_dmp_vint(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca [256 x i8]
store i8* %2, i8** %5
%10 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%11 = bitcast i32* %7 to i8*
store i32 %3, i32* %7
%12 = bitcast i64* %8 to i8*
store i64 0, i64* %8
%13 = load i8, i8* %2
%14 = lshr i8 %13, 3
%15 = zext i8 %14 to i32
%16 = call i32 (i32*, i8**, i32*, i32, ...) bitcast (i32 (...)* @iaad_adj to i32 (i32*, i8**, i32*, i32, ...)*)(i32* %6, i8** %5, i32* %7, i32 1)
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = call i32 (i32, i8*, i32, i64*, ...) bitcast (i32 (...)* @iaad_vint_dec to i32 (i32, i8*, i32, i64*, ...)*)(i32 %0, i8* %17, i32 %18, i64* %8)
%20 = call i32 (i32*, i8**, i32*, i32, ...) bitcast (i32 (...)* @iaad_adj to i32 (i32*, i8**, i32*, i32, ...)*)(i32* %6, i8** %5, i32* %7, i32 %19)
%21 = icmp eq i32 %0, 0
br i1 %21, label %35, label %22
22: ; preds = %4
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%24 = add i32 %1, -1
%25 = icmp eq i32 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %22, %26
%27 = phi i32 [ %30, %26 ], [ 0, %22 ]
%28 = call i64 @strlen(i8* %23)
%29 = getelementptr [256 x i8], [256 x i8]* %9, i64 0, i64 %28
%30 = add nuw nsw i32 %27, 1
%31 = icmp eq i32 %30, %24
br i1 %31, label %32, label %26
32: ; preds = %26, %22
%33 = load i64, i64* %8
%34 = call i32 (i32, i8*, i8*, i8*, i8*, i32, i64, i64, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i8*, i32, i64, i64, ...)*)(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.iaad_dmp_vint, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %23, i32 %15, i64 %33, i64 %33)
br label %35
35: ; preds = %32, %4
%36 = load i32, i32* %6
ret i32 %36
}