#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*/ system(char *);
int main() {
  int x = 0, y = 0;
  for (x = 0, y = 1000; (x != y); x = x + 2, y = y - 3) {
    printf("\n\tX = %d Y=%d", x, y);
  }
  printf("\n\tFora do laço X = %d Y=%d", x, y);
  printf("\t\tFim do programa\n");
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3e8,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1182 <main+0x62>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <main+0x2b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x3e8,%ebx
mov    $0x2,%r15d
lea    0xeb9(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    -0x2(%r15),%esi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xfffffffd,%ebx
lea    0x2(%r15),%eax
cmp    %ebx,%r15d
mov    %eax,%r15d
jne    1150 <main+0x20>
lea    0xe98(%rip),%rdi
mov    $0x190,%esi
mov    $0x190,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0A\09X = %d Y=%d\00"
@.str.1 = [28 x i8] c"\0A\09Fora do la\C3\A7o X = %d Y=%d\00"
@.str.2 = [19 x i8] c"\09\09Fim do programa\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %2
store i32 1000, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 2
store i32 %14, i32* %2
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 3
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0A\09X = %d Y=%d\00"
@.str.1 = [28 x i8] c"\0A\09Fora do la\C3\A7o X = %d Y=%d\00"
@.str.3 = [6 x i8] c"pause\00"
@str = [18 x i8] c"\09\09Fim do programa\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1000, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %5, %1 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
%5 = add nuw nsw i32 %3, 2
%6 = add nsw i32 %2, -3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %1
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 400, i32 400)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}