#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*/ fflash(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char letter, number;
  printf("What is your favourite letter? ");
  letter = getchar();
  fflash(stdin);
  printf("What is your favourite number? ");
  number = getchar();
  printf("\n\n  Thank you!\n\n  So \"%c\" is your favourite letter and \"%c\" "
         "is your favourite number....\n \n\n    Nice!\n",
         letter, number);
  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   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflash@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%esi
movsbl -0x6(%rbp),%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <fflash@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %bl,%esi
movsbl %al,%edx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"What is your favourite letter? \00"
@stdin = global i32 0
@.str.1 = [32 x i8] c"What is your favourite number? \00"
@.str.2 = [103 x i8] c"\0A\0A Thank you!\0A\0A So \22%c\22 is your favourite letter and \22%c\22 is your favourite number....\0A \0A\0A Nice!\0A\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 ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = load i32, i32* @stdin
%7 = call i32 @fflash(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%9 = call signext i8 (...) @getchar()
store i8 %9, i8* %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"What is your favourite letter? \00"
@stdin = global i32 0
@.str.1 = [32 x i8] c"What is your favourite number? \00"
@.str.2 = [103 x i8] c"\0A\0A Thank you!\0A\0A So \22%c\22 is your favourite letter and \22%c\22 is your favourite number....\0A \0A\0A Nice!\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = load i32, i32* @stdin
%4 = tail call i32 @fflash(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call signext i8 (...) @getchar()
%7 = sext i8 %2 to i32
%8 = sext i8 %6 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([103 x i8], [103 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}