#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*/ flushall();
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
main() {
  char ch;
  char ch2;
  printf("Please enter two characters: ");
  ch = getchar();
  flushall();
  ch2 = getchar();
  printf("\nYou entered: ");
  flushall();
  putchar(ch);
  printf(" And ");
  putchar(ch2);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1050 <flushall@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x2(%rbp)
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <flushall@plt>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x2(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <flushall@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
movsbl %bpl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Please enter two characters: \00"
@.str.1 = [15 x i8] c"\0AYou entered: \00"
@.str.2 = [6 x i8] c" And \00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %1
%5 = call i32 (...) @flushall()
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @flushall()
%9 = load i8, i8* %1
%10 = call i32 @putchar(i8 signext %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = load i8, i8* %2
%13 = call i32 @putchar(i8 signext %12)
%14 = call signext i8 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Please enter two characters: \00"
@.str.1 = [15 x i8] c"\0AYou entered: \00"
@.str.2 = [6 x i8] c" And \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 (...) @flushall()
%4 = tail call signext i8 (...) @getchar()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @flushall()
%7 = tail call i32 @putchar(i8 signext %2)
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @putchar(i8 signext %4)
%10 = tail call signext i8 (...) @getchar()
ret i32 0
}