#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(void) {
  int a[10];
  int i, b;
  for (i = 0; i < 10; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 1; i <= 10; i++) {
    b = a[10 - i];
    if (b % 2 == 0) {
      b = b / 2;
    }
    printf("%d\n", b);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1169 <main+0x49>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <main+0x16>
movl   $0x1,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jg     11ca <main+0xaa>
mov    $0xa,%eax
sub    -0x34(%rbp),%eax
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ad <main+0x8d>
mov    -0x38(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1170 <main+0x50>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x24(%rsp),%esi
test   $0x1,%sil
jne    11c1 <main+0xa1>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
test   $0x1,%sil
jne    11e2 <main+0xc2>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
test   $0x1,%sil
jne    1203 <main+0xe3>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
test   $0x1,%sil
jne    1224 <main+0x104>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
test   $0x1,%sil
jne    1245 <main+0x125>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xdb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
test   $0x1,%sil
jne    1266 <main+0x146>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xd96(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
test   $0x1,%sil
jne    1287 <main+0x167>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xd75(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
test   $0x1,%sil
jne    12a8 <main+0x188>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xd54(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
test   $0x1,%sil
jne    12c9 <main+0x1a9>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xd33(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
test   $0x1,%sil
jne    12e9 <main+0x1c9>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%esi
lea    0xd13(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %16
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)
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
store i32 1, i32* %3
br label %17
17: ; preds = %35, %16
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 10
br i1 %19, label %20, label %38
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sub nsw i32 10, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %23
%25 = load i32, i32* %24
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = srem i32 %26, 2
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %20
%30 = load i32, i32* %4
%31 = sdiv i32 %30, 2
store i32 %31, i32* %4
br label %32
32: ; preds = %29, %20
%33 = load i32, i32* %4
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %17
38: ; preds = %17
%39 = load i32, i32* %1
ret i32 %39
}

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