int parse_tca_u32_hash(char *msg, char **mp, struct rtattr *u32) {
  unsigned htid;
  if (RTA_PAYLOAD(u32) < sizeof(unsigned)) {
    rec_log("error: %s: payload too short", __func__);
    return (1);
  }
  htid = *(unsigned *)RTA_DATA(u32);
  *mp = add_log(msg, *mp, "hash(table/bucket)=0x%x/0x%x ",
                TC_U32_USERHTID(htid), TC_U32_HASH(htid));
  return (0);
}


x86 assembly (clang, -O0):
<parse_tca_u32_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <RTA_PAYLOAD@plt>
cltq
cmp    $0x4,%rax
jae    11ac <parse_tca_u32_hash+0x4c>
lea    0xe6e(%rip),%rdi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1070 <rec_log@plt>
movl   $0x1,-0x4(%rbp)
jmp    1215 <parse_tca_u32_hash+0xb5>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1060 <RTA_DATA@plt>
cltq
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x0,%al
call   1050 <TC_U32_USERHTID@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x0,%al
call   1040 <TC_U32_HASH@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%ecx
mov    %eax,%r8d
lea    0xe33(%rip),%rdx
mov    $0x0,%al
call   1080 <add_log@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_tca_u32_hash>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebp,%ebp
mov    %rdx,%rdi
xor    %eax,%eax
call   1030 <RTA_PAYLOAD@plt>
cmp    $0x3,%eax
ja     11a1 <parse_tca_u32_hash+0x41>
lea    0xe74(%rip),%rdi
lea    0xe8a(%rip),%rsi
xor    %eax,%eax
call   1070 <rec_log@plt>
mov    $0x1,%ebp
jmp    11e6 <parse_tca_u32_hash+0x86>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <RTA_DATA@plt>
cltq
mov    (%rax),%ebx
mov    (%r14),%r12
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <TC_U32_USERHTID@plt>
mov    %eax,%r13d
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <TC_U32_HASH@plt>
lea    0xe62(%rip),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1080 <add_log@plt>
cltq
mov    %rax,(%r14)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.rtattr = type opaque
@.str = [29 x i8] c"error: %s: payload too short\00"
@__func__.parse_tca_u32_hash = [19 x i8] c"parse_tca_u32_hash\00"
@.str.1 = [30 x i8] c"hash(table/bucket)=0x%x/0x%x \00"
define i32 @parse_tca_u32_hash(i8* %0, i8** %1, %struct.rtattr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca %struct.rtattr*
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store %struct.rtattr* %2, %struct.rtattr** %7
%9 = load %struct.rtattr*, %struct.rtattr** %7
%10 = call i32 (%struct.rtattr*, ...) bitcast (i32 (...)* @RTA_PAYLOAD to i32 (%struct.rtattr*, ...)*)(%struct.rtattr* %9)
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 4
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @rec_log to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.parse_tca_u32_hash, i64 0, i64 0))
store i32 1, i32* %4
br label %32
15: ; preds = %3
%16 = load %struct.rtattr*, %struct.rtattr** %7
%17 = call i32 (%struct.rtattr*, ...) bitcast (i32 (...)* @RTA_DATA to i32 (%struct.rtattr*, ...)*)(%struct.rtattr* %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load i32, i32* %19
store i32 %20, i32* %8
%21 = load i8*, i8** %5
%22 = load i8**, i8*** %6
%23 = load i8*, i8** %22
%24 = load i32, i32* %8
%25 = call i32 (i32, ...) bitcast (i32 (...)* @TC_U32_USERHTID to i32 (i32, ...)*)(i32 %24)
%26 = load i32, i32* %8
%27 = call i32 (i32, ...) bitcast (i32 (...)* @TC_U32_HASH to i32 (i32, ...)*)(i32 %26)
%28 = call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @add_log to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* %21, i8* %23, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %27)
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i8*
%31 = load i8**, i8*** %6
store i8* %30, i8** %31
store i32 0, i32* %4
br label %32
32: ; preds = %15, %13
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
%struct.rtattr = type opaque
@.str = [29 x i8] c"error: %s: payload too short\00"
@__func__.parse_tca_u32_hash = [19 x i8] c"parse_tca_u32_hash\00"
@.str.1 = [30 x i8] c"hash(table/bucket)=0x%x/0x%x \00"
define i32 @parse_tca_u32_hash(i8* %0, i8** nocapture %1, %struct.rtattr* %2) {
%4 = tail call i32 (%struct.rtattr*, ...) bitcast (i32 (...)* @RTA_PAYLOAD to i32 (%struct.rtattr*, ...)*)(%struct.rtattr* %2)
%5 = icmp ult i32 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @rec_log to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.parse_tca_u32_hash, i64 0, i64 0))
br label %19
8: ; preds = %3
%9 = tail call i32 (%struct.rtattr*, ...) bitcast (i32 (...)* @RTA_DATA to i32 (%struct.rtattr*, ...)*)(%struct.rtattr* %2)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load i32, i32* %11
%13 = load i8*, i8** %1
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @TC_U32_USERHTID to i32 (i32, ...)*)(i32 %12)
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @TC_U32_HASH to i32 (i32, ...)*)(i32 %12)
%16 = tail call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @add_log to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* %0, i8* %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %1
br label %19
19: ; preds = %8, %6
%20 = phi i32 [ 1, %6 ], [ 0, %8 ]
ret i32 %20
}