#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 year = 365 * 24 * 60 * 60;
  int leap_year = 366 * 24 * 60 * 60;
  int current_year = 2013;
  int age;
  int i;
  int leap;
  int wynik = 0;
  printf("Podaj swój wiek w latach: ");
  scanf("%d", &age);
  for (i = current_year - 1; i >= current_year - age; i--) {
    leap = ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0);
    if (leap == 1)
      wynik = wynik + leap_year;
    else
      wynik = wynik + year;
  }
  printf("Twój wiek w sekundach to: %d\n", wynik);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e13380,-0x8(%rbp)
movl   $0x1e28500,-0xc(%rbp)
movl   $0x7dd,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jl     1203 <main+0xe3>
mov    -0x18(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b0 <main+0x90>
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x21(%rbp)
jne    11c4 <main+0xa4>
mov    -0x18(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    11e7 <main+0xc7>
mov    -0x20(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11f0 <main+0xd0>
mov    -0x20(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11f5 <main+0xd5>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x52>
mov    -0x20(%rbp),%esi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf94(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfa0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    1314 <main+0x1f4>
cmp    $0x8,%ecx
jae    1163 <main+0x43>
mov    $0x7dc,%eax
xor    %ebx,%ebx
jmp    132c <main+0x20c>
mov    %ecx,%edx
and    $0xfffffff8,%edx
mov    $0x7dc,%eax
sub    %edx,%eax
movdqa 0xe89(%rip),%xmm0
movdqa 0xea0(%rip),%xmm12
movdqa 0xeb8(%rip),%xmm5
movdqa 0xebf(%rip),%xmm13
movdqa 0xed6(%rip),%xmm15
pcmpeqd %xmm11,%xmm11
movdqa 0xed9(%rip),%xmm7
movdqa 0xee1(%rip),%xmm3
movdqa 0xee8(%rip),%xmm14
mov    %edx,%esi
pxor   %xmm6,%xmm6
pxor   %xmm4,%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqa %xmm0,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xe8,%xmm1,%xmm8
pshufd $0xf5,%xmm0,%xmm1
pmuludq %xmm12,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm8
movdqa %xmm8,%xmm1
paddd  0xe30(%rip),%xmm1
movdqa %xmm1,%xmm2
psrld  $0x2,%xmm2
movdqa %xmm1,%xmm10
pslld  $0x1e,%xmm10
por    %xmm2,%xmm10
paddd  0xe3e(%rip),%xmm8
movdqa %xmm8,%xmm2
psrld  $0x2,%xmm2
movdqa %xmm8,%xmm9
pslld  $0x1e,%xmm9
por    %xmm2,%xmm9
movdqa %xmm0,%xmm2
pand   0xdc8(%rip),%xmm2
pcmpeqd 0xe60(%rip),%xmm2
pxor   %xmm5,%xmm10
pcmpgtd %xmm13,%xmm10
pxor   %xmm5,%xmm9
pcmpgtd %xmm13,%xmm9
pand   %xmm2,%xmm10
pand   %xmm2,%xmm9
movdqa %xmm1,%xmm2
psrld  $0x4,%xmm2
pslld  $0x1c,%xmm1
por    %xmm2,%xmm1
pxor   %xmm5,%xmm1
pcmpgtd %xmm15,%xmm1
pxor   %xmm11,%xmm1
por    %xmm10,%xmm1
movdqa %xmm8,%xmm2
psrld  $0x4,%xmm2
pslld  $0x1c,%xmm8
por    %xmm2,%xmm8
pxor   %xmm5,%xmm8
pcmpgtd %xmm15,%xmm8
pxor   %xmm11,%xmm8
por    %xmm9,%xmm8
movdqa %xmm1,%xmm2
pandn  %xmm7,%xmm2
pand   %xmm3,%xmm1
por    %xmm2,%xmm1
paddd  %xmm1,%xmm6
movdqa %xmm8,%xmm1
pandn  %xmm7,%xmm1
pand   %xmm3,%xmm8
por    %xmm1,%xmm8
paddd  %xmm8,%xmm4
paddd  %xmm14,%xmm0
add    $0xfffffff8,%esi
jne    11d0 <main+0xb0>
paddd  %xmm6,%xmm4
pshufd $0xee,%xmm4,%xmm0
paddd  %xmm4,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
cmp    %edx,%ecx
jne    132c <main+0x20c>
lea    0xdc4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x7dd,%r8d
sub    %ecx,%r8d
jmp    135a <main+0x23a>
nopw   0x0(%rax,%rax,1)
cmp    $0x28f5c29,%edx
cmovb  %edi,%ecx
test   $0x3,%al
cmovne %edi,%ecx
add    %ecx,%ebx
lea    -0x1(%rax),%ecx
cmp    %r8d,%eax
mov    %ecx,%eax
jle    1314 <main+0x1f4>
imul   $0xc28f5c29,%eax,%esi
add    $0x51eb850,%esi
mov    %esi,%edx
ror    $0x2,%edx
ror    $0x4,%esi
mov    $0x1e28500,%ecx
mov    $0x1e28500,%edi
cmp    $0xa3d70b,%esi
jb     1340 <main+0x220>
mov    $0x1e13380,%edi
jmp    1340 <main+0x220>

LLVM IR (-O0):
@.str = [28 x i8] c"Podaj sw\C3\B3j wiek w latach: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Tw\C3\B3j wiek w sekundach to: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 31536000, i32* %2
store i32 31622400, i32* %3
store i32 2013, i32* %4
store i32 0, i32* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %6
br label %13
13: ; preds = %45, %0
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
%18 = icmp sge i32 %14, %17
br i1 %18, label %19, label %48
19: ; preds = %13
%20 = load i32, i32* %6
%21 = srem i32 %20, 4
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i32, i32* %6
%25 = srem i32 %24, 100
%26 = icmp ne i32 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %23, %19
%28 = load i32, i32* %6
%29 = srem i32 %28, 400
%30 = icmp eq i32 %29, 0
br label %31
31: ; preds = %27, %23
%32 = phi i1 [ true, %23 ], [ %30, %27 ]
%33 = zext i1 %32 to i32
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %40
36: ; preds = %31
%37 = load i32, i32* %8
%38 = load i32, i32* %3
%39 = add nsw i32 %37, %38
store i32 %39, i32* %8
br label %44
40: ; preds = %31
%41 = load i32, i32* %8
%42 = load i32, i32* %2
%43 = add nsw i32 %41, %42
store i32 %43, i32* %8
br label %44
44: ; preds = %40, %36
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = add nsw i32 %46, -1
store i32 %47, i32* %6
br label %13
48: ; preds = %13
%49 = load i32, i32* %8
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %49)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Podaj sw\C3\B3j wiek w latach: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Tw\C3\B3j wiek w sekundach to: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sub nsw i32 2013, %5
%7 = icmp slt i32 %5, 1
br i1 %7, label %64, label %8
8: ; preds = %0
%9 = icmp ult i32 %5, 8
br i1 %9, label %46, label %10
10: ; preds = %8
%11 = and i32 %5, -8
%12 = sub i32 2012, %11
br label %13
13: ; preds = %13, %10
%14 = phi i32 [ 0, %10 ], [ %39, %13 ]
%15 = phi <4 x i32> [ zeroinitializer, %10 ], [ %37, %13 ]
%16 = phi <4 x i32> [ zeroinitializer, %10 ], [ %38, %13 ]
%17 = phi <4 x i32> [ <i32 2012, i32 2011, i32 2010, i32 2009>, %10 ], [ %40, %13 ]
%18 = add <4 x i32> %17, <i32 -4, i32 -4, i32 -4, i32 -4>
%19 = and <4 x i32> %17, <i32 3, i32 3, i32 3, i32 3>
%20 = and <4 x i32> %17, <i32 3, i32 3, i32 3, i32 3>
%21 = icmp eq <4 x i32> %19, zeroinitializer
%22 = icmp eq <4 x i32> %20, zeroinitializer
%23 = srem <4 x i32> %17, <i32 100, i32 100, i32 100, i32 100>
%24 = srem <4 x i32> %18, <i32 100, i32 100, i32 100, i32 100>
%25 = icmp ne <4 x i32> %23, zeroinitializer
%26 = icmp ne <4 x i32> %24, zeroinitializer
%27 = and <4 x i1> %21, %25
%28 = and <4 x i1> %22, %26
%29 = srem <4 x i32> %17, <i32 400, i32 400, i32 400, i32 400>
%30 = srem <4 x i32> %18, <i32 400, i32 400, i32 400, i32 400>
%31 = icmp eq <4 x i32> %29, zeroinitializer
%32 = icmp eq <4 x i32> %30, zeroinitializer
%33 = select <4 x i1> %27, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %31
%34 = select <4 x i1> %28, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %32
%35 = select <4 x i1> %33, <4 x i32> <i32 31622400, i32 31622400, i32 31622400, i32 31622400>, <4 x i32> <i32 31536000, i32 31536000, i32 31536000, i32 31536000>
%36 = select <4 x i1> %34, <4 x i32> <i32 31622400, i32 31622400, i32 31622400, i32 31622400>, <4 x i32> <i32 31536000, i32 31536000, i32 31536000, i32 31536000>
%37 = add <4 x i32> %35, %15
%38 = add <4 x i32> %36, %16
%39 = add nuw i32 %14, 8
%40 = add <4 x i32> %17, <i32 -8, i32 -8, i32 -8, i32 -8>
%41 = icmp eq i32 %39, %11
br i1 %41, label %42, label %13
42: ; preds = %13
%43 = add <4 x i32> %38, %37
%44 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %43)
%45 = icmp eq i32 %5, %11
br i1 %45, label %64, label %46
46: ; preds = %8, %42
%47 = phi i32 [ 0, %8 ], [ %44, %42 ]
%48 = phi i32 [ 2012, %8 ], [ %12, %42 ]
br label %49
49: ; preds = %46, %49
%50 = phi i32 [ %61, %49 ], [ %47, %46 ]
%51 = phi i32 [ %62, %49 ], [ %48, %46 ]
%52 = and i32 %51, 3
%53 = icmp eq i32 %52, 0
%54 = srem i32 %51, 100
%55 = icmp ne i32 %54, 0
%56 = and i1 %53, %55
%57 = srem i32 %51, 400
%58 = icmp eq i32 %57, 0
%59 = select i1 %56, i1 true, i1 %58
%60 = select i1 %59, i32 31622400, i32 31536000
%61 = add nuw nsw i32 %60, %50
%62 = add nsw i32 %51, -1
%63 = icmp sgt i32 %51, %6
br i1 %63, label %49, label %64
64: ; preds = %49, %42, %0
%65 = phi i32 [ 0, %0 ], [ %44, %42 ], [ %61, %49 ]
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %65)
ret i32 0
}