#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 strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char toupper(char);
int main(void) {
  char nombre1[] = "Mi nombre es Chelin";
  char nombre2[] = "Mi nombre es Tutorials(???";
  printf("%s\n", nombre1);
  printf("%s\n", nombre2);
  printf("Copio lo q tiene nombre1 arriba de nombre2\n");
  strcpy(nombre2, nombre1);
  printf("%s\n", nombre2);
  int largo;
  largo = strlen(nombre1);
  printf("Longitud de nombre1: %d\n", largo);
  int i;
  i = strcmp(nombre1, nombre2);
  printf("i : %d\n", i);
  char mayus;
  mayus = toupper(nombre1[7]);
  printf("caracter 7 en mayus : %c", mayus);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe95(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe95(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe92(%rip),%ax
mov    %ax,-0x28(%rbp)
mov    0xe8a(%rip),%al
mov    %al,-0x26(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <strcmp@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x19(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,-0x49(%rbp)
movsbl -0x49(%rbp),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movaps 0xe92(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x6e696c,0x10(%rsp)
movups 0xeaa(%rip),%xmm0
movups %xmm0,0x2b(%rsp)
movaps 0xe93(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xec4(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0xe63(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <strcmp@plt>
lea    0xe61(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
movsbl 0x7(%rsp),%edi
call   1040 <toupper@plt>
movsbl %al,%esi
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.nombre1 = [20 x i8] c"Mi nombre es Chelin\00"
@__const.main.nombre2 = [27 x i8] c"Mi nombre es Tutorials(???\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [44 x i8] c"Copio lo q tiene nombre1 arriba de nombre2\0A\00"
@.str.2 = [25 x i8] c"Longitud de nombre1: %d\0A\00"
@.str.3 = [8 x i8] c"i : %d\0A\00"
@.str.4 = [25 x i8] c"caracter 7 en mayus : %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [27 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 0, i32* %1
%7 = bitcast [20 x i8]* %2 to i8*
%8 = bitcast [27 x i8]* %3 to i8*
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%25 = call i32 @strcmp(i8* %23, i8* %24)
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 7
%29 = load i8, i8* %28
%30 = call signext i8 @toupper(i8 signext %29)
store i8 %30, i8* %6
%31 = load i8, i8* %6
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nombre1 = [20 x i8] c"Mi nombre es Chelin\00"
@__const.main.nombre2 = [27 x i8] c"Mi nombre es Tutorials(???\00"
@.str.2 = [25 x i8] c"Longitud de nombre1: %d\0A\00"
@.str.3 = [8 x i8] c"i : %d\0A\00"
@.str.4 = [25 x i8] c"caracter 7 en mayus : %c\00"
@str = [43 x i8] c"Copio lo q tiene nombre1 arriba de nombre2\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [27 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [27 x i8], [27 x i8]* %2, i64 0, i64 0
%5 = call i32 @puts(i8* %3)
%6 = call i32 @puts(i8* %4)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%8 = call i32 @strcpy(i8* %4, i8* %3)
%9 = call i32 @puts(i8* %4)
%10 = call i32 @strlen(i8* %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 @strcmp(i8* %3, i8* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 7
%15 = load i8, i8* %14
%16 = call signext i8 @toupper(i8 signext %15)
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %17)
ret i32 0
}