#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 n, i;
  for (i = 1; i == 1;) {
    scanf("%d", &n);
    if (n == 2002) {
      printf("Acesso Permitido\n");
      break;
    } else {
      printf("Senha Invalida\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    117f <main+0x5f>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x7d2,-0x8(%rbp)
jne    116e <main+0x4e>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x5f>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x7d2,0xc(%rsp)
je     117d <main+0x5d>
lea    0xeb8(%rip),%r14
lea    0xeae(%rip),%r15
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x7d2,0xc(%rsp)
jne    1160 <main+0x40>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [18 x i8] c"Acesso Permitido\0A\00"
@.str.2 = [16 x i8] c"Senha Invalida\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 2002
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %16
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13
br label %4
16: ; preds = %11, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [15 x i8] c"Senha Invalida\00"
@str.3 = [17 x i8] c"Acesso Permitido\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2002
br i1 %5, label %6, label %8
6: ; preds = %8, %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
ret i32 0
8: ; preds = %0, %8
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 2002
br i1 %12, label %6, label %8
}