#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 */
typedef int /*<<< orphan*/ string;
typedef int /*<<< orphan*/ s2;
typedef int /*<<< orphan*/ s1;
typedef int /*<<< orphan*/ n1;
typedef int /*<<< orphan*/ letra;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  int n1, n2;
  int n3 = 30;
  char letra;
  int vector[5];
  char string[10];
  char s1[] = "CHAU";
  char s2[50];
  n1 = 10;
  n2 = n1 + 10;
  n3++;
  n3 += 5;
  n2--;
  vector[0] = 65;
  vector[1] = 66;
  vector[2] = 67;
  vector[3] = 68;
  vector[4] = 69;
  printf("Valor de la variable n1=%d n2=%d y n3=%d \n", ++n1, n2, n3);
  letra = 'A';
  printf("Valor \\ de %% la letra %c y la letra %c\n", letra, 66);
  printf("%c\n", vector[0]);
  printf("%c\n", vector[1]);
  printf("%c\n", vector[2]);
  printf("%c\n", vector[3]);
  printf("%c\n", vector[4]);
  string[0] = 'H';
  string[1] = 'O';
  string[2] = 'L';
  string[3] = 65;
  string[4] = '\0';
  printf("El string se puede imprimir así: %s %s\n", string, s1);
  snprintf(s2, sizeof(s2), "Internetworking dice %s", string);
  printf("El tamaño en memoria de n1 es %ld bytes\n", sizeof(n1));
  printf("El tamaño en memoria de letra es %ld bytes\n", sizeof(letra));
  printf("El tamaño en memoria de string es %ld bytes\n", sizeof(string));
  printf("El tamaño en memoria de s1 es %ld bytes\n", sizeof(s1));
  printf("El tamaño en memoria de s2 es %ld bytes\n", sizeof(s2));
  printf("El tamaño del string de s1(%s) es de %ld caracteres, y el de s2(%s) "
         "es de %ld\n",
         s1, strlen(s1), s2, strlen(s2));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e,-0x10(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x3f(%rbp)
mov    0xeac(%rip),%al
mov    %al,-0x3b(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
movl   $0x41,-0x30(%rbp)
movl   $0x42,-0x2c(%rbp)
movl   $0x43,-0x28(%rbp)
movl   $0x44,-0x24(%rbp)
movl   $0x45,-0x20(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x41,-0x11(%rbp)
movsbl -0x11(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x42,%edx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x48,-0x3a(%rbp)
movb   $0x4f,-0x39(%rbp)
movb   $0x4c,-0x38(%rbp)
movb   $0x41,-0x37(%rbp)
movb   $0x0,-0x36(%rbp)
lea    -0x3a(%rbp),%rsi
lea    -0x3f(%rbp),%rdx
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0x3a(%rbp),%rcx
mov    $0x32,%esi
lea    0xe0e(%rip),%rdx
call   1050 <snprintf@plt>
lea    0xe1a(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe31(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4b(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x32,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x3f(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x3f(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8c(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x98(%rbp),%rsi
mov    -0x8c(%rbp),%edx
mov    -0x88(%rbp),%rcx
mov    %eax,%r8d
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movb   $0x0,0x4(%rsp)
movl   $0x55414843,(%rsp)
lea    0xeb9(%rip),%rdi
mov    $0xb,%esi
mov    $0x13,%edx
mov    $0x24,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x41,%esi
mov    $0x42,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x43,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x44,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x45,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x414c4f48,0x6(%rsp)
41
movb   $0x0,0xa(%rsp)
lea    0xe79(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe86(%rip),%rdx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x32,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
lea    0xe82(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe99(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x32,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <strlen@plt>
lea    0xeea(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %r15,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s1 = [5 x i8] c"CHAU\00"
@.str = [43 x i8] c"Valor de la variable n1=%d n2=%d y n3=%d \0A\00"
@.str.1 = [41 x i8] c"Valor \\ de %% la letra %c y la letra %c\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
@.str.3 = [41 x i8] c"El string se puede imprimir as\C3\AD: %s %s\0A\00"
@.str.4 = [24 x i8] c"Internetworking dice %s\00"
@.str.5 = [42 x i8] c"El tama\C3\B1o en memoria de n1 es %ld bytes\0A\00"
@.str.6 = [45 x i8] c"El tama\C3\B1o en memoria de letra es %ld bytes\0A\00"
@.str.7 = [46 x i8] c"El tama\C3\B1o en memoria de string es %ld bytes\0A\00"
@.str.8 = [42 x i8] c"El tama\C3\B1o en memoria de s1 es %ld bytes\0A\00"
@.str.9 = [42 x i8] c"El tama\C3\B1o en memoria de s2 es %ld bytes\0A\00"
@.str.10 = [80 x i8] c"El tama\C3\B1o del string de s1(%s) es de %ld caracteres, y el de s2(%s) es de %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca [5 x i32]
%7 = alloca [10 x i8]
%8 = alloca [5 x i8]
%9 = alloca [50 x i8]
store i32 0, i32* %1
store i32 30, i32* %4
%10 = bitcast [5 x i8]* %8 to i8*
store i32 10, i32* %2
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 10
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 5
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
store i32 65, i32* %19
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 1
store i32 66, i32* %20
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 2
store i32 67, i32* %21
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 3
store i32 68, i32* %22
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 4
store i32 69, i32* %23
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %27)
store i8 65, i8* %5
%29 = load i8, i8* %5
%30 = sext i8 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 66)
%32 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 1
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 2
%39 = load i32, i32* %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 3
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 4
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
store i8 72, i8* %47
%48 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 1
store i8 79, i8* %48
%49 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 2
store i8 76, i8* %49
%50 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 3
store i8 65, i8* %50
%51 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 4
store i8 0, i8* %51
%52 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%53 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %52, i8* %53)
%55 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%57 = call i32 @snprintf(i8* %55, i32 50, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i64 4)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i64 1)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), i64 10)
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i64 5)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i64 50)
%63 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%64 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%65 = call i32 @strlen(i8* %64)
%66 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%67 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%68 = call i32 @strlen(i8* %67)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.10, i64 0, i64 0), i8* %63, i32 %65, i8* %66, i32 %68)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [5 x i8] c"CHAU\00"
@.str = [43 x i8] c"Valor de la variable n1=%d n2=%d y n3=%d \0A\00"
@.str.1 = [41 x i8] c"Valor \\ de %% la letra %c y la letra %c\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
@.str.3 = [41 x i8] c"El string se puede imprimir as\C3\AD: %s %s\0A\00"
@.str.4 = [24 x i8] c"Internetworking dice %s\00"
@.str.5 = [42 x i8] c"El tama\C3\B1o en memoria de n1 es %ld bytes\0A\00"
@.str.6 = [45 x i8] c"El tama\C3\B1o en memoria de letra es %ld bytes\0A\00"
@.str.7 = [46 x i8] c"El tama\C3\B1o en memoria de string es %ld bytes\0A\00"
@.str.8 = [42 x i8] c"El tama\C3\B1o en memoria de s1 es %ld bytes\0A\00"
@.str.9 = [42 x i8] c"El tama\C3\B1o en memoria de s2 es %ld bytes\0A\00"
@.str.10 = [80 x i8] c"El tama\C3\B1o del string de s1(%s) es de %ld caracteres, y el de s2(%s) es de %ld\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [5 x i8]
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 11, i32 19, i32 36)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 65, i32 66)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 65)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 66)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 67)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 68)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 69)
store i8 72, i8* %4
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 79, i8* %14
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 76, i8* %15
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
store i8 65, i8* %16
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 4
store i8 0, i8* %17
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %4, i8* %5)
%19 = call i32 @snprintf(i8* %6, i32 50, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i64 4)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i64 1)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), i64 10)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i64 5)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i64 50)
%25 = call i32 @strlen(i8* %5)
%26 = call i32 @strlen(i8* %6)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.10, i64 0, i64 0), i8* %5, i32 %25, i8* %6, i32 %26)
ret i32 0
}