#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int parar = 1;
  int a = 0, b = 0, c = 0;
  int count = 0;
  char elevador = ' ';
  do {
    printf("Elevador: ");
    scanf("%c", &elevador);
    if (elevador == 'a') {
      a++;
      count++;
    } else if (elevador == 'b') {
      b++;
      count++;
    } else if (elevador == 'c') {
      c++;
      count++;
    } else {
      printf("inválido!");
    }
    printf("\nContinuar respondendo? s=1 n=0");
    scanf("%d", &parar);
  } while (parar != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movb   $0x20,-0x19(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x19(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x19(%rbp),%eax
cmp    $0x61,%eax
jne    1198 <main+0x78>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f6 <main+0xd6>
movsbl -0x19(%rbp),%eax
cmp    $0x62,%eax
jne    11bc <main+0x9c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f1 <main+0xd1>
movsbl -0x19(%rbp),%eax
cmp    $0x63,%eax
jne    11e0 <main+0xc0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ec <main+0xcc>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
jmp    11f6 <main+0xd6>
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe30(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1156 <main+0x36>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x1,0x4(%rsp)
movb   $0x20,0x3(%rsp)
lea    0xec1(%rip),%r14
lea    0xec5(%rip),%r15
lea    0x3(%rsp),%r12
lea    0xec7(%rip),%r13
lea    0xee0(%rip),%rbx
lea    0x4(%rsp),%rbp
jmp    117c <main+0x5c>
mov    %r13,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     11aa <main+0x8a>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movzbl 0x3(%rsp),%eax
add    $0x9f,%al
cmp    $0x3,%al
jb     1160 <main+0x40>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Elevador: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [11 x i8] c"inv\C3\A1lido!\00"
@.str.3 = [32 x i8] c"\0AContinuar respondendo? s=1 n=0\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i8 32, i8* %7
br label %8
8: ; preds = %44, %0
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 97
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %41
19: ; preds = %8
%20 = load i8, i8* %7
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 98
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %40
28: ; preds = %19
%29 = load i8, i8* %7
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 99
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %39
37: ; preds = %28
%38 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %32
br label %40
40: ; preds = %39, %23
br label %41
41: ; preds = %40, %14
%42 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
br label %44
44: ; preds = %41
%45 = load i32, i32* %2
%46 = icmp ne i32 %45, 0
br i1 %46, label %8, label %47
47: ; preds = %44
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [11 x i8] c"Elevador: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [11 x i8] c"inv\C3\A1lido!\00"
@.str.3 = [32 x i8] c"\0AContinuar respondendo? s=1 n=0\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
store i8 32, i8* %2
br label %4
4: ; preds = %12, %0
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %2
%8 = add i8 %7, -97
%9 = icmp ult i8 %8, 3
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %4, %10
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %12
ret i32 0
}