#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*/ __ebt_print_error(char *, char *);
char *strchr(char *, char);
int parse_iface(char *iface, char *option) {
  char *c;
  if ((c = strchr(iface, '+'))) {
    if (*(c + 1) != '\0') {
      __ebt_print_error("Spurious characters after '+' wildcard for '%s'",
                        option);
      ;
      return -1;
    } else
      *c = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_iface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2b,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1185 <parse_iface+0x65>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1179 <parse_iface+0x59>
mov    -0x18(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <__ebt_print_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <parse_iface+0x6c>
mov    -0x20(%rbp),%rax
movb   $0x1,(%rax)
jmp    1185 <parse_iface+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_iface>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2b,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1157 <parse_iface+0x37>
cmpb   $0x0,0x1(%rcx)
je     1154 <parse_iface+0x34>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <__ebt_print_error@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
movb   $0x1,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Spurious characters after '+' wildcard for '%s'\00"
define i32 @parse_iface(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i8* @strchr(i8* %7, i8 signext 43)
store i8* %8, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %22
10: ; preds = %2
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i8*, i8** %5
%18 = call i32 @__ebt_print_error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 -1, i32* %3
br label %23
19: ; preds = %10
%20 = load i8*, i8** %6
store i8 1, i8* %20
br label %21
21: ; preds = %19
br label %22
22: ; preds = %21, %2
store i32 0, i32* %3
br label %23
23: ; preds = %22, %16
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [48 x i8] c"Spurious characters after '+' wildcard for '%s'\00"
define i32 @parse_iface(i8* %0, i8* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 43)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @__ebt_print_error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %12
11: ; preds = %5
store i8 1, i8* %3
br label %12
12: ; preds = %2, %11, %9
%13 = phi i32 [ -1, %9 ], [ 0, %11 ], [ 0, %2 ]
ret i32 %13
}