#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() {
  int x, y, z, result, year;
  double pi = 3.141592;
  x = 5;
  y = 2;
  z = 3;
  result = x - y + z * x / y + -y;
  printf("result = %d\n", result);
  result = x - (y + z) * x / y + -y;
  printf("result = %d\n", result);
  result = x % y;
  printf("result = %d\n", result);
  year = 2010;
  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
    printf("%d ´Â À±³âÀÔ´Ï´Ù.\n", year);
  else
    printf("%d ´Â À±³âÀÌ ¾Æ´Õ´Ï´Ù.\n", year);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7da,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11f1 <main+0xe1>
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1205 <main+0xf5>
mov    -0x18(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1219 <main+0x109>
mov    -0x18(%rbp),%esi
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
jmp    1228 <main+0x118>
mov    -0x18(%rbp),%esi
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffff7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x7da,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"result = %d\0A\00"
@.str.1 = [31 x i8] c"%d \C2\B4\C3\82 \C3\80\C2\B1\C2\B3\C3\A2\C3\80\C3\94\C2\B4\C3\8F\C2\B4\C3\99.\0A\00"
@.str.2 = [40 x i8] c"%d \C2\B4\C3\82 \C3\80\C2\B1\C2\B3\C3\A2\C3\80\C3\8C \C2\BE\C3\86\C2\B4\C3\95\C2\B4\C3\8F\C2\B4\C3\99.\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 double
store i32 0, i32* %1
store double 0x400921FAFC8B007A, double* %7
store i32 5, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %3
%15 = sdiv i32 %13, %14
%16 = add nsw i32 %10, %15
%17 = load i32, i32* %3
%18 = sub nsw i32 0, %17
%19 = add nsw i32 %16, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %2
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* %3
%29 = sdiv i32 %27, %28
%30 = sub nsw i32 %22, %29
%31 = load i32, i32* %3
%32 = sub nsw i32 0, %31
%33 = add nsw i32 %30, %32
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = srem i32 %36, %37
store i32 %38, i32* %5
%39 = load i32, i32* %5
%40 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %39)
store i32 2010, i32* %6
%41 = load i32, i32* %6
%42 = srem i32 %41, 4
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %0
%45 = load i32, i32* %6
%46 = srem i32 %45, 100
%47 = icmp ne i32 %46, 0
br i1 %47, label %52, label %48
48: ; preds = %44, %0
%49 = load i32, i32* %6
%50 = srem i32 %49, 400
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %48, %44
%53 = load i32, i32* %6
%54 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %53)
br label %58
55: ; preds = %48
%56 = load i32, i32* %6
%57 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %55, %52
%59 = load i32, i32* %1
ret i32 %59
}

LLVM IR (-O2):
@.str = [13 x i8] c"result = %d\0A\00"
@.str.2 = [40 x i8] c"%d \C2\B4\C3\82 \C3\80\C2\B1\C2\B3\C3\A2\C3\80\C3\8C \C2\BE\C3\86\C2\B4\C3\95\C2\B4\C3\8F\C2\B4\C3\99.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 -9)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 2010)
ret i32 0
}