int main(int n) {
  for (;;) {
    printf("아스키 코드 =? "), scanf("%d", &n);
    if (n < 33 || 127 < n)
      return 0;
    printf("%c\n", n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x21,-0x8(%rbp)
jl     116a <main+0x4a>
mov    $0x7f,%eax
cmp    -0x8(%rbp),%eax
jge    1172 <main+0x52>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1132 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x80(%rsi),%eax
cmp    $0xffffffa1,%eax
jb     11ad <main+0x8d>
lea    0xeb8(%rip),%r14
lea    0xe99(%rip),%r15
lea    0xea7(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%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
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x80(%rsi),%eax
cmp    $0xffffffa1,%eax
jae    1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\EC\95\84\EC\8A\A4\ED\82\A4 \EC\BD\94\EB\93\9C =? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 33
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp slt i32 127, %10
br i1 %11, label %12, label %13
12: ; preds = %9, %4
ret i32 0
13: ; preds = %9
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"\EC\95\84\EC\8A\A4\ED\82\A4 \EC\BD\94\EB\93\9C =? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = add i32 %5, -128
%7 = icmp ult i32 %6, -95
br i1 %7, label %8, label %9
8: ; preds = %9, %1
ret i32 0
9: ; preds = %1, %9
%10 = phi i32 [ %14, %9 ], [ %5, %1 ]
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = add i32 %14, -128
%16 = icmp ult i32 %15, -95
br i1 %16, label %8, label %9
}