#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 *, char *, ...);
int strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
main(void) {
  char cadena1[] = "La Comunidad de Cantabria es muy bonita";
  char cadena2[] = "La Comunidad de CANTABRIA es muy bonita";
  char temp[20];
  int resu;
  printf("Comparar las cadenas:\n\n%s\n%s\n\n", cadena1, cadena2);
  resu = strcmp(cadena1, cadena2);
  if (resu > 0)
    strcpy(temp, "mayor que");
  else if (resu < 0)
    strcpy(temp, "menor que");
  else
    strcpy(temp, "igual a");
  printf("strcmp: cadena 1 es %s cadena 2\n", temp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x30(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <strcmp@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0x0,-0x84(%rbp)
jle    11c7 <main+0x87>
lea    -0x80(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11fe <main+0xbe>
cmpl   $0x0,-0x84(%rbp)
jge    11e9 <main+0xa9>
lea    -0x80(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11f9 <main+0xb9>
lea    -0x80(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11fe <main+0xbe>
lea    -0x80(%rbp),%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movabs $0x6174696e6f6220,%rax
mov    %rax,0x50(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rax,0x20(%rsp)
lea    0xed7(%rip),%rdi
lea    0x30(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
lea    0xed7(%rip),%rax
lea    0xeda(%rip),%rcx
cmovs  %rax,%rcx
lea    0xebb(%rip),%rsi
cmovle %rcx,%rsi
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.cadena1 = [40 x i8] c"La Comunidad de Cantabria es muy bonita\00"
@__const.main.cadena2 = [40 x i8] c"La Comunidad de CANTABRIA es muy bonita\00"
@.str = [31 x i8] c"Comparar las cadenas:\0A\0A%s\0A%s\0A\0A\00"
@.str.1 = [10 x i8] c"mayor que\00"
@.str.2 = [10 x i8] c"menor que\00"
@.str.3 = [8 x i8] c"igual a\00"
@.str.4 = [33 x i8] c"strcmp: cadena 1 es %s cadena 2\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca [40 x i8]
%4 = alloca [20 x i8]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [40 x i8]* %2 to i8*
%7 = bitcast [40 x i8]* %3 to i8*
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%13 = call i32 @strcmp(i8* %11, i8* %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %29
19: ; preds = %0
%20 = load i32, i32* %5
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %28
25: ; preds = %19
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %25, %22
br label %29
29: ; preds = %28, %16
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%31 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %30)
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@__const.main.cadena1 = [40 x i8] c"La Comunidad de Cantabria es muy bonita\00"
@__const.main.cadena2 = [40 x i8] c"La Comunidad de CANTABRIA es muy bonita\00"
@.str = [31 x i8] c"Comparar las cadenas:\0A\0A%s\0A%s\0A\0A\00"
@.str.1 = [10 x i8] c"mayor que\00"
@.str.2 = [10 x i8] c"menor que\00"
@.str.3 = [8 x i8] c"igual a\00"
@.str.4 = [33 x i8] c"strcmp: cadena 1 es %s cadena 2\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca [40 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
%8 = call i32 @strcmp(i8* %4, i8* %5)
%9 = icmp sgt i32 %8, 0
%10 = icmp slt i32 %8, 0
%11 = select i1 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0)
%12 = select i1 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %11
%13 = call i32 @strcpy(i8* %6, i8* %12)
%14 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %6)
ret i32 0
}