#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 */
scalar_t__ isspace(char);
char fBufferEmpty(char *pBuffer) {
  if (pBuffer == NULL)
    return 1;
  for (; isspace(*pBuffer) && *pBuffer != '\0'; pBuffer++)
    ;
  if (*pBuffer == '\0')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fBufferEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <fBufferEmpty+0x20>
movb   $0x1,-0x1(%rbp)
jmp    11a6 <fBufferEmpty+0x96>
jmp    1135 <fBufferEmpty+0x25>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1163 <fBufferEmpty+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1173 <fBufferEmpty+0x63>
jmp    1189 <fBufferEmpty+0x79>
jmp    1178 <fBufferEmpty+0x68>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1135 <fBufferEmpty+0x25>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11a2 <fBufferEmpty+0x92>
movb   $0x1,-0x1(%rbp)
jmp    11a6 <fBufferEmpty+0x96>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fBufferEmpty>:
test   %rdi,%rdi
je     1141 <fBufferEmpty+0x31>
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopl   0x0(%rax)
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <fBufferEmpty+0x29>
cmpb   $0x0,(%rbx)
je     1139 <fBufferEmpty+0x29>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <fBufferEmpty+0x10>
cmpb   $0x0,(%rbx)
sete   %al
pop    %rbx
ret
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @fBufferEmpty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %21, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %3, %11
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = tail call i64 @isspace(i8 signext %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %11, %3
%17 = phi i8* [ %0, %3 ], [ %12, %11 ], [ %8, %7 ]
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
%20 = zext i1 %19 to i8
br label %21
21: ; preds = %16, %1
%22 = phi i8 [ 1, %1 ], [ %20, %16 ]
ret i8 %22
}