#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 */

/* Variables and functions */
int /*<<< orphan*/ acid_test_for_cardinality_sequence(int *, int);
int /*<<< orphan*/ assert(int);
void verify_one_cardinality_sequence_data(int *index, int *sequence,
                                          int order) {
  int i = 0;
  int length = 0;
  length = 1 << order;
  for (i = 0; i < length; i++) {
    assert(index[i] == i);
  }
  acid_test_for_cardinality_sequence(sequence, order);
  return;
}


x86 assembly (clang, -O0):
<verify_one_cardinality_sequence_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    118a <verify_one_cardinality_sequence_data+0x6a>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1155 <verify_one_cardinality_sequence_data+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <acid_test_for_cardinality_sequence@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_one_cardinality_sequence_data>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
cmp    $0x1f,%edx
je     116b <verify_one_cardinality_sequence_data+0x4b>
mov    %rdi,%r12
mov    $0x1,%eax
mov    $0x1,%ebp
mov    %r15d,%ecx
shl    %cl,%ebp
cmp    $0x2,%ebp
cmovl  %eax,%ebp
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r12,%rbx,4),%eax
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <verify_one_cardinality_sequence_data+0x30>
mov    %r14,%rdi
mov    %r15d,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <acid_test_for_cardinality_sequence@plt>

LLVM IR (-O0):
define void @verify_one_cardinality_sequence_data(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %6
%10 = shl i32 1, %9
store i32 %10, i32* %8
store i32 0, i32* %7
br label %11
11: ; preds = %25, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load i32*, i32** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %7
%22 = icmp eq i32 %20, %21
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
br label %25
25: ; preds = %15
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %11
28: ; preds = %11
%29 = load i32*, i32** %5
%30 = load i32, i32* %6
%31 = call i32 @acid_test_for_cardinality_sequence(i32* %29, i32 %30)
ret void
}

LLVM IR (-O2):
define void @verify_one_cardinality_sequence_data(i32* nocapture %0, i32* %1, i32 %2) {
%4 = icmp eq i32 %2, 31
br i1 %4, label %19, label %5
5: ; preds = %3
%6 = shl nuw nsw i32 1, %2
%7 = call i32 @llvm.smax.i32(i32 %6, i32 1)
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %17, %9 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = zext i32 %12 to i64
%14 = icmp eq i64 %10, %13
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = add nuw nsw i64 %10, 1
%18 = icmp eq i64 %17, %8
br i1 %18, label %19, label %9
19: ; preds = %9, %3
%20 = tail call i32 @acid_test_for_cardinality_sequence(i32* %1, i32 %2)
ret void
}