#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*/ scanf(char *, int *);
int main() {
  int a[10];
  int i = 0;
  int s = 0;
  for (i = 0; i < 10; i++) {
    scanf("%d", &a[i]);
    if (a[i] % 2 != 0) {
      if (s != i) {
        a[s] = a[i];
        a[i] = 0;
        s++;
      }
    } else {
      a[i] = 0;
    }
  }
  for (i = 0; i < 10; i++)
    printf("%d", a[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11d7 <main+0xb7>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b8 <main+0x98>
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     11b3 <main+0x93>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x38(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11c4 <main+0xa4>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
jmp    11c9 <main+0xa9>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1144 <main+0x24>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    120a <main+0xea>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe09(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11de <main+0xbe>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
xor    %r15d,%r15d
lea    0xecc(%rip),%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    1155 <main+0x35>
nopw   0x0(%rax,%rax,1)
movl   $0x0,(%rsp,%rbx,4)
add    $0x1,%rbx
add    $0x4,%r15
cmp    $0xa,%rbx
je     1181 <main+0x61>
lea    (%rsp,%r15,1),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    (%rsp,%rbx,4),%eax
test   $0x1,%al
je     1140 <main+0x20>
mov    %ebp,%ecx
cmp    %rcx,%rbx
je     1147 <main+0x27>
movslq %ebp,%rcx
mov    %eax,(%rsp,%rcx,4)
movl   $0x0,(%rsp,%rbx,4)
add    $0x1,%ebp
jmp    1147 <main+0x27>
mov    (%rsp),%esi
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %42, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %45
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%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
%16 = load i32, i32* %15
%17 = srem i32 %16, 2
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %8
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = icmp ne i32 %20, %21
br i1 %22, label %23, label %36
23: ; preds = %19
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %29
store i32 %27, i32* %30
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %32
store i32 0, i32* %33
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %36
36: ; preds = %23, %19
br label %41
37: ; preds = %8
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %39
store i32 0, i32* %40
br label %41
41: ; preds = %37, %36
br label %42
42: ; preds = %41
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %5
45: ; preds = %5
store i32 0, i32* %3
br label %46
46: ; preds = %55, %45
%47 = load i32, i32* %3
%48 = icmp slt i32 %47, 10
br i1 %48, label %49, label %58
49: ; preds = %46
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %49
%56 = load i32, i32* %3
%57 = add nsw i32 %56, 1
store i32 %57, i32* %3
br label %46
58: ; preds = %46
%59 = load i32, i32* %1
ret i32 %59
}

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