#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, int);
int main(void) {
  int array[10] = {};
  int i = 0;
  for (i = 0; i < 10; i++) {
    if (i % 3 == 0) {
      array[i] = 1;
      continue;
    }
    if (i % 5 == 0) {
      array[i] = 2;
      continue;
    }
    if (i % 7 == 0) {
      array[i] = 3;
      continue;
    }
    if ((i % 3 == 0 && i % 5 == 0) || (i % 3 == 0 && i % 7 == 0) ||
        (i % 5 == 0 && i % 7 == 0) ||
        (i % 5 == 0 && i % 7 == 0 && i % 3 == 0)) {
      array[i] = 8;
      continue;
    }
    array[i] = 0;
  }
  for (i = 0; i < 10; i++) {
    printf("a[%d]=%d\n", i, array[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    12a5 <main+0x185>
mov    -0x34(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117c <main+0x5c>
movslq -0x34(%rbp),%rax
movl   $0x1,-0x30(%rbp,%rax,4)
jmp    1297 <main+0x177>
mov    -0x34(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a1 <main+0x81>
movslq -0x34(%rbp),%rax
movl   $0x2,-0x30(%rbp,%rax,4)
jmp    1297 <main+0x177>
mov    -0x34(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c6 <main+0xa6>
movslq -0x34(%rbp),%rax
movl   $0x3,-0x30(%rbp,%rax,4)
jmp    1297 <main+0x177>
mov    -0x34(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ee <main+0xce>
mov    -0x34(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     127a <main+0x15a>
mov    -0x34(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1216 <main+0xf6>
mov    -0x34(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     127a <main+0x15a>
mov    -0x34(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    123e <main+0x11e>
mov    -0x34(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     127a <main+0x15a>
mov    -0x34(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    128b <main+0x16b>
mov    -0x34(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    128b <main+0x16b>
mov    -0x34(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    128b <main+0x16b>
movslq -0x34(%rbp),%rax
movl   $0x8,-0x30(%rbp,%rax,4)
jmp    1297 <main+0x177>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114d <main+0x2d>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    12db <main+0x1bb>
mov    -0x34(%rbp),%esi
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xd38(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12ac <main+0x18c>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"a[%d]=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %76, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %79
8: ; preds = %5
%9 = load i32, i32* %3
%10 = srem i32 %9, 3
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %14
store i32 1, i32* %15
br label %76
16: ; preds = %8
%17 = load i32, i32* %3
%18 = srem i32 %17, 5
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %22
store i32 2, i32* %23
br label %76
24: ; preds = %16
%25 = load i32, i32* %3
%26 = srem i32 %25, 7
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %24
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %30
store i32 3, i32* %31
br label %76
32: ; preds = %24
%33 = load i32, i32* %3
%34 = srem i32 %33, 3
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %32
%37 = load i32, i32* %3
%38 = srem i32 %37, 5
%39 = icmp eq i32 %38, 0
br i1 %39, label %68, label %40
40: ; preds = %36, %32
%41 = load i32, i32* %3
%42 = srem i32 %41, 3
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %40
%45 = load i32, i32* %3
%46 = srem i32 %45, 7
%47 = icmp eq i32 %46, 0
br i1 %47, label %68, label %48
48: ; preds = %44, %40
%49 = load i32, i32* %3
%50 = srem i32 %49, 5
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %48
%53 = load i32, i32* %3
%54 = srem i32 %53, 7
%55 = icmp eq i32 %54, 0
br i1 %55, label %68, label %56
56: ; preds = %52, %48
%57 = load i32, i32* %3
%58 = srem i32 %57, 5
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %72
60: ; preds = %56
%61 = load i32, i32* %3
%62 = srem i32 %61, 7
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %72
64: ; preds = %60
%65 = load i32, i32* %3
%66 = srem i32 %65, 3
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %64, %52, %44, %36
%69 = load i32, i32* %3
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %70
store i32 8, i32* %71
br label %76
72: ; preds = %64, %60, %56
%73 = load i32, i32* %3
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %74
store i32 0, i32* %75
br label %76
76: ; preds = %72, %68, %28, %20, %12
%77 = load i32, i32* %3
%78 = add nsw i32 %77, 1
store i32 %78, i32* %3
br label %5
79: ; preds = %5
store i32 0, i32* %3
br label %80
80: ; preds = %90, %79
%81 = load i32, i32* %3
%82 = icmp slt i32 %81, 10
br i1 %82, label %83, label %93
83: ; preds = %80
%84 = load i32, i32* %3
%85 = load i32, i32* %3
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %86
%88 = load i32, i32* %87
%89 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %84, i32 %88)
br label %90
90: ; preds = %83
%91 = load i32, i32* %3
%92 = add nsw i32 %91, 1
store i32 %92, i32* %3
br label %80
93: ; preds = %80
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"a[%d]=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3, i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i32 2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6, i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7, i32 3)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8, i32 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 1)
ret i32 0
}