#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 EOF;
int /*<<< orphan*/ c_isspace(int);
int fgetc(int /*<<< orphan*/ *);
int next_content(FILE *f) {
  int c;
  for (c = fgetc(f); c != EOF; c = fgetc(f)) {
    if (!c_isspace(c)) {
      break;
    }
    if (c == '\n') {
      break;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<next_content>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
je     1185 <next_content+0x65>
mov    -0xc(%rbp),%edi
call   1040 <c_isspace@plt>
cmp    $0x0,%eax
jne    1160 <next_content+0x40>
jmp    1185 <next_content+0x65>
cmpl   $0xa,-0xc(%rbp)
jne    116f <next_content+0x4f>
jmp    1185 <next_content+0x65>
jmp    1174 <next_content+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
jmp    1138 <next_content+0x18>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_content>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    0x2eb3(%rip),%r14
cmp    (%r14),%eax
je     115f <next_content+0x3f>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <c_isspace@plt>
cmp    $0xa,%ebp
je     115f <next_content+0x3f>
test   %eax,%eax
je     115f <next_content+0x3f>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
jne    1140 <next_content+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @next_content(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @c_isspace(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10
br label %23
15: ; preds = %10
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %19
18: ; preds = %15
br label %23
19: ; preds = %15
br label %20
20: ; preds = %19
%21 = load i32*, i32** %2
%22 = call i32 @fgetc(i32* %21)
store i32 %22, i32* %3
br label %6
23: ; preds = %18, %14, %6
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @next_content(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %15, label %5
5: ; preds = %1, %11
%6 = phi i32 [ %12, %11 ], [ %2, %1 ]
%7 = tail call i32 @c_isspace(i32 %6)
%8 = icmp eq i32 %7, 0
%9 = icmp eq i32 %6, 10
%10 = or i1 %9, %8
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = tail call i32 @fgetc(i32* %0)
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %5
15: ; preds = %11, %5, %1
%16 = phi i32 [ %2, %1 ], [ %6, %5 ], [ %12, %11 ]
ret i32 %16
}