#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 */
scalar_t__ analyze(short *, short *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(short *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  short *sets = (short *)calloc(4, 16);
  short *counts = (short *)calloc(4, 16);
  if (analyze(sets, counts))
    printf("%d %d %d %d\n", 13 - *counts, 13 - *(counts + 1),
           13 - *(counts + 2), 13 - *(counts + 3));
  else
    printf("GRESKA\n");
  free(sets);
  free(counts);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x10,%esi
call   1060 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
mov    $0x10,%esi
call   1060 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <analyze@plt>
cmp    $0x0,%rax
je     11dc <main+0x9c>
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
mov    $0xd,%esi
sub    %eax,%esi
mov    -0x18(%rbp),%rax
movswl 0x2(%rax),%eax
mov    $0xd,%edx
sub    %eax,%edx
mov    -0x18(%rbp),%rax
movswl 0x4(%rax),%eax
mov    $0xd,%ecx
sub    %eax,%ecx
mov    -0x18(%rbp),%rax
movswl 0x6(%rax),%eax
mov    $0xd,%r8d
sub    %eax,%r8d
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ea <main+0xaa>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
mov    $0x10,%esi
call   1070 <calloc@plt>
mov    %rax,%r14
mov    $0x4,%edi
mov    $0x10,%esi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <analyze@plt>
test   %rax,%rax
je     11c5 <main+0x75>
movswl (%rbx),%eax
mov    $0xd,%r8d
mov    $0xd,%esi
sub    %eax,%esi
movswl 0x2(%rbx),%eax
mov    $0xd,%edx
sub    %eax,%edx
movswl 0x4(%rbx),%eax
mov    $0xd,%ecx
sub    %eax,%ecx
movswl 0x6(%rbx),%eax
sub    %eax,%r8d
lea    0xe44(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11d1 <main+0x81>
lea    0xe41(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
@.str.1 = [8 x i8] c"GRESKA\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16*
%3 = alloca i16*
store i32 0, i32* %1
%4 = call i64 @calloc(i32 4, i32 16)
%5 = inttoptr i64 %4 to i16*
store i16* %5, i16** %2
%6 = call i64 @calloc(i32 4, i32 16)
%7 = inttoptr i64 %6 to i16*
store i16* %7, i16** %3
%8 = load i16*, i16** %2
%9 = load i16*, i16** %3
%10 = call i64 @analyze(i16* %8, i16* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %33
12: ; preds = %0
%13 = load i16*, i16** %3
%14 = load i16, i16* %13
%15 = sext i16 %14 to i32
%16 = sub nsw i32 13, %15
%17 = load i16*, i16** %3
%18 = getelementptr inbounds i16, i16* %17, i64 1
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = sub nsw i32 13, %20
%22 = load i16*, i16** %3
%23 = getelementptr inbounds i16, i16* %22, i64 2
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
%26 = sub nsw i32 13, %25
%27 = load i16*, i16** %3
%28 = getelementptr inbounds i16, i16* %27, i64 3
%29 = load i16, i16* %28
%30 = sext i16 %29 to i32
%31 = sub nsw i32 13, %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %21, i32 %26, i32 %31)
br label %35
33: ; preds = %0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %12
%36 = load i16*, i16** %2
%37 = call i32 @free(i16* %36)
%38 = load i16*, i16** %3
%39 = call i32 @free(i16* %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
@str = [7 x i8] c"GRESKA\00"
define i32 @main() {
%1 = tail call i64 @calloc(i32 4, i32 16)
%2 = inttoptr i64 %1 to i16*
%3 = tail call i64 @calloc(i32 4, i32 16)
%4 = inttoptr i64 %3 to i16*
%5 = tail call i64 @analyze(i16* %2, i16* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %24, label %7
7: ; preds = %0
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = sub nsw i32 13, %9
%11 = getelementptr inbounds i16, i16* %4, i64 1
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
%14 = sub nsw i32 13, %13
%15 = getelementptr inbounds i16, i16* %4, i64 2
%16 = load i16, i16* %15
%17 = sext i16 %16 to i32
%18 = sub nsw i32 13, %17
%19 = getelementptr inbounds i16, i16* %4, i64 3
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
%22 = sub nsw i32 13, %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %14, i32 %18, i32 %22)
br label %26
24: ; preds = %0
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %26
26: ; preds = %24, %7
%27 = tail call i32 @free(i16* %2)
%28 = tail call i32 @free(i16* %4)
ret i32 0
}