#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 n;
  do {
    scanf("%d", &n);
    if (n > 0)
      printf(n % 2 ? "홀수\n" : "짝수\n");
  } while (n > 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    116e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
lea    0xeb0(%rip),%rdi
lea    0xea1(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x53>
cmpl   $0x0,-0x8(%rbp)
jg     112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%r14
lea    0x4(%rsp),%rbx
lea    0xed0(%rip),%r15
lea    0xec1(%rip),%r12
jmp    115c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    117b <main+0x5b>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    117b <main+0x5b>
mov    %r15,%rdi
test   $0x1,%al
je     1150 <main+0x30>
mov    %r12,%rdi
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"\ED\99\80\EC\88\98\0A\00"
@.str.2 = [8 x i8] c"\EC\A7\9D\EC\88\98\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 2
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 @printf(i8* %12)
br label %14
14: ; preds = %7, %3
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 0
br i1 %17, label %3, label %18
18: ; preds = %15
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"\ED\99\80\EC\88\98\0A\00"
@.str.2 = [8 x i8] c"\EC\A7\9D\EC\88\98\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %7, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = and i32 %5, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%11 = call i32 @printf(i8* dereferenceable(1) %10)
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %3, label %14
14: ; preds = %3, %7
ret i32 0
}