#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 */
int /*<<< orphan*/ bbs_bug(char *);
scalar_t__ feof(int /*<<< orphan*/ *);
char getc(int /*<<< orphan*/ *);
scalar_t__ isspace(char);
char fget_letter(FILE *pFile) {
  char c;
  do {
    if (feof(pFile) != 0) {
      bbs_bug("Fget_letter: Unexpected EOF");
      return ('\0');
    }
    c = getc(pFile);
  } while (isspace(c) != 0);
  return (c);
}


x86 assembly (clang, -O0):
<fget_letter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%rax
je     1174 <fget_letter+0x34>
lea    0xe9a(%rip),%rdi
call   1030 <bbs_bug@plt>
movb   $0x0,-0x1(%rbp)
jmp    1199 <fget_letter+0x59>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
jne    114c <fget_letter+0xc>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_letter>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %rax,%rax
jne    1176 <fget_letter+0x36>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %eax,%ebp
movsbl %al,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1150 <fget_letter+0x10>
jmp    1184 <fget_letter+0x44>
lea    0xe83(%rip),%rdi
call   1030 <bbs_bug@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Fget_letter: Unexpected EOF\00"
define signext i8 @fget_letter(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
br label %5
5: ; preds = %14, %1
%6 = load i32*, i32** %3
%7 = call i64 @feof(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @bbs_bug(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i8 0, i8* %2
br label %20
11: ; preds = %5
%12 = load i32*, i32** %3
%13 = call signext i8 @getc(i32* %12)
store i8 %13, i8* %4
br label %14
14: ; preds = %11
%15 = load i8, i8* %4
%16 = call i64 @isspace(i8 signext %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %5, label %18
18: ; preds = %14
%19 = load i8, i8* %4
store i8 %19, i8* %2
br label %20
20: ; preds = %18, %9
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
@.str = [28 x i8] c"Fget_letter: Unexpected EOF\00"
define signext i8 @fget_letter(i32* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = tail call i64 @feof(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @bbs_bug(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = tail call signext i8 @getc(i32* %0)
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %7, %5
%12 = phi i8 [ 0, %5 ], [ %8, %7 ]
ret i8 %12
}