#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 main() {
  char *cadena = "hola";
  if (cadena == "hola") {
    printf("Cadena si es igual a %s \n", cadena);
  }
  if (cadena == "ALGO DIFERENTE") {
    printf("La cadena es = ALGO DIFEREBTE");
  } else {
    printf("No cumplio ninguna condicion \n");
  }
  if (cadena == "hola" && 1 == 1) {
    printf("Es hola ya no usara else-if ni else \n");
  } else if (cadena != "hola") {
    printf("Es diferente a hola uso condicion else if \n");
  } else {
    printf("aqui no hay condicion solo lo hace si no cumple ninguna \n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecf(%rip),%rax
cmp    %rax,-0x10(%rbp)
jne    114d <main+0x3d>
mov    -0x10(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rax
cmp    %rax,-0x10(%rbp)
jne    1171 <main+0x61>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117f <main+0x6f>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rax
cmp    %rax,-0x10(%rbp)
jne    11a3 <main+0x93>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <main+0xca>
lea    0xe56(%rip),%rax
cmp    %rax,-0x10(%rbp)
je     11c7 <main+0xb7>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d5 <main+0xc5>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <main+0xca>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedd(%rip),%rdi
lea    0xed1(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedf(%rip),%rax
cmp    %rax,%rbx
jne    1155 <main+0x35>
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1161 <main+0x41>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"hola\00"
@.str.1 = [26 x i8] c"Cadena si es igual a %s \0A\00"
@.str.2 = [15 x i8] c"ALGO DIFERENTE\00"
@.str.3 = [30 x i8] c"La cadena es = ALGO DIFEREBTE\00"
@.str.4 = [31 x i8] c"No cumplio ninguna condicion \0A\00"
@.str.5 = [38 x i8] c"Es hola ya no usara else-if ni else \0A\00"
@.str.6 = [44 x i8] c"Es diferente a hola uso condicion else if \0A\00"
@.str.7 = [58 x i8] c"aqui no hay condicion solo lo hace si no cumple ninguna \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %0
%9 = load i8*, i8** %2
%10 = icmp eq i8* %9, getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i8*, i8** %2
%17 = icmp eq i8* %16, getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
br label %28
20: ; preds = %15
%21 = load i8*, i8** %2
%22 = icmp ne i8* %21, getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %27
25: ; preds = %20
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
br label %28
28: ; preds = %27, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"hola\00"
@.str.1 = [26 x i8] c"Cadena si es igual a %s \0A\00"
@.str.2 = [15 x i8] c"ALGO DIFERENTE\00"
@.str.3 = [30 x i8] c"La cadena es = ALGO DIFEREBTE\00"
@str = [30 x i8] c"No cumplio ninguna condicion \00"
@str.8 = [37 x i8] c"Es hola ya no usara else-if ni else \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br i1 icmp eq (i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)), label %2, label %4
2: ; preds = %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %2, %4
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}