#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 /*<<< orphan*/ system(char *);
main() {
  system("title 17_LerUnCaracterEEscribilo_Cascallar_Autrán_Manuel");
  printf("LER UN CARACTER E ESCRIBILO\n");
  printf("===========================\n");
  printf("Escribe o caracter:\n");
  int a, x;
  unsigned char caracter;
  scanf("%c", &caracter);
  printf("Introduce o n\243mero de veces que queres que se repita:\n");
  scanf("%i", &x);
  for (a = 0; a < x; a = a + 1) {
    printf("\nO caracter introducido \202: %c \n", caracter);
  }
  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    0xee8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf27(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11da <main+0xaa>
movzbl -0xd(%rbp),%esi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ae <main+0x7e>
lea    0xf05(%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    0xeb6(%rip),%rdi
call   1040 <system@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11d8 <main+0x98>
lea    0xe8d(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x3(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     11c0 <main+0x80>
lea    0xe81(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [58 x i8] c"title 17_LerUnCaracterEEscribilo_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [29 x i8] c"LER UN CARACTER E ESCRIBILO\0A\00"
@.str.2 = [29 x i8] c"===========================\0A\00"
@.str.3 = [21 x i8] c"Escribe o caracter:\0A\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [55 x i8] c"Introduce o n\A3mero de veces que queres que se repita:\0A\00"
@.str.6 = [3 x i8] c"%i\00"
@.str.7 = [32 x i8] c"\0AO caracter introducido \82: %c \0A\00"
@.str.8 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
store i32 0, i32* %2
br label %12
12: ; preds = %20, %0
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %16
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %12
23: ; preds = %12
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str = [58 x i8] c"title 17_LerUnCaracterEEscribilo_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.6 = [3 x i8] c"%i\00"
@.str.7 = [32 x i8] c"\0AO caracter introducido \82: %c \0A\00"
@.str.8 = [6 x i8] c"pause\00"
@str = [28 x i8] c"LER UN CARACTER E ESCRIBILO\00"
@str.9 = [28 x i8] c"===========================\00"
@str.10 = [20 x i8] c"Escribe o caracter:\00"
@str.11 = [54 x i8] c"Introduce o n\A3mero de veces que queres que se repita:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = tail call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
%7 = bitcast i32* %1 to i8*
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.11, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %0, %13
%14 = phi i32 [ %18, %13 ], [ 0, %0 ]
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %16)
%18 = add nuw nsw i32 %14, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
br i1 %20, label %13, label %21
21: ; preds = %13, %0
%22 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}