#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 packCharacters(char, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ unpackCharacters(unsigned int);
int main() {
  char c1;
  char c2;
  unsigned c;
  printf("%s\n", "char1:");
  scanf("%c", &c1);
  printf("%s\n", "char2:");
  scanf(" %c", &c2);
  c = packCharacters(c1, c2);
  printf("\n****************\n");
  unpackCharacters(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe8c(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
lea    -0x2(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x1(%rbp),%al
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1060 <packCharacters@plt>
mov    %eax,-0x8(%rbp)
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <unpackCharacters@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb7(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe99(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%edi
movsbl 0xe(%rsp),%esi
call   1060 <packCharacters@plt>
mov    %eax,%ebx
lea    0xe7b(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1030 <unpackCharacters@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"char1:\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [7 x i8] c"char2:\00"
@.str.4 = [4 x i8] c" %c\00"
@.str.5 = [19 x i8] c"\0A****************\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%8 = load i8, i8* %1
%9 = load i8, i8* %2
%10 = call i32 @packCharacters(i8 signext %8, i8 signext %9)
store i32 %10, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = call i32 @unpackCharacters(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"char1:\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [7 x i8] c"char2:\00"
@.str.4 = [4 x i8] c" %c\00"
@str = [18 x i8] c"\0A****************\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %1
%8 = load i8, i8* %2
%9 = call i32 @packCharacters(i8 signext %7, i8 signext %8)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%11 = call i32 @unpackCharacters(i32 %9)
ret i32 0
}