#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 printline(int line, int level) {
  printf("%2d", line);
  if (level <= 0)
    printf(": ");
  else {
    printf(".");
    for (int i = 0; i < level; i++)
      printf("..");
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<printline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jg     114c <printline+0x3c>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1197 <printline+0x87>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1189 <printline+0x79>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <printline+0x51>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printline>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%esi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jle    1170 <printline+0x50>
mov    $0x2e,%edi
call   1030 <putchar@plt>
lea    0xebc(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1150 <printline+0x30>
mov    $0x20,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%2d\00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"..\00"
@.str.4 = [2 x i8] c" \00"
define void @printline(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %14
14: ; preds = %20, %12
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %14
23: ; preds = %14
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %23, %10
ret void
}

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