#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 parse_bb(char *, char *, void *, void *);
scalar_t__ parse_sm(char *, char *, void *, void *);
int /*<<< orphan*/ strlen(char *);
int parse_bitsm(char *str, char *err, void *netw, void *nBits) {
  if (parse_sm(str, err, netw, nBits))
    return !0;
  else if (!strlen(err))
    return parse_bb(str, err, netw, nBits);
  else
    return 0;
}


x86 assembly (clang, -O0):
<parse_bitsm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1050 <parse_sm@plt>
cmp    $0x0,%rax
je     1173 <parse_bitsm+0x43>
movl   $0x1,-0x4(%rbp)
jmp    11a9 <parse_bitsm+0x79>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    11a2 <parse_bitsm+0x72>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <parse_bb@plt>
mov    %eax,-0x4(%rbp)
jmp    11a9 <parse_bitsm+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_bitsm>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
call   1050 <parse_sm@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1166 <parse_bitsm+0x36>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1172 <parse_bitsm+0x42>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <parse_bb@plt>

LLVM IR (-O0):
define i32 @parse_bitsm(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i8*, i8** %9
%14 = call i64 @parse_sm(i8* %10, i8* %11, i8* %12, i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 1, i32* %5
br label %28
17: ; preds = %4
%18 = load i8*, i8** %7
%19 = call i32 @strlen(i8* %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %27, label %21
21: ; preds = %17
%22 = load i8*, i8** %6
%23 = load i8*, i8** %7
%24 = load i8*, i8** %8
%25 = load i8*, i8** %9
%26 = call i32 @parse_bb(i8* %22, i8* %23, i8* %24, i8* %25)
store i32 %26, i32* %5
br label %28
27: ; preds = %17
store i32 0, i32* %5
br label %28
28: ; preds = %27, %21, %16
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @parse_bitsm(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @parse_sm(i8* %0, i8* %1, i8* %2, i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = tail call i32 @strlen(i8* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @parse_bb(i8* %0, i8* %1, i8* %2, i8* %3)
br label %12
12: ; preds = %7, %4, %10
%13 = phi i32 [ %11, %10 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %13
}