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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe9e(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    -0x2(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1(%rbp),%al
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1050 <packCharacters@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%edi
movsbl 0xe(%rsp),%esi
call   1050 <packCharacters@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"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @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))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%5 = call i32 @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))
%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)
ret i32 0
}

LLVM IR (-O2):
@.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"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 @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))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%5 = call i32 @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))
%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)
ret i32 0
}