#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*/ conta_voto(int *);
int /*<<< orphan*/ mostra_candidato();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int voto, candA, candB, eleitor, nulo;
  int cont = 1;
  candA = candB = nulo = 0;
  mostra_candidato();
  puts("Entre com o numero de eleitores");
  scanf("%d", &eleitor);
  while (cont <= eleitor) {
    printf("Voto do eleitor %d: ", cont);
    scanf("%d", &voto);
    if (voto < 0) {
      mostra_candidato();
      cont--;
    } else if (voto == 42) {
      conta_voto(&candA);
    } else if (voto == 18) {
      conta_voto(&candB);
    } else {
      nulo += 1;
    }
    cont++;
  }
  puts("\t\tRESULTADOS");
  printf("Quantidade de votos do Candidato A: %d\n", candA);
  printf("Quantidade de votos do Candidato B: %d\n", candB);
  printf("Quantidade de votos nulos: %d\n", nulo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <mostra_candidato@plt>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe92(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1232 <main+0xe2>
mov    -0x18(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1050 <printf@plt>
lea    0xe67(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jge    11e1 <main+0x91>
mov    $0x0,%al
call   1040 <mostra_candidato@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1224 <main+0xd4>
cmpl   $0x2a,-0x4(%rbp)
jne    11f9 <main+0xa9>
lea    -0x8(%rbp),%rdi
call   1070 <conta_voto@plt>
jmp    121f <main+0xcf>
cmpl   $0x12,-0x4(%rbp)
jne    1211 <main+0xc1>
lea    -0xc(%rbp),%rdi
call   1070 <conta_voto@plt>
jmp    121a <main+0xca>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121f <main+0xcf>
jmp    1224 <main+0xd4>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1197 <main+0x47>
lea    0xdff(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%esi
lea    0xdfd(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe16(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe2f(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <mostra_candidato@plt>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1236 <main+0xe6>
mov    $0x1,%ebp
lea    0xe77(%rip),%r15
lea    0xe6d(%rip),%r12
lea    0x14(%rsp),%rbx
lea    0x10(%rsp),%r13
xor    %r14d,%r14d
jmp    11e5 <main+0x95>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <mostra_candidato@plt>
add    $0xffffffff,%ebp
lea    0x1(%rbp),%eax
cmp    0x8(%rsp),%ebp
mov    %eax,%ebp
jge    1236 <main+0xe6>
mov    %r15,%rdi
mov    %ebp,%esi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x14(%rsp),%eax
test   %eax,%eax
js     11d0 <main+0x80>
cmp    $0x12,%eax
je     1220 <main+0xd0>
cmp    $0x2a,%eax
jne    1230 <main+0xe0>
mov    %r13,%rdi
call   1070 <conta_voto@plt>
jmp    11da <main+0x8a>
cs nopw 0x0(%rax,%rax,1)
lea    0xc(%rsp),%rdi
call   1070 <conta_voto@plt>
jmp    11da <main+0x8a>
nopl   0x0(%rax)
add    $0x1,%r14d
jmp    11da <main+0x8a>
lea    0xdfb(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%esi
lea    0xdf8(%rip),%rdi
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe10(%rip),%rdi
call   1050 <printf@plt>
lea    0xe2c(%rip),%rdi
mov    %r14d,%esi
call   1050 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Entre com o numero de eleitores\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Voto do eleitor %d: \00"
@.str.3 = [13 x i8] c"\09\09RESULTADOS\00"
@.str.4 = [40 x i8] c"Quantidade de votos do Candidato A: %d\0A\00"
@.str.5 = [40 x i8] c"Quantidade de votos do Candidato B: %d\0A\00"
@.str.6 = [31 x i8] c"Quantidade de votos nulos: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 1, i32* %6
store i32 0, i32* %5
store i32 0, i32* %3
store i32 0, i32* %2
%7 = call i32 (...) @mostra_candidato()
%8 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %10
10: ; preds = %39, %0
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %42
14: ; preds = %10
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %14
%21 = call i32 (...) @mostra_candidato()
%22 = load i32, i32* %6
%23 = add nsw i32 %22, -1
store i32 %23, i32* %6
br label %39
24: ; preds = %14
%25 = load i32, i32* %1
%26 = icmp eq i32 %25, 42
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @conta_voto(i32* %2)
br label %38
29: ; preds = %24
%30 = load i32, i32* %1
%31 = icmp eq i32 %30, 18
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @conta_voto(i32* %3)
br label %37
34: ; preds = %29
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %37
37: ; preds = %34, %32
br label %38
38: ; preds = %37, %27
br label %39
39: ; preds = %38, %20
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %10
42: ; preds = %10
%43 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%44 = load i32, i32* %2
%45 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %3
%47 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %5
%49 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %48)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Entre com o numero de eleitores\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Voto do eleitor %d: \00"
@.str.3 = [13 x i8] c"\09\09RESULTADOS\00"
@.str.4 = [40 x i8] c"Quantidade de votos do Candidato A: %d\0A\00"
@.str.5 = [40 x i8] c"Quantidade de votos do Candidato B: %d\0A\00"
@.str.6 = [31 x i8] c"Quantidade de votos nulos: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %3
store i32 0, i32* %2
%9 = tail call i32 (...) @mostra_candidato()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 1
br i1 %13, label %37, label %14
14: ; preds = %0, %31
%15 = phi i32 [ %34, %31 ], [ 1, %0 ]
%16 = phi i32 [ %32, %31 ], [ 0, %0 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = call i32 (...) @mostra_candidato()
%23 = add nsw i32 %15, -1
br label %31
24: ; preds = %14
switch i32 %19, label %29 [
i32 42, label %25
i32 18, label %27
]
25: ; preds = %24
%26 = call i32 @conta_voto(i32* %2)
br label %31
27: ; preds = %24
%28 = call i32 @conta_voto(i32* %3)
br label %31
29: ; preds = %24
%30 = add nsw i32 %16, 1
br label %31
31: ; preds = %25, %29, %27, %21
%32 = phi i32 [ %16, %21 ], [ %16, %25 ], [ %16, %27 ], [ %30, %29 ]
%33 = phi i32 [ %23, %21 ], [ %15, %25 ], [ %15, %27 ], [ %15, %29 ]
%34 = add nsw i32 %33, 1
%35 = load i32, i32* %4
%36 = icmp slt i32 %33, %35
br i1 %36, label %14, label %37
37: ; preds = %31, %0
%38 = phi i32 [ 0, %0 ], [ %32, %31 ]
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%40 = load i32, i32* %2
%41 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %3
%43 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i32 %42)
%44 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %38)
ret void
}