#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 send_exact_entry(int /*<<< orphan*/, int /*<<< orphan*/ *, char *, char *,
                     char *, char *, char *);
int sscanf(char const *, char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *, char *, char *,
           char *, char *);
int process_exact(const char *line) {
  uint16_t port;
  uint8_t mac[6];
  char table_name[100];
  char header_name[100];
  char action_name[100];
  char par1[100];
  char par2[100];
  int matches =
      sscanf(line, "%*s %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hd %s %s %s %s %s",
             &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5], &port,
             table_name, header_name, action_name, par1, par2);
  if (6 + 3 > matches)
    return -1;
  return send_exact_entry(port, mac, table_name, header_name, action_name,
                          matches < 6 + 3 + 1 ? 0 : par1,
                          matches < 6 + 3 + 1 ? 0 : par2);
}


x86 assembly (clang, -O0):
<process_exact>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2f8,%rsp
mov    %rdi,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    -0x60(%rbp),%rcx
add    $0x4,%rcx
lea    -0x60(%rbp),%r8
add    $0x8,%r8
lea    -0x60(%rbp),%r9
add    $0xc,%r9
lea    -0x60(%rbp),%r13
add    $0x10,%r13
lea    -0x60(%rbp),%r12
add    $0x14,%r12
lea    -0xd0(%rbp),%r14
lea    -0x140(%rbp),%rbx
lea    -0x1b0(%rbp),%r11
lea    -0x220(%rbp),%r10
lea    -0x290(%rbp),%rax
lea    0xe6e(%rip),%rsi
lea    -0x3c(%rbp),%r15
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1030 <sscanf@plt>
mov    %eax,-0x294(%rbp)
mov    $0x9,%eax
cmp    -0x294(%rbp),%eax
jle    11e5 <process_exact+0xc5>
movl   $0xffffffff,-0x2c(%rbp)
jmp    12bf <process_exact+0x19f>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x2bc(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x2b8(%rbp)
lea    -0xd0(%rbp),%rax
mov    %rax,-0x2b0(%rbp)
lea    -0x140(%rbp),%rax
mov    %rax,-0x2a8(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x2a0(%rbp)
cmpl   $0xa,-0x294(%rbp)
jge    123e <process_exact+0x11e>
xor    %eax,%eax
mov    %rax,-0x2c8(%rbp)
jmp    124c <process_exact+0x12c>
lea    -0x220(%rbp),%rax
mov    %rax,-0x2c8(%rbp)
mov    -0x2c8(%rbp),%rax
mov    %rax,-0x2d0(%rbp)
cmpl   $0xa,-0x294(%rbp)
jge    1275 <process_exact+0x155>
xor    %eax,%eax
mov    %rax,-0x2d8(%rbp)
jmp    1283 <process_exact+0x163>
lea    -0x290(%rbp),%rax
mov    %rax,-0x2d8(%rbp)
mov    -0x2d0(%rbp),%r9
mov    -0x2a0(%rbp),%r8
mov    -0x2a8(%rbp),%rcx
mov    -0x2b0(%rbp),%rdx
mov    -0x2b8(%rbp),%rsi
mov    -0x2bc(%rbp),%edi
mov    -0x2d8(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <send_exact_entry@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_exact>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x260,%rsp
lea    0x14(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x1c(%rsp),%r9
lea    0x20(%rsp),%r10
lea    0x24(%rsp),%r11
lea    0x180(%rsp),%r14
lea    0x1f0(%rsp),%rbx
lea    0x30(%rsp),%rax
lea    0xa0(%rsp),%r15
lea    0x110(%rsp),%r12
lea    0xc(%rsp),%r13
lea    0xe86(%rip),%rsi
lea    0x10(%rsp),%rdx
push   %r14
push   %rbx
push   %rax
push   %r15
push   %r12
push   %r13
push   %r11
push   %r10
call   1030 <sscanf@plt>
add    $0x40,%rsp
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x9,%ecx
jl     11df <process_exact+0xbf>
mov    0xc(%rsp),%edi
xor    %eax,%eax
cmp    $0x9,%ecx
cmove  %rax,%rbx
cmove  %rax,%r14
sub    $0x8,%rsp
lea    0x18(%rsp),%rsi
lea    0x118(%rsp),%rdx
lea    0xa8(%rsp),%rcx
lea    0x38(%rsp),%r8
mov    %rbx,%r9
push   %r14
call   1040 <send_exact_entry@plt>
add    $0x10,%rsp
add    $0x260,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [53 x i8] c"%*s %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hd %s %s %s %s %s\00"
define i32 @process_exact(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [6 x i32]
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
%9 = alloca [100 x i8]
%10 = alloca [100 x i8]
%11 = alloca i32
store i8* %0, i8** %3
%12 = load i8*, i8** %3
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 1
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 2
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 3
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 4
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 5
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%24 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32* %13, i32* %14, i32* %15, i32* %16, i32* %17, i32* %18, i32* %4, i8* %19, i8* %20, i8* %21, i8* %22, i8* %23)
store i32 %24, i32* %11
%25 = load i32, i32* %11
%26 = icmp sgt i32 9, %25
br i1 %26, label %27, label %28
27: ; preds = %1
store i32 -1, i32* %2
br label %49
28: ; preds = %1
%29 = load i32, i32* %4
%30 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%34 = load i32, i32* %11
%35 = icmp slt i32 %34, 10
br i1 %35, label %36, label %37
36: ; preds = %28
br label %39
37: ; preds = %28
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
br label %39
39: ; preds = %37, %36
%40 = phi i8* [ null, %36 ], [ %38, %37 ]
%41 = load i32, i32* %11
%42 = icmp slt i32 %41, 10
br i1 %42, label %43, label %44
43: ; preds = %39
br label %46
44: ; preds = %39
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
br label %46
46: ; preds = %44, %43
%47 = phi i8* [ null, %43 ], [ %45, %44 ]
%48 = call i32 @send_exact_entry(i32 %29, i32* %30, i8* %31, i8* %32, i8* %33, i8* %40, i8* %47)
store i32 %48, i32* %2
br label %49
49: ; preds = %46, %27
%50 = load i32, i32* %2
ret i32 %50
}

LLVM IR (-O2):
@.str = [53 x i8] c"%*s %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hd %s %s %s %s %s\00"
define i32 @process_exact(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca [6 x i32]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
%9 = bitcast i32* %2 to i8*
%10 = bitcast [6 x i32]* %3 to i8*
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%22 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21, i32* %2, i8* %11, i8* %12, i8* %13, i8* %14, i8* %15)
%23 = icmp slt i32 %22, 9
br i1 %23, label %30, label %24
24: ; preds = %1
%25 = load i32, i32* %2
%26 = icmp eq i32 %22, 9
%27 = select i1 %26, i8* null, i8* %14
%28 = select i1 %26, i8* null, i8* %15
%29 = call i32 @send_exact_entry(i32 %25, i32* %16, i8* %11, i8* %12, i8* %13, i8* %27, i8* %28)
br label %30
30: ; preds = %1, %24
%31 = phi i32 [ %29, %24 ], [ -1, %1 ]
ret i32 %31
}