#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);
scalar_t__ scanf(char *, int *);
int main() {
  int i, n;
  while (scanf("%d", &n)) {
    if (n == 0) {
      break;
    }
    for (i = 1; i < n; i++) {
      printf("%d ", i);
    }
    printf("%d\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     119c <main+0x7c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <main+0x38>
jmp    119c <main+0x7c>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1188 <main+0x68>
mov    -0x8(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <main+0x3f>
mov    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     11b5 <main+0x95>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     11b5 <main+0x95>
lea    0xeb2(%rip),%rbx
lea    0xeaf(%rip),%r14
lea    0xea1(%rip),%r15
lea    0xc(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x2,%esi
jl     1195 <main+0x75>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%esi
cmp    %esi,%ebp
jl     1180 <main+0x60>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     11b5 <main+0x95>
mov    0xc(%rsp),%esi
test   %esi,%esi
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %22, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %25
11: ; preds = %7
store i32 1, i32* %2
br label %12
12: ; preds = %19, %11
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i32, i32* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %12
22: ; preds = %12
%23 = load i32, i32* %3
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %4
25: ; preds = %10, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %25, label %8
8: ; preds = %0, %17
%9 = phi i32 [ %22, %17 ], [ %5, %0 ]
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %8, %11
%12 = phi i32 [ %14, %11 ], [ 1, %8 ]
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i32 %12, 1
%15 = load i32, i32* %1
%16 = icmp slt i32 %14, %15
br i1 %16, label %11, label %17
17: ; preds = %11, %8
%18 = phi i32 [ %9, %8 ], [ %15, %11 ]
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%21 = icmp eq i64 %20, 0
%22 = load i32, i32* %1
%23 = icmp eq i32 %22, 0
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %25, label %8
25: ; preds = %17, %0
ret i32 0
}