#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 0, j, V[5], R[10];
  do {
    scanf("%d", &V[i]);
    if (V[i] >= 0 && V[i] <= 1023)
      i++;
  } while (i < 5);
  for (i = 0; i < 5; i++) {
    for (j = 10 - 1; j >= 0; j--) {
      R[j] = V[i] % 2;
      V[i] = V[i] / 2;
    }
    for (j = 0; j < 10; j++)
      printf("%d ", R[j]);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0x20(%rbp,%rax,4)
jl     117b <main+0x5b>
movslq -0x8(%rbp),%rax
cmpl   $0x3ff,-0x20(%rbp,%rax,4)
jg     117b <main+0x5b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <main+0x60>
cmpl   $0x5,-0x8(%rbp)
jl     1136 <main+0x16>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    123d <main+0x11d>
movl   $0x9,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     11ec <main+0xcc>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq -0xc(%rbp),%rax
mov    %edx,-0x50(%rbp,%rax,4)
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11a2 <main+0x82>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1221 <main+0x101>
movslq -0xc(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f3 <main+0xd3>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1191 <main+0x71>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %ebp,%ebp
lea    0xeb9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %ebp,%ebx
lea    (%rsp,%rbx,4),%rsi
add    $0x20,%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
cmpl   $0x400,0x20(%rsp,%rbx,4)
adc    $0x0,%ebp
cmp    $0x5,%ebp
jb     1150 <main+0x20>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,0x18(%rsp)
mov    0x20(%rsp,%rax,4),%ebx
lea    0x3ff(%rbx),%r8d
test   %ebx,%ebx
cmovns %ebx,%r8d
lea    0x1ff(%rbx),%r9d
test   %ebx,%ebx
cmovns %ebx,%r9d
lea    0xff(%rbx),%r10d
test   %ebx,%ebx
cmovns %ebx,%r10d
lea    0x7f(%rbx),%r11d
test   %ebx,%ebx
cmovns %ebx,%r11d
lea    0x3f(%rbx),%r12d
test   %ebx,%ebx
cmovns %ebx,%r12d
lea    0x1f(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
lea    0xf(%rbx),%ebp
test   %ebx,%ebx
cmovns %ebx,%ebp
lea    0x7(%rbx),%ecx
test   %ebx,%ebx
cmovns %ebx,%ecx
lea    0x3(%rbx),%edx
test   %ebx,%ebx
cmovns %ebx,%edx
mov    %ebx,%edi
shr    $0x1f,%edi
add    %ebx,%edi
mov    %edi,%esi
and    $0xfffffffe,%esi
sub    %esi,%ebx
mov    %edi,%esi
sar    %esi
shr    $0x1f,%edi
add    %esi,%edi
and    $0xfffffffe,%edi
sub    %edi,%esi
mov    %esi,0x14(%rsp)
mov    %edx,%esi
sar    $0x2,%esi
shr    $0x1f,%edx
add    %esi,%edx
and    $0xfffffffe,%edx
sub    %edx,%esi
mov    %esi,0x10(%rsp)
mov    %ecx,%edx
sar    $0x3,%edx
shr    $0x1f,%ecx
add    %edx,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%edx
mov    %edx,0xc(%rsp)
mov    %ebp,%ecx
sar    $0x4,%ecx
shr    $0x1f,%ebp
add    %ecx,%ebp
and    $0xfffffffe,%ebp
sub    %ebp,%ecx
mov    %ecx,0x8(%rsp)
mov    %eax,%r14d
sar    $0x5,%r14d
shr    $0x1f,%eax
add    %r14d,%eax
and    $0xfffffffe,%eax
sub    %eax,%r14d
mov    %r12d,%r15d
sar    $0x6,%r15d
shr    $0x1f,%r12d
add    %r15d,%r12d
and    $0xfffffffe,%r12d
sub    %r12d,%r15d
mov    %r11d,%r12d
sar    $0x7,%r12d
shr    $0x1f,%r11d
add    %r12d,%r11d
and    $0xfffffffe,%r11d
sub    %r11d,%r12d
mov    %r10d,%r13d
sar    $0x8,%r13d
shr    $0x1f,%r10d
add    %r13d,%r10d
and    $0xfffffffe,%r10d
sub    %r10d,%r13d
mov    %r9d,%esi
sar    $0x9,%esi
shr    $0x1f,%r9d
add    %esi,%r9d
and    $0xfffffffe,%r9d
sub    %r9d,%esi
sar    $0xa,%r8d
mov    0x18(%rsp),%rax
mov    %r8d,0x20(%rsp,%rax,4)
lea    0xd4b(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%rax
add    $0x1,%rax
cmp    $0x5,%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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