#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 */
struct cymkd_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ block(struct cymkd_parser *);
scalar_t__ newlines(struct cymkd_parser *);
int next(struct cymkd_parser *);
int /*<<< orphan*/ parser_emit_char(struct cymkd_parser *, char);
bool more_blocks(struct cymkd_parser *parser) {
  if (next(parser) != -1) {
    block(parser);
    while (newlines(parser)) {
      parser_emit_char(parser, '\n');
    }
    return more_blocks(parser);
  }
  return true;
}


x86 assembly (clang, -O0):
<more_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <next@plt>
cmp    $0xffffffff,%eax
je     11ae <more_blocks+0x5e>
mov    -0x10(%rbp),%rdi
call   1050 <block@plt>
mov    -0x10(%rbp),%rdi
call   1040 <newlines@plt>
cmp    $0x0,%rax
je     119d <more_blocks+0x4d>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1060 <parser_emit_char@plt>
jmp    1177 <more_blocks+0x27>
mov    -0x10(%rbp),%rdi
call   1070 <more_blocks@plt>
mov    %eax,-0x4(%rbp)
jmp    11b5 <more_blocks+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_blocks>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <next@plt>
cmp    $0xffffffff,%eax
je     118c <more_blocks+0x4c>
mov    %rbx,%rdi
call   1050 <block@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <newlines@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1150 <more_blocks+0x10>
mov    $0xa,%esi
call   1060 <parser_emit_char@plt>
jmp    1170 <more_blocks+0x30>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cymkd_parser = type { i32 }
define i32 @more_blocks(%struct.cymkd_parser* %0) {
%2 = alloca i32
%3 = alloca %struct.cymkd_parser*
store %struct.cymkd_parser* %0, %struct.cymkd_parser** %3
%4 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%5 = call i32 @next(%struct.cymkd_parser* %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %20
7: ; preds = %1
%8 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%9 = call i32 @block(%struct.cymkd_parser* %8)
br label %10
10: ; preds = %14, %7
%11 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%12 = call i64 @newlines(%struct.cymkd_parser* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%16 = call i32 @parser_emit_char(%struct.cymkd_parser* %15, i8 signext 10)
br label %10
17: ; preds = %10
%18 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%19 = call i32 @more_blocks(%struct.cymkd_parser* %18)
store i32 %19, i32* %2
br label %21
20: ; preds = %1
store i32 1, i32* %2
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
%struct.cymkd_parser = type { i32 }
define i32 @more_blocks(%struct.cymkd_parser* %0) {
%2 = tail call i32 @next(%struct.cymkd_parser* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %15, label %4
4: ; preds = %1, %12
%5 = tail call i32 @block(%struct.cymkd_parser* %0)
%6 = tail call i64 @newlines(%struct.cymkd_parser* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4, %8
%9 = tail call i32 @parser_emit_char(%struct.cymkd_parser* %0, i8 signext 10)
%10 = tail call i64 @newlines(%struct.cymkd_parser* %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %8
12: ; preds = %8, %4
%13 = tail call i32 @next(%struct.cymkd_parser* %0)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %4
15: ; preds = %12, %1
ret i32 1
}