#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 */
scalar_t__ is_bullet(int);
scalar_t__ isspace(int /*<<< orphan*/);
int /*<<< orphan*/ lookahead(struct cymkd_parser *, int);
int next(struct cymkd_parser *);
int unordered_list_internal(struct cymkd_parser *, int, char *);
bool unordered_list(struct cymkd_parser *parser) {
  int bullet;
  if (is_bullet(next(parser)) && isspace(lookahead(parser, 1))) {
    bullet = next(parser);
    return unordered_list_internal(parser, bullet, "");
  }
  return false;
}


x86 assembly (clang, -O0):
<unordered_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <next@plt>
mov    %eax,%edi
call   1030 <is_bullet@plt>
cmp    $0x0,%rax
je     11bc <unordered_list+0x6c>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1060 <lookahead@plt>
mov    %eax,%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     11bc <unordered_list+0x6c>
mov    -0x10(%rbp),%rdi
call   1050 <next@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xe51(%rip),%rdx
call   1070 <unordered_list_internal@plt>
mov    %eax,-0x4(%rbp)
jmp    11c3 <unordered_list+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unordered_list>:
push   %rbx
mov    %rdi,%rbx
call   1050 <next@plt>
mov    %eax,%edi
call   1030 <is_bullet@plt>
test   %rax,%rax
je     1198 <unordered_list+0x48>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <lookahead@plt>
mov    %eax,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     1198 <unordered_list+0x48>
mov    %rbx,%rdi
call   1050 <next@plt>
lea    0xe73(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1070 <unordered_list_internal@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cymkd_parser = type { i32 }
@.str = [1 x i8] zeroinitializer
define i32 @unordered_list(%struct.cymkd_parser* %0) {
%2 = alloca i32
%3 = alloca %struct.cymkd_parser*
%4 = alloca i32
store %struct.cymkd_parser* %0, %struct.cymkd_parser** %3
%5 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%6 = call i32 @next(%struct.cymkd_parser* %5)
%7 = call i64 @is_bullet(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %1
%10 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%11 = call i32 @lookahead(%struct.cymkd_parser* %10, i32 1)
%12 = call i64 @isspace(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%16 = call i32 @next(%struct.cymkd_parser* %15)
store i32 %16, i32* %4
%17 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%18 = load i32, i32* %4
%19 = call i32 @unordered_list_internal(%struct.cymkd_parser* %17, i32 %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %19, i32* %2
br label %21
20: ; preds = %9, %1
store i32 0, i32* %2
br label %21
21: ; preds = %20, %14
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
%struct.cymkd_parser = type { i32 }
@.str = [1 x i8] zeroinitializer
define i32 @unordered_list(%struct.cymkd_parser* %0) {
%2 = tail call i32 @next(%struct.cymkd_parser* %0)
%3 = tail call i64 @is_bullet(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = tail call i32 @lookahead(%struct.cymkd_parser* %0, i32 1)
%7 = tail call i64 @isspace(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = tail call i32 @next(%struct.cymkd_parser* %0)
%11 = tail call i32 @unordered_list_internal(%struct.cymkd_parser* %0, i32 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %1, %5, %9
%13 = phi i32 [ %11, %9 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %13
}