#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcat(char *, char *);
void buildString(FILE *pFile, char *strOut, char *c) {
  while ((*c != ' ') && (*c != '\n') && (*c != EOF)) {
    strcat(strOut, c);
    *c = fgetc(pFile);
  }
}


x86 assembly (clang, -O0):
<buildString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x19(%rbp)
je     1177 <buildString+0x57>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x19(%rbp)
je     1177 <buildString+0x57>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    0x2e7c(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1187 <buildString+0x67>
jmp    11aa <buildString+0x8a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1134 <buildString+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdx),%al
mov    0x2eae(%rip),%r12
cmp    $0xa,%al
je     1163 <buildString+0x43>
xchg   %ax,%ax
cmp    $0x20,%al
je     1163 <buildString+0x43>
cmp    (%r12),%al
je     1163 <buildString+0x43>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %al,(%rbx)
cmp    $0xa,%al
jne    1140 <buildString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @buildString(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %26, %3
%8 = load i8*, i8** %6
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 32
br i1 %11, label %12, label %24
12: ; preds = %7
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %24
17: ; preds = %12
%18 = load i8*, i8** %6
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i8, i8* @EOF
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %20, %22
br label %24
24: ; preds = %17, %12, %7
%25 = phi i1 [ false, %12 ], [ false, %7 ], [ %23, %17 ]
br i1 %25, label %26, label %33
26: ; preds = %24
%27 = load i8*, i8** %5
%28 = load i8*, i8** %6
%29 = call i32 @strcat(i8* %27, i8* %28)
%30 = load i32*, i32** %4
%31 = call signext i8 @fgetc(i32* %30)
%32 = load i8*, i8** %6
store i8 %31, i8* %32
br label %7
33: ; preds = %24
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @buildString(i32* nocapture %0, i8* %1, i8* %2) {
%4 = load i8, i8* %2
br label %5
5: ; preds = %10, %3
%6 = phi i8 [ %12, %10 ], [ %4, %3 ]
switch i8 %6, label %7 [
i8 32, label %13
i8 10, label %13
]
7: ; preds = %5
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %6, %8
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = tail call i32 @strcat(i8* %1, i8* %2)
%12 = tail call signext i8 @fgetc(i32* %0)
store i8 %12, i8* %2
br label %5
13: ; preds = %5, %5, %7
ret void
}