#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 getchar_unlocked();
void fastRead_string(char *str, char delim) {
  register char c = 0;
  register int i = 0;
  while (c < 33)
    c = getchar_unlocked();
  while (c != delim) {
    str[i] = c;
    c = getchar_unlocked();
    i = i + 1;
  }
  str[i] = '\0';
}


x86 assembly (clang, -O0):
<fastRead_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
movsbl -0xa(%rbp),%eax
cmp    $0x21,%eax
jge    1149 <fastRead_string+0x39>
mov    $0x0,%al
call   1030 <getchar_unlocked@plt>
mov    %al,-0xa(%rbp)
jmp    112d <fastRead_string+0x1d>
jmp    114e <fastRead_string+0x3e>
movsbl -0xa(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1184 <fastRead_string+0x74>
mov    -0xa(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    $0x0,%al
call   1030 <getchar_unlocked@plt>
mov    %al,-0xa(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <fastRead_string+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastRead_string>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
cmp    $0x21,%al
jl     1120 <fastRead_string+0x10>
cmp    %bpl,%al
jne    1134 <fastRead_string+0x24>
xor    %eax,%eax
jmp    1156 <fastRead_string+0x46>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
add    $0x1,%rbx
cmp    %bpl,%al
jne    1140 <fastRead_string+0x30>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fastRead_string(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i8 0, i8* %5
store i32 0, i32* %6
br label %7
7: ; preds = %11, %2
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 33
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call signext i8 (...) @getchar_unlocked()
store i8 %12, i8* %5
br label %7
13: ; preds = %7
br label %14
14: ; preds = %20, %13
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %29
20: ; preds = %14
%21 = load i8, i8* %5
%22 = load i8*, i8** %3
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
%26 = call signext i8 (...) @getchar_unlocked()
store i8 %26, i8* %5
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %14
29: ; preds = %14
%30 = load i8*, i8** %3
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8 0, i8* %33
ret void
}

LLVM IR (-O2):
define void @fastRead_string(i8* nocapture writeonly %0, i8 signext %1) {
br label %5
3: ; preds = %5
%4 = icmp eq i8 %6, %1
br i1 %4, label %17, label %8
5: ; preds = %2, %5
%6 = tail call signext i8 (...) @getchar_unlocked()
%7 = icmp slt i8 %6, 33
br i1 %7, label %5, label %3
8: ; preds = %3, %8
%9 = phi i64 [ %13, %8 ], [ 0, %3 ]
%10 = phi i8 [ %12, %8 ], [ %6, %3 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %10, i8* %11
%12 = tail call signext i8 (...) @getchar_unlocked()
%13 = add nuw i64 %9, 1
%14 = icmp eq i8 %12, %1
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = and i64 %13, 4294967295
br label %17
17: ; preds = %15, %3
%18 = phi i64 [ 0, %3 ], [ %16, %15 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret void
}