int main(void) {
  int asksQtt = 3;
  char asks[][4] = {"Q1?", "Q2?", "Q3?"};
  char answers[] = {'a', 'c', 'd'};
  int correctAnswersQtt = 0;
  char answer;
  for (int i = 0; i < asksQtt; i++) {
    printf("%s ", asks[i]);
    scanf(" %c", &answer);
    if (answers[i] == answer) {
      correctAnswersQtt++;
    }
  }
  printf("%d\n", correctAnswersQtt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x15(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d8 <main+0xb8>
movslq -0x24(%rbp),%rax
lea    -0x14(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe77(%rip),%rdi
lea    -0x1d(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x24(%rbp),%rax
movsbl -0x17(%rbp,%rax,1),%eax
movsbl -0x1d(%rbp),%ecx
cmp    %ecx,%eax
jne    11c5 <main+0xa5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ca <main+0xaa>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116c <main+0x4c>
mov    -0x1c(%rbp),%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0xed4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%r14
lea    0xebc(%rip),%r15
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaa(%rip),%r13
lea    0x7(%rsp),%r12
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %ebp,%ebp
cmpb   $0x61,0x7(%rsp)
sete   %bpl
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %ebx,%ebx
cmpb   $0x63,0x7(%rsp)
sete   %bl
add    %ebp,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %esi,%esi
cmpb   $0x64,0x7(%rsp)
sete   %sil
add    %ebx,%esi
lea    0xe3b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.asks = [3 x [4 x i8]] [[4 x i8] c"Q1?\00", [4 x i8] c"Q2?\00", [4 x i8] c"Q3?\00"]
@__const.main.answers = [3 x i8] c"acd"
@.str = [4 x i8] c"%s \00"
@.str.1 = [4 x i8] c" %c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x [4 x i8]]
%4 = alloca [3 x i8]
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%8 = bitcast [3 x [4 x i8]]* %3 to i8*
%9 = bitcast [3 x i8]* %4 to i8*
store i32 0, i32* %5
store i32 0, i32* %7
br label %10
10: ; preds = %33, %0
%11 = load i32, i32* %7
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %36
14: ; preds = %10
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %3, i64 0, i64 %16
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %17, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i8, i8* %6
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %25, %27
br i1 %28, label %29, label %32
29: ; preds = %14
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %32
32: ; preds = %29, %14
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %10
36: ; preds = %10
%37 = load i32, i32* %5
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@__const.main.asks = [3 x [4 x i8]] [[4 x i8] c"Q1?\00", [4 x i8] c"Q2?\00", [4 x i8] c"Q3?\00"]
@.str = [4 x i8] c"%s \00"
@.str.1 = [4 x i8] c" %c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x [4 x i8]]
%2 = alloca i8
%3 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %1, i64 0, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 97
%8 = zext i1 %7 to i32
%9 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %1, i64 0, i64 1, i64 0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%12 = load i8, i8* %2
%13 = icmp eq i8 %12, 99
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %8, %14
%16 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* %1, i64 0, i64 2, i64 0
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%19 = load i8, i8* %2
%20 = icmp eq i8 %19, 100
%21 = zext i1 %20 to i32
%22 = add nuw nsw i32 %15, %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %22)
ret i32 0
}