#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*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void inc_print(int len, int int_list[]) {
  int last;
  for (int i = 0; i < len; i++) {
    if (int_list[i] != last) {
      printf("%d ", int_list[i]);
    }
    last = int_list[i];
  }
  puts("");
}


x86 assembly (clang, -O0):
<inc_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1189 <inc_print+0x69>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
je     116d <inc_print+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <inc_print+0x16>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    115f <inc_print+0x3f>
mov    %rsi,%r12
mov    %edi,%r15d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
jmp    1149 <inc_print+0x29>
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     115f <inc_print+0x3f>
mov    (%r12,%rbx,4),%esi
cmp    %eax,%esi
je     1140 <inc_print+0x20>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%r12,%rbx,4),%eax
jmp    1140 <inc_print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @inc_print(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %17, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %17
%9 = phi i64 [ 0, %4 ], [ %19, %17 ]
%10 = phi i32 [ undef, %4 ], [ %18, %17 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %9
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %10
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%16 = load i32, i32* %11
br label %17
17: ; preds = %14, %8
%18 = phi i32 [ %16, %14 ], [ %10, %8 ]
%19 = add nuw nsw i64 %9, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %6, label %8
}