#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 *, ...);
void printList(int *list, int length, int mask) {
  int i;
  for (i = 0; i < length; i++) {
    if ((1 << i) & mask)
      continue;
    printf("%d ", list[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <printList+0x67>
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     1150 <printList+0x40>
jmp    1169 <printList+0x59>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <printList+0x19>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printList>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    115f <printList+0x3f>
mov    %edx,%r12d
mov    %rdi,%r14
mov    %esi,%ebx
lea    0xec5(%rip),%r15
xor    %ebp,%ebp
jmp    1149 <printList+0x29>
nop
add    $0x1,%rbp
cmp    %rbp,%rbx
je     115f <printList+0x3f>
bt     %ebp,%r12d
jb     1140 <printList+0x20>
mov    (%r14,%rbp,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1140 <printList+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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