#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*/ LC_ALL;
int /*<<< orphan*/ getch();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
scalar_t__ strcmp(char *, char *);
main() {
  setlocale(LC_ALL, "Portuguese");
  char str1[100], str2[100];
  printf("Entre com uma string: ");
  gets(str1);
  printf("\n\nEntre com outra string: ");
  gets(str2);
  if ((strcmp(str1, str2)) < 0)
    printf("\n\n %s é menor/diferente que %s", str1, str2);
  else if ((strcmp(str1, str2)) > 0)
    printf("\n\%s é maior/diferente que %s", str1, str2);
  else
    printf("\n\n%s é igual a %s ");
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jge    11e0 <main+0x90>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122b <main+0xdb>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jle    1218 <main+0xc8>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1226 <main+0xd6>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122b <main+0xdb>
mov    $0x0,%al
call   1070 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jns    11bc <main+0x6c>
lea    0xe83(%rip),%rdi
jmp    11d5 <main+0x85>
lea    0x70(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jle    11e6 <main+0x96>
lea    0xe88(%rip),%rdi
lea    0x70(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11f4 <main+0xa4>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [23 x i8] c"Entre com uma string: \00"
@.str.2 = [27 x i8] c"\0A\0AEntre com outra string: \00"
@.str.3 = [32 x i8] c"\0A\0A %s \C3\A9 menor/diferente que %s\00"
@.str.4 = [30 x i8] c"\0A%s \C3\A9 maior/diferente que %s\00"
@.str.5 = [20 x i8] c"\0A\0A%s \C3\A9 igual a %s \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %0
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %17, i8* %18)
br label %32
20: ; preds = %0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%23 = call i64 @strcmp(i8* %21, i8* %22)
%24 = icmp sgt i64 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %26, i8* %27)
br label %31
29: ; preds = %20
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
br label %32
32: ; preds = %31, %16
%33 = call i32 (...) @getch()
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [23 x i8] c"Entre com uma string: \00"
@.str.2 = [27 x i8] c"\0A\0AEntre com outra string: \00"
@.str.3 = [32 x i8] c"\0A\0A %s \C3\A9 menor/diferente que %s\00"
@.str.4 = [30 x i8] c"\0A%s \C3\A9 maior/diferente que %s\00"
@.str.5 = [20 x i8] c"\0A\0A%s \C3\A9 igual a %s \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @gets(i8* %5)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @gets(i8* %6)
%11 = call i64 @strcmp(i8* %5, i8* %6)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %5, i8* %6)
br label %22
15: ; preds = %0
%16 = call i64 @strcmp(i8* %5, i8* %6)
%17 = icmp sgt i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %5, i8* %6)
br label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %22
22: ; preds = %18, %20, %13
%23 = call i32 (...) @getch()
ret i32 0
}