#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();
int /*<<< orphan*/ getchar();
int most_common(char, char, char, char, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char c1, c2, c3, c4, c5;
  int result;
  printf("Input character c1:\n");
  scanf("%c", &c1);
  printf("Input character c2:\n");
  scanf("%c", &c2);
  printf("Input character c3:\n");
  scanf("%c", &c3);
  printf("Input character c4:\n");
  scanf("%c", &c4);
  printf("Input character c5:\n");
  scanf("%c", &c5);
  result = most_common(c1, c2, c3, c4, c5);
  printf("\nThe most commonly used character is %c.\n", result);
  flushall();
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x2(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
lea    -0x3(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe30(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x1(%rbp),%sil
mov    -0x2(%rbp),%dl
mov    -0x3(%rbp),%cl
mov    -0x4(%rbp),%al
movsbl %sil,%edi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x5(%rbp),%r8d
call   1070 <most_common@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xd(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
lea    0xb(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%edi
movsbl 0xe(%rsp),%esi
movsbl 0xd(%rsp),%edx
movsbl 0xc(%rsp),%ecx
movsbl 0xb(%rsp),%r8d
call   1080 <most_common@plt>
lea    0xdf4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Input character c1:\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [21 x i8] c"Input character c2:\0A\00"
@.str.3 = [21 x i8] c"Input character c3:\0A\00"
@.str.4 = [21 x i8] c"Input character c4:\0A\00"
@.str.5 = [21 x i8] c"Input character c5:\0A\00"
@.str.6 = [42 x i8] c"\0AThe most commonly used character is %c.\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%17 = load i8, i8* %1
%18 = load i8, i8* %2
%19 = load i8, i8* %3
%20 = load i8, i8* %4
%21 = load i8, i8* %5
%22 = call i32 @most_common(i8 signext %17, i8 signext %18, i8 signext %19, i8 signext %20, i8 signext %21)
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), i32 %23)
%25 = call i32 (...) @flushall()
%26 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.6 = [42 x i8] c"\0AThe most commonly used character is %c.\0A\00"
@str = [20 x i8] c"Input character c1:\00"
@str.7 = [20 x i8] c"Input character c2:\00"
@str.8 = [20 x i8] c"Input character c3:\00"
@str.9 = [20 x i8] c"Input character c4:\00"
@str.10 = [20 x i8] c"Input character c5:\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%16 = load i8, i8* %1
%17 = load i8, i8* %2
%18 = load i8, i8* %3
%19 = load i8, i8* %4
%20 = load i8, i8* %5
%21 = call i32 @most_common(i8 signext %16, i8 signext %17, i8 signext %18, i8 signext %19, i8 signext %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = call i32 (...) @flushall()
%24 = call i32 (...) @getchar()
ret i32 0
}