#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 *, short *);
void load_puzzle(short *puzzle) {
  int i;
  for (i = 0; i < 16; i++)
    scanf("%d", puzzle + i);
}


x86 assembly (clang, -O0):
<load_puzzle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1156 <load_puzzle+0x46>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x1,%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 <load_puzzle+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_puzzle>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
lea    0x2(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x4(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x6(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0xa(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0xc(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0xe(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x10(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x12(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x14(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x16(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x18(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x1a(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x1c(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
add    $0x1e,%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 @load_puzzle(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
store i16* %0, i16** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i16*, i16** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %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 @load_puzzle(i16* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %0)
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %3)
%5 = getelementptr inbounds i16, i16* %0, i64 2
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %5)
%7 = getelementptr inbounds i16, i16* %0, i64 3
%8 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %7)
%9 = getelementptr inbounds i16, i16* %0, i64 4
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %9)
%11 = getelementptr inbounds i16, i16* %0, i64 5
%12 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %11)
%13 = getelementptr inbounds i16, i16* %0, i64 6
%14 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %13)
%15 = getelementptr inbounds i16, i16* %0, i64 7
%16 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %15)
%17 = getelementptr inbounds i16, i16* %0, i64 8
%18 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %17)
%19 = getelementptr inbounds i16, i16* %0, i64 9
%20 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %19)
%21 = getelementptr inbounds i16, i16* %0, i64 10
%22 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %21)
%23 = getelementptr inbounds i16, i16* %0, i64 11
%24 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %23)
%25 = getelementptr inbounds i16, i16* %0, i64 12
%26 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %25)
%27 = getelementptr inbounds i16, i16* %0, i64 13
%28 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %27)
%29 = getelementptr inbounds i16, i16* %0, i64 14
%30 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %29)
%31 = getelementptr inbounds i16, i16* %0, i64 15
%32 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %31)
ret void
}