#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int sscanf(char const *, char *, char *, char *, char *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *);
int process_uplink(const char *line) {
  char table_name[100];
  char header_name[100];
  char action_name[100];
  uint8_t mac[6];
  uint16_t port;
  uint16_t inport;
  int matches =
      sscanf(line, "%*s %s %s %s %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hd %hd",
             table_name, header_name, action_name, &mac[0], &mac[1], &mac[2],
             &mac[3], &mac[4], &mac[5], &inport, &port);
  if (3 + 6 + 2 != matches)
    return -1;
  return -1;
}


x86 assembly (clang, -O0):
<process_uplink>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1d0,%rsp
mov    %rdi,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0xa0(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x180(%rbp),%r8
lea    -0x1a0(%rbp),%r9
lea    -0x1a0(%rbp),%r12
add    $0x4,%r12
lea    -0x1a0(%rbp),%r15
add    $0x8,%r15
lea    -0x1a0(%rbp),%r14
add    $0xc,%r14
lea    -0x1a0(%rbp),%rbx
add    $0x10,%rbx
lea    -0x1a0(%rbp),%r11
add    $0x14,%r11
lea    0xe7c(%rip),%rsi
lea    -0x1a8(%rbp),%r10
lea    -0x1a4(%rbp),%rax
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <sscanf@plt>
mov    %eax,-0x1ac(%rbp)
mov    $0xb,%eax
cmp    -0x1ac(%rbp),%eax
je     11dc <process_uplink+0xcc>
movl   $0xffffffff,-0x24(%rbp)
jmp    11e3 <process_uplink+0xd3>
movl   $0xffffffff,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1d0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_uplink>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x168,%rsp
lea    0x4(%rsp),%r10
lea    0x8(%rsp),%r11
lea    0xc(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0x14(%rsp),%r12
sub    $0x8,%rsp
lea    0x24(%rsp),%rbx
lea    0x20(%rsp),%rax
lea    0xeb4(%rip),%rsi
lea    0x108(%rsp),%rdx
lea    0x98(%rsp),%rcx
lea    0x28(%rsp),%r8
lea    0x8(%rsp),%r9
push   %rbx
push   %rax
push   %r12
push   %r15
push   %r14
push   %r11
push   %r10
call   1030 <sscanf@plt>
add    $0x40,%rsp
mov    $0xffffffff,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [51 x i8] c"%*s %s %s %s %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hd %hd\00"
define i32 @process_uplink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = alloca [6 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %3
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 1
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 2
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 3
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 4
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 5
%21 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %14, i32* %15, i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %9, i32* %8)
store i32 %21, i32* %10
%22 = load i32, i32* %10
%23 = icmp ne i32 11, %22
br i1 %23, label %24, label %25
24: ; preds = %1
store i32 -1, i32* %2
br label %26
25: ; preds = %1
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [51 x i8] c"%*s %s %s %s %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hd %hd\00"
define i32 @process_uplink(i8* nocapture %0) {
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [6 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%11 = bitcast [6 x i32]* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 1
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 2
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 3
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 4
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 5
%20 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* %10, i32* %14, i32* %15, i32* %16, i32* %17, i32* %18, i32* %19, i32* %7, i32* %6)
ret i32 -1
}