#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 */

/* Variables and functions */
int /*<<< orphan*/ set_table_default_action(char *, char *, char *);
int sscanf(char const *, char *, char *, char *);
int process_set_default(const char *line) {
  char table_name[100];
  char default_action_name[100];
  int matches = sscanf(line, "%*s %s %s", table_name, default_action_name);
  if (2 != matches)
    return -1;
  set_table_default_action(table_name, table_name, default_action_name);
  return 0;
}


x86 assembly (clang, -O0):
<process_set_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    -0xf0(%rbp),%rcx
lea    0xebb(%rip),%rsi
call   1040 <sscanf@plt>
mov    %eax,-0xf4(%rbp)
mov    $0x2,%eax
cmp    -0xf4(%rbp),%eax
je     116d <process_set_default+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <process_set_default+0x68>
lea    -0x80(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
call   1030 <set_table_default_action@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_set_default>:
sub    $0xd8,%rsp
lea    0xed2(%rip),%rsi
lea    0x70(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x2,%ecx
jne    1159 <process_set_default+0x39>
lea    0x70(%rsp),%rdi
mov    %rsp,%rdx
mov    %rdi,%rsi
call   1030 <set_table_default_action@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%*s %s %s\00"
define i32 @process_set_default(i8* nocapture %0) {
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @set_table_default_action(i8* %4, i8* %4, i8* %5)
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ 0, %8 ], [ -1, %1 ]
ret i32 %11
}