#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 */
char *parse_next_regex(char *ptr) {
  while ((*ptr != '"' || (*(ptr + 1) != ' ' && *(ptr + 1) != '\n')) &&
         *ptr != '\n' && *ptr != '\0')
    ptr++;
  if (*ptr == '\0')
    return NULL;
  *ptr++ = '\0';
  while (*ptr == ' ' || *ptr == '\t')
    ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<parse_next_regex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1144 <parse_next_regex+0x44>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1169 <parse_next_regex+0x69>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1169 <parse_next_regex+0x69>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1169 <parse_next_regex+0x69>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1179 <parse_next_regex+0x79>
jmp    118a <parse_next_regex+0x8a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <parse_next_regex+0x8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11a7 <parse_next_regex+0xa7>
movq   $0x0,-0x8(%rbp)
jmp    1207 <parse_next_regex+0x107>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x12(%rbp)
je     11de <parse_next_regex+0xde>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    11ee <parse_next_regex+0xee>
jmp    11ff <parse_next_regex+0xff>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11b9 <parse_next_regex+0xb9>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_next_regex>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x22,%cl
je     1130 <parse_next_regex+0x30>
test   %cl,%cl
je     1162 <parse_next_regex+0x62>
cmp    $0xa,%cl
jne    1110 <parse_next_regex+0x10>
jmp    113d <parse_next_regex+0x3d>
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    $0xa,%cl
je     113d <parse_next_regex+0x3d>
cmp    $0x20,%cl
jne    1110 <parse_next_regex+0x10>
movb   $0x0,-0x1(%rax)
jmp    1154 <parse_next_regex+0x54>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1150 <parse_next_regex+0x50>
cmp    $0x9,%cl
je     1150 <parse_next_regex+0x50>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @parse_next_regex(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %33, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 34
br i1 %8, label %21, label %9
9: ; preds = %4
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 32
br i1 %14, label %15, label %31
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 10
br i1 %20, label %21, label %31
21: ; preds = %15, %4
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 10
br i1 %25, label %26, label %31
26: ; preds = %21
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 0
br label %31
31: ; preds = %26, %21, %15, %9
%32 = phi i1 [ false, %21 ], [ false, %15 ], [ false, %9 ], [ %30, %26 ]
br i1 %32, label %33, label %36
33: ; preds = %31
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %3
br label %4
36: ; preds = %31
%37 = load i8*, i8** %3
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %36
store i8* null, i8** %2
br label %62
42: ; preds = %36
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %3
store i8 0, i8* %43
br label %45
45: ; preds = %57, %42
%46 = load i8*, i8** %3
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 32
br i1 %49, label %55, label %50
50: ; preds = %45
%51 = load i8*, i8** %3
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 9
br label %55
55: ; preds = %50, %45
%56 = phi i1 [ true, %45 ], [ %54, %50 ]
br i1 %56, label %57, label %60
57: ; preds = %55
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i32 1
store i8* %59, i8** %3
br label %45
60: ; preds = %55
%61 = load i8*, i8** %3
store i8* %61, i8** %2
br label %62
62: ; preds = %60, %41
%63 = load i8*, i8** %2
ret i8* %63
}

LLVM IR (-O2):
define i8* @parse_next_regex(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 34, label %5
i8 0, label %16
i8 10, label %10
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
switch i8 %7, label %8 [
i8 32, label %10
i8 10, label %10
]
8: ; preds = %2, %5
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2, %5, %5
store i8 0, i8* %3
br label %11
11: ; preds = %15, %10
%12 = phi i8* [ %3, %10 ], [ %13, %15 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
switch i8 %14, label %16 [
i8 32, label %15
i8 9, label %15
]
15: ; preds = %11, %11
br label %11
16: ; preds = %2, %11
%17 = phi i8* [ %13, %11 ], [ null, %2 ]
ret i8* %17
}