#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 tamanhoDaSequencia(int);
void imprimirSequencia(int numero) {
  int i, n = tamanhoDaSequencia(numero);
  for (i = 0; i < n; i++) {
    printf("%d", numero);
    if (i < n - 1) {
      printf(" ");
    }
  }
}


x86 assembly (clang, -O0):
<imprimirSequencia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <tamanhoDaSequencia@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118c <imprimirSequencia+0x6c>
mov    -0x4(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1179 <imprimirSequencia+0x59>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117e <imprimirSequencia+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <imprimirSequencia+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirSequencia>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r15d
call   1050 <tamanhoDaSequencia@plt>
test   %eax,%eax
jle    1185 <imprimirSequencia+0x55>
mov    %eax,%r12d
lea    -0x1(%r12),%ebp
lea    0xead(%rip),%r14
xor    %ebx,%ebx
jmp    1168 <imprimirSequencia+0x38>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    %ebx,%r12d
je     1185 <imprimirSequencia+0x55>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebp,%ebx
jge    1160 <imprimirSequencia+0x30>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1160 <imprimirSequencia+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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