#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 argc, const char *argv[]) {
  int ano;
  printf("Digite um ano:");
  scanf("%d", &ano);
  if (ano % 4 == 0 && ano % 100 != 0) {
    printf("O ano é bissexto.\n");
  } else if (ano == 2000) {
    printf("o ano é bissexto.\n");
  } else {
    printf("O ano não é bissexto.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118b <main+0x6b>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     118b <main+0x6b>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    11ba <main+0x9a>
cmpl   $0x7d0,-0x14(%rbp)
jne    11a9 <main+0x89>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    11b5 <main+0x95>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    11ba <main+0x9a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
imul   $0xc28f5c29,%eax,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
cmp    $0x7d0,%eax
lea    0xebd(%rip),%rdx
lea    0xe9e(%rip),%rsi
cmove  %rdx,%rsi
cmp    $0x28f5c29,%ecx
lea    0xeb8(%rip),%rdi
cmovb  %rsi,%rdi
test   $0x3,%al
cmovne %rsi,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Digite um ano:\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [24 x i8] c"O ano n\C3\A3o \C3\A9 bissexto.\00"
@str.5 = [19 x i8] c"o ano \C3\A9 bissexto.\00"
@str.6 = [19 x i8] c"O ano \C3\A9 bissexto.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = and i32 %7, 3
%9 = icmp ne i32 %8, 0
%10 = srem i32 %7, 100
%11 = icmp eq i32 %10, 0
%12 = or i1 %9, %11
%13 = icmp eq i32 %7, 2000
%14 = select i1 %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0)
%15 = select i1 %12, i8* %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0)
%16 = call i32 @puts(i8* dereferenceable(1) %15)
ret i32 0
}