#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 treeGetCh(int /*<<< orphan*/ *);
int /*<<< orphan*/ treeProcessLength(int /*<<< orphan*/ *, double *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int treeFlushLen(FILE *fp) {
  double dummy;
  int ch;
  ch = treeGetCh(fp);
  if (ch == ':') {
    ch = treeGetCh(fp);
    ungetc(ch, fp);
    if (!treeProcessLength(fp, &dummy))
      return 0;
    return 1;
  }
  if (ch != EOF)
    (void)ungetc(ch, fp);
  return 1;
}


x86 assembly (clang, -O0):
<treeFlushLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <treeGetCh@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x3a,-0x1c(%rbp)
jne    1198 <treeFlushLen+0x68>
mov    -0x10(%rbp),%rdi
call   1030 <treeGetCh@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <ungetc@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <treeProcessLength@plt>
cmp    $0x0,%eax
jne    118c <treeFlushLen+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    11bd <treeFlushLen+0x8d>
movl   $0x1,-0x4(%rbp)
jmp    11bd <treeFlushLen+0x8d>
mov    -0x1c(%rbp),%eax
mov    0x2e46(%rip),%rcx
cmp    (%rcx),%eax
je     11b6 <treeFlushLen+0x86>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <ungetc@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<treeFlushLen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <treeGetCh@plt>
cmp    $0x3a,%eax
jne    1167 <treeFlushLen+0x37>
mov    %rbx,%rdi
call   1030 <treeGetCh@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <treeProcessLength@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
jmp    1181 <treeFlushLen+0x51>
mov    0x2e7a(%rip),%rcx
mov    $0x1,%ebp
cmp    (%rcx),%eax
je     1181 <treeFlushLen+0x51>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @treeFlushLen(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca double
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @treeGetCh(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 58
br i1 %9, label %10, label %21
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = call i32 @treeGetCh(i32* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32*, i32** %3
%15 = call i32 @ungetc(i32 %13, i32* %14)
%16 = load i32*, i32** %3
%17 = call i32 @treeProcessLength(i32* %16, double* %4)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %10
store i32 0, i32* %2
br label %30
20: ; preds = %10
store i32 1, i32* %2
br label %30
21: ; preds = %1
%22 = load i32, i32* %5
%23 = load i32, i32* @EOF
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* %5
%27 = load i32*, i32** %3
%28 = call i32 @ungetc(i32 %26, i32* %27)
br label %29
29: ; preds = %25, %21
store i32 1, i32* %2
br label %30
30: ; preds = %29, %20, %19
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @treeFlushLen(i32* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = tail call i32 @treeGetCh(i32* %0)
%5 = icmp eq i32 %4, 58
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = tail call i32 @treeGetCh(i32* %0)
%8 = tail call i32 @ungetc(i32 %7, i32* %0)
%9 = call i32 @treeProcessLength(i32* %0, double* %2)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %17
12: ; preds = %1
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %4, %13
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @ungetc(i32 %4, i32* %0)
br label %17
17: ; preds = %12, %15, %6
%18 = phi i32 [ %11, %6 ], [ 1, %15 ], [ 1, %12 ]
ret i32 %18
}