#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 *);
int main() {
  int vetor[100];
  int cont = 0, i = 0, j;
  printf("Para encerrar o programa digite -1.\n\n");
  do {
    printf("Entre com um número: ");
    scanf("%d", &vetor[i]);
    i = i + 1;
  } while (vetor[i] != -1);
  for (j = 0; j < i; j++) {
    if ((vetor[j] == 1) && (vetor[j + 1] == 3) && (vetor[j + 2] == 4)) {
      printf("%d", cont);
      cont = cont + 1;
      printf("%d", cont);
    }
  }
  printf("Os numeros 1,3,4 aparece nessa ordem %d vezes!\n", cont);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
movl   $0x0,-0x1a8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x1a8(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebf(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
movslq -0x1a8(%rbp),%rax
cmpl   $0xffffffff,-0x1a0(%rbp,%rax,4)
ff
jne    1154 <main+0x34>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1a8(%rbp),%eax
jge    125a <main+0x13a>
movslq -0x1ac(%rbp),%rax
cmpl   $0x1,-0x1a0(%rbp,%rax,4)
01
jne    1241 <main+0x121>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
cltq
cmpl   $0x3,-0x1a0(%rbp,%rax,4)
03
jne    1241 <main+0x121>
mov    -0x1ac(%rbp),%eax
add    $0x2,%eax
cltq
cmpl   $0x4,-0x1a0(%rbp,%rax,4)
04
jne    1241 <main+0x121>
mov    -0x1a4(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%esi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1246 <main+0x126>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    11b1 <main+0x91>
mov    -0x1a4(%rbp),%esi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x198,%rsp
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
lea    0xead(%rip),%r14
lea    0xebd(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%ebp
cmpl   $0xffffffff,0x4(%rbx)
lea    0x4(%rbx),%rbx
jne    1160 <main+0x30>
mov    %ebp,%ebx
lea    0xe8c(%rip),%r14
xor    %ebp,%ebp
xor    %r15d,%r15d
jmp    11a5 <main+0x75>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rbp,%rbx
je     11e0 <main+0xb0>
mov    %rbp,%rax
add    $0x1,%rbp
cmpl   $0x1,(%rsp,%rax,4)
jne    11a0 <main+0x70>
cmpl   $0x3,0x4(%rsp,%rax,4)
jne    11a0 <main+0x70>
cmpl   $0x4,0x8(%rsp,%rax,4)
jne    11a0 <main+0x70>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15d
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11a0 <main+0x70>
lea    0xe33(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Para encerrar o programa digite -1.\0A\0A\00"
@.str.1 = [23 x i8] c"Entre com um n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [48 x i8] c"Os numeros 1,3,4 aparece nessa ordem %d vezes!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %15, %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %15
15: ; preds = %7
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, -1
br i1 %20, label %7, label %21
21: ; preds = %15
store i32 0, i32* %5
br label %22
22: ; preds = %54, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %57
26: ; preds = %22
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %53
32: ; preds = %26
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 3
br i1 %38, label %39, label %53
39: ; preds = %32
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = icmp eq i32 %44, 4
br i1 %45, label %46, label %53
46: ; preds = %39
%47 = load i32, i32* %3
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
%51 = load i32, i32* %3
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %46, %39, %32, %26
br label %54
54: ; preds = %53
%55 = load i32, i32* %5
%56 = add nsw i32 %55, 1
store i32 %56, i32* %5
br label %22
57: ; preds = %22
%58 = load i32, i32* %3
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %58)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Entre com um n\C3\BAmero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [48 x i8] c"Os numeros 1,3,4 aparece nessa ordem %d vezes!\0A\00"
@str = [37 x i8] c"Para encerrar o programa digite -1.\0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
%5 = phi i64 [ %9, %4 ], [ 0, %0 ]
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i64 %5, 1
%15 = and i64 %14, 4294967295
br label %16
16: ; preds = %13, %36
%17 = phi i64 [ 0, %13 ], [ %22, %36 ]
%18 = phi i32 [ 0, %13 ], [ %37, %36 ]
%19 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %17
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 1
%22 = add nuw nsw i64 %17, 1
br i1 %21, label %23, label %36
23: ; preds = %16
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %22
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 3
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = add nuw nsw i64 %17, 2
%29 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 4
br i1 %31, label %32, label %36
32: ; preds = %27
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%34 = add nsw i32 %18, 1
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %16, %23, %27, %32
%37 = phi i32 [ %18, %23 ], [ %18, %27 ], [ %34, %32 ], [ %18, %16 ]
%38 = icmp eq i64 %22, %15
br i1 %38, label %39, label %16
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %37)
ret i32 0
}