#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 *, ...);
int main() {
  int a[6] = {3, 11, 2, 9, 1, 5};
  int b[100];
  int i;
  for (i = 0; i < 100; i++) {
    b[i] = 0;
  }
  for (i = 0; i < 6; i++) {
    b[a[i]] = 1;
  }
  for (i = 0; i < 100; i++) {
    if (b[i] == 1)
      printf(" %d", i);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x64,-0x1b4(%rbp)
jge    1180 <main+0x70>
movslq -0x1b4(%rbp),%rax
movl   $0x0,-0x1b0(%rbp,%rax,4)
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    114d <main+0x3d>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x6,-0x1b4(%rbp)
jge    11c2 <main+0xb2>
movslq -0x1b4(%rbp),%rax
movslq -0x20(%rbp,%rax,4),%rax
movl   $0x1,-0x1b0(%rbp,%rax,4)
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    118a <main+0x7a>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x64,-0x1b4(%rbp)
jge    121b <main+0x10b>
movslq -0x1b4(%rbp),%rax
cmpl   $0x1,-0x1b0(%rbp,%rax,4)
01
jne    1202 <main+0xf2>
mov    -0x1b4(%rbp),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1207 <main+0xf7>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    11cc <main+0xbc>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    %rsp,%rdi
mov    $0x190,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movl   $0x1,0xc(%rsp)
movl   $0x1,0x2c(%rsp)
movl   $0x1,0x24(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x4(%rsp)
movl   $0x1,0x14(%rsp)
lea    0xe81(%rip),%r14
xor    %ebx,%ebx
jmp    119a <main+0x6a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    $0x64,%rbx
je     11ae <main+0x7e>
cmpl   $0x1,(%rsp,%rbx,4)
jne    1190 <main+0x60>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 3, i32 11, i32 2, i32 9, i32 1, i32 5]
@.str = [4 x i8] c" %d\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [100 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %11
store i32 0, i32* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %6
16: ; preds = %6
store i32 0, i32* %4
br label %17
17: ; preds = %27, %16
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 6
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %25
store i32 1, i32* %26
br label %27
27: ; preds = %20
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %17
30: ; preds = %17
store i32 0, i32* %4
br label %31
31: ; preds = %44, %30
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 100
br i1 %33, label %34, label %47
34: ; preds = %31
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %43
40: ; preds = %34
%41 = load i32, i32* %4
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %40, %34
br label %44
44: ; preds = %43
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
br label %31
47: ; preds = %31
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 3
store i32 1, i32* %3
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 11
store i32 1, i32* %4
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 2
store i32 1, i32* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 9
store i32 1, i32* %6
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 1
store i32 1, i32* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 5
store i32 1, i32* %8
br label %9
9: ; preds = %0, %17
%10 = phi i64 [ 0, %0 ], [ %18, %17 ]
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = trunc i64 %10 to i32
%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 = %9, %14
%18 = add nuw nsw i64 %10, 1
%19 = icmp eq i64 %18, 100
br i1 %19, label %20, label %9
20: ; preds = %17
%21 = tail call i32 @putchar(i32 10)
ret i32 0
}