#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*/ scanf(char *, int *);
void read(int *array) {
  int i;
  for (i = 0; i < 20; i++)
    scanf("%d", array + i);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1156 <read+0x46>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebd(%rip),%rdi
call   1030 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <read+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
lea    0x4(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0xc(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x10(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x14(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x18(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x1c(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x20(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x24(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x28(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x2c(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x30(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x34(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x38(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x3c(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x40(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x44(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x48(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
add    $0x4c,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @read(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 20
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, 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 = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds i32, i32* %0, i64 5
%12 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds i32, i32* %0, i64 6
%14 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds i32, i32* %0, i64 7
%16 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds i32, i32* %0, i64 8
%18 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = getelementptr inbounds i32, i32* %0, i64 9
%20 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = getelementptr inbounds i32, i32* %0, i64 10
%22 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = getelementptr inbounds i32, i32* %0, i64 11
%24 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%25 = getelementptr inbounds i32, i32* %0, i64 12
%26 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
%27 = getelementptr inbounds i32, i32* %0, i64 13
%28 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %27)
%29 = getelementptr inbounds i32, i32* %0, i64 14
%30 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = getelementptr inbounds i32, i32* %0, i64 15
%32 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %31)
%33 = getelementptr inbounds i32, i32* %0, i64 16
%34 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %33)
%35 = getelementptr inbounds i32, i32* %0, i64 17
%36 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %35)
%37 = getelementptr inbounds i32, i32* %0, i64 18
%38 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %37)
%39 = getelementptr inbounds i32, i32* %0, i64 19
%40 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %39)
ret void
}