#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*/ skipWhitespace(char **);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
char *findNextAttr(char *start) {
  char *s = start;
  char *e;
  char quote;
  skipWhitespace(&s);
  if (*s != '=') {
    fprintf(stderr, "FXML: malformed attribute lacks equals sign.\n");
    return s;
  }
  s++;
  skipWhitespace(&s);
  if (*s != '"' && *s != '\'') {
    fprintf(stderr, "FXML: malformed attribute lacks quotes.\n");
    return s;
  }
  quote = *s;
  s++;
  e = strchr(s, quote);
  return e + 1;
}


x86 assembly (clang, -O0):
<findNextAttr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <skipWhitespace@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     117f <findNextAttr+0x4f>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1208 <findNextAttr+0xd8>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <skipWhitespace@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     11d6 <findNextAttr+0xa6>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
je     11d6 <findNextAttr+0xa6>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
lea    0xe6a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1208 <findNextAttr+0xd8>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movsbl -0x21(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextAttr>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1050 <skipWhitespace@plt>
mov    (%rsp),%rax
cmpb   $0x3d,(%rax)
jne    117a <findNextAttr+0x4a>
add    $0x1,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1050 <skipWhitespace@plt>
mov    (%rsp),%rdi
mov    (%rdi),%al
cmp    $0x22,%al
je     1164 <findNextAttr+0x34>
cmp    $0x27,%al
jne    118c <findNextAttr+0x5c>
add    $0x1,%rdi
mov    %rdi,(%rsp)
movsbl %al,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
pop    %rcx
ret
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0xe76(%rip),%rsi
jmp    119c <findNextAttr+0x6c>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"FXML: malformed attribute lacks equals sign.\0A\00"
@.str.1 = [41 x i8] c"FXML: malformed attribute lacks quotes.\0A\00"
define i8* @findNextAttr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %3
%7 = load i8*, i8** %3
store i8* %7, i8** %4
%8 = call i32 @skipWhitespace(i8** %4)
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 61
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %44
17: ; preds = %1
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
%20 = call i32 @skipWhitespace(i8** %4)
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 34
br i1 %24, label %25, label %34
25: ; preds = %17
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 39
br i1 %29, label %30, label %34
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%33 = load i8*, i8** %4
store i8* %33, i8** %2
br label %44
34: ; preds = %25, %17
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
store i8 %36, i8* %6
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %4
%39 = load i8*, i8** %4
%40 = load i8, i8* %6
%41 = call i8* @strchr(i8* %39, i8 signext %40)
store i8* %41, i8** %5
%42 = load i8*, i8** %5
%43 = getelementptr inbounds i8, i8* %42, i64 1
store i8* %43, i8** %2
br label %44
44: ; preds = %34, %30, %13
%45 = load i8*, i8** %2
ret i8* %45
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"FXML: malformed attribute lacks equals sign.\0A\00"
@.str.1 = [41 x i8] c"FXML: malformed attribute lacks quotes.\0A\00"
define i8* @findNextAttr(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i32 @skipWhitespace(i8** %2)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 61
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %2
br label %25
12: ; preds = %1
%13 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %13, i8** %2
%14 = call i32 @skipWhitespace(i8** %2)
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
switch i8 %16, label %17 [
i8 34, label %21
i8 39, label %21
]
17: ; preds = %12
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%20 = load i8*, i8** %2
br label %25
21: ; preds = %12, %12
%22 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %22, i8** %2
%23 = call i8* @strchr(i8* %22, i8 signext %16)
%24 = getelementptr inbounds i8, i8* %23, i64 1
br label %25
25: ; preds = %21, %17, %8
%26 = phi i8* [ %11, %8 ], [ %20, %17 ], [ %24, %21 ]
ret i8* %26
}