#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;
  for (;;) {
    printf("정수를 입력하세요. ");
    scanf("%d", &n);
    if (n)
      printf("%s수입니다. \n", n > 0 ? "양" : "음");
    else
      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    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1182 <main+0x62>
mov    -0x8(%rbp),%ecx
lea    0xed4(%rip),%rsi
lea    0xec9(%rip),%rax
cmp    $0x0,%ecx
cmovg  %rax,%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x6a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     11b3 <main+0x93>
lea    0xed8(%rip),%r13
lea    0xed5(%rip),%rbp
lea    0xeb8(%rip),%r14
lea    0xe92(%rip),%r15
lea    0xea7(%rip),%r12
lea    0x4(%rsp),%rbx
jmp    11a7 <main+0x87>
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     11b3 <main+0x93>
mov    %r13,%rsi
test   %eax,%eax
jg     1180 <main+0x60>
mov    %rbp,%rsi
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\EC\A0\95\EC\88\98\EB\A5\BC \EC\9E\85\EB\A0\A5\ED\95\98\EC\84\B8\EC\9A\94. \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"%s\EC\88\98\EC\9E\85\EB\8B\88\EB\8B\A4. \0A\00"
@.str.3 = [4 x i8] c"\EC\96\91\00"
@.str.4 = [4 x i8] c"\EC\9D\8C\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 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %15
14: ; preds = %3
ret i32 0
15: ; preds = %8
br label %3
}

LLVM IR (-O2):
@.str = [28 x i8] c"\EC\A0\95\EC\88\98\EB\A5\BC \EC\9E\85\EB\A0\A5\ED\95\98\EC\84\B8\EC\9A\94. \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"%s\EC\88\98\EC\9E\85\EB\8B\88\EB\8B\A4. \0A\00"
@.str.3 = [4 x i8] c"\EC\96\91\00"
@.str.4 = [4 x i8] c"\EC\9D\8C\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = 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 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %14, %7 ], [ %5, %0 ]
%9 = icmp sgt i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %0
ret i32 0
}