#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 */
char lookahead(struct cymkd_parser *, int);
char next(struct cymkd_parser *);
int ordered_list_internal(struct cymkd_parser *, char *);
bool ordered_list(struct cymkd_parser *parser) {
  if (next(parser) == '1' && lookahead(parser, 1) == '.') {
    return ordered_list_internal(parser, "");
  }
  return false;
}


x86 assembly (clang, -O0):
<ordered_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <next@plt>
movsbl %al,%eax
cmp    $0x31,%eax
jne    1183 <ordered_list+0x53>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <lookahead@plt>
movsbl %al,%eax
cmp    $0x2e,%eax
jne    1183 <ordered_list+0x53>
mov    -0x10(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <ordered_list_internal@plt>
mov    %eax,-0x4(%rbp)
jmp    118a <ordered_list+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordered_list>:
push   %rbx
mov    %rdi,%rbx
call   1030 <next@plt>
cmp    $0x31,%al
jne    115e <ordered_list+0x2e>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <lookahead@plt>
cmp    $0x2e,%al
jne    115e <ordered_list+0x2e>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ordered_list_internal@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cymkd_parser = type { i32 }
@.str = [1 x i8] zeroinitializer
define i32 @ordered_list(%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 signext i8 @next(%struct.cymkd_parser* %4)
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 49
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%10 = call signext i8 @lookahead(%struct.cymkd_parser* %9, i32 1)
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 46
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%15 = call i32 @ordered_list_internal(%struct.cymkd_parser* %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %15, i32* %2
br label %17
16: ; preds = %8, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %2
ret i32 %18
}

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