#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*/ printf(char *, long long);
int printprimes(unsigned char *condition_array, long long size) {
  long long i;
  for (i = 1; i < size; i++) {
    if ((condition_array[(i / 8)] & (1 << (i % 8)))) {
      printf("%lld\n", i);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<printprimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11a7 <printprimes+0x97>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    -0x1c(%rbp),%eax
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1191 <printprimes+0x81>
mov    -0x18(%rbp),%rsi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <printprimes+0x86>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printprimes+0x18>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printprimes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%rsi
jl     116f <printprimes+0x5f>
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x1,%ebx
lea    0xed0(%rip),%r12
jmp    1149 <printprimes+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     116f <printprimes+0x5f>
mov    %rbx,%rax
shr    $0x3,%rax
movzbl (%r14,%rax,1),%eax
mov    %ebx,%ecx
and    $0x7,%cl
movzbl %cl,%ecx
bt     %ecx,%eax
jae    1140 <printprimes+0x30>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1140 <printprimes+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @printprimes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 1, i64* %5
br label %6
6: ; preds = %27, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = sdiv i64 %12, 8
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i64, i64* %5
%18 = srem i64 %17, 8
%19 = trunc i64 %18 to i32
%20 = shl i32 1, %19
%21 = and i32 %16, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %10
%24 = load i64, i64* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %24)
br label %26
26: ; preds = %23, %10
br label %27
27: ; preds = %26
%28 = load i64, i64* %5
%29 = add nsw i64 %28, 1
store i64 %29, i64* %5
br label %6
30: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @printprimes(i8* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %20
4: ; preds = %2, %17
%5 = phi i64 [ %18, %17 ], [ 1, %2 ]
%6 = lshr i64 %5, 3
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = trunc i64 %5 to i32
%11 = and i32 %10, 7
%12 = shl nuw nsw i32 1, %11
%13 = and i32 %12, %9
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %4
%16 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %5)
br label %17
17: ; preds = %4, %15
%18 = add nuw nsw i64 %5, 1
%19 = icmp eq i64 %18, %1
br i1 %19, label %20, label %4
20: ; preds = %17, %2
ret i32 0
}