#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 abs(int);
int /*<<< orphan*/ printf(char *, ...);
void printRepeating(int arr[], int size) {
  int i;
  printf("The repeating elements are: \n");
  for (i = 0; i < size; i++) {
    if (arr[abs(arr[i])] >= 0)
      arr[abs(arr[i])] = -arr[abs(arr[i])];
    else
      printf(" %d ", abs(arr[i]));
  }
}


x86 assembly (clang, -O0):
<printRepeating>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1201 <printRepeating+0xe1>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
jl     11ce <printRepeating+0xae>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    -0x30(%rbp),%rcx
movslq %eax,%rdx
xor    %eax,%eax
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    11ee <printRepeating+0xce>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f3 <printRepeating+0xd3>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <printRepeating+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printRepeating>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    117b <printRepeating+0x5b>
mov    %ebp,%r15d
lea    0xeba(%rip),%r14
xor    %ebp,%ebp
jmp    1163 <printRepeating+0x43>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
je     117b <printRepeating+0x5b>
mov    (%rbx,%rbp,4),%eax
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
mov    (%rbx,%rsi,4),%eax
test   %eax,%eax
js     1150 <printRepeating+0x30>
neg    %eax
mov    %eax,(%rbx,%rsi,4)
jmp    115a <printRepeating+0x3a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"The repeating elements are: \0A\00"
@.str.1 = [5 x i8] c" %d \00"
define void @printRepeating(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %53, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %56
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @abs(i32 %17)
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %12, i64 %19
%21 = load i32, i32* %20
%22 = icmp sge i32 %21, 0
br i1 %22, label %23, label %44
23: ; preds = %11
%24 = load i32*, i32** %3
%25 = load i32*, i32** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = call i32 @abs(i32 %29)
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %24, i64 %31
%33 = load i32, i32* %32
%34 = sub nsw i32 0, %33
%35 = load i32*, i32** %3
%36 = load i32*, i32** %3
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = load i32, i32* %39
%41 = call i32 @abs(i32 %40)
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %35, i64 %42
store i32 %34, i32* %43
br label %52
44: ; preds = %11
%45 = load i32*, i32** %3
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %45, i64 %47
%49 = load i32, i32* %48
%50 = call i32 @abs(i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %44, %23
br label %53
53: ; preds = %52
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %7
56: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c" %d \00"
@str = [29 x i8] c"The repeating elements are: \00"
define void @printRepeating(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %23
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %20
%8 = phi i64 [ 0, %5 ], [ %21, %20 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %7
%17 = sub nsw i32 0, %14
store i32 %17, i32* %13
br label %20
18: ; preds = %7
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %20
20: ; preds = %16, %18
%21 = add nuw nsw i64 %8, 1
%22 = icmp eq i64 %21, %6
br i1 %22, label %23, label %7
23: ; preds = %20, %2
ret void
}