#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*/ fpurge(int /*<<< orphan*/);
void *getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  char fav;
  int num;
  printf("Enter your favourite letter character :");
  fav = getchar();
  if (fav == 'q') {
    printf("That's my favourite character too!");
  }
  fpurge(stdin);
  printf("\n\nOk, wo now what is your favourite number?");
  num = getchar();
  if (num == 4) {
    printf("That' my favourite number!");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    116e <main+0x3e>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <fpurge@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    11a8 <main+0x78>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x71,%al
jne    1154 <main+0x24>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <fpurge@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x4,%eax
jne    1186 <main+0x56>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Enter your favourite letter character :\00"
@.str.1 = [35 x i8] c"That's my favourite character too!\00"
@stdin = global i32 0
@.str.2 = [44 x i8] c"\0A\0AOk, wo now what is your favourite number?\00"
@.str.3 = [27 x i8] c"That' my favourite number!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%5 = call i8* (...) @getchar()
%6 = ptrtoint i8* %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 113
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
%13 = load i32, i32* @stdin
%14 = call i32 @fpurge(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%16 = call i8* (...) @getchar()
%17 = ptrtoint i8* %16 to i32
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Enter your favourite letter character :\00"
@.str.1 = [35 x i8] c"That's my favourite character too!\00"
@stdin = global i32 0
@.str.2 = [44 x i8] c"\0A\0AOk, wo now what is your favourite number?\00"
@.str.3 = [27 x i8] c"That' my favourite number!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @getchar()
%3 = ptrtoint i8* %2 to i64
%4 = and i64 %3, 255
%5 = icmp eq i64 %4, 113
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* @stdin
%10 = tail call i32 @fpurge(i32 %9)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i8* (...) @getchar()
%13 = ptrtoint i8* %12 to i64
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %14, 4
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %8
ret i32 0
}