#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 ano;
  printf("Vamos calcular se o ano e bissexto ou nao\n");
  printf("Digite o ano:\n");
  scanf("%d", &ano);
  if ((ano % 4 == 0) && (ano % 100 != 0)) {
    printf("O ano %d e bissexto!", ano);
  } else {
    if (ano % 400 == 0) {
      printf("O ano %d e bissexto!", ano);
    } else {
      printf("O ano nao e bissexto");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1199 <main+0x79>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1199 <main+0x79>
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c3 <main+0xa3>
mov    -0x8(%rbp),%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <main+0xb1>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rsi
test   $0x3,%sil
jne    1182 <main+0x52>
imul   $0x51eb851f,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
mov    %esi,%ecx
sub    %eax,%ecx
jne    11a7 <main+0x77>
imul   $0xc28f5c29,%esi,%eax
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70a,%eax
jbe    11a7 <main+0x77>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b5 <main+0x85>
lea    0xe55(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Vamos calcular se o ano e bissexto ou nao\0A\00"
@.str.1 = [15 x i8] c"Digite o ano:\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [21 x i8] c"O ano %d e bissexto!\00"
@.str.4 = [21 x i8] c"O ano nao e bissexto\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %0
%10 = load i32, i32* %2
%11 = srem i32 %10, 100
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %26
16: ; preds = %9, %0
%17 = load i32, i32* %2
%18 = srem i32 %17, 400
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %25
23: ; preds = %16
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
br label %26
26: ; preds = %25, %13
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [21 x i8] c"O ano %d e bissexto!\00"
@.str.4 = [21 x i8] c"O ano nao e bissexto\00"
@str = [42 x i8] c"Vamos calcular se o ano e bissexto ou nao\00"
@str.5 = [14 x i8] c"Digite o ano:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = and i32 %6, 3
%8 = icmp ne i32 %7, 0
%9 = srem i32 %6, 100
%10 = icmp eq i32 %9, 0
%11 = or i1 %8, %10
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %6)
br label %21
14: ; preds = %0
%15 = srem i32 %6, 400
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %6)
br label %21
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %21
21: ; preds = %17, %19, %12
ret i32 0
}