#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 /*<<< orphan*/ puts(char *);
void show(int table[]) {
  int count = 1;
  for (int i = 2; i < 1000; i++) {
    if (table[i] == 1) {
      printf("%4d", i);
      count++;
    }
    if (count % 10 == 0) {
      puts("");
      count++;
    }
  }
  puts("");
  return;
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
cmpl   $0x3e8,-0x10(%rbp)
jge    11ad <show+0x8d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1171 <show+0x51>
mov    -0x10(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119a <show+0x7a>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119f <show+0x7f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <show+0x1a>
lea    0xe4f(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%ebp
mov    $0x2,%ebx
lea    0xec5(%rip),%r15
jmp    114d <show+0x2d>
nopl   (%rax)
add    $0x1,%rbx
cmp    $0x3e8,%rbx
je     1184 <show+0x64>
cmpl   $0x1,(%r14,%rbx,4)
jne    1161 <show+0x41>
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebp
imul   $0xcccccccd,%ebp,%eax
add    $0x19999998,%eax
ror    %eax
cmp    $0x19999998,%eax
ja     1140 <show+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
jmp    1140 <show+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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