#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int main(void) {
  char name1[71], name2[71];
  printf("Digite o primeiro nome: ");
  fgets(name1, 71, stdin);
  printf("Digite o segundo nome: ");
  fgets(name2, 71, stdin);
  if (strcmp(name1, name2) >= 0) {
    printf("\n%s\n%s\n", name2, name1);
  } else {
    printf("\n%s\n%s\n", name1, name2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
mov    $0x47,%esi
call   1040 <fgets@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
mov    $0x47,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jl     11c7 <main+0x97>
lea    -0xa0(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e0 <main+0xb0>
lea    -0x50(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e99(%rip),%rbx
mov    (%rbx),%edx
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    $0x47,%esi
call   1040 <fgets@plt>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x47,%esi
call   1040 <fgets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
lea    0xe9c(%rip),%rdi
test   %rax,%rax
js     11a4 <main+0x74>
mov    %rsp,%rsi
lea    0x50(%rsp),%rdx
jmp    11ac <main+0x7c>
lea    0x50(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Digite o primeiro nome: \00"
@stdin = global i32 0
@.str.1 = [24 x i8] c"Digite o segundo nome: \00"
@.str.2 = [8 x i8] c"\0A%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [71 x i8]
%3 = alloca [71 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [71 x i8], [71 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 71, i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [71 x i8], [71 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 71, i32 %10)
%12 = getelementptr inbounds [71 x i8], [71 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [71 x i8], [71 x i8]* %3, i64 0, i64 0
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp sge i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %0
%17 = getelementptr inbounds [71 x i8], [71 x i8]* %3, i64 0, i64 0
%18 = getelementptr inbounds [71 x i8], [71 x i8]* %2, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %17, i8* %18)
br label %24
20: ; preds = %0
%21 = getelementptr inbounds [71 x i8], [71 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [71 x i8], [71 x i8]* %3, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %21, i8* %22)
br label %24
24: ; preds = %20, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Digite o primeiro nome: \00"
@stdin = global i32 0
@.str.1 = [24 x i8] c"Digite o segundo nome: \00"
@.str.2 = [8 x i8] c"\0A%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca [71 x i8]
%2 = alloca [71 x i8]
%3 = getelementptr inbounds [71 x i8], [71 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [71 x i8], [71 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %3, i32 71, i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %4, i32 71, i32 %9)
%11 = call i64 @strcmp(i8* %3, i8* %4)
%12 = icmp sgt i64 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %3)
br label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
br label %17
17: ; preds = %15, %13
ret i32 0
}