#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fxmlFindNextTagStart(char **);
scalar_t__ fxmlIsCloseTagFor(char *, char *, int);
int /*<<< orphan*/ fxmlSkipTag(char **);
int /*<<< orphan*/ stderr;
void fxmlFindEndOfContent(char **start, char *name, int namelen) {
  char *s = *start;
  while (*s) {
    int ctype;
    fxmlFindNextTagStart(&s);
    if (fxmlIsCloseTagFor(s, name, namelen)) {
      *start = s;
      return;
    }
    fxmlSkipTag(&s);
  }
  fprintf(stderr, "FXML: unexpected end of input in fxmlFindEndOfContent.\n");
}


x86 assembly (clang, -O0):
<fxmlFindEndOfContent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     11ac <fxmlFindEndOfContent+0x6c>
lea    -0x20(%rbp),%rdi
call   1060 <fxmlFindNextTagStart@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <fxmlIsCloseTagFor@plt>
cmp    $0x0,%rax
je     119e <fxmlFindEndOfContent+0x5e>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    11c1 <fxmlFindEndOfContent+0x81>
lea    -0x20(%rbp),%rdi
call   1030 <fxmlSkipTag@plt>
jmp    115e <fxmlFindEndOfContent+0x1e>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
lea    0xe44(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxmlFindEndOfContent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    %rax,(%rsp)
cmpb   $0x0,(%rax)
je     118d <fxmlFindEndOfContent+0x4d>
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%rbp
nop
mov    %rbp,%rdi
call   1060 <fxmlFindNextTagStart@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1040 <fxmlIsCloseTagFor@plt>
test   %rax,%rax
jne    11a4 <fxmlFindEndOfContent+0x64>
mov    %rbp,%rdi
call   1030 <fxmlSkipTag@plt>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
jne    1160 <fxmlFindEndOfContent+0x20>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11ab <fxmlFindEndOfContent+0x6b>
mov    (%rsp),%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"FXML: unexpected end of input in fxmlFindEndOfContent.\0A\00"
define void @fxmlFindEndOfContent(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
store i8* %10, i8** %7
br label %11
11: ; preds = %25, %3
%12 = load i8*, i8** %7
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = call i32 @fxmlFindNextTagStart(i8** %7)
%17 = load i8*, i8** %7
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = call i64 @fxmlIsCloseTagFor(i8* %17, i8* %18, i32 %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = load i8*, i8** %7
%24 = load i8**, i8*** %4
store i8* %23, i8** %24
br label %30
25: ; preds = %15
%26 = call i32 @fxmlSkipTag(i8** %7)
br label %11
27: ; preds = %11
%28 = load i32, i32* @stderr
%29 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %30
30: ; preds = %27, %22
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"FXML: unexpected end of input in fxmlFindEndOfContent.\0A\00"
define void @fxmlFindEndOfContent(i8** nocapture %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = load i8*, i8** %0
store i8* %6, i8** %4
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %3, %16
%10 = call i32 @fxmlFindNextTagStart(i8** %4)
%11 = load i8*, i8** %4
%12 = call i64 @fxmlIsCloseTagFor(i8* %11, i8* %1, i32 %2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = load i8*, i8** %4
store i8* %15, i8** %0
br label %24
16: ; preds = %9
%17 = call i32 @fxmlSkipTag(i8** %4)
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %9
21: ; preds = %16, %3
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %14, %21
ret void
}