#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 /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
main() {
  system(
      "title 16_EscribirOMeuNomeTantasVecesComoQueira_Cascallar_Autrán_Manuel");
  int a, b;
  printf(
      "Introduce o n\243nero de veces que queiras que apareza o teu nome:\n");
  scanf("%d", &a);
  if (a <= 0) {
    printf("Con este n\243mero non se pode facer o bucle. Deb\241as escribir "
           "un n\243mero positivo\n");
  }
  for (b = 0; b < a; b = b + 1) {
    printf("Manuel Cascallar Autr\240n\n");
  }
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <system@plt>
lea    0xef6(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jg     117d <main+0x4d>
lea    0xf14(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11aa <main+0x7a>
lea    0xf44(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <main+0x54>
lea    0xf43(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1040 <system@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jg     1176 <main+0x46>
lea    0xf3f(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0x4(%rsp)
jle    1191 <main+0x61>
xor    %ebp,%ebp
lea    0xf12(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1180 <main+0x50>
lea    0xeb3(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [72 x i8] c"title 16_EscribirOMeuNomeTantasVecesComoQueira_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [65 x i8] c"Introduce o n\A3nero de veces que queiras que apareza o teu nome:\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [79 x i8] c"Con este n\A3mero non se pode facer o bucle. Deb\A1as escribir un n\A3mero positivo\0A\00"
@.str.4 = [25 x i8] c"Manuel Cascallar Autr\A0n\0A\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @system(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
store i32 0, i32* %3
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %12
21: ; preds = %12
%22 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [72 x i8] c"title 16_EscribirOMeuNomeTantasVecesComoQueira_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.5 = [6 x i8] c"pause\00"
@str = [64 x i8] c"Introduce o n\A3nero de veces que queiras que apareza o teu nome:\00"
@str.6 = [24 x i8] c"Manuel Cascallar Autr\A0n\00"
@str.7 = [78 x i8] c"Con este n\A3mero non se pode facer o bucle. Deb\A1as escribir un n\A3mero positivo\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @system(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.7, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %0, %8
br label %13
13: ; preds = %12, %13
%14 = phi i32 [ %16, %13 ], [ 0, %12 ]
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.6, i64 0, i64 0))
%16 = add nuw nsw i32 %14, 1
%17 = load i32, i32* %1
%18 = icmp slt i32 %16, %17
br i1 %18, label %13, label %19
19: ; preds = %13, %8
%20 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}