#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, char);
int scanf(char *, int *);
int main(void) {
  int i, n;
  while (scanf("%d", &n), n) {
    for (i = 1; i <= n; i++) {
      printf("%d%c", i, i == 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>
cmpl   $0x0,-0xc(%rbp)
je     1196 <main+0x76>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1191 <main+0x71>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%edi
mov    $0x20,%eax
mov    $0xa,%ecx
cmp    %edi,%edx
cmove  %ecx,%eax
lea    0xe88(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x30>
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   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     11a5 <main+0x85>
lea    0xeb9(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xeb0(%rip),%rbx
jmp    1173 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     11a5 <main+0x85>
test   %eax,%eax
jle    1160 <main+0x40>
xor    %ebp,%ebp
jmp    1192 <main+0x72>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebp
jge    1160 <main+0x40>
add    $0x1,%ebp
mov    $0xa,%edx
cmp    %eax,%ebp
je     1180 <main+0x60>
mov    $0x20,%edx
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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