#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 */
struct Mx1 {
  int dummy;
};

/* Variables and functions */
int Mx1_is_bold_wrap(struct Mx1 *, char *, char **, int /*<<< orphan*/);
int Mx1_is_ignored_wrap(struct Mx1 *, char *, char **, int /*<<< orphan*/);
int Mx1_is_normal_wrap(struct Mx1 *, char *, char **, int /*<<< orphan*/);
int Mx1_is_any_wrap(struct Mx1 *m, char *start, char **found, int flag) {
  int ret;
  ret = Mx1_is_bold_wrap(m, start, found, 0);
  if (ret > 0)
    return (1);
  ret = Mx1_is_normal_wrap(m, start, found, 0);
  if (ret > 0)
    return (2);
  ret = Mx1_is_ignored_wrap(m, start, found, 0);
  if (ret > 0)
    return (3);
  return (0);
}


x86 assembly (clang, -O0):
<Mx1_is_any_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <Mx1_is_bold_wrap@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    1173 <Mx1_is_any_wrap+0x43>
movl   $0x1,-0x4(%rbp)
jmp    11d2 <Mx1_is_any_wrap+0xa2>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1050 <Mx1_is_normal_wrap@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    119f <Mx1_is_any_wrap+0x6f>
movl   $0x2,-0x4(%rbp)
jmp    11d2 <Mx1_is_any_wrap+0xa2>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1040 <Mx1_is_ignored_wrap@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    11cb <Mx1_is_any_wrap+0x9b>
movl   $0x3,-0x4(%rbp)
jmp    11d2 <Mx1_is_any_wrap+0xa2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mx1_is_any_wrap>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %ecx,%ecx
call   1030 <Mx1_is_bold_wrap@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jg     1185 <Mx1_is_any_wrap+0x55>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1050 <Mx1_is_normal_wrap@plt>
mov    %eax,%ecx
mov    $0x2,%eax
test   %ecx,%ecx
jg     1185 <Mx1_is_any_wrap+0x55>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1040 <Mx1_is_ignored_wrap@plt>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
lea    (%rcx,%rcx,2),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Mx1 = type { i32 }
define i32 @Mx1_is_any_wrap(%struct.Mx1* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.Mx1*
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i32
store %struct.Mx1* %0, %struct.Mx1** %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i32 %3, i32* %9
%11 = load %struct.Mx1*, %struct.Mx1** %6
%12 = load i8*, i8** %7
%13 = load i8**, i8*** %8
%14 = call i32 @Mx1_is_bold_wrap(%struct.Mx1* %11, i8* %12, i8** %13, i32 0)
store i32 %14, i32* %10
%15 = load i32, i32* %10
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %4
store i32 1, i32* %5
br label %35
18: ; preds = %4
%19 = load %struct.Mx1*, %struct.Mx1** %6
%20 = load i8*, i8** %7
%21 = load i8**, i8*** %8
%22 = call i32 @Mx1_is_normal_wrap(%struct.Mx1* %19, i8* %20, i8** %21, i32 0)
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %18
store i32 2, i32* %5
br label %35
26: ; preds = %18
%27 = load %struct.Mx1*, %struct.Mx1** %6
%28 = load i8*, i8** %7
%29 = load i8**, i8*** %8
%30 = call i32 @Mx1_is_ignored_wrap(%struct.Mx1* %27, i8* %28, i8** %29, i32 0)
store i32 %30, i32* %10
%31 = load i32, i32* %10
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %26
store i32 3, i32* %5
br label %35
34: ; preds = %26
store i32 0, i32* %5
br label %35
35: ; preds = %34, %33, %25, %17
%36 = load i32, i32* %5
ret i32 %36
}

LLVM IR (-O2):
%struct.Mx1 = type { i32 }
define i32 @Mx1_is_any_wrap(%struct.Mx1* %0, i8* %1, i8** %2, i32 %3) {
%5 = tail call i32 @Mx1_is_bold_wrap(%struct.Mx1* %0, i8* %1, i8** %2, i32 0)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = tail call i32 @Mx1_is_normal_wrap(%struct.Mx1* %0, i8* %1, i8** %2, i32 0)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = tail call i32 @Mx1_is_ignored_wrap(%struct.Mx1* %0, i8* %1, i8** %2, i32 0)
%12 = icmp sgt i32 %11, 0
%13 = select i1 %12, i32 3, i32 0
br label %14
14: ; preds = %10, %7, %4
%15 = phi i32 [ 1, %4 ], [ 2, %7 ], [ %13, %10 ]
ret i32 %15
}