int parse_tca_tcindex_fall_through(char *msg, char **mp,
                                   struct rtattr *tcindex) {
  if (RTA_PAYLOAD(tcindex) < sizeof(int)) {
    rec_log("error: %s: payload too short", __func__);
    return (1);
  }
  *mp = add_log(msg, *mp, "flag=%s ",
                *(int *)RTA_DATA(tcindex) ? "fall_through" : "pass_on");
  return (0);
}


x86 assembly (clang, -O0):
<parse_tca_tcindex_fall_through>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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    118c <parse_tca_tcindex_fall_through+0x4c>
lea    0xe8e(%rip),%rdi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1050 <rec_log@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ea <parse_tca_tcindex_fall_through+0xaa>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <RTA_DATA@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
cltq
mov    (%rax),%edx
lea    0xe88(%rip),%rcx
lea    0xe6b(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%rcx
lea    0xe6a(%rip),%rdx
mov    $0x0,%al
call   1060 <add_log@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_tca_tcindex_fall_through>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
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     117e <parse_tca_tcindex_fall_through+0x3e>
lea    0xe97(%rip),%rdi
lea    0xead(%rip),%rsi
xor    %eax,%eax
call   1050 <rec_log@plt>
mov    $0x1,%ebp
jmp    11bb <parse_tca_tcindex_fall_through+0x7b>
mov    (%r14),%r12
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <RTA_DATA@plt>
cltq
cmpl   $0x0,(%rax)
lea    0xeae(%rip),%rax
lea    0xe91(%rip),%rcx
cmove  %rax,%rcx
lea    0xe93(%rip),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <add_log@plt>
cltq
mov    %rax,(%r14)
mov    %ebp,%eax
pop    %rbx
pop    %r12
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_tcindex_fall_through = [31 x i8] c"parse_tca_tcindex_fall_through\00"
@.str.1 = [9 x i8] c"flag=%s \00"
@.str.2 = [13 x i8] c"fall_through\00"
@.str.3 = [8 x i8] c"pass_on\00"
define i32 @parse_tca_tcindex_fall_through(i8* %0, i8** %1, %struct.rtattr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca %struct.rtattr*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store %struct.rtattr* %2, %struct.rtattr** %7
%8 = load %struct.rtattr*, %struct.rtattr** %7
%9 = call i32 (%struct.rtattr*, ...) bitcast (i32 (...)* @RTA_PAYLOAD to i32 (%struct.rtattr*, ...)*)(%struct.rtattr* %8)
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = 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 ([31 x i8], [31 x i8]* @__func__.parse_tca_tcindex_fall_through, i64 0, i64 0))
store i32 1, i32* %4
br label %30
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i8**, i8*** %6
%17 = load i8*, i8** %16
%18 = load %struct.rtattr*, %struct.rtattr** %7
%19 = call i32 (%struct.rtattr*, ...) bitcast (i32 (...)* @RTA_DATA to i32 (%struct.rtattr*, ...)*)(%struct.rtattr* %18)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0)
%26 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_log to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* %15, i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i8*
%29 = load i8**, i8*** %6
store i8* %28, i8** %29
store i32 0, i32* %4
br label %30
30: ; preds = %14, %12
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
%struct.rtattr = type opaque
@.str = [29 x i8] c"error: %s: payload too short\00"
@__func__.parse_tca_tcindex_fall_through = [31 x i8] c"parse_tca_tcindex_fall_through\00"
@.str.1 = [9 x i8] c"flag=%s \00"
@.str.2 = [13 x i8] c"fall_through\00"
@.str.3 = [8 x i8] c"pass_on\00"
define i32 @parse_tca_tcindex_fall_through(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 ([31 x i8], [31 x i8]* @__func__.parse_tca_tcindex_fall_through, i64 0, i64 0))
br label %19
8: ; preds = %3
%9 = load i8*, i8** %1
%10 = tail call i32 (%struct.rtattr*, ...) bitcast (i32 (...)* @RTA_DATA to i32 (%struct.rtattr*, ...)*)(%struct.rtattr* %2)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0)
%16 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @add_log to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* %0, i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %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
}