#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 /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char a, b;
  printf("Digite o primeiro caracter: ");
  scanf(" %c", &a);
  printf("Digite o segundo caracter: ");
  scanf(" %c", &b);
  if (a > b) {
    printf("%c %c\n", b, a);
  } else {
    printf("%c %c\n", a, b);
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jle    11a6 <main+0x76>
movsbl -0x6(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11bc <main+0x8c>
movsbl -0x5(%rbp),%esi
movsbl -0x6(%rbp),%edx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%edx
movsbl 0xe(%rsp),%eax
lea    0xeba(%rip),%rdi
cmp    %al,%dl
jle    118b <main+0x5b>
mov    %eax,%esi
jmp    118f <main+0x5f>
mov    %edx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [29 x i8] c"Digite o primeiro caracter: \00"
@.str.1 = [4 x i8] c" %c\00"
@.str.2 = [28 x i8] c"Digite o segundo caracter: \00"
@.str.3 = [7 x i8] c"%c %c\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sgt i8 %7, %9
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %8)
br label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 %10)
br label %16
16: ; preds = %14, %12
%17 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}