#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ *fopen(char const *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ parse_problem(int /*<<< orphan*/ *, int *, int *);
int /*<<< orphan*/ print_repeat_element(int *, int *);
int main(int argc, const char *argv[]) {
  FILE *in_file = fopen(argv[1], "r");
  int size;
  while (fscanf(in_file, "%d;", &size) != EOF) {
    int arr[size];
    parse_problem(in_file, arr, &size);
    print_repeat_element(arr, &size);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe89(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <fscanf@plt>
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%rax
je     11df <main+0x9f>
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x38(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rdx
call   1050 <parse_problem@plt>
mov    -0x38(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <print_repeat_element@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
jmp    116e <main+0x2e>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
lea    0xea7(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r12
lea    0xe9a(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    %rax,%rdi
call   1030 <fscanf@plt>
mov    0x2e6d(%rip),%r15
cmp    (%r15),%rax
je     11de <main+0x9e>
lea    -0x2c(%rbp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rsp,%r13
mov    -0x2c(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <parse_problem@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <print_repeat_element@plt>
mov    %r13,%rsp
mov    %r12,%rdi
lea    0xe31(%rip),%rsi
mov    %r14,%rdx
call   1030 <fscanf@plt>
cmp    (%r15),%rax
jne    1190 <main+0x50>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%d;\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %13, i32** %6
br label %14
14: ; preds = %19, %2
%15 = load i32*, i32** %6
%16 = call i64 @fscanf(i32* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%17 = load i64, i64* @EOF
%18 = icmp ne i64 %16, %17
br i1 %18, label %19, label %28
19: ; preds = %14
%20 = load i32, i32* %7
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %8
%23 = alloca i32, i64 %21
store i64 %21, i64* %9
%24 = load i32*, i32** %6
%25 = call i32 @parse_problem(i32* %24, i32* %23, i32* %7)
%26 = call i32 @print_repeat_element(i32* %23, i32* %7)
%27 = load i8*, i8** %8
br label %14
28: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%d;\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = bitcast i32* %3 to i8*
%8 = call i64 @fscanf(i32* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %21, label %11
11: ; preds = %2, %11
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
%15 = alloca i32, i64 %13
%16 = call i32 @parse_problem(i32* %6, i32* %15, i32* %3)
%17 = call i32 @print_repeat_element(i32* %15, i32* %3)
%18 = call i64 @fscanf(i32* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %11
21: ; preds = %11, %2
ret i32 0
}