#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 */
unsigned int compactaCaracteres(char, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main() {
  char char1, char2;
  unsigned int compactado;
  printf("Informe 2 caracteres: ");
  scanf("%c%c", &char1, &char2);
  compactado = compactaCaracteres(char1, char2);
  printf("%d %d %d\n", ((int)char1), ((int)char2), compactado);
  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    0xec3(%rip),%rdi
lea    -0x5(%rbp),%rsi
lea    -0x6(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x5(%rbp),%al
movsbl %al,%edi
movsbl -0x6(%rbp),%esi
call   1030 <compactaCaracteres@plt>
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%esi
movsbl -0x6(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rdx
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%edi
movsbl 0x6(%rsp),%esi
call   1030 <compactaCaracteres@plt>
movsbl 0x7(%rsp),%esi
movsbl 0x6(%rsp),%edx
lea    0xea7(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Informe 2 caracteres: \00"
@.str.1 = [5 x i8] c"%c%c\00"
@.str.2 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3)
%7 = load i8, i8* %2
%8 = load i8, i8* %3
%9 = call i32 @compactaCaracteres(i8 signext %7, i8 signext %8)
store i32 %9, i32* %4
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Informe 2 caracteres: \00"
@.str.1 = [5 x i8] c"%c%c\00"
@.str.2 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2)
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = call i32 @compactaCaracteres(i8 signext %5, i8 signext %6)
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %11, i32 %7)
ret i32 0
}