#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 argc, const char *argv[]) {
  int i, n, new, a[19];
  a[0] = -1;
  for (i = 1; i < 19; i += 2) {
    scanf("%d", &a[i]);
    a[i + 1] = -1;
  }
  scanf("%d", &new);
  i = 1;
  n = 0;
  while (a[i] < new) {
    if (i >= 18) {
      i = 19;
      break;
    }
    i = i + 2;
  }
  a[i - 1] = new;
  for (i = 0; i < 19; i++) {
    if (a[i] == -1)
      continue;
    printf("%d\n", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x70(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x13,-0x14(%rbp)
jge    1187 <main+0x67>
movslq -0x14(%rbp),%rax
lea    -0x70(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0xffffffff,-0x70(%rbp,%rax,4)
ff
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
lea    0xe72(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
cmp    -0x1c(%rbp),%eax
jge    11da <main+0xba>
cmpl   $0x12,-0x14(%rbp)
jl     11cc <main+0xac>
movl   $0x13,-0x14(%rbp)
jmp    11da <main+0xba>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    11a5 <main+0x85>
mov    -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %ecx,-0x70(%rbp,%rax,4)
movl   $0x0,-0x14(%rbp)
cmpl   $0x13,-0x14(%rbp)
jge    1230 <main+0x110>
movslq -0x14(%rbp),%rax
cmpl   $0xffffffff,-0x70(%rbp,%rax,4)
jne    120e <main+0xee>
jmp    1222 <main+0x102>
movslq -0x14(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%esi
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f0 <main+0xd0>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
movl   $0xffffffff,0x10(%rsp)
ff
lea    0x14(%rsp),%rsi
lea    0xec5(%rip),%rbx
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x18(%rsp)
ff
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x20(%rsp)
ff
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x28(%rsp)
ff
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x30(%rsp)
ff
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x38(%rsp)
ff
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x40(%rsp)
ff
lea    0x44(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x48(%rsp)
ff
lea    0x4c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x50(%rsp)
ff
lea    0x54(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movl   $0xffffffff,0x58(%rsp)
ff
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x14(%rsp)
jge    1269 <main+0x149>
mov    $0x2,%ecx
cmp    %eax,0x1c(%rsp)
jge    126b <main+0x14b>
mov    $0x4,%ecx
cmp    %eax,0x24(%rsp)
jge    126b <main+0x14b>
mov    $0x6,%ecx
cmp    %eax,0x2c(%rsp)
jge    126b <main+0x14b>
mov    $0x8,%ecx
cmp    %eax,0x34(%rsp)
jge    126b <main+0x14b>
mov    $0xa,%ecx
cmp    %eax,0x3c(%rsp)
jge    126b <main+0x14b>
mov    $0xc,%ecx
cmp    %eax,0x44(%rsp)
jge    126b <main+0x14b>
mov    $0xe,%ecx
cmp    %eax,0x4c(%rsp)
jge    126b <main+0x14b>
xor    %ecx,%ecx
cmp    %eax,0x54(%rsp)
setl   %cl
add    %rcx,%rcx
add    $0x10,%rcx
jmp    126b <main+0x14b>
xor    %ecx,%ecx
mov    %eax,0x10(%rsp,%rcx,4)
xor    %ebx,%ebx
lea    0xd8b(%rip),%r14
jmp    128a <main+0x16a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x13,%rbx
je     129d <main+0x17d>
mov    0x10(%rsp,%rbx,4),%esi
cmp    $0xffffffff,%esi
je     1280 <main+0x160>
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1280 <main+0x160>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

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