#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*/ s2;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int main() {
  int n1;
  int n2 = 20;
  int res;
  const int y = 10;
  n1 = 10;
  n1 += 5;
  printf("La suma de %d + %d es igual a %d\n", ++n1, n2, res = (++n1 + n2));
  char c;
  c = 'X';
  printf("La letra %d\n", c);
  int vec[10];
  vec[0] = 5;
  vec[1] = 20;
  vec[9] = 100;
  printf("El array posición 1 %d\n", vec[1]);
  char str[10];
  char s1[10] = "CHAU";
  char s2[22];
  str[0] = 'H';
  str[1] = 'O';
  str[2] = 'L';
  str[3] = 'A';
  str[4] = '\0';
  printf("El string %s y %s \n", str, s1);
  snprintf(s2, sizeof(s2), "%s y %s", str, s1);
  printf("El string %s \n", s2);
  if (n1 == 5) {
    printf("Todo valor distinto de cero es verdadero %d\n", (y == 10));
  } else {
    printf("El valor cero es falso %d\n", (y != 10));
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x58,-0x15(%rbp)
movsbl -0x15(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x5,-0x40(%rbp)
movl   $0x14,-0x3c(%rbp)
movl   $0x64,-0x1c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xf02(%rip),%rax
mov    %rax,-0x54(%rbp)
mov    0xeff(%rip),%ax
mov    %ax,-0x4c(%rbp)
movb   $0x48,-0x4a(%rbp)
movb   $0x4f,-0x49(%rbp)
movb   $0x4c,-0x48(%rbp)
movb   $0x41,-0x47(%rbp)
movb   $0x0,-0x46(%rbp)
lea    -0x4a(%rbp),%rsi
lea    -0x54(%rbp),%rdx
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x4a(%rbp),%rcx
lea    -0x54(%rbp),%r8
mov    $0x16,%esi
lea    0xe52(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jne    1243 <main+0x123>
lea    0xe41(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1253 <main+0x133>
lea    0xe56(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xed0(%rip),%rdi
mov    $0x10,%esi
mov    $0x14,%edx
mov    $0x25,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x58,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movw   $0x0,0x10(%rsp)
movq   $0x55414843,0x8(%rsp)
41 55
movl   $0x414c4f48,0x16(%rsp)
41
movb   $0x0,0x1a(%rsp)
lea    0xeb8(%rip),%rdi
lea    0x16(%rsp),%r15
lea    0x8(%rsp),%r14
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeae(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x16,%esi
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <snprintf@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"La suma de %d + %d es igual a %d\0A\00"
@.str.1 = [13 x i8] c"La letra %d\0A\00"
@.str.2 = [25 x i8] c"El array posici\C3\B3n 1 %d\0A\00"
@__const.main.s1 = [10 x i8] c"CHAU\00\00\00\00\00\00"
@.str.3 = [20 x i8] c"El string %s y %s \0A\00"
@.str.4 = [8 x i8] c"%s y %s\00"
@.str.5 = [15 x i8] c"El string %s \0A\00"
@.str.6 = [45 x i8] c"Todo valor distinto de cero es verdadero %d\0A\00"
@.str.7 = [27 x i8] c"El valor cero es falso %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca [10 x i32]
%8 = alloca [10 x i8]
%9 = alloca [10 x i8]
%10 = alloca [22 x i8]
store i32 0, i32* %1
store i32 20, i32* %3
store i32 10, i32* %5
store i32 10, i32* %2
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 5
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
store i32 %19, i32* %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %19)
store i8 88, i8* %6
%21 = load i8, i8* %6
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
store i32 5, i32* %24
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 1
store i32 20, i32* %25
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 9
store i32 100, i32* %26
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 1
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = bitcast [10 x i8]* %9 to i8*
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
store i8 72, i8* %31
%32 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 1
store i8 79, i8* %32
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 2
store i8 76, i8* %33
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 3
store i8 65, i8* %34
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 4
store i8 0, i8* %35
%36 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %36, i8* %37)
%39 = getelementptr inbounds [22 x i8], [22 x i8]* %10, i64 0, i64 0
%40 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%42 = call i32 @snprintf(i8* %39, i32 22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %40, i8* %41)
%43 = getelementptr inbounds [22 x i8], [22 x i8]* %10, i64 0, i64 0
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %43)
%45 = load i32, i32* %2
%46 = icmp eq i32 %45, 5
br i1 %46, label %47, label %49
47: ; preds = %0
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 1)
br label %51
49: ; preds = %0
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 0)
br label %51
51: ; preds = %49, %47
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"La suma de %d + %d es igual a %d\0A\00"
@.str.1 = [13 x i8] c"La letra %d\0A\00"
@.str.2 = [25 x i8] c"El array posici\C3\B3n 1 %d\0A\00"
@__const.main.s1 = [10 x i8] c"CHAU\00\00\00\00\00\00"
@.str.3 = [20 x i8] c"El string %s y %s \0A\00"
@.str.4 = [8 x i8] c"%s y %s\00"
@.str.5 = [15 x i8] c"El string %s \0A\00"
@.str.7 = [27 x i8] c"El valor cero es falso %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = alloca [22 x i8]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 16, i32 20, i32 37)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 88)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 20)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [22 x i8], [22 x i8]* %3, i64 0, i64 0
store i8 72, i8* %7
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 79, i8* %10
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 76, i8* %11
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
store i8 65, i8* %12
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 4
store i8 0, i8* %13
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %7, i8* %8)
%15 = call i32 @snprintf(i8* %9, i32 22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %7, i8* %8)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 0)
ret i32 0
}