#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 *, ...);
void print_place(int count, int *ids) {
  int i, j;
  printf("{");
  for (i = 0; i < count; i++) {
    for (j = i + 1; j < count; j++)
      if (ids[j] != ids[i] + (j - i))
        break;
    if (i)
      printf(",");
    if (j == i + 1)
      printf("%d", ids[i]);
    else {
      printf("%d:%d", ids[i], j - i);
      i = j - 1;
    }
  }
  printf("}\n");
}


x86 assembly (clang, -O0):
<print_place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1215 <print_place+0x105>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1193 <print_place+0x83>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
mov    -0x18(%rbp),%edx
sub    -0x14(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
je     1180 <print_place+0x70>
jmp    1193 <print_place+0x83>
jmp    1185 <print_place+0x75>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1149 <print_place+0x39>
cmpl   $0x0,-0x14(%rbp)
je     11ab <print_place+0x9b>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    11da <print_place+0xca>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1202 <print_place+0xf2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x18(%rbp),%edx
sub    -0x14(%rbp),%edx
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1207 <print_place+0xf7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <print_place+0x24>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_place>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x7b,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    11dd <print_place+0xad>
mov    %ebp,%ecx
mov    %ebp,%r15d
xor    %r14d,%r14d
mov    %ebp,0x4(%rsp)
jmp    1182 <print_place+0x52>
mov    %r13d,%edx
sub    %r14d,%edx
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13d,%ebp
mov    0x4(%rsp),%ecx
mov    %ebp,%r14d
cmp    %ecx,%ebp
jge    11dd <print_place+0xad>
lea    0x1(%r14),%ebp
movslq %r14d,%r12
mov    %ebp,%r13d
cmp    %ecx,%ebp
jge    11b5 <print_place+0x85>
mov    (%rbx,%r12,4),%eax
movslq %ebp,%r13
add    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmp    (%rbx,%r13,4),%eax
jne    11b5 <print_place+0x85>
add    $0x1,%r13
add    $0x1,%eax
cmp    %r13,%r15
jne    11a0 <print_place+0x70>
mov    %r15d,%r13d
test   %r14d,%r14d
je     11c4 <print_place+0x94>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    (%rbx,%r12,4),%esi
cmp    %ebp,%r13d
jne    1160 <print_place+0x30>
lea    0xe2f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1177 <print_place+0x47>
lea    0xe22(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [2 x i8] c",\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [6 x i8] c"%d:%d\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @print_place(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
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %8
8: ; preds = %70, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %73
12: ; preds = %8
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %15
15: ; preds = %37, %12
%16 = load i32, i32* %6
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %40
19: ; preds = %15
%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 = load i32*, i32** %4
%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 = load i32, i32* %6
%31 = load i32, i32* %5
%32 = sub nsw i32 %30, %31
%33 = add nsw i32 %29, %32
%34 = icmp ne i32 %24, %33
br i1 %34, label %35, label %36
35: ; preds = %19
br label %40
36: ; preds = %19
br label %37
37: ; preds = %36
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %15
40: ; preds = %35, %15
%41 = load i32, i32* %5
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %45
45: ; preds = %43, %40
%46 = load i32, i32* %6
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
%49 = icmp eq i32 %46, %48
br i1 %49, label %50, label %57
50: ; preds = %45
%51 = load i32*, i32** %4
%52 = load i32, i32* %5
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %51, i64 %53
%55 = load i32, i32* %54
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %55)
br label %69
57: ; preds = %45
%58 = load i32*, i32** %4
%59 = load i32, i32* %5
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %58, i64 %60
%62 = load i32, i32* %61
%63 = load i32, i32* %6
%64 = load i32, i32* %5
%65 = sub nsw i32 %63, %64
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %62, i32 %65)
%67 = load i32, i32* %6
%68 = sub nsw i32 %67, 1
store i32 %68, i32* %5
br label %69
69: ; preds = %57, %50
br label %70
70: ; preds = %69
%71 = load i32, i32* %5
%72 = add nsw i32 %71, 1
store i32 %72, i32* %5
br label %8
73: ; preds = %8
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [6 x i8] c"%d:%d\00"
@str = [2 x i8] c"}\00"
define void @print_place(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @putchar(i32 123)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %47
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %44
%8 = phi i32 [ %45, %44 ], [ 0, %5 ]
%9 = add nsw i32 %8, 1
%10 = icmp slt i32 %9, %0
br i1 %10, label %11, label %29
11: ; preds = %7
%12 = sext i32 %8 to i64
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
%15 = sext i32 %9 to i64
br label %16
16: ; preds = %11, %24
%17 = phi i64 [ %15, %11 ], [ %25, %24 ]
%18 = getelementptr inbounds i32, i32* %1, i64 %17
%19 = load i32, i32* %18
%20 = trunc i64 %17 to i32
%21 = sub i32 %20, %8
%22 = add nsw i32 %21, %14
%23 = icmp eq i32 %19, %22
br i1 %23, label %24, label %27
24: ; preds = %16
%25 = add nsw i64 %17, 1
%26 = icmp eq i64 %25, %6
br i1 %26, label %29, label %16
27: ; preds = %16
%28 = trunc i64 %17 to i32
br label %29
29: ; preds = %24, %27, %7
%30 = phi i32 [ %9, %7 ], [ %28, %27 ], [ %0, %24 ]
%31 = icmp eq i32 %8, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = tail call i32 @putchar(i32 44)
br label %34
34: ; preds = %32, %29
%35 = icmp eq i32 %30, %9
%36 = sext i32 %8 to i64
%37 = getelementptr inbounds i32, i32* %1, i64 %36
%38 = load i32, i32* %37
br i1 %35, label %39, label %41
39: ; preds = %34
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %38)
br label %44
41: ; preds = %34
%42 = sub nsw i32 %30, %8
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %38, i32 %42)
br label %44
44: ; preds = %39, %41
%45 = phi i32 [ %9, %39 ], [ %30, %41 ]
%46 = icmp slt i32 %45, %0
br i1 %46, label %7, label %47
47: ; preds = %44, %2
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}