#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*/ EXIT_FAILURE;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ flush();
int scanf(char *, int *const);
void getArr(const int size, int *const arr) {
  assert(size >= 0);
  for (int i = 0; i < size; i++) {
    if (scanf("%d", arr + i) != 1) {
      exit(EXIT_FAILURE);
    }
  }
  flush();
}


x86 assembly (clang, -O0):
<getArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b8 <getArr+0x78>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe77(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     11a5 <getArr+0x65>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    11aa <getArr+0x6a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <getArr+0x27>
mov    $0x0,%al
call   1030 <flush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
test   %ebp,%ebp
jle    117a <getArr+0x3a>
mov    %ebp,%ebp
lea    0xea0(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1185 <getArr+0x45>
add    $0x4,%rbx
add    $0xffffffffffffffff,%rbp
jne    1160 <getArr+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <flush@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EXIT_FAILURE = global i32 0
define void @getArr(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
store i32 0, i32* %5
br label %10
10: ; preds = %25, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%20 = icmp ne i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %10
28: ; preds = %10
%29 = call i32 (...) @flush()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EXIT_FAILURE = global i32 0
define void @getArr(i32 %0, i32* %1) {
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = zext i32 %0 to i64
br label %13
9: ; preds = %13
%10 = icmp eq i64 %18, %8
br i1 %10, label %11, label %13
11: ; preds = %9, %2
%12 = tail call i32 (...) @flush()
ret void
13: ; preds = %7, %9
%14 = phi i64 [ 0, %7 ], [ %18, %9 ]
%15 = getelementptr inbounds i32, i32* %1, i64 %14
%16 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = icmp eq i32 %16, 1
%18 = add nuw nsw i64 %14, 1
br i1 %17, label %9, label %19
19: ; preds = %13
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @exit(i32 %20)
unreachable
}