#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 main(void) {
  unsigned short num1 = 0;
  unsigned short num2 = 1;
  printf("\nSequência: 0 ");
  do {
    printf("%u ", num2);
    num2 += num1;
    num1 = num2 - num1;
  } while (num2 <= 10000);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
movw   $0x1,-0x8(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzwl -0x8(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzwl -0x6(%rbp),%ecx
movzwl -0x8(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x8(%rbp)
movzwl -0x8(%rbp),%eax
movzwl -0x6(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x8(%rbp),%eax
cmp    $0x2710,%eax
jle    1139 <main+0x29>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
lea    0xed2(%rip),%r14
xor    %ebp,%ebp
movzwl %bx,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movzwl %bp,%eax
add    %eax,%ebx
movzwl %bx,%ecx
mov    %ecx,%ebp
sub    %eax,%ebp
cmp    $0x2711,%ecx
jb     1140 <main+0x20>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0ASequ\C3\AAncia: 0 \00"
@.str.1 = [4 x i8] c"%u \00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 0, i16* %2
store i16 1, i16* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %21, %0
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = add nsw i32 %12, %10
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
%17 = load i16, i16* %2
%18 = zext i16 %17 to i32
%19 = sub nsw i32 %16, %18
%20 = trunc i32 %19 to i16
store i16 %20, i16* %2
br label %21
21: ; preds = %5
%22 = load i16, i16* %3
%23 = zext i16 %22 to i32
%24 = icmp sle i32 %23, 10000
br i1 %24, label %5, label %25
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0ASequ\C3\AAncia: 0 \00"
@.str.1 = [4 x i8] c"%u \00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %10, %2 ]
%4 = phi i32 [ 1, %0 ], [ %8, %2 ]
%5 = and i32 %4, 65535
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = and i32 %3, 65535
%8 = add nuw nsw i32 %5, %7
%9 = and i32 %8, 65535
%10 = sub nsw i32 %9, %7
%11 = icmp ult i32 %9, 10001
br i1 %11, label %2, label %12
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}